/* ═══════════════════════════════════════════════════════════════
   BASE — Reset + Root + Typography
   ═══════════════════════════════════════════════════════════════ */

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

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: var(--lh-normal);
  letter-spacing: var(--ls-normal);
  min-height: 100vh;
}

/* Top accent line — cinematic frame */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(200, 184, 154, 0.3) 30%,
    rgba(200, 184, 154, 0.5) 50%,
    rgba(200, 184, 154, 0.3) 70%,
    transparent 100%
  );
  z-index: calc(var(--z-nav) + 1);
  pointer-events: none;
}

/* ─── SCROLLBAR ─────────────────────────────────────────────────── */
::-webkit-scrollbar          { width: 6px; }
::-webkit-scrollbar-track    { background: var(--bg); }
::-webkit-scrollbar-thumb    { background: var(--surface-4); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-ghost); }

/* ─── SELECTION ─────────────────────────────────────────────────── */
::selection {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ─── FOCUS ─────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ─── TYPOGRAPHY SCALE ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tighter);
  color: var(--text);
}

h1 { font-size: clamp(var(--text-4xl), 8vw, var(--text-7xl)); letter-spacing: var(--ls-tightest); }
h2 { font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl)); letter-spacing: var(--ls-tighter); }
h3 { font-size: clamp(var(--text-xl), 3vw, var(--text-3xl)); }
h4 { font-size: var(--text-lg); letter-spacing: var(--ls-tight); }
h5 { font-size: var(--text-base); }
h6 { font-size: var(--text-sm); }

p {
  font-size: var(--text-base);
  line-height: var(--lh-relaxed);
  color: var(--text-sub);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

ul, ol { list-style: none; }

img, video { display: block; max-width: 100%; }

button {
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: var(--font-sans);
  color-scheme: dark;
}

/* Prevent autofill blue/white flash */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface-3) inset;
  transition: background-color 5000s ease-in-out 0s;
}

/* ─── UTILITY CLASSES ───────────────────────────────────────────── */
.text-muted    { color: var(--text-muted); }
.text-sub      { color: var(--text-sub); }
.text-accent   { color: var(--accent); }
.text-white    { color: var(--white); }
.font-light    { font-weight: var(--fw-light); }
.font-medium   { font-weight: var(--fw-medium); }
.font-bold     { font-weight: var(--fw-bold); }
.uppercase     { text-transform: uppercase; }
.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;
}
