/* ═══════════════════════════════════════════════════════
   DESTROLA — BASE STYLES
   Reset · Body · Film Grain · Typography · Utilities
═══════════════════════════════════════════════════════ */
/* Local fonts — no CDN dependency */
@font-face {
  font-family: "Pixelify Sans";
  src: url("../fonts/PixelifySans-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sekerith";
  src: url("../fonts/Sekerith.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

html {
  scrollbar-width: none;
  overflow-x: hidden;
  scroll-behavior: smooth;
}
html::-webkit-scrollbar { display: none; }

body {
  font-family: var(--font-ui);
  font-size: var(--text-md);
  line-height: 1.65;
  background-color: var(--bg-primary);
  color: var(--fg-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  opacity: 0;
  transition: opacity 0.8s var(--ease-smooth);
}
body.loaded { opacity: 1; }

/* ─── FILM GRAIN OVERLAY ─────────────────────────────── */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23g)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ─── TYPOGRAPHY ─────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  color: var(--fg-primary);
}
h1 { font-size: var(--text-hero); letter-spacing: -0.03em; }
h2 { font-size: var(--text-3xl);  letter-spacing: -0.025em; }
h3 { font-size: var(--text-2xl);  letter-spacing: -0.02em; }
h4 { font-size: var(--text-xl);   letter-spacing: -0.01em; }

p {
  color: var(--fg-secondary);
  font-size: var(--text-base);
  line-height: 1.75;
  max-width: 60ch;
  text-wrap: pretty;
  orphans: 2;
  widows: 2;
}

a { color: inherit; text-decoration: none; }

/* ─── LAYOUT CONTAINERS ──────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

section {
  padding-top: clamp(60px, 8vw, 120px);
  padding-bottom: clamp(60px, 8vw, 120px);
}

/* ─── EYEBROW LABELS ─────────────────────────────────── */
.eyebrow {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: var(--sp-4);
}

/* ─── SECTION HEADERS ────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: clamp(40px, 6vw, 80px);
}
.section-header h2 { margin-bottom: var(--sp-4); }
.section-header p { margin: 0 auto; color: var(--fg-secondary); }

/* ─── DIVIDERS ───────────────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border-subtle);
}

/* ─── UTILITY CLASSES ────────────────────────────────── */
.text-accent  { color: var(--accent); }
.text-muted   { color: var(--fg-muted); }
.text-dim     { color: var(--fg-secondary); }
.text-center  { text-align: center; }
.text-upper   { text-transform: uppercase; letter-spacing: 0.15em; }
.num-display  { font-family: var(--font-display); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-2  { gap: var(--sp-2); }
.gap-4  { gap: var(--sp-4); }
.gap-6  { gap: var(--sp-6); }
.gap-8  { gap: var(--sp-8); }
.gap-12 { gap: var(--sp-12); }

/* ─── XP BAR ─────────────────────────────────────────── */
.xp-track {
  width: 100%;
  height: 4px;
  background: var(--border-subtle);
  border-radius: 2px;
  overflow: hidden;
}
.xp-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(206,68,39,0.6);
  width: 0;
  transition: width 2.5s var(--ease-smooth);
}

/* ─── SELECTION ──────────────────────────────────────── */
::selection {
  background: var(--accent);
  color: var(--fg-primary);
}

/* ─── FOCUS VISIBLE ──────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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