/* naim.design / system — tokens
   Source: Figma "naim.design" › Main (home, playground, BTC up/down).
   Components use semantic tokens (--bg, --fg …) only; never raw primitives. */

/* ── Fonts (files in ./fonts) ───────────────── */
@font-face { font-family: "Ashcroft"; src: url("fonts/AshcroftTest-Light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "PP Neue Montreal"; src: url("fonts/PPM-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "PP Neue Montreal"; src: url("fonts/PPM-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  /* ── Primitives ─────────────────────────────── */
  --paper:        #eeeee8;
  --ink:          #111111;
  --black:        #000000;
  --white:        #ffffff;
  --grey-50:      #f6f6f6;
  --grey-200:     #d9d9d9;   /* media placeholder */
  --grey-400:     #c2c2c2;
  --grey-600:     #666666;
  --night-1:      #212121;
  --night-2:      #323232;
  --night-0:      #252525;
  --btc-up:       #3dd637;
  --btc-down:     #ff393c;
  --tag-red:      #ff6868;
  --tag-green:    #9ddf6b;
  --tag-gold:     #d6b937;

  /* ── Type ───────────────────────────────────── */
  --font-display: "Ashcroft", "Ashcroft Test", "Iowan Old Style", Georgia, serif;
  --font-body:    "PP Neue Montreal", "Neue Montreal", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;

  /* size / line-height — desktop; mobile overrides below */
  --text-display: 80px;  --lh-display: 88px;  --ls-display: -1px;   /* hero */
  --text-h1:      48px;  --lh-h1:      56px;  --ls-h1:      -1px;   /* featured project title */
  --text-h2:      32px;  --lh-h2:      38px;                        /* project title (Medium) */
  --text-lg:      24px;  --lh-lg:      29px;                        /* project blurb, wordmark */
  --text-md:      20px;  --lh-md:      24px;                        /* sub-hero */
  --text-sm:      16px;  --lh-sm:      19px;                        /* nav, labels */
  --text-xs:      12px;  --lh-xs:      14px;                        /* tags */

  /* ── Space (4px base) ───────────────────────── */
  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;  --space-4: 16px;
  --space-5: 24px;  --space-6: 32px;  --space-7: 40px;  --space-8: 42px;  /* 42 = carousel gap */
  --space-9: 64px;  --space-10: 80px; --space-11: 130px; --space-12: 201px; /* section rhythm */
  --gutter: 64px;          /* page side padding */
  --carousel-gap: 42px;
  --section-gap: 201px;

  /* ── Shape ──────────────────────────────────── */
  --radius-xs: 6px;
  --radius-sm: 12px;       /* buttons */
  --radius-md: 24px;
  --radius-lg: 32px;       /* chips (pill) */
  --radius-xl: 40px;       /* project media cards */
  --card-ratio: 3 / 2;     /* 1200 × 800 */
  --card-w: min(1200px, 82vw);

  /* ── Motion ─────────────────────────────────── */
  --ease-out:    cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast: 150ms;  --dur-base: 300ms;  --dur-slow: 600ms;
  --theme-transition: background-color var(--dur-slow) var(--ease-out), color var(--dur-slow) var(--ease-out);

  /* ── Semantic: Light (default) ──────────────── */
  --bg:          var(--paper);
  --fg:          var(--ink);
  --fg-strong:   var(--black);
  --fg-muted:    var(--grey-600);
  --surface:     var(--white);       /* /play cards */
  --surface-2:   var(--grey-50);
  --placeholder: var(--grey-200);
  --line:        rgba(17, 17, 17, .14);
  --footer-bg:   var(--black);
  --footer-fg:   var(--paper);
  --chip-bg:     var(--white);
  --chip-fg:     var(--black);
  color-scheme: light;
}

/* ── Dark ───────────────────────────────────── */
:root[data-theme="dark"] {
  --bg:          var(--ink);
  --fg:          var(--white);
  --fg-strong:   var(--white);
  --fg-muted:    var(--grey-400);
  --surface:     var(--night-1);
  --surface-2:   var(--night-2);
  --placeholder: var(--night-1);
  --line:        rgba(255, 255, 255, .14);
  --footer-bg:   var(--white);   /* the NAÏM letters are white on the dark page */
  --footer-fg:   var(--ink);
  --chip-bg:     var(--night-2);
  --chip-fg:     var(--white);
  color-scheme: dark;
}

/* ── BTC mode: whole page takes the day's colour ─
   Set data-theme="btc-up" when BTC 24h change >= 0, "btc-down" otherwise.
   Text stays black for contrast (≥ 7:1 on both). */
:root[data-theme="btc-up"],
:root[data-theme="btc-down"] {
  --fg:          var(--black);
  --fg-strong:   var(--black);
  --fg-muted:    rgba(0, 0, 0, .6);
  --surface:     rgba(255, 255, 255, .92);
  --surface-2:   rgba(255, 255, 255, .6);
  --placeholder: var(--grey-200);
  --line:        rgba(0, 0, 0, .18);
  --footer-bg:   var(--black);
  --footer-fg:   var(--black);
  color-scheme: light;
}
:root[data-theme="btc-up"]   { --bg: var(--btc-up);   --footer-fg: var(--btc-up); }
:root[data-theme="btc-down"] { --bg: var(--btc-down); --footer-fg: var(--btc-down); }

/* ── Mobile (≤ 768px) ───────────────────────── */
@media (max-width: 768px) {
  :root {
    --text-display: 32px; --lh-display: 38px; --ls-display: -.5px;
    --text-h1: 32px;      --lh-h1: 38px;
    --text-h2: 24px;      --lh-h2: 29px;
    --text-lg: 20px;      --lh-lg: 24px;
    --text-md: 14px;      --lh-md: 17px;
    --gutter: 24px;
    --carousel-gap: 12px;
    --section-gap: 96px;
    --radius-xl: 24px;
    --card-w: 86vw;       /* next card peeks → signals swipe */
  }
}

/* ── Base + utilities ───────────────────────── */
html { background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: var(--fw-regular) var(--text-sm)/var(--lh-sm) var(--font-body);
  -webkit-font-smoothing: antialiased;
  transition: var(--theme-transition);
}
.t-display { font: var(--fw-light) var(--text-display)/var(--lh-display) var(--font-display); letter-spacing: var(--ls-display); }
.t-h1      { font: var(--fw-light) var(--text-h1)/var(--lh-h1) var(--font-display); letter-spacing: var(--ls-h1); }
.t-h2      { font: var(--fw-medium) var(--text-h2)/var(--lh-h2) var(--font-body); }
.t-lg      { font: var(--fw-regular) var(--text-lg)/var(--lh-lg) var(--font-body); }
.t-md      { font: var(--fw-regular) var(--text-md)/var(--lh-md) var(--font-body); }
.t-sm      { font: var(--fw-medium) var(--text-sm)/var(--lh-sm) var(--font-body); }
.t-xs      { font: var(--fw-medium) var(--text-xs)/var(--lh-xs) var(--font-body); }
.t-wordmark{ font: var(--fw-light) var(--text-lg)/var(--lh-lg) var(--font-display); }
.t-figure  { font-variant-numeric: tabular-nums; }  /* numbers on /play: body font, tabular */

/* Chip — the small floating pill tags (Prototype / Animate / GM) */
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-lg);
  background: var(--chip-bg); color: var(--chip-fg);
  font: var(--fw-medium) var(--text-xs)/var(--lh-xs) var(--font-body);
}
.chip--red   { background: var(--tag-red);   color: var(--black); }
.chip--green { background: var(--tag-green); color: var(--black); }
.chip--gold  { color: var(--tag-gold); }

/* Carousel — scroll-snap, swipe-native on mobile */
.carousel {
  display: flex; gap: var(--carousel-gap);
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
  padding-inline: var(--gutter); scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel > * {
  flex: 0 0 var(--card-w); aspect-ratio: var(--card-ratio);
  border-radius: var(--radius-xl); background: var(--placeholder);
  overflow: hidden; scroll-snap-align: start;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-base: 0ms; --dur-slow: 0ms; }
}
