/*
 * Homepage scroll story (cms/home_page.html, driven by js/home-story.js).
 * Everything is scoped to .story so it can't collide with Tailwind utilities.
 * Colors come from the Tailwind theme in input.css, with fallbacks.
 */
.story {
  --onyx: var(--color-onyx, #161616);
  --snow: var(--color-bright-snow, #F9F8F6);
  --orange: var(--color-blaze-orange, #FF6200);
  --grey: var(--color-grey-olive, #959595);
  /* Same edges as the site's max-w-7xl px-4/sm:px-6/lg:px-8 container, so copy lines up with the header */
  --pad: 16px;
  --gutter: max(var(--pad), calc((100vw - 80rem) / 2 + var(--pad)));
  --hdr: 65px; /* sticky site header height; set from the real header in home-story.js */
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  overflow-x: clip;
}
@media (min-width: 640px) { .story { --pad: 24px; } }
@media (min-width: 1024px) { .story { --pad: 32px; } }
.story .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.story .eyebrow { font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; color: var(--orange); }
.story .pin { position: relative; height: calc(100vh - var(--hdr)); height: calc(100svh - var(--hdr)); overflow: hidden; }
.story .grain::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--grain); opacity: .28; mix-blend-mode: multiply; pointer-events: none; }
.story .btn { display: inline-flex; align-items: center; gap: .5em; border: 2px solid currentColor; border-radius: 999px; padding: .8em 1.5em; font-weight: 600; transition: background .2s, color .2s; }

/* Progress bar under the header and the chapter rail */
.story .progress { position: fixed; top: var(--hdr); left: 0; height: 3px; width: 100%; background: var(--orange); transform-origin: 0 50%; transform: scaleX(0); z-index: 30; }
.story .chapters { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 30; display: flex; flex-direction: column; gap: 10px; --chap: var(--onyx); color: var(--chap); transition: color .3s, opacity .3s; font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; text-align: right; }
.story .chapters li { opacity: .35; transition: opacity .3s; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.story .chapters li::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--chap); }
.story .chapters.dark { --chap: var(--snow); }
.story .chapters.on-orange { --chap: var(--onyx); }
.story .chapters.gone { opacity: 0; }
.story .chapters li.on { opacity: 1; }
.story .chapters li:not(.on) { color: transparent; }
@media (max-width: 900px) { .story .chapters { display: none; } }

/* 1. Spark: the period of the headline becomes the orange sun */
.story #spark { background: var(--onyx); color: var(--snow); }
.story .spark-pin { display: grid; align-items: center; padding: 32px var(--gutter); }
.story .spark-circle { position: absolute; left: 0; top: 0; width: 700px; height: 700px; border-radius: 50%; background: var(--orange); transform-origin: 50% 50%; visibility: hidden; }
.story .spark-inner { position: relative; z-index: 2; max-width: 1100px; }
.story .spark-title { font-size: clamp(3rem, 10vw, 8.75rem); line-height: .95; font-weight: 600; letter-spacing: -.04em; margin-top: 1.25rem; }
.story .spark-title .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .06em; }
.story .spark-title .w > span { display: inline-block; }
.story .period { display: inline-block; width: .19em; height: .19em; border-radius: 50%; background: var(--orange); margin-left: .05em; }
.story .spark-lines { margin-top: clamp(1.25rem, 3vh, 2.25rem); max-width: 30ch; font-size: clamp(1.125rem, 2vw, 1.5rem); line-height: 1.45; font-weight: 500; }
.story.is-live .spark-lines .line { opacity: .2; }
.story .spark-cta { margin-top: clamp(1.5rem, 4vh, 2.5rem); }
.story .spark-cta .btn:hover { background: var(--snow); color: var(--onyx); }
.story .scroll-cue { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; opacity: .6; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.story .scroll-cue i { width: 1.5px; height: 36px; background: linear-gradient(var(--snow) 50%, transparent 50%) 0 0 / 100% 200%; animation: story-cue 1.6s ease-in-out infinite; }
@keyframes story-cue { from { background-position: 0 100%; } to { background-position: 0 -100%; } }

/* 2. Stuck: the questions circle until we put them in order */
.story #stuck { background: var(--snow); }
.story .stuck-pin { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 64px); align-items: center; padding: 40px var(--gutter); }
.story .stuck-copy h2 { font-size: clamp(1.9rem, 4vw, 3.6rem); line-height: 1.02; font-weight: 600; letter-spacing: -.03em; margin-top: .75rem; }
.story .steps { display: grid; margin-top: 1.5rem; }
.story.is-live .step { grid-area: 1 / 1; }
.story .step { font-size: clamp(1rem, 1.5vw, 1.25rem); line-height: 1.55; color: #3d3d3d; max-width: 36ch; }
.story .arena { position: relative; height: min(70vh, 640px); }
.story .arena-img { position: absolute; inset: 0; overflow: hidden; clip-path: circle(28% at 50% 38%); filter: grayscale(1) contrast(.85); }
.story .arena-img img { width: 100%; height: 100%; object-fit: cover; }
.story .q { position: absolute; left: 0; top: 0; white-space: nowrap; display: inline-flex; align-items: center; background: #fff; color: var(--onyx); border: 1.5px solid var(--onyx); border-radius: 999px; padding: .55em 1.1em; font-size: clamp(.78rem, 1.1vw, .95rem); font-weight: 600; box-shadow: 0 8px 22px rgba(22,22,22,.14); will-change: transform; }
.story .q .n { display: inline-block; overflow: hidden; color: var(--orange); }
.story.is-live .q .n { max-width: 0; opacity: 0; }
.story.is-live .q .tag { max-width: 0; opacity: 0; }
.story .q .tag { display: inline-block; overflow: hidden; color: var(--orange); font-size: .8em; letter-spacing: .1em; text-transform: uppercase; }
.story .arena:not(.live) .q { position: static; margin: 4px; }
@media (max-width: 800px) {
  .story .stuck-pin { display: flex; flex-direction: column; align-items: stretch; gap: 16px; padding-top: 24px; padding-bottom: 20px; }
  .story .steps { margin-top: .9rem; }
  .story .arena { flex: 1; min-height: 0; height: auto; }
}

/* 3. AI native: scroll scrubs the chaos-to-clarity film */
.story #ai { background: var(--onyx); color: var(--snow); }
.story .ai-pin { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 56px); align-items: center; padding: 40px var(--gutter); }
.story .ai-media { position: relative; width: calc(100% + var(--gutter)); }
.story .ai-frame { position: relative; aspect-ratio: 832 / 464; overflow: hidden; background: #f3e9d2; }
.story .ai-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.story .ai-scrub { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-right: var(--gutter); font-size: .7rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: rgba(249,248,246,.55); }
.story .ai-scrub .bar { flex: 1; height: 2px; background: rgba(249,248,246,.15); }
.story .ai-scrub .bar i { display: block; height: 100%; background: var(--orange); transform-origin: 0 50%; transform: scaleX(0); }
.story .ai-copy { position: relative; z-index: 2; max-width: 34rem; }
.story .ai-copy h2 { font-size: clamp(2.4rem, 5.5vw, 5rem); line-height: 1; font-weight: 600; letter-spacing: -.035em; margin-top: .75rem; }
.story .ai-copy .lede { margin-top: 1.25rem; font-size: clamp(1rem, 1.5vw, 1.2rem); color: rgba(249,248,246,.75); }
.story .stages { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1rem; }
.story .stages li { display: flex; align-items: center; gap: .5em; border: 1.5px solid rgba(249,248,246,.22); color: rgba(249,248,246,.42); border-radius: 999px; padding: .45em 1em; font-weight: 600; font-size: .9rem; }
.story .stages .spark { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); transform: scale(0); }
.story .team { margin-top: clamp(1.5rem, 4vh, 2.5rem); display: flex; align-items: center; gap: 20px; }
.story .dots { display: grid; grid-template-columns: repeat(5, 14px); gap: 9px; flex: none; }
.story .dots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(249,248,246,.45); }
.story .team-label { display: grid; font-size: clamp(.95rem, 1.4vw, 1.1rem); font-weight: 500; line-height: 1.4; }
.story .team-label span { grid-area: 1 / 1; }
.story.is-live .team-label .b { opacity: 0; }
.story:not(.is-live) .team-label .a { display: none; }
.story .ai-close { margin-top: clamp(1.5rem, 4vh, 2.5rem); font-size: clamp(1.3rem, 2.4vw, 2rem); line-height: 1.25; font-weight: 600; letter-spacing: -.015em; }
@media (max-width: 800px) {
  .story .ai-pin { display: flex; flex-direction: column; justify-content: center; gap: 20px; padding-top: 24px; padding-bottom: 20px; }
  .story .ai-media { width: calc(100% + 2 * var(--gutter)); margin-left: calc(-1 * var(--gutter)); }
  .story .ai-scrub { padding: 0 var(--gutter); }
  .story .ai-copy h2 { font-size: 2.2rem; }
  .story .ai-close { font-size: 1.15rem; }
}

/* 4. What We Do: horizontal track of service cards */
.story #doors { background: var(--snow); }
.story .doors-pin { display: flex; flex-direction: column; justify-content: center; gap: clamp(20px, 4vh, 44px); padding: 32px 0; }
.story .doors-head { padding: 0 var(--gutter); display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.story .doors-head h2 { font-size: clamp(1.9rem, 4vw, 3.6rem); line-height: 1.02; font-weight: 600; letter-spacing: -.03em; margin-top: .75rem; max-width: 16ch; }
.story .doors-head .hint { font-size: .8rem; font-weight: 600; color: #6b6b6b; white-space: nowrap; }
.story .track { display: flex; gap: clamp(14px, 2.2vw, 28px); padding: 0 var(--gutter); width: max-content; will-change: transform; }
/* Mirrors the /ideas index cards: full-bleed art, onyx gradient, quiet meta + semibold title, square corners */
.story .door { position: relative; isolation: isolate; width: min(80vw, 384px); height: min(58vh, 480px); display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; padding: 32px; background: var(--orange); color: var(--snow); box-shadow: inset 0 0 0 1px rgba(22,22,22,.1); }
.story .door-media { position: absolute; inset: 0; z-index: -2; overflow: hidden; transition: transform .5s; }
.story .door:hover .door-media { transform: scale(1.05); }
.story .door-media img { position: absolute; top: 0; left: 0; width: 112%; max-width: none; height: 100%; object-fit: cover; }
.story .door::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, var(--onyx), rgba(22,22,22,.4) 50%, transparent); }
/* Fixed-height text block so every card's text starts at the same line */
.story .door-content { min-height: 8.75rem; display: flex; flex-direction: column; }
.story .door--cta { color: var(--onyx); }
.story .door--cta::before { display: none; }
.story .door--cta .door-meta, .story .door--cta .door-desc { color: rgba(22,22,22,.8); }
.story .door-meta { font-size: .875rem; line-height: 1.5rem; color: rgba(249,248,246,.8); }
.story .door-title { margin-top: .75rem; font-size: 1.125rem; line-height: 1.5rem; font-weight: 600; }
.story .door-title a::after { content: ""; position: absolute; inset: 0; }
.story .door-desc { margin-top: .5rem; font-size: .875rem; line-height: 1.5rem; color: rgba(249,248,246,.8); }
.story .rail { margin: 0 var(--gutter); height: 2px; background: rgba(22,22,22,.12); }
.story .rail i { display: block; height: 100%; background: var(--orange); transform-origin: 0 50%; transform: scaleX(0); }
@media (max-width: 800px) { .story .doors-head .hint { display: none; } }

/* 5. Proof: scattered logos collect into a row */
.story #proof { background: var(--onyx); color: var(--snow); overflow: clip; padding: clamp(96px, 18vh, 180px) var(--gutter); }
.story #proof h2 { font-size: clamp(1.6rem, 3.4vw, 3rem); line-height: 1.12; font-weight: 600; letter-spacing: -.025em; max-width: 24ch; margin-top: .9rem; }
.story #proof h2 .word { opacity: .18; }
.story .logos { margin-top: clamp(48px, 8vh, 88px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 32px 40px; }
.story .logos img { height: clamp(44px, 6vw, 72px); width: auto; object-fit: contain; }

/* 6. Voices: cards stack like a deck; the key line gets highlighted */
.story #voices { background: var(--snow); padding: clamp(96px, 16vh, 160px) var(--gutter) 12vh; }
.story .voices-head { max-width: 920px; margin: 0 auto 6vh; }
.story .voices-head h2 { font-size: clamp(1.9rem, 4vw, 3.6rem); line-height: 1.02; font-weight: 600; letter-spacing: -.03em; margin-top: .75rem; }
.story .vcard { position: sticky; top: calc(var(--hdr) + 8vh + var(--i) * 14px); max-width: 920px; min-height: min(60vh, 540px); margin: 0 auto 16vh; padding: clamp(24px, 4vw, 56px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; transform-origin: 50% 0; border: 1.5px solid var(--onyx); }
.story .vcard:last-child { margin-bottom: 0; }
.story .vcard blockquote { font-size: clamp(1.1rem, 2.1vw, 1.6rem); line-height: 1.45; font-weight: 500; letter-spacing: -.01em; }
.story .vcard mark { color: inherit; background: linear-gradient(var(--hl), var(--hl)) no-repeat 0 0 / 0% 100%; padding: 0 .08em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.story .vcard figcaption { font-size: .9rem; line-height: 1.4; }
.story .vcard figcaption b { display: block; font-weight: 700; }
/* --i offsets each card's sticky top so the stacked edges peek out */
.story .v1 { --i: 0; background: #fff; --hl: var(--orange); }
.story .v2 { --i: 1; background: var(--orange); border-color: var(--orange); --hl: var(--snow); }
.story .v3 { --i: 2; background: var(--onyx); color: var(--snow); --hl: var(--orange); }
.story .v4 { --i: 3; background: var(--grey); border-color: var(--grey); --hl: var(--snow); }

/* 7. Finale: the dot comes back and floods the screen */
.story #finale { background: var(--onyx); color: var(--snow); }
.story .finale-pin { display: grid; place-items: center; text-align: center; padding: 0 var(--gutter); }
.story .finale-fill { position: absolute; inset: 0; background: var(--orange); clip-path: circle(7px at 50% 50%); }
.story .finale-pre { position: absolute; left: 50%; top: calc(50% + 28px); transform: translateX(-50%); font-size: .95rem; font-weight: 500; color: rgba(249,248,246,.7); white-space: nowrap; }
.story .finale-copy { position: relative; z-index: 2; color: var(--onyx); max-width: 860px; }
.story .finale-copy h2 { font-size: clamp(3rem, 9vw, 8rem); line-height: .95; font-weight: 600; letter-spacing: -.04em; }
.story .finale-copy p { margin: 1.5rem auto 0; max-width: 34ch; font-size: clamp(1.05rem, 1.8vw, 1.35rem); line-height: 1.5; font-weight: 500; }
.story .finale-copy .btn { margin-top: 2rem; background: var(--onyx); color: var(--snow); border-color: var(--onyx); font-size: 1.05rem; }

/* Reduced motion: every scene shows its end state, nothing pins */
.reduce .story .pin, .story:not(.is-live) .pin { height: auto; min-height: calc(100svh - var(--hdr)); }
.reduce .story .doors-pin, .story:not(.is-live) .doors-pin { overflow-x: auto; }
.reduce .story .spark-lines .line, .reduce .story #proof h2 .word { opacity: 1; }

/* Without JS (GSAP failed or blocked): show resolved content, drop the scroll-only chrome */
.story:not(.is-live) .progress, .story:not(.is-live) .chapters, .story:not(.is-live) .scroll-cue, .story:not(.is-live) .finale-pre { display: none; }
.story:not(.is-live) .arena-img { clip-path: none; filter: none; }
.story:not(.is-live) .finale-fill { clip-path: none; }
.story:not(.is-live) .vcard mark { background-size: 100% 100%; }
