/* ==========================================================
   base.css — Resets, Typography, CSS Custom Properties
   Source of truth for ALL design tokens.
   ========================================================== */

/* ── Google Font Imports ─────────────────────────────── */
/* Noto Serif: display=block — text stays invisible until font is ready,
   eliminating FOUT-triggered layout reflow on the hero headline. The
   char-reveal animation provides natural cover during the load window. */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,400;0,700;1,400;1,700&display=block');
/* Manrope: display=swap — body/label text swaps gracefully from system font. */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;600;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=block');

/* ── Design Tokens (from Tailwind @theme) ────────────── */
:root {
  /* ─ Fonts ─ */
  --font-headline: "Noto Serif", serif;
  --font-body: "Manrope", sans-serif;
  --font-label: "Manrope", sans-serif;

  /* ─ Core Surface Colors ─ */
  --color-surface: #181210;
  --color-surface-dim: #181210;
  --color-surface-bright: #3f3835;
  --color-surface-container: #251e1c;
  --color-surface-container-low: #201a18;
  --color-surface-container-lowest: #130d0b;
  --color-surface-container-high: #2f2826;
  --color-surface-container-highest: #3b3331;
  --color-surface-variant: #3b3331;
  --color-surface-tint: #ffb77d;

  /* ─ On-Surface Text Colors ─ */
  --color-on-surface: #ede0dc;
  --color-on-surface-variant: #dbc2b0;
  --color-on-background: #ede0dc;

  /* ─ Primary ─ */
  --color-primary: #ffb77d;
  --color-primary-container: #d97707;
  --color-primary-fixed: #ffdcc3;
  --color-primary-fixed-dim: #ffb77d;
  --color-on-primary: #4d2600;
  --color-on-primary-container: #432100;
  --color-on-primary-fixed: #2f1500;
  --color-on-primary-fixed-variant: #6e3900;

  /* ─ Secondary ─ */
  --color-secondary: #ecbcaa;
  --color-secondary-container: #613e31;
  --color-secondary-fixed: #ffdbce;
  --color-secondary-fixed-dim: #ecbcaa;
  --color-on-secondary: #47291d;
  --color-on-secondary-container: #daab9a;
  --color-on-secondary-fixed: #2e140a;
  --color-on-secondary-fixed-variant: #613e31;

  /* ─ Tertiary ─ */
  --color-tertiary: #a4d393;
  --color-tertiary-container: #709c61;
  --color-tertiary-fixed: #c0f0ad;
  --color-tertiary-fixed-dim: #a4d393;
  --color-on-tertiary: #113809;
  --color-on-tertiary-container: #093103;
  --color-on-tertiary-fixed: #022100;
  --color-on-tertiary-fixed-variant: #28501e;

  /* ─ Error ─ */
  --color-error: #ffb4ab;
  --color-error-container: #93000a;
  --color-on-error: #690005;
  --color-on-error-container: #ffdad6;

  /* ─ Outline ─ */
  --color-outline: #a38c7c;
  --color-outline-variant: #554336;

  /* ─ Inverse ─ */
  --color-inverse-surface: #ede0dc;
  --color-inverse-primary: #904d00;
  --color-inverse-on-surface: #362f2c;

  /* ─ Background ─ */
  --color-background: #181210;

  /* ─ Brand Accent ─ */
  --color-amber-accent: #D97706;

  /* ─ Spacing Scale ─ */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-28: 7rem;
  --space-32: 8rem;
  --space-40: 10rem;
}

/* ── CSS Reset ───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  caret-color: transparent;
  cursor: default;
}

/* ── Universal Scrollbar Suppression ─────────────────────────────────────────
   CSS spec trap: `overflow-x: hidden` on ANY element implicitly promotes its
   `overflow-y: visible` (default) to `overflow-y: auto`, silently turning it
   into a vertical scroll container with its own OS-native scrollbar.
   .brand-page, .collection-page, and similar wrappers all use overflow-x:hidden.
   When the overscroll engine translates <main> downward, those containers detect
   overflow, show a ~15px scrollbar, and shift the content left.
   Applying scrollbar rules universally catches every element, regardless of
   whether it becomes a scroll container through explicit or implicit CSS spec promotion.
   ─────────────────────────────────────────────────────────────────────────────── */
* {
  -ms-overflow-style: none;    /* IE / legacy Edge */
  scrollbar-width: none;       /* Firefox; Chrome 121+ */
}
*::-webkit-scrollbar {
  display: none;               /* Chrome / Safari / Chromium-based browsers */
  width: 0;
  height: 0;
}

html {
  /* ── Viewport-Proportional Upscale ──────────────────────
     Scales the root font-size with viewport width to maintain
     visual prominence on high-res / large displays.
     • 0.78vw = 16px at ~2051px — your 1080p baseline is untouched.
     • 1440p (2560px) → ~20px (+25%)   — noticeably larger, still elegant.
     • 4K   (3840px) → ~28px (cap, +75%) — fills the viewport without overwhelming.
     • Below 2051px  → 16px floor — zero change on your dev screen.
     Every rem in the codebase inherits this scale. */
  font-size: clamp(16px, 0.78vw, 28px);

  scroll-behavior: smooth;
  overscroll-behavior: none;
  background-color: var(--color-surface);
  /* Explicit viewport scrollbar suppression — belt-and-suspenders.
     The universal * { scrollbar-width: none } may not reliably target
     the viewport scrollbar on all Windows/Chrome configurations.
     scrollbar-gutter: auto ensures zero gutter space is reserved. */
  scrollbar-width: none;
  -ms-overflow-style: none;
  scrollbar-gutter: auto;
}
html::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-surface);
  color: var(--color-on-surface);
  min-height: 100vh; /* fallback */
  min-height: 100svh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

/* ── Base Element Styles ─────────────────────────────── */
img {
  max-width: 100%;
  display: block;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input {
  font-family: inherit;
  border: none;
  outline: none;
}

/* ── Interactive Exceptions ──────────────────────────── */
input, textarea, [contenteditable="true"] {
  user-select: text;
  caret-color: auto;
  cursor: text;
}

a, button, [role="button"], label {
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

/* ── Typography ──────────────────────────────────────── */
.font-headline {
  font-family: var(--font-headline);
}

.font-body {
  font-family: var(--font-body);
}

.font-label {
  font-family: var(--font-label);
}

/* ── Material Symbols Defaults ───────────────────────── */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none;
}

/* ── Selection Color ─────────────────────────────────── */
::selection {
  background-color: var(--color-primary-container);
  color: var(--color-on-primary-container);
}
