/* ============================================================
   MAIN.CSS — Variables · Reset · Typography · Layout
   ============================================================ */

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Color System */
  --color-bg:              #0A0A09;
  --color-surface:         #111110;
  --color-surface-2:       #171715;
  --color-surface-raised:  #1C1C1A;
  --color-border:          rgba(255, 255, 255, 0.06);
  --color-border-hover:    rgba(200, 169, 126, 0.25);
  --color-accent:          #C8A97E;
  --color-accent-dim:      rgba(200, 169, 126, 0.10);
  --color-accent-glow:     rgba(200, 169, 126, 0.05);
  --color-text-primary:    #F0EDE8;
  --color-text-secondary:  #7A7670;
  --color-text-tertiary:   #3D3B38;

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-ui:      'DM Sans', system-ui, -apple-system, sans-serif;

  /* Spacing Scale (8pt) */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   24px;
  --space-6:   32px;
  --space-7:   48px;
  --space-8:   64px;
  --space-9:   96px;
  --space-10:  128px;
  --space-11:  160px;
  --space-12:  200px;

  /* Border Radius */
  --radius-sm:   2px;
  --radius-md:   6px;
  --radius-lg:   12px;
  --radius-xl:   20px;
  --radius-2xl:  32px;
  --radius-pill: 9999px;

  /* Z-Index Scale */
  --z-base:    0;
  --z-raised:  10;
  --z-overlay: 100;
  --z-nav:     200;
  --z-grain:   500;
  --z-cursor:  9999;

  /* Transitions */
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:       cubic-bezier(0.7, 0, 0.84, 0);
  --ease-spring:   cubic-bezier(0.32, 0.72, 0, 1);
  --trans-fast:    150ms var(--ease-out);
  --trans-base:    300ms var(--ease-out);
  --trans-slow:    600ms var(--ease-out);
  --trans-spring:  700ms var(--ease-spring);

  /* Layout */
  --max-width: 1200px;
  --gutter:    clamp(24px, 5vw, 80px);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-ui);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
ul, ol { list-style: none; }

/* ── Grain Overlay (fixed, pointer-events-none) ─────────────── */
.grain {
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  background-repeat: repeat;
}

/* ── Typography Scale ───────────────────────────────────────── */
.t-display {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(52px, 7.5vw, 104px);
  line-height: 0.95;
  letter-spacing: -0.025em;
}

.t-display-lg {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(64px, 11vw, 140px);
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.t-h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 5.5vw, 80px);
  line-height: 1.0;
  letter-spacing: -0.025em;
}

.t-h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(36px, 4.5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.t-h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 2.5vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.t-body {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text-secondary);
}

.t-body-sm {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.t-label {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.t-italic {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
}

/* ── Layout Utilities ───────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(100px, 14vw, 200px);
  position: relative;
  overflow: hidden;
}

.section--narrow {
  padding-block: clamp(80px, 10vw, 140px);
}

.section-divider {
  width: 100%;
  height: 1px;
  background: var(--color-border);
  border: none;
}

/* Section Number Marker */
.section-number {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(140px, 22vw, 280px);
  color: var(--color-text-primary);
  opacity: 0.025;
  line-height: 1;
  letter-spacing: -0.06em;
  pointer-events: none;
  user-select: none;
  z-index: var(--z-base);
}

/* Eyebrow pill tag — premium style */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.eyebrow--pill {
  background: rgba(200, 169, 126, 0.08);
  border: 1px solid rgba(200, 169, 126, 0.18);
  border-radius: var(--radius-pill);
  padding: 6px 14px 6px 10px;
}

.eyebrow--pill::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}

/* Gold decorative line */
.gold-line {
  display: block;
  height: 1px;
  background: linear-gradient(to right, var(--color-accent), transparent);
  transform-origin: left;
  transform: scaleX(0);
  width: 80px;
  margin-bottom: var(--space-6);
}

/* Text utilities */
.text-measure { max-width: 640px; }
.text-center  { text-align: center; }
.text-muted   { color: var(--color-text-secondary); }

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

/* Flex utilities */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-5  { gap: var(--space-5); }
.gap-6  { gap: var(--space-6); }

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

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-accent);
  color: var(--color-bg);
  padding: var(--space-2) var(--space-4);
  font-weight: 400;
  z-index: calc(var(--z-nav) + 10);
  border-radius: var(--radius-md);
}
.skip-link:focus { top: var(--space-4); }

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