/* LAKRAZ — Design system foundation
 * Single source of truth for tokens + type + base element styles.
 * Link this file FIRST from every page, before page-specific CSS.
 * Derived from the LAKRAZ Design System handoff bundle (April 2026).
 *
 * Monochrome only. No saturated color ever hits the product surface.
 * Franklin Gothic ATF is the only typeface. Self-hosted from /fonts/fgatf/.
 */

/* ─── Fonts ─────────────────────────────────────────────────── */
@font-face {
  font-family: 'FG';
  src: url('../../fonts/fgatf/FranklinGothicATF-Light.otf') format('opentype');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'FG';
  src: url('../../fonts/fgatf/FranklinGothicATF-Regular.otf') format('opentype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'FG';
  src: url('../../fonts/fgatf/FranklinGothicATF-Italic.otf') format('opentype');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'FG';
  src: url('../../fonts/fgatf/FranklinGothicATF-Medium.otf') format('opentype');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'FG';
  src: url('../../fonts/fgatf/FranklinGothicATF-Bold.otf') format('opentype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'FG';
  src: url('../../fonts/fgatf/FranklinGothicATF-Heavy.otf') format('opentype');
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'FG';
  src: url('../../fonts/fgatf/FranklinGothicATF-Black.otf') format('opentype');
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'FG Mono';
  src: url('../../fonts/fgatf/FranklinGothicATF-Monospace.otf') format('opentype');
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  /* ─── Color — surface + ink ──────────────────────────────── */
  --bg:            #000000;
  --bg-elev:       #0A0A0A;
  --bg-charcoal:   #0E0F12;
  --bg-charcoal-warm: #121010;

  --fg:            #FFFFFF;
  --fg-soft:       #EDEDED;
  --off:           #999999;
  --dim:           #4A4A4A;

  --chrome-hi:     #D8DCE0;
  --chrome-mid:    #B8BCC2;
  --chrome-lo:     #6E7278;

  --rule:          rgba(255,255,255,.07);
  --rule-hi:       rgba(255,255,255,.22);

  --focus:         #FFFFFF;
  --error:         #E06767;

  --color-surface:        var(--bg);
  --color-surface-raised: var(--bg-charcoal);
  --color-ink:            var(--fg);
  --color-ink-muted:      var(--off);
  --color-ink-dim:        var(--dim);
  --color-hairline:       var(--rule);
  --color-hairline-hi:    var(--rule-hi);

  /* ─── Type family ────────────────────────────────────────── */
  --font-sans: 'FG', 'Franklin Gothic Medium', 'Franklin Gothic', Arial, sans-serif;
  --font-mono: 'FG Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* ─── Type scale ─────────────────────────────────────────── */
  --text-micro:    10px;
  --text-caption:  12px;
  --text-body:     13px;
  --text-lead:     clamp(15px, 1.6vw, 20px);
  --text-sub:      clamp(16px, 2vw, 24px);
  --text-h4:       clamp(16px, 1.8vw, 22px);
  --text-h3:       clamp(22px, 2.8vw, 34px);
  --text-h2:       clamp(32px, 5vw, 64px);
  --text-h1:       clamp(48px, 9vw, 140px);
  --text-display:  clamp(60px, 12vw, 200px);

  /* ─── Tracking ───────────────────────────────────────────── */
  --tracking-label: .35em;
  --tracking-nav:   .22em;
  --tracking-btn:   .22em;
  --tracking-wide:  .5em;
  --tracking-head:  .03em;

  /* ─── Leading ────────────────────────────────────────────── */
  --lead-tight:   .92;
  --lead-hero:    1;
  --lead-snug:    1.15;
  --lead-body:    1.6;
  --lead-prose:   1.85;

  /* ─── Layout ─────────────────────────────────────────────── */
  --container:    1320px;
  --gutter:       clamp(24px, 5vw, 80px);
  --space-xs:     clamp(24px, 3vw, 40px);
  --space-sm:     clamp(48px, 6vw, 80px);
  --space-md:     clamp(80px, 10vw, 150px);
  --space-lg:     clamp(120px, 15vw, 220px);
  --space-xl:     clamp(160px, 20vw, 300px);

  /* ─── Motion ─────────────────────────────────────────────── */
  --ease:      cubic-bezier(.16, 1, .3, 1);
  --ease-out:  cubic-bezier(.22, 1, .36, 1);
  --dur-fast:  .3s;
  --dur-base:  .55s;
  --dur-slow:  .95s;

  /* ─── Borders / radii ────────────────────────────────────── */
  --radius-0: 0;
  --radius-1: 2px;
  --hairline:    1px solid var(--rule);
  --hairline-hi: 1px solid var(--rule-hi);
}

/* ─── Base element styling ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--text-body);
  line-height: var(--lead-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, .h1 {
  font-weight: 700;
  font-size: var(--text-h1);
  letter-spacing: var(--tracking-head);
  line-height: var(--lead-hero);
  text-transform: uppercase;
}
h2, .h2 {
  font-weight: 700;
  font-size: var(--text-h2);
  letter-spacing: var(--tracking-head);
  line-height: var(--lead-tight);
}
h3, .h3 {
  font-weight: 700;
  font-size: var(--text-h3);
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
}
h4, .h4 {
  font-weight: 700;
  font-size: var(--text-h4);
  letter-spacing: .12em;
  line-height: 1.1;
  text-transform: uppercase;
}

p, .body   { font-size: var(--text-body); line-height: var(--lead-body); color: var(--fg-soft); }
.lead      { font-size: var(--text-lead); line-height: var(--lead-prose); color: var(--off); max-width: 720px; }
.caption   { font-size: var(--text-caption); color: var(--dim); letter-spacing: .06em; }
.mono      { font-family: var(--font-mono); letter-spacing: 0; }

.label, label.lakraz {
  font-size: var(--text-micro);
  font-weight: 300;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--dim);
}

.numeral {
  font-family: var(--font-sans);
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
  color: var(--dim);
  font-size: 11px;
}

.chrome-fill {
  background: linear-gradient(180deg,
    var(--chrome-hi) 0%,
    #ffffff 18%,
    var(--chrome-mid) 52%,
    #ffffff 68%,
    var(--chrome-lo) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

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

::selection { background: var(--fg); color: var(--bg); }

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
