/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, p { margin: 0; }

html {
  scroll-behavior: auto; /* Lenis handles smooth scroll; avoid double-smoothing */
}

body {
  background: var(--color-bg-dark);
  color: var(--text-on-dark);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

em, .italic-accent {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
}

/* Cursor hidden only when a custom cursor is active + not touch/reduced-motion */
.has-custom-cursor,
.has-custom-cursor a,
.has-custom-cursor button {
  cursor: none;
}
.has-custom-cursor input,
.has-custom-cursor textarea,
.has-custom-cursor select {
  cursor: auto;
}

/* ---------- Section theming ---------- */
.section {
  position: relative;
  padding-block: var(--space-xl);
}
.section--light {
  background: var(--color-bg-light);
  color: var(--text-on-light);
  /* Base gold is too pale to read on cream - deepen it here so eyebrows,
     links, and icons stay legible; dark sections keep the lighter default. */
  --color-accent: var(--gold-600);
  --color-accent-strong: var(--terracotta-600);
}
.section--dark {
  background: var(--color-bg-dark);
  color: var(--text-on-dark);
  --color-accent: var(--gold-300);
  --color-accent-strong: var(--terracotta-400);
}

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
  position: relative;
}

/* ---------- Typography ---------- */
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.5em 1.1em;
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-accent);
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}

.heading-xl {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.01em;
}
.heading-lg {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: 1.08;
}
.heading-md {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.15;
}
.heading-sm {
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  font-weight: 600;
  line-height: 1.25;
}

.text-muted { color: var(--text-on-dark-muted); }
.section--light .text-muted { color: var(--text-on-light-muted); }

.text-accent { color: var(--color-accent); }

/* ---------- Links ---------- */
.link-underline {
  position: relative;
  display: inline-block;
  padding-bottom: 2px;
}
.link-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-fast) var(--ease-out);
}
.link-underline:hover::after,
.link-underline:focus-visible::after {
  transform: scaleX(1);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 1.05em 2.1em;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
  will-change: transform;
}
.btn--primary {
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
  color: var(--charcoal-950);
  box-shadow: 0 8px 24px -8px var(--gold-glow);
}
.btn--primary:hover {
  box-shadow: 0 12px 32px -8px var(--gold-glow);
  transform: translateY(-2px);
}
.btn--outline {
  background: transparent;
  border: 1px solid var(--color-border-dark);
  color: var(--text-on-dark);
}
.section--light .btn--outline {
  border-color: var(--color-border-light);
  color: var(--text-on-light);
}
.btn--outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.btn--ghost {
  background: transparent;
  color: var(--color-accent);
  padding-inline: 0.4em;
}
.btn--ghost:hover { color: var(--color-accent-strong); }

/* ---------- Focus ---------- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* ---------- Custom scrollbar ---------- */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--gold-500) var(--charcoal-900);
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--charcoal-900); }
::-webkit-scrollbar-thumb {
  background: var(--gold-500);
  border-radius: var(--radius-pill);
  border: 2px solid var(--charcoal-900);
}

/* ---------- Grain overlay ---------- */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 8s steps(8) infinite;
}
@keyframes grain-shift {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-2%, -3%); }
  30% { transform: translate(3%, 2%); }
  50% { transform: translate(-3%, 3%); }
  70% { transform: translate(2%, -2%); }
  90% { transform: translate(-2%, 2%); }
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-accent);
  color: var(--charcoal-950);
  padding: 0.75em 1.25em;
  z-index: 10000;
  border-radius: var(--radius-sm);
}
.skip-link:focus {
  left: var(--space-sm);
  top: var(--space-sm);
}

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

/* ---------- Visually hidden ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Responsive 2-column utility ---------- */
.grid-2col {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr 1fr;
  align-items: start;
}
.grid-2col--narrow-right { grid-template-columns: 1fr 1.2fr; }
@media (max-width: 900px) {
  .grid-2col, .grid-2col--narrow-right { grid-template-columns: 1fr; }
}
