/* homepage owns html/body here; other routes keep the Tailwind globals */
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--sc-canvas); color: var(--sc-ink); font-family: var(--sc-font-text); overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---- the rebrand: six colours + two faces. --------------------------- */
  :root {
    --sc-canvas:     #EDF1FA;
    --sc-surface:    #FFFFFF;
    --sc-ink:        #1B2740;
    --sc-ink-soft:   #4F5F7A;
    --sc-accent:     #1C46C2;
    --sc-accent-ink: #F4F7FE;
    --sc-font-display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
    --sc-font-text:    "Figtree", system-ui, sans-serif;

    --ns-now-ground: #D9E1F1;
    --ns-nn-ground:  #FFFFFF;
    --ns-now-ink:    #3E4A63;
    --ns-seam:       color-mix(in oklab, var(--sc-ink) 22%, transparent);
  }

  /* ---- page-local classes only. Nothing here touches [data-sc-*]. ----- */

  .ns-mark {
    position: fixed; left: 50%; top: clamp(0.9rem, 2.6vw, 1.8rem);
    transform: translateX(-50%); z-index: 40;
    font-family: var(--sc-font-display); font-weight: 700;
    font-size: var(--sc-t-sm); letter-spacing: -0.01em; color: var(--sc-ink);
    text-decoration: none; transition: opacity .3s var(--sc-ease-out);
  }
  body.hide-chrome .ns-mark, body.hide-chrome .ns-frame,
  body.hide-chrome .ns-scroll-hint { opacity: 0; pointer-events: none; }

  /* one framing line, top-centre, only while the split is being established */
  .ns-frame {
    position: fixed; left: 50%; top: clamp(3rem, 8vh, 5rem); transform: translateX(-50%);
    z-index: 39; margin: 0; white-space: nowrap;
    font-family: var(--sc-font-mono); font-size: var(--sc-t-xs);
    letter-spacing: 0.14em; text-transform: uppercase; color: var(--sc-ink-soft);
    opacity: var(--ns-frame-o, 1); transition: opacity .35s var(--sc-ease-out); pointer-events: none;
  }

  /* first-screen affordance: the split looks static until this moves. It fades
     the instant the first scroll lands and does not come back. */
  .ns-scroll-hint {
    position: fixed; left: 50%; bottom: clamp(1.4rem, 5vh, 2.6rem); transform: translateX(-50%);
    z-index: 39; display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
    font-family: var(--sc-font-mono); font-size: var(--sc-t-xs);
    letter-spacing: 0.16em; text-transform: uppercase; color: var(--sc-ink-soft);
    opacity: var(--ns-hint-o, 1); transition: opacity .4s var(--sc-ease-out); pointer-events: none;
  }
  .ns-scroll-rail {
    position: relative; width: 1px; height: 2.6rem; overflow: hidden;
    background: color-mix(in oklab, var(--sc-ink) 16%, transparent);
  }
  .ns-scroll-bead {
    position: absolute; left: -1.5px; top: 0; width: 4px; height: 4px; border-radius: 50%;
    background: var(--sc-accent);
  }
  @media (prefers-reduced-motion: no-preference) {
    .ns-scroll-bead { animation: ns-bead 1.8s var(--sc-ease-out) infinite; }
  }
  @keyframes ns-bead {
    0%   { transform: translateY(-5px); opacity: 0; }
    25%  { opacity: 1; }
    75%  { opacity: 1; }
    100% { transform: translateY(2.6rem); opacity: 0; }
  }
  @media (prefers-reduced-motion: reduce) {
    .ns-scroll-bead { top: auto; bottom: 0; }
  }

  /* ---- the fixed split stage ---------------------------------------- */
  .ns-stage {
    --ns-div: 42;
    position: fixed; inset: 0; z-index: 0;
    background: var(--sc-canvas); overflow: hidden;
    transition: opacity 300ms var(--sc-ease-out);
  }
  .ns-stage.is-hidden { opacity: 0; pointer-events: none; }

  .ns-col { position: absolute; inset: 0; }
  .ns-col--now {
    background: var(--ns-now-ground);
    clip-path: inset(0 calc(100% - var(--ns-div) * 1%) 0 0);
  }
  .ns-col--nn {
    background: var(--ns-nn-ground);
    clip-path: inset(0 0 0 calc(var(--ns-div) * 1%));
  }

  /* content hugs the seam: the two arguments face each other across the line,
     and both slide with it when the seam lurches per business */
  .ns-inner {
    position: absolute; top: 46%; transform: translateY(-50%);
    width: min(27ch, 26vw);
  }
  .ns-now .ns-inner {
    left: max(clamp(1.4rem, 5vw, 5.2rem),
              calc(var(--ns-div) * 1% - min(27ch, 26vw) - clamp(1.5rem, 4vw, 3.5rem)));
  }
  /* in the peak the index rail owns the left margin: keep NOW copy clear of it */
  .ns-stage.is-peak .ns-now .ns-inner {
    left: max(clamp(11rem, 18vw, 15rem),
              calc(var(--ns-div) * 1% - min(26ch, 24vw) - clamp(1.5rem, 4vw, 3.5rem)));
    width: min(26ch, 24vw);
  }
  .ns-nn .ns-inner {
    left: min(calc(100% - min(27ch, 26vw) - clamp(1.4rem, 5vw, 5.2rem)),
              calc(var(--ns-div) * 1% + clamp(1.5rem, 4vw, 3.5rem)));
  }

  .ns-h {
    font-family: var(--sc-font-display); font-weight: 600;
    font-size: var(--sc-t-2xl); line-height: 1.0; letter-spacing: -0.03em;
    color: var(--sc-ink); margin: 0 0 var(--sc-4); text-wrap: balance;
  }
  .ns-now .ns-h { font-weight: 500; color: #2E3A52; }
  .ns-stage.is-peak .ns-h { font-size: var(--sc-t-xl); line-height: 1.06; letter-spacing: -0.025em; }

  .ns-lines { list-style: none; margin: 0; padding: 0; }
  .ns-lines li {
    font-size: var(--sc-t-base); line-height: 1.5; color: var(--ns-now-ink);
    padding: 0.42rem 0; border-top: 1px solid color-mix(in oklab, var(--sc-ink) 12%, transparent);
    opacity: 0; transform: translateY(8px);
    transition: opacity .5s var(--sc-ease-out), transform .5s var(--sc-ease-out);
  }
  .ns-lines li.on { opacity: 1; transform: none; }
  .ns-lines li:last-child { padding-bottom: 0; }
  .ns-stage.is-peak .ns-lines li { font-size: var(--sc-t-sm); padding: 0.34rem 0; }

  .ns-nn .ns-body { font-size: var(--sc-t-base); line-height: 1.55; color: var(--sc-ink-soft); margin: 0; max-width: 40ch; }
  .ns-meta {
    margin-top: var(--sc-5); opacity: var(--ns-meta-o, 1);
    display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem;
    font-family: var(--sc-font-mono); font-size: var(--sc-t-xs); letter-spacing: 0.02em;
    color: var(--sc-ink-soft); text-transform: uppercase;
    transition: opacity .25s var(--sc-ease-out);
  }
  .ns-meta b { color: var(--sc-accent); font-weight: 600; }

  @keyframes ns-pulse { from { opacity: 0.4; } to { opacity: 1; } }
  .ns-pulse { animation: ns-pulse .3s var(--sc-ease-out); }

  /* ---- the quiet index: a readout, not a menu --------------------- */
  .ns-index {
    list-style: none; margin: 0; padding: 0;
    position: absolute; z-index: 7;
    left: clamp(1.4rem, 5vw, 5.2rem); top: 50%; transform: translateY(-50%);
    opacity: 0; visibility: hidden; transition: opacity .35s var(--sc-ease-out);
  }
  .ns-stage.is-peak .ns-index { opacity: 1; visibility: visible; }
  /* a hairline through the ticks, filled to the current business in accent */
  .ns-index::before {
    content: ""; position: absolute; left: 3.5px; top: 0.9rem; bottom: 0.9rem; width: 1px;
    background: color-mix(in oklab, var(--sc-ink) 16%, transparent);
  }
  .ns-index::after {
    content: ""; position: absolute; left: 3.5px; top: 0.9rem; width: 1px;
    height: calc(var(--ns-idxp, 0) * (100% - 1.8rem));
    background: var(--sc-accent); transition: height .3s var(--sc-ease-out);
  }
  .ns-index li { margin: 0; }
  .ns-index button {
    appearance: none; border: 0; background: none; cursor: pointer;
    display: flex; align-items: center; gap: 0.7rem; width: 100%;
    padding: 0.4rem 0; font-family: var(--sc-font-mono); font-size: var(--sc-t-xs);
    letter-spacing: 0.04em; text-transform: uppercase;
    font-weight: 400; color: var(--sc-ink-soft); text-align: left; white-space: nowrap;
    transition: color .16s var(--sc-ease-out);
  }
  .ns-index button:hover { color: var(--sc-ink); }
  .ns-tick {
    flex: none; width: 8px; height: 8px; border-radius: 50%;
    border: 1.5px solid currentColor; background: transparent;
    transition: background .16s var(--sc-ease-out), border-color .16s var(--sc-ease-out);
  }
  .ns-index button[aria-current="true"] { color: var(--sc-ink); font-weight: 600; }
  .ns-index button[aria-current="true"] .ns-tick { background: var(--sc-accent); border-color: var(--sc-accent); }
  .ns-index button:focus-visible { outline-offset: 4px; }

  /* ---- the divider ---------------------------------------------------- */
  .ns-divider {
    position: absolute; top: 0; bottom: 0; left: calc(var(--ns-div) * 1%);
    width: 0; z-index: 6;
  }
  .ns-divider::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: -1.5px; width: 3px;
    background: var(--ns-seam);
    box-shadow: 0 0 0 1px color-mix(in oklab, var(--sc-canvas) 55%, transparent);
  }
  /* scroll fills the seam top-to-bottom while the split is on screen */
  .ns-divider::after {
    content: ""; position: absolute; left: -1.5px; top: 0; width: 3px;
    height: calc(var(--ns-prog, 0) * 100%);
    background: var(--sc-accent); opacity: 0.5;
  }
  .ns-seam-dot {
    position: absolute; left: -5px; width: 10px; height: 10px; border-radius: 50%;
    background: var(--sc-accent); box-shadow: 0 0 0 3px var(--sc-canvas);
    top: calc(var(--ns-prog, 0) * 100%); transform: translateY(-50%);
    transition: opacity .3s var(--sc-ease-out);
  }
  .ns-stage.is-collapsed .ns-seam-dot { opacity: 0; }

  /* ---- the close, in the winning column -------------------------- */
  .ns-close {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: min(58ch, 82vw); text-align: center;
    opacity: 0; visibility: hidden; transition: opacity .5s var(--sc-ease-out);
  }
  .ns-stage.is-collapsed .ns-close { opacity: 1; visibility: visible; }
  .ns-stage.is-collapsed .ns-nn .ns-inner { opacity: 0; }
  .ns-stage.is-friction .ns-nn .ns-inner {
    opacity: clamp(0.4, calc(1 - (var(--ns-div) - 54) / 34), 1);
    transition: opacity .3s var(--sc-ease-out);
  }
  .ns-close h2 {
    font-family: var(--sc-font-display); font-weight: 600;
    font-size: var(--sc-t-3xl); line-height: 1.0; letter-spacing: -0.035em;
    color: var(--sc-ink); margin: 0 0 var(--sc-5); text-wrap: balance;
  }
  .ns-close p {
    font-size: var(--sc-t-lg); line-height: 1.5; color: var(--sc-ink-soft);
    margin: 0 auto var(--sc-6); max-width: 46ch; text-wrap: pretty;
  }
  /* contact channels are the action now: tap the email to open a mail app,
     tap a number to start a call */
  .ns-contact-label {
    margin: 0 0 var(--sc-2);
    font-family: var(--sc-font-mono); font-size: var(--sc-t-xs);
    letter-spacing: 0.14em; text-transform: uppercase; color: var(--sc-ink-soft);
  }
  .ns-contact {
    display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
    margin: 0 auto var(--sc-5);
  }
  .ns-contact a {
    display: inline-flex; align-items: center; min-height: 2.75rem;
    font-family: var(--sc-font-display); font-weight: 600;
    font-size: var(--sc-t-lg); letter-spacing: -0.01em;
    color: var(--sc-accent); text-decoration: none;
    transition: color .14s var(--sc-ease-out);
  }
  .ns-contact a:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1.5px; }
  .ns-contact a:active { color: color-mix(in oklab, var(--sc-accent) 80%, #000); }
  .ns-fine { margin-top: var(--sc-4); font-size: var(--sc-t-sm); line-height: 1.7; color: var(--sc-ink-soft); }

  /* ---- scroll markers ------------------------------------------------ */
  .ns-marker { position: relative; z-index: 1; }
  #m1 { min-height: 130vh; }
  #m2 { min-height: 170vh; }
  #m3 { min-height: 560vh; }
  #m5 { min-height: 140vh; }

  /* ---- the proof act ---------------------------------------------- */
  #proof { position: relative; z-index: 3; }
  #proof [data-sc-stage] { background: #E4EAF6; }
  #proof .ns-proof-poster, #proof #ivms {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0;
  }
  @media (prefers-reduced-motion: no-preference) {
    #proof .ns-proof-poster, #proof #ivms {
      object-position: calc(50% + (var(--sc-p, 0) - 0.5) * 9%) calc(var(--sc-p, 0) * 8%);
    }
  }
  #proof #ivms { opacity: 0; transition: opacity .5s var(--sc-ease-out); }
  #proof.is-playing #ivms { opacity: 1; }
  #proof .sc-scrim--lead { z-index: 2; }
  #proof .ns-proof-cap { z-index: 4; display: grid; max-width: min(34rem, 74vw); }
  #proof .ns-proof-cap .sc-label { grid-column: 1; margin: 0 0 var(--sc-3); color: var(--sc-accent); }
  #proof .ns-proof-h {
    grid-area: 2 / 1; align-self: end;
    font-family: var(--sc-font-display); font-weight: 600; font-size: var(--sc-t-2xl);
    line-height: 1.02; letter-spacing: -0.03em; color: var(--sc-ink); margin: 0; text-wrap: balance;
  }

  .ns-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  /* ---- mobile: stack the split ---------------------------------- */
  @media (max-width: 860px) {
    /* NOW on top, WITH NUMERONEST below, a horizontal seam. No seam-hug maths. */
    .ns-col--now { clip-path: inset(0 0 calc(100% - var(--ns-div) * 1%) 0); }
    .ns-col--nn  { clip-path: inset(calc(var(--ns-div) * 1%) 0 0 0); }
    .ns-now .ns-inner, .ns-nn .ns-inner,
    .ns-stage.is-peak .ns-now .ns-inner {
      position: absolute; transform: none; width: auto;
      left: clamp(1.1rem, 6vw, 1.5rem); right: clamp(1.1rem, 6vw, 1.5rem);
    }
    .ns-now .ns-inner, .ns-stage.is-peak .ns-now .ns-inner { top: clamp(3.4rem, 11vh, 5.5rem); }
    .ns-nn  .ns-inner { top: auto; bottom: clamp(1.3rem, 5vh, 2.6rem); }
    .ns-stage .ns-h, .ns-stage.is-peak .ns-h { font-size: var(--sc-t-lg); line-height: 1.1; }
    .ns-nn .ns-body { font-size: var(--sc-t-sm); max-width: none; }
    .ns-lines li, .ns-stage.is-peak .ns-lines li { font-size: var(--sc-t-sm); padding: 0.28rem 0; }
    .ns-meta { margin-top: var(--sc-3); }

    /* index: a row of ticks at the top of the NOW band, current one labelled */
    .ns-index {
      position: absolute; top: clamp(1.4rem, 4.5vh, 2.4rem); transform: none;
      left: clamp(1.1rem, 6vw, 1.5rem); right: clamp(1.1rem, 6vw, 1.5rem);
      display: flex; align-items: center; gap: 0.55rem;
    }
    .ns-index::before, .ns-index::after { display: none; }
    .ns-index li { display: flex; }
    .ns-index button { padding: 0.3rem 0; gap: 0; font-size: 0; }
    .ns-index button[aria-current="true"] { font-size: var(--sc-t-xs); gap: 0.45rem; }

    .ns-divider { top: calc(var(--ns-div) * 1%); left: 0; right: 0; bottom: auto; width: auto; height: 0; }
    .ns-divider::before { top: -1.5px; left: 0; right: 0; bottom: auto; width: auto; height: 3px; }
    .ns-divider::after { top: -1.5px; left: 0; height: 3px; width: calc(var(--ns-prog, 0) * 100%); }
    .ns-seam-dot { top: -1.5px; left: calc(var(--ns-prog, 0) * 100%); transform: translate(-50%, -50%); }

    .ns-mark { left: clamp(1.1rem,5vw,1.5rem); right: auto; transform: none; }
    .ns-frame { display: none; }
    /* touch devices already read as scrollable; the lower column owns the bottom */
    .ns-scroll-hint { display: none; }

    #proof .ns-proof-poster, #proof #ivms { object-fit: contain; object-position: 50% 42%; }
    #proof .ns-proof-cap { max-width: 86vw; }
    #proof .ns-proof-h { font-size: var(--sc-t-xl); }

    .ns-close h2 { font-size: var(--sc-t-2xl); }
    .ns-close p { font-size: var(--sc-t-base); }
    #m1 { min-height: 130vh; } #m2 { min-height: 170vh; } #m3 { min-height: 560vh; } #m5 { min-height: 150vh; }
  }

  @media (prefers-reduced-motion: reduce) {
    .ns-lines li { transition: none; }
  }
