/* Autorestage — marketing site, part 2: the sections below the fold.
 * Tokens come from style.css; nothing here defines a colour of its own
 * except the photographic overlays, which sit on pictures, not on themes. */

/* ── scrollytelling ────────────────────────────────────────────────────── */
.story { padding: var(--sec) var(--gut) calc(var(--sec) * .6); }
.story-grid { max-width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 88px); }
.steps { grid-column: 1; grid-row: 1; }
/* The wrapper is what sticks. On a phone it also paints the page colour
   around the stage, so step text scrolling underneath never shows through
   the gap under the nav or behind the stage's rounded corners. */
.stage-wrap { grid-column: 2; grid-row: 1; align-self: start; position: sticky; top: calc(var(--nav-h) + 7vh); }
.stage {
  position: relative; aspect-ratio: 16 / 11; border-radius: var(--r-l); overflow: hidden; background: var(--bg-alt);
  box-shadow: var(--shadow-l), 0 0 0 1px var(--line); isolation: isolate;
}
.panel { position: absolute; inset: 0; opacity: 0; clip-path: inset(0 0 0 100%); transition: clip-path 1.1s var(--ease), opacity .3s; }
.panel.on { z-index: 2; opacity: 1; clip-path: inset(0); }
.panel.was { z-index: 1; opacity: 1; clip-path: inset(0); }
.panel > img, .panel > video, .swap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.panel.on > img:not(.scrub), .panel.on > video { animation: settle 1.6s var(--ease) both; }
@keyframes settle { from { transform: scale(1.08); } }
.panel[data-panel="3"] > img { object-position: 50% 22%; }
.swap { position: absolute; inset: 0; }
.swap img { opacity: 0; transition: opacity 1s var(--ease), transform 6s linear; transform: scale(1.04); }
.swap img.on { opacity: 1; transform: none; }
.chips { position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 3; display: flex; gap: 6px; padding: 6px; overflow-x: auto; scrollbar-width: none; border-radius: 999px; background: oklch(14% .01 265 / .6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: oklch(100% 0 0 / .78); font-size: .82rem; font-weight: 500; cursor: pointer; transition: background-color .3s, color .3s; }
.chips button:hover { color: #fff; background: oklch(100% 0 0 / .1); }
.chips button.on { background: var(--accent); color: var(--on-accent); }
.panel-tag { position: absolute; top: 14px; left: 14px; z-index: 3; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: oklch(14% .01 265 / .62); color: #fff; font-size: .8rem; font-weight: 500; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.rec { width: 8px; height: 8px; border-radius: 50%; background: oklch(64% .22 25); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.logo-box { position: absolute; z-index: 3; left: 27.5%; top: 16.5%; width: 47.3%; height: 13.5%; border: 1.5px dashed var(--accent); border-radius: 10px; box-shadow: 0 0 0 9999px oklch(14% .01 265 / .18); opacity: 0; transform: scale(1.15); transition: opacity .6s .5s, transform 1s .5s var(--ease); }
.panel.on .logo-box { opacity: 1; transform: none; }
.step { position: relative; min-height: 70vh; display: flex; flex-direction: column; justify-content: center; padding-left: 30px; cursor: pointer; outline-offset: 8px; }
.step:first-child { min-height: 58vh; justify-content: flex-start; padding-top: 7vh; }
.step::before, .step::after { content: ''; position: absolute; left: 0; top: 50%; height: 140px; width: 2px; translate: 0 -50%; border-radius: 2px; background: var(--line-2); }
.step:first-child::before, .step:first-child::after { top: calc(7vh + 70px); }
.step::after { background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform .8s var(--ease); }
.step.on::after { transform: none; }
/* Inactive steps recede by colour, not opacity: --ink-3 still reads at
   5:1, where opacity .3 took the same text to under 2.5:1. */
.step .n { font: 500 .85rem var(--mono); color: var(--ink-3); transition: color .5s var(--ease); }
.step h3 { margin-top: 10px; font-size: clamp(1.6rem, 1.15rem + 1.5vw, 2.5rem); font-weight: 600; line-height: 1.04; letter-spacing: -.045em; color: var(--ink-3); transition: color .5s var(--ease); }
.step p { margin-top: 16px; max-width: 40ch; color: var(--ink-3); font-size: 1.06rem; transition: color .5s var(--ease); }
.step.on .n { color: var(--accent-ink); }
.step.on h3 { color: var(--ink); }
.step.on p { color: var(--ink-2); }

/* ── before / after ────────────────────────────────────────────────────── */
.ba-sec { padding: var(--sec) var(--gut); background: var(--bg-alt); }
.ba { --pos: 50%; position: relative; max-width: 1120px; margin: 0 auto; aspect-ratio: 16 / 9; border-radius: var(--r-l); overflow: hidden; box-shadow: var(--shadow-l); background: var(--surface); }
.ba-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-clip { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); }
.ba-range { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.ba-bar { position: absolute; z-index: 2; top: 0; bottom: 0; left: var(--pos); width: 2px; translate: -1px 0; background: #fff; box-shadow: 0 0 24px oklch(0% 0 0 / .35); pointer-events: none; }
.ba-grip { position: absolute; top: 50%; left: 50%; translate: -50% -50%; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #fff; color: oklch(18% .01 265); box-shadow: 0 8px 30px oklch(0% 0 0 / .3); transition: transform .4s var(--ease); }
.ba-grip svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ba:hover .ba-grip { transform: scale(1.08); }
.ba-range:focus-visible ~ .ba-bar .ba-grip { outline: 3px solid var(--accent); outline-offset: 3px; }
.ba-tag { position: absolute; z-index: 2; top: 16px; padding: 6px 13px; border-radius: 999px; font-size: .8rem; font-weight: 500; pointer-events: none; }
.ba-tag.l { left: 16px; background: oklch(14% .01 265 / .6); color: #fff; backdrop-filter: blur(8px); }
.ba-tag.r { right: 16px; background: var(--accent); color: var(--on-accent); }

/* ── details: an editorial list, not another card grid ─────────────────── */
.details { padding: var(--sec) var(--gut); }
.det-grid { max-width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(24px, 4vw, 56px); }
.det-grid li { position: relative; padding: 34px 0 42px; border-top: 1px solid var(--line-2); }
.det-grid li::before { content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .7s var(--ease); }
.det-grid li:hover::before { transform: none; }
.det-grid svg { width: 44px; height: 44px; padding: 10px; border-radius: 12px; background: var(--accent-soft); fill: none; stroke: var(--accent-ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .6s var(--ease); }
.det-grid li:hover svg { transform: rotate(-8deg) scale(1.06); }
.det-grid h3 { margin-top: 22px; font-size: 1.2rem; font-weight: 600; letter-spacing: -.03em; }
.det-grid p { margin-top: 8px; color: var(--ink-2); max-width: 34ch; }
.det-grid li:nth-child(3n+2) { --d: .08s; } .det-grid li:nth-child(3n) { --d: .16s; }

/* ── who it is for ─────────────────────────────────────────────────────── */
.built { padding: var(--sec) var(--gut); background: var(--bg-alt); }
.ind-grid { max-width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.ind { display: flex; flex-direction: column; padding: 10px 10px 24px; border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-s), 0 0 0 1px var(--line); transition: transform .6s var(--ease), box-shadow .6s var(--ease); }
.ind:hover { transform: translateY(-8px); box-shadow: var(--shadow-l), 0 0 0 1px var(--line); }
.ind:nth-child(2) { --d: .08s; } .ind:nth-child(3) { --d: .16s; } .ind:nth-child(4) { --d: .24s; }
.ind-img { aspect-ratio: 4 / 3; overflow: hidden; border-radius: calc(var(--r-l) - 9px); }
.ind-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
.ind:hover .ind-img img { transform: scale(1.07); }
.ind h3 { margin: 20px 12px 0; font-size: 1.22rem; font-weight: 600; letter-spacing: -.03em; }
.ind p { margin: 8px 12px 0; color: var(--ink-2); font-size: .96rem; }
.ind .more { align-self: flex-start; }
.more { display: inline-flex; gap: 6px; margin: auto 12px 0; padding-top: 18px; color: var(--accent-ink); font-size: .92rem; font-weight: 600; text-decoration: none; }
.more span { transition: transform .4s var(--ease); }
.ind:hover .more span, .more:hover span { transform: translateX(5px); }
@media (min-width: 1101px) { .ind:nth-child(even) { margin-top: 56px; margin-bottom: -56px; } .ind-grid { padding-bottom: 56px; } }

/* ── the difference ────────────────────────────────────────────────────── */
.diff { padding: var(--sec) var(--gut); }
.diff-table { position: relative; max-width: 1000px; margin: 0 auto; border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-s), 0 0 0 1px var(--line); overflow: hidden; }
.diff-table::after { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; right: 0; background: var(--accent-soft); box-shadow: inset 1px 0 0 var(--line); pointer-events: none; }
.diff-row { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.diff-row + .diff-row { border-top: 1px solid var(--line); }
.diff-row span { display: flex; align-items: center; gap: 14px; padding: 20px clamp(16px, 3vw, 32px); font-size: 1.02rem; line-height: 1.4; overflow-wrap: anywhere; }
.diff-row span::before { content: ''; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--line); -webkit-mask: var(--ic) center / 12px no-repeat, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: var(--ic) center / 12px no-repeat exclude, linear-gradient(#000 0 0); }
.diff-row span:first-child { color: var(--ink-3); --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 3l6 6M9 3L3 9' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); }
.diff-row span:first-child::before { background: var(--line-2); }
.diff-row span:last-child { font-weight: 500; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.3l2.3 2.3 4.7-5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.diff-row span:last-child::before { background: var(--accent); }
.diff-head span { padding-block: 18px; font-size: .78rem; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.diff-head span::before { display: none; }
.diff-head span:last-child { color: var(--accent-ink); }
.js .diff-table .diff-row { opacity: 0; transform: translateY(10px); transition: opacity .6s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 90ms + .2s); }
.js .diff-table.in .diff-row { opacity: 1; transform: none; }
.diff-row:nth-child(2) { --i: 1; } .diff-row:nth-child(3) { --i: 2; } .diff-row:nth-child(4) { --i: 3; }
.diff-row:nth-child(5) { --i: 4; } .diff-row:nth-child(6) { --i: 5; } .diff-row:nth-child(7) { --i: 6; }

/* ── numbers ───────────────────────────────────────────────────────────── */
.stats { position: relative; overflow: hidden; color-scheme: dark; color: var(--ink); background: var(--night); padding: clamp(72px, 8vw, 120px) var(--gut); }
.stats::before { content: ''; position: absolute; left: 50%; top: -60%; width: 90%; height: 120%; translate: -50% 0; background: radial-gradient(closest-side, oklch(77% .16 68 / .16), transparent); pointer-events: none; }
.stats dl { position: relative; max-width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.stats dl > div { padding-top: 26px; border-top: 1px solid var(--line-2); }
.stats dl > div:nth-child(2) { --d: .08s; } .stats dl > div:nth-child(3) { --d: .16s; } .stats dl > div:nth-child(4) { --d: .24s; }
.stats dt { font-size: clamp(2.6rem, 1.5rem + 3.4vw, 4.8rem); font-weight: 600; line-height: 1; letter-spacing: -.055em; font-variant-numeric: tabular-nums; background: linear-gradient(180deg, var(--ink) 30%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats dd { margin-top: 14px; max-width: 24ch; color: var(--ink-2); }
.stats .pre { font-size: .32em; letter-spacing: -.01em; vertical-align: .9em; margin-right: -.1em; }

/* ── how it works ──────────────────────────────────────────────────────── */
.how { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 100px); align-items: center; padding-block: var(--sec); background: var(--bg-alt); }
.how { padding-inline: max(var(--gut), calc((100% - var(--wrap)) / 2)); }
.how-img { position: relative; border-radius: var(--r-l); overflow: hidden; box-shadow: var(--shadow-l); }
.how-img img { width: 100%; aspect-ratio: 4 / 3.4; object-fit: cover; }
.how .sec-head { margin-bottom: 36px; }
.how-steps { position: relative; display: grid; gap: 30px; }
.how-steps::before, .how-steps::after { content: ''; position: absolute; left: 21px; top: 22px; bottom: 22px; width: 2px; background: var(--line-2); }
.how-steps::after { background: var(--accent); transform: scaleY(var(--hp, 0)); transform-origin: top; transition: transform .2s linear; }
.how-steps li { position: relative; z-index: 1; display: flex; gap: 22px; }
.how-steps li:nth-child(2) { --d: .1s; } .how-steps li:nth-child(3) { --d: .2s; }
.how-steps .n { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1px var(--line-2); font-weight: 600; color: var(--accent-ink); transition: background-color .4s, color .4s; }
.how-steps li.lit .n { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.how-steps h3 { margin-top: 8px; font-size: 1.25rem; font-weight: 600; letter-spacing: -.03em; }
.how-steps p { margin-top: 6px; color: var(--ink-2); max-width: 40ch; }

/* ── developers ────────────────────────────────────────────────────────── */
.api { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(36px, 5vw, 88px); align-items: center; padding-block: var(--sec); }
.api { padding-inline: max(var(--gut), calc((100% - var(--wrap)) / 2)); }
.api-copy h2 { margin-top: 18px; font-size: clamp(1.9rem, 1.2rem + 2.2vw, 3.1rem); font-weight: 600; line-height: 1.04; letter-spacing: -.045em; text-wrap: balance; }
.api-copy > p:not(.eyebrow) { margin-top: 20px; max-width: 50ch; color: var(--ink-2); font-size: 1.05rem; }
.ticks { margin-top: 24px; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 32px; }
.ticks li::before { content: ''; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.ticks li::after { content: ''; position: absolute; left: 7px; top: 7px; width: 6px; height: 9px; border: solid var(--accent-ink); border-width: 0 2px 2px 0; rotate: 40deg; }
.code { --d: .1s; color-scheme: dark; color: var(--ink); background: oklch(16.5% .008 265); border-radius: var(--r-l); box-shadow: var(--shadow-l), 0 0 0 1px var(--line); overflow: hidden; }
.code-bar { display: flex; align-items: center; gap: 7px; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--line); }
.code-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); }
.code-bar span { flex: 1; margin-left: 10px; font: .8rem var(--mono); color: var(--ink-3); }
.code pre { margin: 0; padding: 24px; overflow-x: auto; font: .86rem/1.8 var(--mono); }
.code .c { color: var(--ink-3); } .code .s { color: var(--accent); }

/* ── final call ────────────────────────────────────────────────────────── */
.end { position: relative; isolation: isolate; overflow: hidden; color-scheme: dark; color: var(--ink); background: var(--night); padding: clamp(130px, 15vw, 230px) var(--gut); text-align: center; }
.end-bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; opacity: .6; transform: scale(1.12); transition: transform 3s var(--ease); }
.end:has(.in) .end-bg { transform: none; }
.end::after { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(70% 70% at 50% 50%, oklch(12.4% .006 265 / .55), var(--night)); }
.end h2 { font-size: clamp(2.7rem, 1.2rem + 5.4vw, 6.4rem); font-weight: 600; line-height: .98; letter-spacing: -.058em; }
.end p { max-width: 40ch; margin: 22px auto 0; color: var(--ink-2); font-size: var(--t-lead); }
.end .hero-cta { justify-content: center; animation: none; }

/* ── footer ────────────────────────────────────────────────────────────── */
.foot { padding: 72px var(--gut) 36px; border-top: 1px solid var(--line); }
.foot-top { max-width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr); gap: 48px; }
.foot-brand p { margin-top: 14px; max-width: 30ch; color: var(--ink-3); }
.foot-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.foot-h { margin-bottom: 12px; font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.foot-cols a { display: block; padding: 5px 0; color: var(--ink-2); font-size: .94rem; text-decoration: none; transition: color .2s; }
.foot-cols a:hover { color: var(--ink); }
.foot-bot { max-width: var(--wrap); margin: 56px auto 0; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; color: var(--ink-3); font-size: .86rem; }

/* ── responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .ind-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-top { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .story-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .stage-wrap { grid-column: 1; grid-row: 1; z-index: 4; top: var(--nav-h); margin-inline: calc(-1 * var(--gut)); padding: 10px var(--gut) 16px; background: var(--bg); }
  .stage { aspect-ratio: 16 / 10; width: min(100%, calc(46svh * 1.6)); margin-inline: auto; }
  .steps { grid-column: 1; grid-row: 2; }
  .step, .step:first-child { min-height: 58vh; justify-content: center; padding-top: 0; }
  .step:first-child::before, .step:first-child::after { top: 50%; }
  .logo-box { top: 15.9%; height: 14.9%; }
  .det-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats dl { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 44px; }
  .how, .api { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) and (max-height: 560px) {
  .stage-wrap { position: relative; top: auto; }
}
@media (max-width: 600px) {
  .ind-grid, .det-grid { grid-template-columns: minmax(0, 1fr); }
  .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
  .diff-row span { padding: 16px 14px; gap: 10px; font-size: .94rem; }
  .ba { aspect-ratio: 4 / 3; }
  .chips { left: 8px; right: 8px; top: 8px; bottom: auto; }
  .panel[data-panel="3"] .panel-tag { top: auto; bottom: 10px; }
}
