/* X89 APK — tokens.css — red, white and black. Every colour token is declared on :root FIRST, then re-declared in the prefers-color-scheme block and again in [data-theme="light"]. No colour is ever defined only inside a media query. */

:root {
  /* ---- ground & plate -------------------------------------------------- */
  --graphite:    #0A0A0A;
  --graphite-2:  #111111;
  --plate:       #171717;
  --plate-2:     #212121;
  --groove:      #050505;

  /* ---- bevel constituents ---------------------------------------------- */
  --edge-hi:     rgba(255, 255, 255, .16);
  --edge-lo:     rgba(0, 0, 0, .60);
  --hairline:    rgba(255, 255, 255, .10);
  --hairline-2:  rgba(255, 255, 255, .06);

  /* ---- text ------------------------------------------------------------- */
  --chrome-hi:   #FFFFFF;
  --chrome-mid:  #D6D6D6;
  --chrome-lo:   #A3A3A3;

  /* ---- red / white / black --------------------------------------------- */
  /* iris-* is for text and edges. Bright red clears 4.5:1 on the black ground.
     flare is the button fill: dark enough that white label text clears 4.5:1. */
  --iris-1:      #FF3B3B;
  --iris-2:      #FFFFFF;
  --iris-3:      #FF6B6B;
  --iris-4:      #FF4D4D;
  --jade:        #FFFFFF;
  --flare:       #C1121F;

  --on-accent:   #FFFFFF;
  --on-flare:    #FFFFFF;

  /* ---- derived surfaces ------------------------------------------------- */
  --iris-rim: linear-gradient(115deg, #FFFFFF, #FF3B3B 42%, #FFFFFF 68%, #FF4D4D);
  --btn-fill: linear-gradient(115deg, #6E0C14, #C1121F 48%, #9B1220);
  --brushed: repeating-linear-gradient(102deg, rgba(255,255,255,.020) 0 1px, transparent 1px 3px);
  --bevel: inset 0 1px 0 var(--edge-hi), inset 0 -1px 0 var(--edge-lo);
  --bevel-in: inset 0 1px 0 var(--edge-lo), inset 0 -1px 0 var(--edge-hi);
  --lift: 0 18px 40px -22px rgba(0,0,0,.9), 0 2px 0 rgba(0,0,0,.5);
  --lift-hi: 0 28px 56px -24px rgba(0,0,0,.95), 0 2px 0 rgba(0,0,0,.5);
  --lift-lo: 0 8px 20px -16px rgba(0,0,0,.85);

  /* Specular sweep gradient — hard-edged band, moved via background-position */
  --specular: linear-gradient(102deg,
    transparent 38%,
    rgba(255,255,255,.00) 44%,
    rgba(255,255,255,.13) 50%,
    rgba(255,255,255,.00) 56%,
    transparent 62%);

  /* Section-joining hairline: iridescent only in the centre, fading to ends */
  --seam: linear-gradient(90deg,
    transparent 0%,
    #FFFFFF 18%,
    #FF3B3B 42%,
    #FFFFFF 58%,
    #FF3B3B 82%,
    transparent 100%);

  /* ---- type ------------------------------------------------------------- */
  --font-display: "Archivo", "Helvetica Neue", "Arial Narrow", Arial, system-ui, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --fs-base:    17px;
  --lh-base:    1.65;
  --measure:    68ch;

  --fs-h1:      clamp(2.4rem, 5.8vw, 4.5rem);
  --fs-h2:      clamp(1.7rem, 3.2vw, 2.7rem);
  --fs-h3:      clamp(1.2rem, 1.9vw, 1.55rem);
  --fs-h4:      clamp(1.02rem, 1.4vw, 1.15rem);
  --fs-lead:    clamp(1.05rem, 1.5vw, 1.24rem);
  --fs-sm:      .9375rem;
  --fs-xs:      .8125rem;
  --fs-kicker:  .75rem;
  --fs-readout: clamp(1.7rem, 3.4vw, 2.6rem);

  --tr-display: -.01em;
  --tr-caps:    .06em;
  --tr-kicker:  .16em;
  --wd-display: 118%;

  /* ---- space ------------------------------------------------------------ */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --section-y: clamp(64px, 8vw, 120px);
  --gutter:    clamp(18px, 3.4vw, 40px);
  --container: 1200px;

  /* ---- radius ----------------------------------------------------------- */
  --r-card:  12px;
  --r-input: 10px;
  --r-sm:    8px;
  --r-pill:  999px;
  --chamfer: 14px;

  /* ---- easing & duration ------------------------------------------------ */
  --e-seat:   cubic-bezier(.2, .8, .2, 1);
  --e-roll:   cubic-bezier(.3, .9, .25, 1);
  --e-out:    cubic-bezier(.22, .61, .36, 1);
  --d-fast:   140ms;
  --d-ui:     260ms;
  --d-slow:   340ms;
  --d-sweep:  420ms;
  --d-reveal: 520ms;

  /* ---- z-index ladder ---------------------------------------------------- */
  --z-base:      1;
  --z-content:   2;
  --z-marquee:  40;
  --z-nav:      50;
  --z-drawer:   60;
  --z-toast:    70;
  --z-mobile:   75;
  --z-modal:    90;
  --z-progress: 95;

  color-scheme: dark light;
}

/* Light mode — white ground, black type, red accent. */

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --graphite:    #FFFFFF;
    --graphite-2:  #F4F4F4;
    --plate:       #FFFFFF;
    --plate-2:     #FAFAFA;
    --groove:      #E8E8E8;

    --edge-hi:     rgba(255, 255, 255, .90);
    --edge-lo:     rgba(0, 0, 0, .14);
    --hairline:    rgba(10, 10, 10, .14);
    --hairline-2:  rgba(10, 10, 10, .08);

    --chrome-hi:   #0A0A0A;
    --chrome-mid:  #2C2C2C;
    --chrome-lo:   #4A4A4A;

    /* Dark red clears 4.5:1 as text on white. Buttons stay on --flare. */
    --iris-1:      #C1121F;
    --iris-2:      #0A0A0A;
    --iris-3:      #8E0F18;
    --iris-4:      #A01018;
    --jade:        #C1121F;
    --flare:       #C1121F;
    --on-accent:   #FFFFFF;
    --on-flare:    #FFFFFF;
    --iris-rim: linear-gradient(115deg, #0A0A0A, #C1121F 42%, #0A0A0A 70%, #8E0F18);
    --seam: linear-gradient(90deg,
      transparent 0%,
      #0A0A0A 18%,
      #C1121F 50%,
      #0A0A0A 82%,
      transparent 100%);

    --lift: 0 18px 40px -26px rgba(14,17,20,.42), 0 1px 0 rgba(14,17,20,.10);
    --lift-hi: 0 28px 56px -28px rgba(14,17,20,.48), 0 1px 0 rgba(14,17,20,.10);
    --lift-lo: 0 8px 20px -18px rgba(14,17,20,.35);

    --brushed: repeating-linear-gradient(102deg, rgba(14,17,20,.022) 0 1px, transparent 1px 3px);
    --specular: linear-gradient(102deg,
      transparent 38%,
      rgba(255,255,255,.00) 44%,
      rgba(255,255,255,.75) 50%,
      rgba(255,255,255,.00) 56%,
      transparent 62%);
  }
}

[data-theme="light"] {
  --graphite:    #FFFFFF;
  --graphite-2:  #F4F4F4;
  --plate:       #FFFFFF;
  --plate-2:     #FAFAFA;
  --groove:      #E8E8E8;

  --edge-hi:     rgba(255, 255, 255, .90);
  --edge-lo:     rgba(0, 0, 0, .14);
  --hairline:    rgba(10, 10, 10, .14);
  --hairline-2:  rgba(10, 10, 10, .08);

  --chrome-hi:   #0A0A0A;
  --chrome-mid:  #2C2C2C;
  --chrome-lo:   #4A4A4A;

  /* Dark red clears 4.5:1 as text on white. Buttons stay on --flare. */
  --iris-1:      #C1121F;
  --iris-2:      #0A0A0A;
  --iris-3:      #8E0F18;
  --iris-4:      #A01018;
  --jade:        #C1121F;
  --flare:       #C1121F;
  --on-accent:   #FFFFFF;
  --on-flare:    #FFFFFF;
  --iris-rim: linear-gradient(115deg, #0A0A0A, #C1121F 42%, #0A0A0A 70%, #8E0F18);
  --seam: linear-gradient(90deg,
    transparent 0%,
    #0A0A0A 18%,
    #C1121F 50%,
    #0A0A0A 82%,
    transparent 100%);

  --lift: 0 18px 40px -26px rgba(14,17,20,.42), 0 1px 0 rgba(14,17,20,.10);
  --lift-hi: 0 28px 56px -28px rgba(14,17,20,.48), 0 1px 0 rgba(14,17,20,.10);
  --lift-lo: 0 8px 20px -18px rgba(14,17,20,.35);

  --brushed: repeating-linear-gradient(102deg, rgba(14,17,20,.022) 0 1px, transparent 1px 3px);
  --specular: linear-gradient(102deg,
    transparent 38%,
    rgba(255,255,255,.00) 44%,
    rgba(255,255,255,.75) 50%,
    rgba(255,255,255,.00) 56%,
    transparent 62%);
}

/* Brand attribute kept so older markup still resolves. Same red, white and black palette as :root. */

[data-brand="x89"] {
  --graphite:    #0A0A0A;
  --graphite-2:  #111111;
  --plate:       #171717;
  --plate-2:     #212121;
  --groove:      #050505;
  --chrome-hi:   #FFFFFF;
  --chrome-mid:  #D6D6D6;
  --chrome-lo:   #A3A3A3;
  --iris-1:      #FF3B3B;
  --iris-2:      #FFFFFF;
  --iris-3:      #FF6B6B;
  --iris-4:      #FF4D4D;
  --jade:        #FFFFFF;
  --flare:       #C1121F;
  --on-accent:   #FFFFFF;
  --on-flare:    #FFFFFF;
  --iris-rim: linear-gradient(115deg, #FFFFFF, #FF3B3B 42%, #FFFFFF 68%, #FF4D4D);
  --btn-fill: linear-gradient(115deg, #6E0C14, #C1121F 48%, #9B1220);
  --seam: linear-gradient(90deg,
    transparent 0%, #FFFFFF 18%, #FF3B3B 42%, #FFFFFF 58%, #FF3B3B 82%, transparent 100%);
}
