/* Homepage styles. Builds on tokens.css + components.css. */

html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--canvas); }
a { color: var(--accent-text); }
a:hover { color: var(--action-hover); }
img { max-width: 100%; }

.page { font-family: var(--font-sans); color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; overflow-x: clip; }
.page * { box-sizing: border-box; }
.wrap { max-width: 1280px; margin: 0 auto; padding-inline: var(--space-8); }

.skip-link { position: absolute; left: var(--space-4); top: -100px; z-index: 50; background: var(--surface); color: var(--ink); padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); }
.skip-link:focus { top: var(--space-4); }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(250, 248, 246, .86); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 24px; }
.nav-logo { display: flex; }
.nav-logo img { height: 34px; width: auto; display: block; }
.nav-links { display: flex; gap: 36px; align-items: center; }
.nav-links a { color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 500; padding: 12px 0; position: relative; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }

/* ---------- Type ---------- */
.display { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: -0.5px; line-height: .92; margin: 0; font-size: clamp(52px, 7vw, 108px); }
.display span { display: block; }
.h2 { font-family: var(--font-display); font-weight: 600; line-height: 1.02; margin: 0; font-size: clamp(40px, 4.6vw, 64px); }
.red { color: var(--brand-red); }
.lede { font-size: 20px; line-height: 1.55; color: var(--ink-soft); margin: 0; max-width: 560px; }
.body-copy { margin: 0; font-size: 16px; line-height: 1.65; color: var(--ink-soft); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-8); align-items: start; }

/* ---------- Hero ---------- */
.hero { padding-top: 112px; padding-bottom: 104px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-8); align-items: center; }
.hero-eyebrow { margin-bottom: 32px; }
.hero .lede { margin-top: 32px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 40px; }

/* Hero answer panel (looping) */
.panel { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-6); box-shadow: var(--shadow-card); }
.panel-head { display: flex; justify-content: space-between; }
.query { margin-top: 24px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 12px; }
.query svg { flex: none; }
.q-stack { position: relative; height: 22px; flex: 1; min-width: 0; overflow: hidden; }
.q { position: absolute; left: 0; top: 0; line-height: 22px; white-space: nowrap; opacity: 0; clip-path: inset(0 100% 0 0); animation: qcycle 12s linear infinite; }
.q:nth-child(2) { animation-delay: 4s; }
.q:nth-child(3) { animation-delay: 8s; }
.caret { display: inline-block; width: 2px; height: 18px; background: var(--brand-red); animation: blink 1s steps(1) infinite; flex: none; }
.bars { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.bar { height: 10px; border-radius: var(--radius-full); background: var(--surface-muted); overflow: hidden; }
.bar i { display: block; height: 100%; background: #ddd5cf; transform-origin: left; transform: scaleX(0); animation: fillbar 4s var(--ease) infinite; }
.bar:nth-child(1) { width: 96%; }
.bar:nth-child(2) { width: 88%; } .bar:nth-child(2) i { animation-delay: .12s; }
.bar:nth-child(3) { width: 92%; } .bar:nth-child(3) i { animation-delay: .24s; }
.bar:nth-child(4) { width: 54%; } .bar:nth-child(4) i { animation-delay: .36s; }
.sources-head { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { font-family: var(--font-mono); font-size: 12px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink-muted); white-space: nowrap; opacity: 0; animation: pop 4s var(--ease) infinite; }
.chip:nth-child(1) { animation-delay: .2s; }
.chip:nth-child(3) { animation-delay: .4s; }
.chip:nth-child(4) { animation-delay: .55s; }
.chip-on { border-color: var(--brand-red); color: var(--accent-text); background: #fdf3f4; animation: pop 4s var(--ease) infinite, ring 4s ease-out infinite; animation-delay: .65s, .65s; }
.cited { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent-text); opacity: 0; animation: pop 4s var(--ease) infinite; animation-delay: 1.9s; }
.panel .ddl-dataline { margin-top: 28px; }
.panel .ddl-dataline circle:nth-of-type(1) { animation-delay: 1.2s; }
.panel .ddl-dataline circle:nth-of-type(2) { animation-delay: 1.6s; }
.panel .ddl-dataline circle:nth-of-type(3) { animation-delay: 2s; }
.panel .ddl-dataline circle:nth-of-type(4) { animation-delay: 2.4s; }

@keyframes qcycle { 0% { opacity: 1; clip-path: inset(0 100% 0 0); } 9% { clip-path: inset(0 0 0 0); } 30% { opacity: 1; clip-path: inset(0 0 0 0); } 33.3%, 100% { opacity: 0; clip-path: inset(0 0 0 0); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes fillbar { 0%, 22% { transform: scaleX(0); } 48%, 90% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes pop { 0%, 38% { opacity: 0; transform: translateY(6px); } 48%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; transform: none; } }
@keyframes ring { 0%, 55% { box-shadow: 0 0 0 0 rgba(219, 62, 77, .35); } 75% { box-shadow: 0 0 0 8px rgba(219, 62, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(219, 62, 77, 0); } }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; width: max-content; animation: scroll 48s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-set { display: flex; margin: 0; padding: 0; list-style: none; }
.marquee-item { font-family: var(--font-display); font-weight: 600; font-size: 30px; color: var(--ink-soft); padding: 28px 36px; display: flex; align-items: center; gap: 36px; white-space: nowrap; }
.marquee-item::after { content: ""; width: 7px; height: 7px; border-radius: 999px; border: 1.5px solid var(--brand-red); }

/* ---------- The shift: word-by-word fill ---------- */
.shift-stage { padding-block: var(--space-10) var(--space-8); }
.shift-stage .wrap { width: 100%; }
.shift-h { font-family: var(--font-display); font-weight: 600; line-height: 1; margin: 24px 0 0; font-size: clamp(52px, 6.4vw, 104px); max-width: 1100px; }
.shift-sub { margin-top: 40px; max-width: 640px; }
.w:nth-child(1) { animation-range: contain 2% contain 14%; }
.w:nth-child(2) { animation-range: contain 12% contain 24%; }
.w:nth-child(3) { animation-range: contain 22% contain 34%; }
.w:nth-child(4) { animation-range: contain 34% contain 46%; }
.w:nth-child(5) { animation-range: contain 44% contain 56%; }
.w:nth-child(6) { animation-range: contain 54% contain 70%; }

.pillars-section { padding-bottom: 144px; }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; margin-top: 40px; }
.pillar { padding-top: var(--space-5); border-top: 1px solid var(--ink); }
.pillar h3 { font-family: var(--font-display); font-weight: 600; font-size: 44px; margin: 16px 0 12px; }

/* ---------- Capabilities: sticky index + scrolling rows ---------- */
.caps { padding-bottom: 144px; timeline-scope: --c1, --c2, --c3, --c4; }
.caps .h2 { margin-top: 20px; }
.caps-intro { margin: 24px 0 0; max-width: 400px; }
.cap-index { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 14px; }
.cap-index li { font-family: var(--font-display); font-weight: 600; font-size: 26px; color: var(--ink-muted); display: flex; align-items: center; gap: 14px; }
.cap-index li::before { content: ""; width: 24px; height: 1px; background: currentColor; }
.cap { display: grid; grid-template-columns: 56px minmax(0, 1fr) 44px; gap: var(--space-6); align-items: start; padding: var(--space-8) 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; position: relative; }
.cap:nth-of-type(1) { view-timeline-name: --c1; }
.cap:nth-of-type(2) { view-timeline-name: --c2; }
.cap:nth-of-type(3) { view-timeline-name: --c3; }
.cap:nth-of-type(4) { view-timeline-name: --c4; }
.cap:hover { color: inherit; }
.cap::before { content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 100%; background: var(--brand-red); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.cap:hover::before { transform: scaleX(1); }
.cap:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.cap-icon { width: 48px; height: 48px; color: var(--ink-soft); transition: color .3s ease, transform .5s var(--ease); }
.cap:hover .cap-icon { color: var(--brand-red); transform: translateY(-3px); }
.cap-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(34px, 3.4vw, 48px); line-height: 1; margin: 12px 0 16px; color: var(--ink); }
.cap-copy { margin: 0; font-size: 17px; line-height: 1.6; color: var(--ink-soft); }
.cap-arrow { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--ink); transition: background .3s ease, border-color .3s ease, color .3s ease, transform .4s var(--ease); }
.cap:hover .cap-arrow { background: var(--ink); border-color: var(--ink); color: var(--canvas); transform: rotate(-45deg); }
.tags { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: var(--space-4); padding: 0; list-style: none; }
.tags li { font-family: var(--font-mono); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-muted); display: flex; align-items: center; gap: 8px; }
.tags li::before { content: ""; width: 5px; height: 5px; background: var(--brand-red); }
.caps-foot { margin: 40px 0 0; font-size: 15px; color: var(--ink-muted); }
.sticky { position: sticky; top: 124px; }

/* ---------- Approach: horizontal pinned track ---------- */
.redband { background: var(--brand-red-deep); color: #ffffff; }
.redband .ddl-eyebrow { color: #f4f1ee; }
.redband .ddl-eyebrow b { color: #ffffff; }
.redband .h2 { margin-top: 20px; color: #ffffff; }
.hpin { padding-block: var(--space-10); }
.hpin-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 32px; width: 100%; }
.hpin-head > div:first-child { max-width: 640px; }
.segs { display: flex; gap: 8px; }
.seg { width: 56px; height: 2px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.seg i { display: block; height: 100%; background: #ffffff; }
.htrack { list-style: none; margin: 56px auto 0; padding: 0 var(--space-8); max-width: 1280px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 40px; }
.hstep { border-top: 1px solid rgba(255, 255, 255, .3); padding-top: 28px; }
.hstep-n { font-family: var(--font-display); font-weight: 700; font-size: 112px; line-height: .85; color: rgba(255, 255, 255, .2); display: block; }
.hstep h3 { font-family: var(--font-display); font-weight: 600; font-size: 36px; line-height: 1.05; margin: 24px 0 12px; }
.hstep p { margin: 0; font-size: 16px; line-height: 1.6; color: #f4f1ee; max-width: 400px; }
.hline { display: block; max-width: 1280px; height: 80px; margin: 48px auto 0; padding-inline: var(--space-8); }

/* ---------- Why / stats ---------- */
.why { padding-block: 144px; }
.why .split { margin-bottom: 72px; }
.why .h2 { margin-top: 20px; }
.why .lede { max-width: none; align-self: end; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.stat { padding: var(--space-6) var(--space-6) var(--space-6) 0; border-right: 1px solid var(--line); }
.stat + .stat { padding-left: var(--space-6); }
.stat:last-child { border-right: 0; }
.stat-n { font-family: var(--font-display); font-weight: 600; font-size: clamp(48px, 5vw, 72px); line-height: 1; color: var(--ink); }
.stat-n b { color: var(--brand-red); font-weight: 600; }
.stat-n--text { font-size: clamp(36px, 3.4vw, 48px); padding-block: 6px; }
.stat-l { font-family: var(--font-mono); font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-muted); margin-top: var(--space-4); margin-bottom: 0; line-height: 1.6; }

/* ---------- Closing ---------- */
.dark { background: var(--surface-inverse); color: var(--ink-inverse); padding-block: 144px 64px; }
.dark .ddl-eyebrow { color: #a39d99; }
.closing { max-width: 860px; }
.closing .display { font-size: clamp(52px, 6.4vw, 92px); margin-top: 24px; color: #f4f1ee; }
.closing .display span { display: inline; }
.closing-copy { margin: 32px 0 0; font-size: 20px; line-height: 1.55; color: #d9d4d0; max-width: 600px; }
.btn-light { background: #f4f1ee; color: #1a1a1a; }
.btn-light:hover { background: #ffffff; color: #1a1a1a; }
.btn-ghost-light { color: #f4f1ee; border-color: #77706c; }
.btn-ghost-light:hover { border-color: #f4f1ee; color: #f4f1ee; }
.dark .ddl-btn:focus-visible { outline-color: #f4f1ee; }
.foot { margin-top: 128px; padding-top: 32px; border-top: 1px solid #3a3634; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; }
.foot img { height: 30px; width: auto; display: block; }
.foot nav { display: flex; flex-wrap: wrap; gap: 28px; }
.foot a { color: #d9d4d0; text-decoration: none; font-size: 14px; }
.foot a:hover { color: #ffffff; }
.foot-meta { margin: 0; font-family: var(--font-mono); font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: #a39d99; }

/* ---------- Load-in ---------- */
.draw path { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 2.4s cubic-bezier(.65, 0, .35, 1) .6s forwards; }
.draw circle { opacity: 0; animation: fade .5s ease forwards; }
.in { animation: rise .9s var(--ease) both; }
.d1 { animation-delay: .05s; } .d2 { animation-delay: .15s; } .d3 { animation-delay: .28s; } .d4 { animation-delay: .42s; } .d5 { animation-delay: .56s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fade { to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes scroll { to { transform: translateX(-50%); } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes inkfill { to { color: var(--ink); } }
@keyframes redfill { to { color: var(--brand-red); } }
@keyframes litup { 0%, 100% { color: var(--ink-muted); } 35%, 65% { color: var(--ink); } }
@keyframes hslide { to { transform: translateX(calc(-100% + 100vw)); } }
@keyframes drift { to { transform: translateY(-80px); } }
@keyframes ease-out-hero { to { transform: translateY(-40px); opacity: .35; } }

/* ---------- Scroll-driven (desktop, motion on, supported browsers) ---------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 5% entry 40%; }
  }
  @media (min-width: 961px) and (prefers-reduced-motion: no-preference) {
    .hero-copy { animation: ease-out-hero linear both; animation-timeline: scroll(root); animation-range: 0px 640px; }
    .hero-panel { animation: drift linear both; animation-timeline: scroll(root); animation-range: 0px 720px; }
    .shift-pin { height: 1700px; view-timeline-name: --shift; }
    .shift-stage { position: sticky; top: 76px; height: 760px; padding-block: 0; display: flex; align-items: center; }
    .w { color: #d9d1cb; animation: inkfill linear both; animation-timeline: --shift; }
    .w.wr { animation-name: redfill; }
    .shift-sub { animation: rise linear both; animation-timeline: --shift; animation-range: contain 72% contain 92%; }
    .cap-index li { animation: litup linear both; animation-range: cover 10% cover 90%; }
    .cap-index li:nth-child(1) { animation-timeline: --c1; }
    .cap-index li:nth-child(2) { animation-timeline: --c2; }
    .cap-index li:nth-child(3) { animation-timeline: --c3; }
    .cap-index li:nth-child(4) { animation-timeline: --c4; }
    .hpin { height: 2800px; padding: 0; view-timeline-name: --hp; }
    .hpin-stage { position: sticky; top: 76px; height: 800px; overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
    .htrack { display: flex; width: max-content; max-width: none; margin: 64px 0 0; gap: 72px; padding-inline: max(64px, calc((100vw - 1280px) / 2 + 64px)); animation: hslide linear both; animation-timeline: --hp; animation-range: contain 8% contain 92%; }
    .hstep { width: 440px; flex: none; }
    .seg i { transform-origin: left; animation: grow linear both; animation-timeline: --hp; }
    .seg:nth-child(1) i { animation-range: contain 8% contain 29%; }
    .seg:nth-child(2) i { animation-range: contain 29% contain 50%; }
    .seg:nth-child(3) i { animation-range: contain 50% contain 71%; }
    .seg:nth-child(4) i { animation-range: contain 71% contain 92%; }
    .hline path { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw linear both; animation-timeline: --hp; animation-range: contain 8% contain 92%; }
    .hline circle { opacity: 0; animation: fade linear both; animation-timeline: --hp; }
    .hline circle:nth-of-type(1) { animation-range: contain 20% contain 24%; }
    .hline circle:nth-of-type(2) { animation-range: contain 40% contain 44%; }
    .hline circle:nth-of-type(3) { animation-range: contain 62% contain 66%; }
    .hline circle:nth-of-type(4) { animation-range: contain 82% contain 86%; }
  }
}

/* ---------- Motion off ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .in, .reveal, .draw path, .draw circle, .marquee-track, .q, .caret, .bar i, .chip, .cited { animation: none !important; opacity: 1 !important; transform: none !important; stroke-dashoffset: 0 !important; clip-path: none !important; }
  .q:not(:first-child) { display: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 960px) {
  .wrap { padding-inline: var(--space-4); }
  .hero-grid, .split { grid-template-columns: minmax(0, 1fr); gap: var(--space-7); }
  .cap { grid-template-columns: 48px minmax(0, 1fr); gap: var(--space-4); }
  .cap-arrow, .cap-index { display: none; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat, .stat + .stat { padding: var(--space-5) 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav-links { display: none; }
  .sticky { position: static; }
  .htrack { padding-inline: var(--space-4); }
  .hline { padding-inline: var(--space-4); }
  .section { padding-block: var(--space-8) !important; }
  .q { font-size: 13px; }
}

@media (max-width: 480px) {
  .nav-cta .ddl-arrow { display: none; }
  .nav-logo img { height: 28px; }
}
