/* =========================================================================
   Base — reset + typography + accessibility primitives
   ========================================================================= */

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

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  font-feature-settings: "ss01", "cv11", "kern";
  letter-spacing: var(--tracking-base);
  overflow-x: hidden;
}

/* Subtle film-grain ambient backdrop for premium feel */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 0.85  0 0 0 0 0.55  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

main, header, footer, section, article { position: relative; z-index: var(--z-base); }

/* — Headings — */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
}

h1 { font-size: clamp(var(--fs-3xl), 6vw, var(--fs-6xl)); font-weight: 400; font-variation-settings: "opsz" 144, "SOFT" 30; }
h2 { font-size: clamp(var(--fs-2xl), 4vw, var(--fs-4xl)); font-weight: 400; font-variation-settings: "opsz" 96, "SOFT" 30; }
h3 { font-size: clamp(var(--fs-xl), 2.5vw, var(--fs-2xl)); font-weight: 500; font-variation-settings: "opsz" 48; }
h4 { font-size: var(--fs-lg); font-weight: 500; font-family: var(--font-body); letter-spacing: var(--tracking-snug); }
h5 { font-size: var(--fs-md); font-weight: 500; font-family: var(--font-body); }
h6 { font-size: var(--fs-sm); font-weight: 600; font-family: var(--font-body); text-transform: uppercase; letter-spacing: var(--tracking-xwide); color: var(--text-muted); }

p { margin: 0 0 var(--s-4) 0; color: var(--text-muted); }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: 600; color: var(--text); }

/* — Inline — */
a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--accent); }

/* — Lists — */
ul, ol { margin: 0; padding: 0; }

/* — Media — */
img, picture, svg, video { display: block; max-width: 100%; height: auto; }

/* — Form — */
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; background: transparent; border: none; padding: 0; }

/* — Selection — */
::selection {
  background: var(--gold-400);
  color: var(--ink-900);
}

/* — Scrollbar (WebKit) — */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink-800); }
::-webkit-scrollbar-thumb { background: var(--gold-600); border-radius: var(--r-full); border: 2px solid var(--ink-800); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-500); }

/* — Focus ring (accessibility) — */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-2);
}

/* — Skip link — */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--s-4);
  z-index: var(--z-toast);
  padding: var(--s-3) var(--s-5);
  background: var(--accent);
  color: var(--ink-900);
  font-weight: 600;
  border-radius: var(--r-2);
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--s-4); }

/* — Layout primitives — */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: clamp(var(--s-16), 10vw, var(--s-32));
}

.section--tight { padding-block: clamp(var(--s-10), 6vw, var(--s-16)); }

/* — Utility — */
.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;
}

.text-display { font-family: var(--font-display); font-weight: 400; }
.text-mono    { font-family: var(--font-mono); }
.text-accent  { color: var(--accent); }
.text-muted   { color: var(--text-muted); }
.text-dim     { color: var(--text-dim); }

.uppercase    { text-transform: uppercase; letter-spacing: var(--tracking-xwide); font-size: var(--fs-xs); }

.divider {
  display: block;
  width: 48px;
  height: 1px;
  background: var(--accent);
  border: 0;
  margin: var(--s-6) 0;
}
.divider--center { margin-inline: auto; }
