/* ============================================================
   AI Process Section — "How AI coding agents assist design"
   Blue duo-tone, aligned to the site accent (#1B66FF)
   ============================================================ */

.ai-process {
  /* Shared blue duotone — aligned to the site accent (#1B66FF) */
  --tt-base: #1B66FF;     /* site accent (primary) */
  --tt-deep: #0E47B8;     /* deep blue */
  --tt-mid:  #3D82FF;     /* mid blue  */
  --tt-light:#A9C6FF;     /* light tint */
  --tt-dark: #0A2E78;     /* darkest blue */
  --tt-alert:#FF4D4D;     /* red warning accent (Scene 03 flaw only) */
  --tt-warm: #FF9E1B;     /* warm amber — complement of the blue, used as the second/action colour */

  padding: var(--space-16) 0;
  background: var(--color-surface);
}

.ai-process .container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ---- Section header (reuses site kicker/title pattern) ---- */
.ai-process-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto var(--space-16);
}
.ai-process .section-kicker { color: var(--color-accent); }
.ai-process .section-kicker-icon svg { color: var(--color-accent); }
.ai-process .section-title { color: var(--color-text-primary); }
.ai-process .section-description { color: var(--color-text-secondary); }

/* ---- Two-column layout ---- */
.ai-process-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: var(--space-12);
  align-items: start;
}

/* ---- Left: vertical tab list ---- */
.ai-tabs {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.ai-tab {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  text-align: left;
  width: 100%;
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  font: inherit;
  color: var(--color-text-secondary);
  transition: border-color var(--transition-normal),
              background var(--transition-normal),
              box-shadow var(--transition-normal),
              transform var(--transition-fast);
}
.ai-tab:hover {
  border-color: var(--tt-light);
  border-left-color: var(--tt-base);
  transform: translateX(2px);
}
.ai-tab:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.ai-tab[aria-selected="true"] {
  border-color: var(--color-accent);
  border-left-color: var(--color-accent);
  background: var(--color-accent-soft);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-sm);
}
.ai-tab-num {
  flex: none;
  width: 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tt-base);
  background: var(--color-accent-soft);
  border-radius: var(--radius-md);
  transition: color var(--transition-normal), background var(--transition-normal);
}
.ai-tab-num svg { width: 1.2rem; height: 1.2rem; display: block; }
.ai-tab[aria-selected="true"] .ai-tab-num { color: #fff; background: var(--color-accent); }
.ai-tab-body { display: flex; flex-direction: column; gap: 2px; }
.ai-tab-title {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
}
.ai-tab-step {
  color: var(--tt-base);
  font-variant-numeric: tabular-nums;
  margin-right: 0.4rem;
  letter-spacing: 0.02em;
}
.ai-tab[aria-selected="true"] .ai-tab-step { color: var(--color-accent); }
.ai-tab-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: var(--line-height-snug);
}

/* ---- Right: stage ---- */
.ai-stage {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 0; /* inset removed; scene panels re-add their own padding below */
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ai-stage::before {
  /* blue duotone wash so the two-tone reads as intentional */
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 80% 0%, rgba(27,102,255,0.09), transparent 60%),
    radial-gradient(90% 80% at 10% 100%, rgba(58,130,255,0.06), transparent 55%),
    radial-gradient(80% 70% at 92% 100%, rgba(255,158,27,0.08), transparent 55%);
  pointer-events: none;
}
.ai-panel { display: none; width: 100%; }
.ai-panel:not(.ai-panel--eagle) { padding: var(--space-8); } /* scenes keep their inset; Eagle is flush */
.ai-panel.is-active { display: block; animation: aiPanelIn 0.4s ease both; }
.scene-svg { width: 100%; height: auto; max-height: 360px; display: block; }
.ai-caption {
  margin: var(--space-5) auto 0;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  max-width: 52ch;
}
.ai-caption strong { color: var(--tt-deep); font-weight: var(--font-weight-semibold); }

@keyframes aiPanelIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- SVG paint helpers (duo-tone, themeable from one place) ---- */
.tt-fill-base { fill: var(--tt-base); }
.tt-fill-deep { fill: var(--tt-deep); }
.tt-fill-mid  { fill: var(--tt-mid); }
.tt-fill-light{ fill: var(--tt-light); }
.tt-fill-alert{ fill: var(--tt-alert); }
.tt-fill-warm { fill: var(--tt-warm); }
.tt-fill-warm-soft { fill: var(--tt-warm); fill-opacity: 0.18; }
.tt-fill-soft { fill: var(--tt-base); fill-opacity: 0.16; }
.tt-stroke-base { stroke: var(--tt-base); }
.tt-stroke-deep { stroke: var(--tt-deep); }
.tt-stroke-mid  { stroke: var(--tt-mid); }
.tt-stroke-light{ stroke: var(--tt-light); }
.tt-stroke-alert{ stroke: var(--tt-alert); }
.tt-stroke-warm { stroke: var(--tt-warm); }
.surf { fill: var(--color-surface); }
.bord { stroke: var(--color-border); }
.tw   { fill: #fff; } /* type on dark fills */

/* chat header helper (top-rounded bar) */
.chat-head {
  fill: var(--tt-deep);
}

/* ============================================================
   SCENE 01 — Brief the agent
   ============================================================ */
.s1-flow .node   { animation: fadeUp 0.5s both; }
.s1-flow .node:nth-child(1) { animation-delay: 0.05s; }
.s1-flow .node:nth-child(3) { animation-delay: 0.20s; }
.s1-flow .node:nth-child(5) { animation-delay: 0.35s; }
.s1-constraints  { animation: fadeUp 0.5s 0.45s both; }
.s1-edges .chip  { animation: fadeUp 0.5s both; transform-box: fill-box; transform-origin: center; }
.s1-edges .chip:nth-child(1) { animation-delay: 0.6s; }
.s1-edges .chip:nth-child(2) { animation-delay: 0.75s; }
.s1-connector { animation: dashMove 1.4s linear infinite; }
.s1-packet {
  offset-path: path('M196 226 C 240 226, 250 168, 286 168');
  offset-rotate: 0deg;
  animation: travel1 3s ease-in-out infinite;
}
.s1-typing circle { animation: blink3 1.2s infinite; }
.s1-typing circle:nth-child(2) { animation-delay: 0.2s; }
.s1-typing circle:nth-child(3) { animation-delay: 0.4s; }
.s1-window { animation: glow 3s ease-in-out infinite; }

/* ============================================================
   SCENE 02 — Generate a working prototype
   ============================================================ */
.s2-prompt { animation: fadeUp 0.5s both; }
.s2-beam   { animation: beam 1.6s ease-in-out infinite; }
.s2-code   { animation: codeReveal 3.6s ease-in-out infinite; }
.s2-cursor { animation: blink3 0.9s infinite; }
.s2-browser { animation: floatY 3.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.s2-live   { animation: live 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

/* ============================================================
   SCENE 04 — Sync to Figma via MCP
   ============================================================ */
.s4-pipe { animation: dashFlow 1.2s linear infinite; }
.s4-card {
  offset-path: path('M170 180 C 220 120, 250 120, 300 180');
  offset-rotate: 0deg;
  animation: travel1 3s ease-in-out infinite;
}
.s4-card.s4-card2 { animation-delay: 1.5s; }
.s4-cell { animation: cellFill 3s ease-in-out infinite; }
.s4-cell:nth-child(2) { animation-delay: 0.3s; }
.s4-cell:nth-child(3) { animation-delay: 0.6s; }
.s4-cell:nth-child(4) { animation-delay: 0.9s; }
.s4-cell:nth-child(5) { animation-delay: 1.2s; }
.s4-cell:nth-child(6) { animation-delay: 1.5s; }
.s4-synced { animation: fadeUp 0.5s 0.4s both; }

/* ============================================================
   SCENE 05 — Refine and rebuild
   ============================================================ */
.s5-loop  { transform-box: view-box; transform-origin: 220px 180px; animation: spin 14s linear infinite; }
.s5-bubble{ transform-box: fill-box; transform-origin: center; animation: floatY 3s ease-in-out infinite; }
.s5-v { opacity: 0; }
.s5-v1 { animation: vSeq 6s infinite; }
.s5-v2 { animation: vSeq 6s infinite; animation-delay: 2s; }
.s5-v3 { animation: vSeq 6s infinite; animation-delay: 4s; }
.s5-spark { transform-box: fill-box; transform-origin: center; animation: live 1.8s ease-in-out infinite; }

/* ---- Keyframes ---- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dashMove { to { stroke-dashoffset: -36; } }
@keyframes dashFlow { to { stroke-dashoffset: -24; } }
@keyframes travel1 { 0% { offset-distance: 0%; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { offset-distance: 100%; opacity: 0; } }
@keyframes blink3 { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@keyframes glow { 0%, 100% { stroke: var(--color-border); } 50% { stroke: var(--tt-base); } }
@keyframes codeReveal { 0% { clip-path: inset(0 0 100% 0); } 65% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 0 0); } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes live { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }
@keyframes beam { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.9; } }
@keyframes cellFill { 0%, 30% { fill-opacity: 0; } 60%, 100% { fill-opacity: 0.18; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes vSeq { 0%, 100% { opacity: 0; } 4%, 92% { opacity: 1; } }

/* ---- Scroll reveal (matches site pattern) ---- */
.anim-ai-process .ai-process-header,
.anim-ai-process .ai-process-layout {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.anim-ai-process.is-visible .ai-process-header,
.anim-ai-process.is-visible .ai-process-layout {
  opacity: 1;
  transform: none;
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .ai-process-layout { grid-template-columns: 1fr; }
  .ai-stage { min-height: 360px; order: -1; } /* stage first on mobile, tabs below */
  .ai-tabs { order: 0; }
}

/* ---- Reduced motion: freeze, keep everything visible ---- */
@media (prefers-reduced-motion: reduce) {
  .ai-process * { animation: none !important; }
  .s2-code { clip-path: none !important; }
  .s1-flow .node, .s1-constraints, .s1-edges .chip,
  .s4-synced { opacity: 1 !important; transform: none !important; }
  .s4-cell { fill-opacity: 0.18 !important; }
  .s5-v1, .s5-v2 { opacity: 0 !important; }
  .s5-v3 { opacity: 1 !important; }
  .ai-panel.is-active { animation: none !important; }
}

/* ============================================================
   EAGLE LEAD CARD (promoted from Option A)
   Clickable preview of the Eagle private-banking platform, shown as
   the first scene. Blue base, amber = action accent.
   ============================================================ */
.dc-split { display: grid; grid-template-columns: 1.6fr 1fr; align-items: stretch; }
.dc-split .dc-media {
  position: relative; background: #EEF2F8; border-right: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center; padding: 0; /* let the screenshot occupy the media fully */
}
.dc-split .dc-media { overflow: hidden; }

/* Eagle rotator — two-layer horizontal push (two images visible mid-transition) */
.eagle-rotator {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #EEF2F8;
}
.eagle-shot {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border: none; border-radius: 0; display: block;
}
.eagle-shot--front { z-index: 1; transform: none; }
.eagle-shot--back  { z-index: 2; transform: translateX(100%); }

/* horizontal push: current slides out left, next slides in from right */
.eagle-shot.is-out { animation: eaglePushOut .45s ease forwards; }
.eagle-shot.is-in  { animation: eaglePushIn  .45s ease forwards; }
@keyframes eaglePushOut { to   { transform: translateX(-100%); } }
@keyframes eaglePushIn  { from { transform: translateX(100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) {
  .eagle-shot.is-out, .eagle-shot.is-in { animation: none; }
}

/* Instagram-story-style progress indicator — a row of dashes.
   The active dash fills left→right; completed dashes stay full. It is
   vertically centred on the .play-btn (bottom-right) and left-aligned with a
   clear gap before it. No drop-shadow (legibility comes from the track colour). */
.eagle-progress {
  position: absolute;
  left: 12px; bottom: 38px;   /* 38px ≈ centres the 3px bar on the 48px play-btn (centre 40px up) */
  width: calc(100% - 120px);
  display: flex; gap: 4px;
  z-index: 4;                 /* above the image layers (1/2) and chrome (3) */
  pointer-events: none;       /* let the card link / play button stay clickable */
}
.eagle-progress__seg {
  flex: 1 1 0;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
  overflow: hidden;
}
.eagle-progress__seg i {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
  border-radius: 2px;
}
.eagle-progress__seg.is-done i { width: 100%; }

/* --- look & feel options (none use a drop-shadow) --- */
.eagle-progress--white .eagle-progress__seg { background: rgba(255, 255, 255, 0.35); }
.eagle-progress--white .eagle-progress__seg i { background: #fff; }

.eagle-progress--dark .eagle-progress__seg { background: rgba(15, 23, 42, 0.5); }
.eagle-progress--dark .eagle-progress__seg i { background: #fff; }

/* production choice: option 2 track, but pale-grey fill instead of white */
.eagle-progress--grey .eagle-progress__seg i { background: #dbe0e8; }

.eagle-progress--accent .eagle-progress__seg { background: rgba(255, 255, 255, 0.3); }
.eagle-progress--accent .eagle-progress__seg i { background: var(--tt-warm); }

.eagle-progress--slim { bottom: 39px; gap: 6px; }
.eagle-progress--slim .eagle-progress__seg { height: 2px; background: rgba(15, 23, 42, 0.45); }
.eagle-progress--slim .eagle-progress__seg i { background: #fff; }
.dc-split .ai-demo-body { padding: 32px 38px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.dc-split .ai-demo-body .btn--primary { margin-top: 18px; align-self: flex-start; white-space: nowrap; }
.dc-split .ai-demo-body .btn--primary .arrow { width: 18px; height: 18px; flex: none; margin-left: 8px; }

@media (max-width: 680px) {
  .dc-split { grid-template-columns: 1fr; }
  .dc-split .dc-media { border-right: none; border-bottom: 1px solid var(--color-border); }
}

.live-pill {
  position: absolute; top: 14px; left: 14px; z-index: 3;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; color: var(--tt-warm);
  background: rgba(255,255,255,0.92); border: 1px solid #FFE3BD;
  border-radius: 999px; padding: 4px 10px;
}
.live-pill .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--tt-warm);
  animation: demoPulse 1.8s infinite;
}
@keyframes demoPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,158,27,.45); }
  70%  { box-shadow: 0 0 0 7px rgba(255,158,27,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,158,27,0); }
}

.play-btn {
  position: absolute; right: 16px; bottom: 16px; z-index: 3;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--tt-warm); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(255,158,27,.4);
}
.play-btn svg { width: 22px; height: 22px; }

.ai-demo-body { padding: 22px 24px 24px; }
.ai-demo-label {
  font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--color-accent); margin: 0 0 4px;
}
.ai-demo-title { font-size: 19px; font-weight: 600; margin: 0 0 6px; letter-spacing: -.01em; }
.ai-demo-desc { font-size: 14px; color: var(--color-text-secondary); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .live-pill .dot { animation: none; }
}

/* ---- Eagle lead panel (promoted from Option A; card chrome unwrapped) ---- */
.eagle-lead {
  text-decoration: none;
  color: inherit;
  border-radius: 0;                  /* square -> clipped flush by .ai-stage radius, no inset card look */
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.eagle-lead:hover { transform: none; box-shadow: none; } /* flush-filled: no lift, just the play-btn cue */
.eagle-lead .play-btn { transition: transform .18s ease; }
.eagle-lead:hover .play-btn { transform: scale(1.08); }

/* Eagle lead panel fills the stage (no inset padding / centering gap) */
.ai-panel--eagle {
  flex: 1 1 auto;                    /* fill stage height, kill vertical centering gap */
}
.ai-panel--eagle.is-active { display: flex; }
.ai-panel--eagle .eagle-lead { flex: 1 1 auto; width: 100%; }

