/* ═══════════════════════════════════════════════════════════════
   BASE — Reset, Global Styles, Typography
   ═══════════════════════════════════════════════════════════════ */

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

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

body {
  font-family: var(--font-sans);
  font-weight: var(--weight-regular);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  position: relative;
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--text-heading);
  line-height: var(--leading-tight);
  font-weight: var(--weight-semibold);
}

h1 { font-size: var(--text-6xl); letter-spacing: var(--tracking-tight); }
h2 { font-size: var(--text-4xl); letter-spacing: var(--tracking-tight); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p {
  line-height: var(--leading-loose);
  color: var(--text-secondary);
  max-width: 68ch;
}

p + p { margin-top: var(--space-lg); }

a {
  color: var(--text-accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--gold-300); }

strong { color: var(--text-primary); font-weight: var(--weight-semibold); }

blockquote {
  border-left: 2px solid var(--gold-500);
  padding: var(--space-xl) var(--space-2xl);
  margin: var(--space-3xl) 0;
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--text-primary);
  line-height: var(--leading-snug);
  position: relative;
}
blockquote::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: var(--space-xl);
  font-size: var(--text-7xl);
  color: var(--gold-dim);
  font-family: var(--font-serif);
  line-height: 1;
}
blockquote cite {
  display: block;
  margin-top: var(--space-md);
  font-size: var(--text-sm);
  font-style: normal;
  color: var(--text-muted);
  letter-spacing: var(--tracking-wide);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

hr {
  border: none;
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-4xl) 0;
}

ul, ol {
  padding-left: var(--space-xl);
  color: var(--text-secondary);
  line-height: var(--leading-loose);
}
li + li { margin-top: var(--space-xs); }

/* ── Utility Classes ── */
.font-serif { font-family: var(--font-serif); }
.font-mono { font-family: var(--font-mono); font-size: 0.9em; }
.text-accent { color: var(--text-accent); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }

.highlight {
  color: var(--gold-500);
  font-weight: var(--weight-semibold);
}

.won {
  color: var(--success);
  font-weight: var(--weight-bold);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wider);
}

/* ── Section Spacing ── */
.section {
  padding: var(--space-5xl) 0;
  position: relative;
}

.section--dark {
  background: var(--bg-secondary);
}

.section--grain {
  position: relative;
}
.section--grain::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ── Section Headers ── */
.section-header {
  margin-bottom: var(--space-3xl);
}
.section-header--center {
  text-align: center;
}
.section-header__label {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-accent);
  margin-bottom: var(--space-md);
}
.section-header__title {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-lg);
}

.accent-line {
  display: block;
  width: 48px;
  height: 2px;
  background: var(--gold-500);
}
.accent-line--center {
  margin: 0 auto;
}

/* ── Containers ── */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}
.container--narrow { max-width: var(--container-narrow); }
.container--wide { max-width: var(--container-wide); }

/* ── Grid ── */
.grid { display: grid; gap: var(--space-2xl); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ── Selection ── */
::selection {
  background: rgba(200,164,92,0.3);
  color: var(--white);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gold-500); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  h1 { font-size: var(--text-5xl); }
  h2 { font-size: var(--text-3xl); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  html { font-size: 15px; }
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  .section { padding: var(--space-4xl) 0; }
  .container { padding: 0 var(--space-lg); }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  html { font-size: 14px; }
  h1 { font-size: var(--text-3xl); }
}
