/* ===========================
   RESET & BASE
   =========================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===========================
   DESIGN TOKENS
   =========================== */
:root {
  --font-display: 'Young Serif', serif;
  --font-body: 'Figtree', sans-serif;

  --bg-deep: #08080D;
  --bg-primary: #0D0D14;
  --bg-elevated: #151520;
  --bg-card: #1A1A28;
  --bg-card-hover: #21212F;

  --text-primary: #EDE9E0;
  --text-secondary: #8B8698;
  --text-muted: #524E5F;

  --accent: #C8956C;
  --accent-light: #E8B890;
  --accent-dim: rgba(200, 149, 108, 0.12);

  --success: #4A9B7E;
  --warning: #D4A853;
  --error: #C86A5C;

  --border: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(200, 149, 108, 0.3);

  /* Infographic ribbon tokens */
  --ribbon-stroke: 6px;
  --ribbon-color: var(--accent);
  --ribbon-glow: rgba(200, 149, 108, 0.65);
  --ribbon-under-opacity: 0.85;

  /* Scroll progress (0-1) set by JS */
  --scroll: 0;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

body.no-scroll { overflow: hidden; }

::selection {
  background: rgba(200, 149, 108, 0.3);
  color: var(--text-primary);
}

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

img, svg { display: block; }
a { color: inherit; text-decoration: none; }

/* ===========================
   SKIP LINK (accessibility)
   =========================== */
.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--bg-deep);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 6px;
  z-index: 10000;
  transform: translateY(-200%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

/* ===========================
   GRAIN OVERLAY
   =========================== */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.028;
  background: 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='.78' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* ===========================
   REVEAL ANIMATIONS
   =========================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ===========================
   REDUCED MOTION
   =========================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
