/* Flagship workflow storytelling for Raysor Technologies.
   Each product owns a distinct material language while sharing adaptive, accessible geometry. */

.flagship-story {
  container-type: inline-size;
  container-name: flagship-story;
}

.flagship-story-list {
  list-style: none;
  margin: clamp(24px, 4vw, 44px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: clamp(12px, 1.7vw, 20px);
}

.flagship-story-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: clamp(20px, 2.4vw, 30px);
  overflow: hidden;
  border: 1px solid var(--story-line, rgba(255,255,255,.14));
  border-radius: clamp(22px, 2.4vw, 30px);
  background: var(--story-surface, rgba(14,18,27,.72));
  box-shadow: inset 0 1px rgba(255,255,255,.1), 0 22px 58px rgba(0,0,0,.24);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  transform: translateZ(0);
  transition: transform 300ms cubic-bezier(.2,.86,.22,1), border-color 220ms ease, box-shadow 280ms ease;
}

.flagship-story-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--story-specular, rgba(255,255,255,.5)), transparent);
  opacity: .68;
  pointer-events: none;
}

.flagship-story-step {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  min-height: 42px;
  margin-bottom: 20px;
  border: 1px solid var(--story-line-strong, rgba(255,255,255,.24));
  border-radius: var(--story-marker-radius, 14px);
  color: var(--story-accent, #fff);
  background: var(--story-marker, rgba(255,255,255,.08));
  box-shadow: inset 0 1px rgba(255,255,255,.12), 0 10px 30px var(--story-glow, rgba(0,0,0,.18));
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.flagship-story-card h3 {
  margin: 0 0 10px;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.flagship-story-card p {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (hover: hover) and (pointer: fine) {
  .flagship-story-card:hover,
  .flagship-story-card:focus-within {
    transform: translateY(-4px) scale(1.006);
    border-color: var(--story-line-strong, rgba(255,255,255,.27));
    box-shadow: inset 0 1px rgba(255,255,255,.14), 0 28px 72px rgba(0,0,0,.3), 0 0 38px var(--story-glow, transparent);
  }
}

/* TerritoryHub: navy / ice / electric-blue operational command lane. */
body.territoryhub-product .th-experience {
  --story-accent: #d9efff;
  --story-line: rgba(183,222,255,.18);
  --story-line-strong: rgba(191,226,255,.38);
  --story-glow: rgba(45,143,255,.16);
  --story-specular: rgba(190,229,255,.78);
}

body.territoryhub-product .th-app-shell {
  position: relative;
  overflow: visible;
}

body.territoryhub-product .th-app-shell::after {
  content: "MAP → ASSIGN → TRACK → HISTORY";
  position: absolute;
  left: clamp(16px, 3cqi, 30px);
  bottom: clamp(14px, 2.4cqi, 24px);
  z-index: 4;
  max-width: calc(100% - clamp(32px, 6cqi, 60px));
  padding: 8px 12px;
  border: 1px solid rgba(191,226,255,.2);
  border-radius: 999px;
  color: rgba(217,239,255,.88);
  background: rgba(5,18,32,.78);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  backdrop-filter: blur(16px) saturate(145%);
  font-size: clamp(.66rem, 1.5cqi, .76rem);
  font-weight: 760;
  letter-spacing: .08em;
  white-space: normal;
  pointer-events: none;
}

/* PowerShell Principal: angular electric workflow rail. */
body.principal-product .principal-story {
  --story-accent: #dff2ff;
  --story-line: rgba(83,174,255,.2);
  --story-line-strong: rgba(89,188,255,.42);
  --story-glow: rgba(0,132,255,.18);
  --story-specular: rgba(102,206,255,.82);
  --story-marker-radius: 10px 18px 10px 18px;
  --story-marker: linear-gradient(145deg, rgba(0,151,255,.2), rgba(9,16,32,.82));
}

body.principal-product .principal-story .flagship-story-card:nth-child(even) {
  transform-origin: 20% 50%;
}

body.principal-product .principal-story .flagship-story-step {
  font-style: italic;
  transform: skewX(-7deg);
}

/* Deep Orbit: circular evidence rings and quieter forensic depth. */
body.deep-orbit-product .deep-orbit-story {
  --story-accent: #e9e3ff;
  --story-line: rgba(178,158,255,.18);
  --story-line-strong: rgba(193,177,255,.4);
  --story-glow: rgba(121,89,255,.15);
  --story-specular: rgba(207,196,255,.72);
  --story-marker-radius: 999px;
  --story-marker: radial-gradient(circle at 32% 28%, rgba(255,255,255,.2), transparent 34%), rgba(88,65,158,.24);
}

body.deep-orbit-product .deep-orbit-story .flagship-story-card {
  background:
    radial-gradient(circle at 82% 0%, rgba(142,115,255,.12), transparent 34%),
    linear-gradient(150deg, rgba(255,255,255,.05), transparent 34%),
    rgba(11,10,22,.78);
}

body.deep-orbit-product .deep-orbit-story .flagship-story-step {
  outline: 1px solid rgba(180,160,255,.1);
  outline-offset: 5px;
}

@container flagship-story (max-width: 42rem) {
  .flagship-story-list {
    grid-template-columns: 1fr;
  }

  .flagship-story-card {
    padding: clamp(18px, 5cqi, 26px);
  }
}

@media (hover: none), (pointer: coarse) {
  .flagship-story-card {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flagship-story-card,
  body.principal-product .principal-story .flagship-story-step {
    transform: none !important;
    transition: none !important;
  }
}

@media (prefers-reduced-transparency: reduce), (prefers-reduced-data: reduce) {
  .flagship-story-card,
  body.territoryhub-product .th-app-shell::after {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: #0a1320;
  }

  body.deep-orbit-product .deep-orbit-story .flagship-story-card {
    background: #100e1c;
  }
}

@media (prefers-contrast: more) {
  .flagship-story-card,
  .flagship-story-step {
    border-color: currentColor;
  }
}

@media (forced-colors: active) {
  .flagship-story-card,
  .flagship-story-step,
  body.territoryhub-product .th-app-shell::after {
    border: 1px solid CanvasText;
    background: Canvas;
    color: CanvasText;
    box-shadow: none;
  }
}
