/**
 * Base Styles, Resets & Global Utilities
 */

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

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

html.lock-scroll,
body.lock-scroll {
  overflow: hidden !important;
  height: 100% !important;
  touch-action: none;
}

body.modal-locked {
  overflow: hidden !important;
}

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

::selection {
  background-color: var(--gold-light);
  color: var(--burgundy-deep);
}

/* Ambient Canvas */
#ambientCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

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

/* Links & Buttons */
a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
}

/* Typography Hierarchy */
h1, h2, h3, h4, .serif-display {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.script-accent {
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--terracotta);
}

.eyebrow,
.section-eyebrow {
  font-family: var(--font-sans);
  font-size: clamp(0.72rem, 1.8vw, 0.8125rem);
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: #c4a785; /* Refined antique gold from reference image */
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: block;
}

.section-num {
  font-family: var(--font-sans);
  font-size: clamp(0.72rem, 1.8vw, 0.8125rem);
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: #c4a785;
  margin-bottom: 0.75rem;
  display: inline-block;
  border-bottom: none;
  padding-bottom: 0;
  font-weight: 600;
}

/* Scroll Reveals */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 1.1s var(--ease-cinematic), transform 1.1s var(--ease-cinematic);
  will-change: opacity, transform;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal-on-scroll,
  .story-stanza {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  #ambientCanvas {
    display: none;
  }
}
