/* ==========================================================================
   n-Track global theme                              (2026-11-06, Matt)
   Plan: ~/global-theme-plan.md. Grew out of the homepage's "Sharp" theme
   (css/v11-sharp.css, 2026-11-05), which this file replaces.

   Look: solid black ground, white type at real weight, crisp 1px edges, one
   saturated amber, no haze. Same fonts (Inter headings, Source Sans 3 body).

   Loaded on every page from the PAGE_COMMON_HEADER row (19547), after
   bootstrap.css and ntrack9.css. Nothing here changes a page until it opts
   in with <body class="nt-theme">; old Bootstrap / ntrack9 pages also add
   "nt-legacy" for the bridge in css/nt-legacy.css. ?theme=0 shows any page
   without the theme (js/nt-theme.js).

   Every rule under a page class starts with body.nt-theme: this file loads
   before each page's own sheets, and the extra element keeps the theme ahead
   of their plain rules while still letting deliberate, stronger page rules
   win (e.g. the homepage carousel's three-class selectors).

   Sections
     1  Tokens          (on :root, so any sheet can use them)
     2  Base            (body.nt-theme)
     3  Components      (.nt-btn, .nt-card, .nt-eyebrow, .nt-section, ...)
     4  Motion          (classes driven by js/nt-theme.js)
     5  v11 skin        (the homepage / v11 components: .home-v11, .hv-*, .fv-*)
   ========================================================================== */

/* 1 · Tokens ----------------------------------------------------------------
   Contrast (2026-11-18 grounds): on ink #202228 text 15.9:1, dim 12.3:1,
   faint 9.5:1; faint >= 7.3:1 up to surface-2, 6.4:1 on surface-3;
   amber-ink on amber 10.1:1, on amber-press 7.9:1. */
:root {
  --nt-ink:         #202228;   /* 2026-11-18 (Matt): was #08090a */
  --nt-surface:     #282b32;   /* 2026-11-18: = topbar/footer, was #141619 */
  --nt-surface-2:   #31353d;   /* 2026-11-18: = dropdown menus, was #1c1f23 */
  --nt-surface-3:   #3a3e47;   /* 2026-11-18: was #272b30 */
  --nt-line:        rgba(255, 255, 255, .14);
  --nt-line-2:      rgba(255, 255, 255, .26);
  --nt-line-hover:  rgba(255, 255, 255, .45);

  --nt-text:        #ffffff;
  --nt-text-dim:    #dfe3e6;
  --nt-text-faint:  #c2c9cd;   /* 2026-11-18: was #b0b8bd, keeps 7:1 on surface-2 */

  --nt-amber:       #ffb000;
  --nt-amber-hi:    #ffc633;   /* link hover text, highlights */
  --nt-amber-press: #e69a00;   /* button hover: deeper, not paler */
  --nt-amber-ink:   #1a1204;   /* text on amber */

  --nt-ai-1:        #22d3ee;
  --nt-ai-2:        #a855f7;
  --nt-ai-grad:     linear-gradient(105deg, var(--nt-ai-1), var(--nt-ai-2));
  /* The version number ("11"), 2026-11-19 (Matt: no purple): a lighter tint
     of the n-Track icon blue into the icon blue itself. The first try (icon
     blue -> deeper blue) was too dark on the dark ground. The AI badges keep
     --nt-ai-grad. */
  --nt-ver-1:       #6aa5dc;   /* a lighter tint of the icon blue (dark-on-dark was hard to read) */
  --nt-ver-2:       #336699;   /* the n-Track icon's blue */
  --nt-ver-grad:    linear-gradient(105deg, var(--nt-ver-1), var(--nt-ver-2));
  --nt-ok:          #34d399;
  --nt-error:       #f87171;

  --nt-s1: 4px;  --nt-s2: 8px;  --nt-s3: 16px; --nt-s4: 24px;
  --nt-s5: 32px; --nt-s6: 48px; --nt-s7: 64px; --nt-s8: 96px;

  --nt-radius-sm: 8px;
  --nt-radius:    14px;
  --nt-radius-lg: 22px;
  --nt-maxw:      1180px;
  --nt-ease:      cubic-bezier(.22, .61, .36, 1);
  --nt-shadow:    0 24px 48px -16px #000;

  --nt-font-body:    'Source Sans 3', 'Avenir Next', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --nt-font-display: 'Inter', 'Source Sans 3', 'Avenir Next', Helvetica, Arial, sans-serif;
}

/* 2 · Base ------------------------------------------------------------------ */
body.nt-theme {
  background-color: var(--nt-ink);
  color: var(--nt-text-dim);
  accent-color: var(--nt-amber);
}
body.nt-theme ::selection { background: rgba(255, 176, 0, .35); color: #fff; }

/* 3 · Components ------------------------------------------------------------
   For pages built or rebuilt in the theme. The bridge (nt-legacy.css) maps
   the old classes (.n-btn, .btn-default, .section …) onto the same looks. */
body.nt-theme .nt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 26px;
  border: 2px solid transparent;
  border-radius: var(--nt-radius-sm);
  font-family: var(--nt-font-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .18s var(--nt-ease), border-color .18s var(--nt-ease),
              color .18s var(--nt-ease), transform .18s var(--nt-ease);
}
body.nt-theme .nt-btn:hover { transform: translateY(-2px); text-decoration: none; }
body.nt-theme .nt-btn--primary { background: var(--nt-amber); color: var(--nt-amber-ink); }
body.nt-theme .nt-btn--primary:hover,
body.nt-theme .nt-btn--primary:focus-visible { background: var(--nt-amber-press); color: var(--nt-amber-ink); }
body.nt-theme .nt-btn--ghost { border-color: rgba(255, 255, 255, .85); background: transparent; color: #fff; }
body.nt-theme .nt-btn--ghost:hover,
body.nt-theme .nt-btn--ghost:focus-visible { border-color: #fff; background: #fff; color: var(--nt-ink); }
body.nt-theme .nt-btn--lg { padding: 15px 36px; font-size: 18px; }

body.nt-theme .nt-section { padding: var(--nt-s8) 0; background-color: var(--nt-ink); }
body.nt-theme .nt-section--alt { background-color: var(--nt-surface); border-top: 1px solid var(--nt-line); border-bottom: 1px solid var(--nt-line); }
body.nt-theme .nt-wrap { max-width: var(--nt-maxw); margin: 0 auto; padding: 0 var(--nt-s4); }

body.nt-theme .nt-card {
  padding: var(--nt-s5);
  border: 1px solid var(--nt-line-2);
  border-radius: var(--nt-radius);
  background: var(--nt-surface);
  color: var(--nt-text-dim);
  transition: border-color .25s var(--nt-ease), transform .25s var(--nt-ease);
}
body.nt-theme a.nt-card:hover,
body.nt-theme .nt-card--hover:hover { border-color: var(--nt-line-hover); transform: translateY(-3px); }

body.nt-theme .nt-eyebrow {
  margin: 0 0 var(--nt-s3);
  font-family: var(--nt-font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--nt-amber);
}
body.nt-theme .nt-h1 { font-family: var(--nt-font-display); font-size: clamp(34px, 5vw, 60px); font-weight: 700; line-height: 1.08; letter-spacing: -.03em; color: var(--nt-text); }
body.nt-theme .nt-h2 { font-family: var(--nt-font-display); font-size: clamp(28px, 4vw, 46px); font-weight: 700; line-height: 1.12; letter-spacing: -.025em; color: var(--nt-text); }
body.nt-theme .nt-lede { font-size: clamp(17px, 1.5vw, 20px); color: var(--nt-text-dim); max-width: 62ch; }
body.nt-theme .nt-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.5;
  background: var(--nt-amber);
  color: var(--nt-amber-ink);
}
body.nt-theme .nt-badge--ai { background: var(--nt-ai-grad); color: #0b0c0e; }
body.nt-theme .nt-grad-text {
  background: var(--nt-ai-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Closing box: a centred title, a line and buttons on a dark rounded panel,
   the same as the homepage's "Download n-Track Studio 11" (.hv-close). */
body.nt-theme .nt-close {
  max-width: var(--nt-maxw);
  margin: 0 auto;
  padding: var(--nt-s8) var(--nt-s4);
  border: 1px solid var(--nt-line-2);
  border-radius: var(--nt-radius-lg);
  background: var(--nt-surface);
  text-align: center;
}
body.nt-theme .nt-close__title {
  margin: 0;
  font-family: var(--nt-font-display);
  font-size: clamp(30px, 4.2vw, 50px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.025em;
  color: var(--nt-text);
}
body.nt-theme .nt-close__lede { max-width: 62ch; margin: var(--nt-s3) auto 0; font-size: clamp(17px, 1.5vw, 20px); color: var(--nt-text-dim); }
body.nt-theme .nt-close__ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--nt-s3); margin-top: var(--nt-s6); }
@media (max-width: 760px) { body.nt-theme .nt-close { padding: var(--nt-s7) var(--nt-s3); } }

/* 4 · Motion ----------------------------------------------------------------
   js/nt-theme.js adds .is-in when an element scrolls into view. Off under
   reduced motion and without JS (the script adds html.nt-js first, and only
   then do these start hidden). */
html.nt-js body.nt-theme .nt-reveal:not(.is-in) { opacity: 0; transform: translateY(22px); }
body.nt-theme .nt-reveal { transition: opacity .7s var(--nt-ease), transform .7s var(--nt-ease); }
/* children come in one after another; the script sets --nt-i */
html.nt-js body.nt-theme .nt-stagger > *:not(.is-in) { opacity: 0; transform: translateY(22px); }
body.nt-theme .nt-stagger > * {
  transition: opacity .7s var(--nt-ease), transform .7s var(--nt-ease);
  transition-delay: calc(var(--nt-i, 0) * 80ms);
}
/* titles rise line by line from behind a mask (the script wraps the words) */
body.nt-theme .nt-w { display: inline-block; overflow: hidden; vertical-align: bottom; padding: 0 .05em .14em 0; margin: 0 -.05em -.14em 0; }
body.nt-theme .nt-w > span { display: inline-block; transition: transform .95s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--nt-ln, 0) * 90ms + 60ms); }
html.nt-js body.nt-theme .nt-rise:not(.is-in) .nt-w > span { transform: translateY(108%); }
@media (prefers-reduced-motion: reduce) {
  html.nt-js body.nt-theme .nt-reveal:not(.is-in),
  html.nt-js body.nt-theme .nt-stagger > *:not(.is-in) { opacity: 1; transform: none; }
  html.nt-js body.nt-theme .nt-rise:not(.is-in) .nt-w > span { transform: none; }
}

/* 5 · v11 skin ---------------------------------------------------------------
   The homepage's v11 components (.home-v11, .hv-*, .fv-*), moved here from
   css/v11-sharp.css with .theme-sharp -> body.nt-theme. */

/* 5.1 tokens for the v11 sheets */
body.nt-theme .home-v11,
body.nt-theme .buy-v11 {
  --ink:        var(--nt-ink);
  --surface:    var(--nt-surface);
  --surface-2:  var(--nt-surface-2);
  --surface-3:  var(--nt-surface-3);
  --line:       var(--nt-line);
  --line-2:     var(--nt-line-2);
  --text:       var(--nt-text);
  --text-dim:   var(--nt-text-dim);
  --text-faint: var(--nt-text-faint);
  --amber:      var(--nt-amber);
  --amber-hi:   var(--nt-amber-hi);
  --amber-press: var(--nt-amber-press);
}

/* 5.2 type weight (same families, same sizes) */
body.nt-theme .hv-h2 { font-weight: 700; letter-spacing: -.025em; }
body.nt-theme .fv-hero__title { font-weight: 700; letter-spacing: -.03em; }
body.nt-theme .hv-h3 { font-weight: 600; }
body.nt-theme .hv-plan__name,
body.nt-theme .hv-plan__price { font-weight: 700; }
body.nt-theme .hv-btn { font-weight: 700; }
body.nt-theme .hv-eyebrow { color: var(--nt-amber); font-weight: 700; }
body.nt-theme .hv-eyebrow--ai { color: transparent; }   /* keep the AI gradient */
body.nt-theme .hv-wn__s:first-child { color: var(--nt-text); }

/* 5.3 edges, not haze */
body.nt-theme .hv-section::before { display: none; }
body.nt-theme .fv-hero,
body.nt-theme .hv-whatsnew,
body.nt-theme .hv-press,
body.nt-theme .hv-get,
body.nt-theme .hv-platforms,
body.nt-theme .hv-showcase { background-image: none; }
body.nt-theme .hv-close { background: var(--nt-surface); border-color: var(--nt-line-2); }
body.nt-theme .fv-stage::before { display: none; }
body.nt-theme .fv-stage__base { transform: none; }
body.nt-theme .fv-frame { border-color: var(--nt-line-2); box-shadow: var(--nt-shadow); }
body.nt-theme .fv-stage__float { box-shadow: 0 20px 40px -12px #000, 0 0 0 1px rgba(0, 0, 0, .5); }
body.nt-theme .hv-chip,
body.nt-theme .hv-organ__speed { -webkit-backdrop-filter: none; backdrop-filter: none; }
body.nt-theme .hv-chip:not(.is-active) { background: var(--nt-surface-2); color: var(--nt-text); }
body.nt-theme .hv-chip:not(.is-active):hover { border-color: rgba(255, 255, 255, .6); }
body.nt-theme .hv-organ__speed { background: rgba(32, 34, 40, .9); }
body.nt-theme .hv-wn__stage { border-color: var(--nt-line-2); background: var(--nt-surface); }
body.nt-theme .hv-wn__thumb { border-color: var(--nt-line-2); }
body.nt-theme .hv-wn__thumb:hover { border-color: var(--nt-line-hover); }
body.nt-theme .hv-wn__thumb.is-active { border-color: var(--nt-amber); background: rgba(255, 176, 0, .12); }
body.nt-theme .hv-quote { background: var(--nt-surface); border-color: var(--nt-line-2); }
body.nt-theme .hv-quote__logo { opacity: 1; }
body.nt-theme .hv-plan { border-color: var(--nt-line-2); }
body.nt-theme .hv-plan:hover { border-color: var(--nt-line-hover); }
body.nt-theme .hv-plan--free {
  background: linear-gradient(170deg, rgba(255, 176, 0, .14), var(--nt-surface-2));
  border-color: var(--nt-amber);
}

/* 5.4 buttons. v11-core's `.home-v11 a {color: inherit}` outranked
   `.hv-btn--primary`, so <a> buttons showed white on amber (1.8:1). */
body.nt-theme .home-v11 .hv-btn--primary,
body.nt-theme .buy-v11 .hv-btn--primary { color: var(--nt-amber-ink); box-shadow: none; }
body.nt-theme .home-v11 .hv-btn--primary:hover,
body.nt-theme .home-v11 .hv-btn--primary:focus-visible,
body.nt-theme .buy-v11 .hv-btn--primary:hover,
body.nt-theme .buy-v11 .hv-btn--primary:focus-visible { background: var(--nt-amber-press); color: var(--nt-amber-ink); box-shadow: none; }
body.nt-theme .hv-btn--ghost { border: 2px solid rgba(255, 255, 255, .85); background: transparent; color: #fff; }
body.nt-theme .hv-btn--ghost:hover,
body.nt-theme .hv-btn--ghost:focus-visible { border-color: #fff; background: #fff; color: var(--nt-ink); }

/* 5.5 focus */
body.nt-theme .home-v11 :focus-visible,
body.nt-theme .buy-v11 :focus-visible { outline: 2px solid var(--nt-amber); outline-offset: 2px; }

/* 5.6 features chapters on the homepage (#features) */
body.nt-theme .fv-wash-amber,
body.nt-theme .fv-wash-cyan,
body.nt-theme .fv-wash-violet,
body.nt-theme .fv-wash-ai { background-image: none; --fv-glow: transparent; }
body.nt-theme .fv-spot .fv-frame,
body.nt-theme .fv-spot--flip .fv-frame { transform: none; }
body.nt-theme .fv-card,
body.nt-theme .fv-tile { border-color: var(--nt-line-2); background: var(--nt-surface); }
body.nt-theme .fv-card:hover,
body.nt-theme .fv-tile:hover { border-color: var(--nt-line-hover); box-shadow: 0 20px 40px -16px #000; }
body.nt-theme .fv-card__media,
body.nt-theme .fv-tile__media { border-bottom-color: var(--nt-line-2); }
body.nt-theme .fv .fv-link { color: var(--nt-amber); }
body.nt-theme .fv .fv-link:hover,
body.nt-theme .fv .fv-link:focus-visible { color: var(--nt-amber-hi); }
body.nt-theme .fv-stats { border-color: var(--nt-line-2); background: var(--nt-line-2); }
body.nt-theme .fv-stats li { background: var(--nt-surface); }
body.nt-theme .fv-stats b { font-weight: 700; }
body.nt-theme .fv-stats li > span { color: var(--nt-text-dim); }

/* 2026-11-18 (Matt): page ground #202228. The hero scrim in home-v11.css
   fades to the old v11 ink (14,15,17); fade it into the new ground instead. */
body.nt-theme .hv-hero__scrim {
  background:
    linear-gradient(180deg, rgba(32, 34, 40, .82) 0%, rgba(32, 34, 40, .55) 38%, rgba(32, 34, 40, .96) 100%),
    radial-gradient(120% 80% at 50% 0%, rgba(0, 0, 0, .1), rgba(32, 34, 40, .7));
}

/* The "11" everywhere: blue, not the AI gradient (Matt, 2026-11-19).
   background-image, not background, so the text clip survives. */
body.nt-theme .nt-grad-text,
body.nt-theme .hv-hero__ver { background-image: var(--nt-ver-grad); }
