/* The mode pages (/agent, /chat, /tutor), 2026-11-22. Dark ground; the mode's name and one line;
   a big live demo on a stage of its own (no other page has one), the step rail under it (js/modes.js);
   then "What you decide" on the bright ground and the free demo. Each page draws its stage in its
   own file (css/mode-agent.css, mode-chat.css, mode-tutor.css) from [data-step] on .mode-demo. */

.mode-hero { padding-block: calc(1.4rem + 5vw) var(--s-section); overflow-x: clip; }
.mode-eyebrow { margin: 0 0 var(--s-3); color: var(--c-petal, oklch(76% 0.09 17)); font-weight: 800; letter-spacing: 0.02em; }
.mode-h { max-width: 14em; }
.mode-lead { margin-top: var(--s-4); max-width: 34em; color: var(--ink-muted); font-size: clamp(1.1rem, 1rem + 0.5vw, 1.4rem); line-height: 1.5; }

.mode-demo { margin-top: clamp(2rem, 1.5rem + 2.5vw, 4rem); }
.mode-stage { position: relative; overflow: hidden; min-height: clamp(440px, 52vw, 660px); border-radius: 28px;
  background: oklch(17.5% 0.004 30); box-shadow: 0 0 0 1px var(--rule), 0 3rem 6rem -3rem oklch(0% 0 0 / 0.7); }
@supports (corner-shape: squircle) { .mode-stage { border-radius: 44px; corner-shape: squircle; } }

.mode-caption { min-height: 1.6em; margin: var(--s-5) 0 var(--s-4); color: var(--ink); font-size: clamp(1.05rem, 1rem + 0.3vw, 1.25rem); font-weight: 600; }
.mode-rail { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
.mode-steps { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.mode-step { position: relative; overflow: hidden; min-height: 2.75rem; padding: 0 1.15rem; border: 1px solid var(--rule-firm); border-radius: 999px;
  background: transparent; color: var(--ink-muted); font: inherit; font-weight: 600; cursor: pointer;
  transition: color var(--dur) var(--ease-out-quart), background-color var(--dur) var(--ease-out-quart), border-color var(--dur) var(--ease-out-quart); }
.mode-step:hover { color: var(--ink); border-color: var(--ink-muted); }
.mode-step.is-done { color: var(--ink); }
.mode-step[aria-current] { color: #fff; background: var(--c-red); border-color: var(--c-red); }
.mode-step[aria-current]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: oklch(100% 0 0 / 0.55);
  transform-origin: left; animation: mode-progress var(--step-ms, 2500ms) linear both; }
.mode-demo:not(.is-running) .mode-step[aria-current]::after { animation-play-state: paused; }
@keyframes mode-progress { from { transform: scaleX(0); } }
.mode-step:focus-visible, .mode-pause:focus-visible { outline: 2px solid var(--c-petal, #E69D9D); outline-offset: 3px; }
.mode-pause { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: 0 1rem; border: 0; border-radius: 999px;
  background: var(--bg-raised); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.mode-pause__b, .mode-pause.is-held .mode-pause__a { display: none; }
.mode-pause.is-held .mode-pause__b { display: inline; }
@media (prefers-reduced-motion: reduce) { .mode-step[aria-current]::after { animation: none; transform: none; } }

/* What you decide: three cards on the bright ground. */
.mode-decide { padding-block: var(--s-section-lg); }
.mode-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); margin: var(--s-6) 0 0; padding: 0; list-style: none; }
.mode-card { display: flex; flex-direction: column; gap: var(--s-3); padding: clamp(1.25rem, 1rem + 1vw, 2rem); border-radius: 22px; background: var(--bg-raised); }
@supports (corner-shape: squircle) { .mode-card { border-radius: 34px; corner-shape: squircle; } }
.mode-card h3 { margin: 0; font-size: clamp(1.1rem, 1rem + 0.35vw, 1.3rem); line-height: 1.25; color: var(--ink); }
.mode-card p { margin: 0; color: var(--ink-muted); }
@media (max-width: 860px) { .mode-cards { grid-template-columns: minmax(0, 1fr); } }

/* The free demo. */
.mode-cta { padding-block: var(--s-section-lg); text-align: center; }
.mode-cta .sec-h { margin-inline: auto; max-width: 18em; }
.mode-cta .btn { margin-top: var(--s-6); }

/* Questions: the site's own .qa rows (site.css), on the dark ground. */
.mode-faq { padding-block: var(--s-section-lg) 0; }
.mode-faq__list { max-width: 52rem; margin-top: var(--s-6); border-top: 1px solid var(--rule-firm); }

/* "Want to see the others?": the two other modes as big dark cards on the bright ground, each with a
   small picture of its demo. The picture plays once when the section comes into view
   (js/modes.js sets .is-in) and loops while the card is hovered or focused; with reduced motion
   (no .motion on <html>) it is a still of the finished state. */
.mode-next { padding-block: var(--s-section-lg); }
.nx-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); margin: var(--s-6) 0 0; padding: 0; list-style: none; }
.nx-card { display: flex; flex-direction: column; gap: var(--s-2); height: 100%; padding: clamp(1rem, 0.8rem + 1vw, 1.5rem); border-radius: 28px;
  background: oklch(17.5% 0.004 30); color: var(--ink); text-decoration: none;
  box-shadow: 0 1.5rem 3rem -1.5rem oklch(31.8% 0.005 67.7 / 0.45); transition: transform 240ms var(--ease-out-quart); }
@supports (corner-shape: squircle) { .nx-card { border-radius: 44px; corner-shape: squircle; } }
.nx-card:hover { transform: translateY(-3px); }
.nx-card:focus-visible { outline: 2px solid var(--c-red); outline-offset: 4px; }
.nx-name { margin-top: var(--s-4); font-size: var(--t-h3); font-weight: 900; letter-spacing: -0.02em; line-height: 1.15; }
.nx-line { color: var(--ink-muted); }
.nx-go { display: inline-flex; align-items: center; gap: var(--s-3); margin-top: auto; padding-top: var(--s-4); font-weight: 700; }
.nx-card:hover .nx-go .petal { transform: translateX(3px); }
@media (max-width: 760px) { .nx-list { grid-template-columns: minmax(0, 1fr); } }

.nx-pic { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 18px; background: oklch(22% 0.005 30); --nx-dim: oklch(31.8% 0.005 67.7 / 0.18); }
@supports (corner-shape: squircle) { .nx-pic { border-radius: 28px; corner-shape: squircle; } }

/* Agent: the race (left) and the run (right). */
.nxa-race { position: absolute; left: 8%; top: 50%; width: 36%; display: grid; gap: 1.1rem; translate: 0 -50%; }
.nxa-lane, .nxa-lane i { display: block; }
.nxa-lane { height: 0.5rem; border-radius: 1rem; background: oklch(100% 0 0 / 0.1); overflow: hidden; }
.nxa-lane i { height: 100%; border-radius: inherit; background: var(--ink-faint); transform-origin: left; transform: scaleX(0.04); }
.nxa-lane--v i { background: var(--c-red); transform: none; }
.nxa-run { position: absolute; right: 7%; top: 13%; bottom: 13%; width: 40%; display: flex; flex-direction: column; justify-content: space-evenly;
  padding: 0 0.8rem; border-radius: 12px; background: var(--c-paper); }
.nxa-run i { display: flex; align-items: center; gap: 0.5rem; }
.nxa-run i::after { content: ""; flex: 1; height: 0.35rem; border-radius: 1rem; background: var(--nx-dim); }
.nxa-run b { width: 0.7rem; height: 0.7rem; flex: none; border-radius: 50%; background: var(--c-red); }

/* Chat: a pile of sheets, the passage marked on the top one, and the answer's source tag. */
.nxc-sheet { position: absolute; left: 16%; top: 10%; width: 32%; height: 80%; border-radius: 6px; background: oklch(90% 0.006 17); rotate: -6deg; }
.nxc-sheet + .nxc-sheet { background: oklch(94% 0.006 17); rotate: 5deg; }
/* The top page: ruled with grey text lines, one passage marked red. */
.nxc-sheet.nxc-sheet--top { rotate: none; background: var(--c-paper)
  repeating-linear-gradient(to bottom, var(--nx-dim) 0 0.3rem, transparent 0.3rem 0.85rem) center / 74% 68% no-repeat; }
.nxc-sheet--top i { display: none; }
.nxc-sheet--top .nxc-mark { display: block; position: absolute; left: 10%; right: 10%; top: 47%; height: 0.95rem; border-radius: 0.2rem;
  background: oklch(59.2% 0.241 29.2 / 0.4); transform-origin: left; }
.nxc-tag { position: absolute; right: 8%; bottom: 20%; width: 32%; height: 17%; border-radius: 10px; background: var(--c-paper); }
.nxc-tag::before { content: ""; position: absolute; left: 12%; top: 50%; width: 0.65rem; height: 0.65rem; translate: 0 -50%; border-radius: 2px; background: var(--c-red); }
.nxc-tag::after { content: ""; position: absolute; left: 30%; right: 12%; top: 50%; height: 0.35rem; translate: 0 -50%; border-radius: 1rem; background: var(--nx-dim); }

/* Tutor: squared paper, a red margin, the pupil's lines with a tick, and a hint card in the margin. */
.nxt-paper { position: absolute; inset: 11% 9%; border-radius: 8px; background-color: var(--c-paper);
  background-image: linear-gradient(oklch(31.8% 0.005 67.7 / 0.07) 1px, transparent 1px), linear-gradient(90deg, oklch(31.8% 0.005 67.7 / 0.07) 1px, transparent 1px);
  background-size: 12px 12px; }
.nxt-paper::after { content: ""; position: absolute; top: 0; bottom: 0; left: 60%; width: 2px; background: oklch(59.2% 0.241 29.2 / 0.55); }
.nxt-paper > i { position: absolute; left: 8%; height: 0.4rem; border-radius: 1rem; background: oklch(31.8% 0.005 67.7 / 0.55); }
.nxt-paper > i:nth-child(1) { top: 26%; width: 36%; }
.nxt-paper > i:nth-child(2) { top: 50%; width: 26%; }
.nxt-paper > .nxt-tick { top: 40%; left: 38%; width: 0.75rem; height: 1.4rem; border: solid var(--c-red); border-width: 0 4px 4px 0; border-radius: 0; background: none; rotate: 45deg; }
.nxt-note { position: absolute; right: 6%; top: 22%; width: 30%; height: 30%; border-radius: 8px; background: var(--c-red); }
.nxt-note::before { content: ""; position: absolute; left: 14%; right: 18%; top: 38%; height: 0.3rem; border-radius: 1rem; background: oklch(100% 0 0 / 0.7); box-shadow: 0 0.55rem 0 oklch(100% 0 0 / 0.5); }

.motion .nxa-lane--v i { animation: nxa-grow 3.6s var(--ease-out-quart) both; }
.motion .nxa-run i:nth-child(1) b { animation: nxa-d1 3.6s linear both; }
.motion .nxa-run i:nth-child(2) b { animation: nxa-d2 3.6s linear both; }
.motion .nxa-run i:nth-child(3) b { animation: nxa-d3 3.6s linear both; }
.motion .nxa-run i:nth-child(4) b { animation: nxa-d4 3.6s linear both; }
.motion .nxc-sheet--top { animation: nxc-rise 3.6s var(--ease-out-quart) both; }
.motion .nxc-mark { animation: nxc-mark 3.6s var(--ease-out-quart) both; }
.motion .nxc-tag { animation: nxc-tag 3.6s var(--ease-out-quart) both; }
.motion .nxt-note { animation: nxt-note 3.6s var(--ease-out-quart) both; }
.motion .nxt-tick { animation: nxt-tick 3.6s var(--ease-out-quart) both; }
.motion .mode-next:not(.is-in) .nx-pic * { animation-play-state: paused; }
.nx-card:hover .nx-pic *, .nx-card:focus-visible .nx-pic * { animation-iteration-count: infinite; }
@keyframes nxa-grow { from { transform: scaleX(0); } 88%, to { transform: none; } }
@keyframes nxa-d1 { 0%, 16% { background: var(--nx-dim); } 19%, 100% { background: var(--c-red); } }
@keyframes nxa-d2 { 0%, 38% { background: var(--nx-dim); } 41%, 100% { background: var(--c-red); } }
@keyframes nxa-d3 { 0%, 60% { background: var(--nx-dim); } 63%, 100% { background: var(--c-red); } }
@keyframes nxa-d4 { 0%, 82% { background: var(--nx-dim); } 85%, 100% { background: var(--c-red); } }
@keyframes nxc-rise { from { transform: translateY(10px) rotate(-3deg); } 25%, to { transform: none; } }
@keyframes nxc-mark { 0%, 30% { transform: scaleX(0); } 58%, 100% { transform: none; } }
@keyframes nxc-tag { 0%, 62% { opacity: 0; transform: translateY(6px); } 76%, 100% { opacity: 1; transform: none; } }
@keyframes nxt-note { 0%, 22% { opacity: 0; transform: scale(0.85); } 36%, 100% { opacity: 1; transform: none; } }
@keyframes nxt-tick { 0%, 58% { opacity: 0; scale: 0.4; } 70%, 100% { opacity: 1; scale: 1; } }
