/* ==========================================================================
   B VISUAL — tokens.css
   The ONLY file in which a raw colour value appears.
   Source of truth: .design/design-system.md
   ========================================================================== */

:root {
  /* --- 1. Colour ------------------------------------------------------ */
  --ink:        #131317;              /* page canvas — neutral charcoal */
  --ink-lift:   #1c1c21;              /* raised surface, sparing */
  --plum:       #140b30;              /* brand primary. Now a FEATURE surface,
                                         not the canvas: hero / page-top field,
                                         CTA bands, footer. Keeping it as a
                                         deliberate block rather than the default
                                         ground lets --purple read chromatically
                                         instead of blending into its own family. */
  --purple:     #8366ff;              /* brand ground — NOT an accent */
  --mint:       #12dbb4;              /* signal, <= 2 per viewport */
  --lime:       #d8ff35;              /* THE accent, <= 3 per viewport */
  /* Cursor neon. Specified by Ben as #dfff4f — two shades off --lime and
     indistinguishable at cursor size. Kept as its own token rather than
     hard-coded, so it can be unified with --lime later in one edit. */
  --neon:       #dfff4f;
  --blue:       #4566f4;              /* gradient partner for purple only */
  --paper:      #ffffff;
  --bone:       #efedf5;              /* body text on dark */
  --mute:       #8b83a8;              /* micro-labels, meta, disabled */
  --hair:       rgba(255, 255, 255, .14);   /* the ONLY divider */

  /* Derived alphas — same hues, never new colours. */
  --purple-08:  rgba(131, 102, 255, .08);
  --purple-16:  rgba(131, 102, 255, .16);
  --purple-32:  rgba(131, 102, 255, .32);
  --ink-80:     rgba(19, 19, 23, .80);
  --ink-94:     rgba(19, 19, 23, .94);
  --plum-80:    rgba(20, 11, 48, .80);
  --bone-64:    rgba(239, 237, 245, .64);

  /* Gradient — permitted on the logo mark, the hero ambient field, the loader.
     Never on a UI control. */
  --grad-brand: linear-gradient(135deg, var(--purple) 0%, var(--blue) 100%);
  --grad-field: radial-gradient(60% 60% at 50% 0%, var(--purple-16) 0%, rgba(20, 11, 48, 0) 70%);
  /* Feature surface: the brand plum, with its own ambient purple lift. */
  --surface-plum: radial-gradient(70% 90% at 50% 0%, rgba(131, 102, 255, .20) 0%, rgba(20, 11, 48, 0) 65%), linear-gradient(var(--plum), var(--plum));

  /* --- 2. Type — exactly five steps. No sixth. ------------------------ */
  --font: 'Gilroy', 'Outfit', system-ui, sans-serif;   /* declared once, on html */

  --t-display: clamp(3.75rem, 11vw, 10.5rem);
  --t-head:    clamp(2.25rem, 5vw, 4.25rem);
  --t-sub:     clamp(1.125rem, 1.6vw, 1.5rem);
  --t-body:    1rem;
  --t-micro:   0.6875rem;

  --lh-display: .82;   --tr-display: -.035em;
  --lh-head:    .88;   --tr-head:    -.02em;
  --lh-sub:    1.35;   --tr-sub:     -.01em;
  --lh-body:   1.55;   --tr-body:      0;
  --lh-micro:     1;   --tr-micro:   .14em;

  --w-reg: 400;
  --w-mid: 600;
  --w-max: 800;

  --measure: 62ch;

  /* --- 3. Space & shape ---------------------------------------------- */
  --u:  8px;
  --s1: 8px;   --s2: 16px;  --s3: 24px;  --s4: 32px;
  --s5: 40px;  --s6: 48px;  --s7: 56px;  --s8: 64px;
  --s10: 80px; --s12: 96px; --s16: 128px;

  --gutter:  clamp(1.25rem, 5vw, 5rem);
  --maxw:    1440px;
  --section: clamp(6rem, 12vw, 11rem);

  --r-flat: 0px;      /* cards, images, panels */
  --r-ui:   10px;     /* buttons, inputs, chips */
  --r-pill: 999px;    /* ONE use only: the primary CTA */

  --hairline: 1px solid var(--hair);

  /* --- 4. Motion ------------------------------------------------------ */
  --e-out:   cubic-bezier(.22, 1, .36, 1);    /* entrances */
  --e-trans: cubic-bezier(.65, 0, .35, 1);    /* page transitions */

  --d-min:    400ms;   /* floor — nothing animates faster */
  --d-ui:     450ms;
  --d-reveal: 700ms;
  --d-page:   900ms;
  --stagger:   70ms;

  /* --- 5. Chrome metrics --------------------------------------------- */
  --nav-h:    88px;
  --nav-h-sm: 64px;
  --mark:     34px;   /* nav mark height — min 24px per brand guidelines */

  --z-base: 1;
  --z-thumb: 40;
  --z-beni: 45;
  --z-menu: 50;
  --z-nav: 60;
  --z-transition: 80;
  --z-loader: 90;
}

@media (max-width: 720px) {
  :root { --nav-h: 68px; --nav-h-sm: 58px; --mark: 28px; }
}

/* ==========================================================================
   Reset
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  /* The one and only font-family declaration in the codebase. */
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: auto;              /* Lenis owns scrolling */
}

body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol, fieldset, legend {
  margin: 0;
  padding: 0;
}

ul[role="list"], ol[role="list"], .list-bare { list-style: none; }

body {
  min-height: 100vh;
  background: var(--ink);
  color: var(--bone);
  font-size: var(--t-body);
  font-weight: var(--w-reg);
  line-height: var(--lh-body);
  letter-spacing: var(--tr-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* clip, not hidden: overflow-x:hidden forces overflow-y to auto, which
     makes body a scroll container and silently breaks position:sticky
     for every descendant (the [data-pin] follow behaviour). */
  overflow-x: clip;
}

h1, h2, h3, h4 { font-weight: var(--w-max); text-wrap: balance; }

img, svg, video, canvas { display: block; max-width: 100%; }
img, video { height: auto; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
  font: inherit;                       /* inherits the single family */
  color: inherit;
  background: none;
  border: 0;
  border-radius: var(--r-ui);
}
button { cursor: pointer; }

::selection { background: var(--purple); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

hr { border: 0; border-top: var(--hairline); margin: 0; }

/* ==========================================================================
   Type utilities — the five steps, and nothing else
   ========================================================================== */

.t-display {
  font-size: var(--t-display);
  font-weight: var(--w-max);
  line-height: var(--lh-display);
  letter-spacing: var(--tr-display);
  text-transform: uppercase;
}

.t-head {
  font-size: var(--t-head);
  font-weight: var(--w-max);
  line-height: var(--lh-head);
  letter-spacing: var(--tr-head);
  text-transform: uppercase;
}

.t-sub {
  font-size: var(--t-sub);
  font-weight: var(--w-mid);
  line-height: var(--lh-sub);
  letter-spacing: var(--tr-sub);
}

.t-body {
  font-size: var(--t-body);
  font-weight: var(--w-reg);
  line-height: var(--lh-body);
  letter-spacing: var(--tr-body);
}

.t-micro, .label {
  font-size: var(--t-micro);
  font-weight: var(--w-max);
  line-height: var(--lh-micro);
  letter-spacing: var(--tr-micro);
  text-transform: uppercase;
}

/* The connective tissue (M2). Mandatory above every section headline
   and on every card meta line. */
.label {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--mute);
}
.label::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--purple);
  flex: none;
}
.label--bare::before { display: none; }
.label--tight { gap: var(--s1); }

.measure { max-width: var(--measure); }
.text-mute { color: var(--mute); }
.text-bone { color: var(--bone); }
.text-paper { color: var(--paper); }
.text-purple { color: var(--purple); }   /* display type >= 40px only */
.text-mint { color: var(--mint); }
.text-lime { color: var(--lime); }

/* ==========================================================================
   Layout utilities
   ========================================================================== */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * .55); }

.stack > * + * { margin-top: var(--s3); }
.stack-sm > * + * { margin-top: var(--s2); }
.stack-lg > * + * { margin-top: var(--s6); }

.rule { border-top: var(--hairline); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--s2);
  left: var(--s2);
  z-index: calc(var(--z-loader) + 1);
  padding: var(--s2) var(--s3);
  background: var(--lime);
  color: var(--ink);
  border-radius: var(--r-ui);
  transform: translateY(-200%);
  transition: transform var(--d-min) var(--e-out);
}
.skip-link:focus-visible { transform: translateY(0); }
