/* =========================================================
   Hollow Knight Map — Design System v1.0
   Aesthetic: Gothic Dark Kingdom / Ancient Hallownest Ruins
   ========================================================= */

/* ---------- CSS Reset (Eric Meyer inspired) ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
body { line-height: 1.5; overflow-x: hidden; }
img, svg { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ---------- Design Tokens ---------- */
:root {
  /* Colors — Ancient Kingdom Palette */
  --bg-void: #05050a;
  --bg-deep: #0a0a14;
  --bg-base: #0e0e1a;
  --bg-elevated: #13131f;
  --bg-sunken: #1a1a28;
  --bg-glass: rgba(18, 18, 30, 0.7);

  --border-subtle: rgba(201, 162, 39, 0.12);
  --border-base: rgba(201, 162, 39, 0.25);
  --border-strong: rgba(201, 162, 39, 0.45);
  --border-light: rgba(255, 255, 255, 0.08);

  --text-primary: #f4f2ed;
  --text-secondary: #b8b5ac;
  --text-muted: #7a7770;
  --text-dim: #4a4842;

  --gold: #c9a227;
  --gold-bright: #e8c547;
  --gold-dim: #8a7320;
  --gold-warm: #d4a84a;
  --amber: #d97706;

  --blood: #9b2c2c;
  --bone: #e8e6df;
  --moss: #3d5a40;
  --moth-wings: #9a6acf;
  --hollow: #5a8acf;

  /* Marker / Location Type Colors */
  --type-charm: #f472b6;      /* pink — charms */
  --type-grub: #fbbf24;       /* amber — grubs */
  --type-boss: #ef4444;       /* red — bosses */
  --type-shop: #a78bfa;       /* purple — shops/NPCs */
  --type-save: #60a5fa;       /* blue — save points */
  --type-poi: #e8c547;        /* gold — general points of interest */

  /* Typography */
  --font-display: 'Cinzel', 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;
  --fs-4xl: 3rem;
  --fs-5xl: 4rem;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  /* Shadows & Glows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border-subtle);
  --shadow-gold: 0 0 0 1px var(--border-strong), 0 0 24px rgba(201, 162, 39, 0.35);
  --glow-gold: 0 0 32px rgba(201, 162, 39, 0.25);
  --glow-gold-strong: 0 0 48px rgba(201, 162, 39, 0.5);

  /* Layout */
  --max-width: 1280px;
  --nav-height: 72px;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 160ms;
  --duration-base: 280ms;
  --duration-slow: 480ms;

  /* Z-index */
  --z-base: 1;
  --z-card: 10;
  --z-nav: 100;
  --z-modal: 1000;
}

/* ---------- Body & Global ---------- */
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100vh;
  position: relative;
}

/* Atmospheric background — subtle radial gradient + texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(201, 162, 39, 0.06), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(90, 138, 207, 0.04), transparent 50%),
    radial-gradient(circle at 50% 50%, var(--bg-deep), var(--bg-void) 100%);
  pointer-events: none;
  z-index: 0;
}

/* Subtle noise texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 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='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.9 0 0 0 0 0.85 0 0 0 0 0.7 0 0 0 0.25 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: overlay;
}

/* Main content wrapper above atmospheric layers */
main, section, nav, footer { position: relative; z-index: var(--z-base); }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.15;
}

h1 { font-size: clamp(2.5rem, 5vw + 1rem, 4.5rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 2.5vw + 0.5rem, 2.75rem); font-weight: 600; }
h3 { font-size: 1.375rem; font-weight: 600; }
h4 { font-size: 1.125rem; font-weight: 600; }
h5 { font-size: 1rem; font-weight: 600; }

/* Decorative gold underline for section titles */
h2.section-title {
  position: relative;
  display: inline-block;
  padding-bottom: var(--space-3);
}

h2.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* Text hierarchy */
.text-display { font-family: var(--font-display); }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-center { text-align: center; }

/* Prose styling for paragraphs */
p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: var(--fs-base);
}

/* Selection */
::selection {
  background: var(--gold);
  color: var(--bg-void);
}

/* ---------- Container System ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-8);
  position: relative;
}

.container-narrow {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-8);
}

/* Section spacing */
section {
  padding: var(--space-20) 0;
  position: relative;
}

.section-intro {
  max-width: 640px;
  margin: 0 auto var(--space-12);
  text-align: center;
  color: var(--text-secondary);
}

/* ---------- Link Styling ---------- */
a {
  color: var(--gold);
  transition: color var(--duration-fast) var(--ease-out-expo);
  position: relative;
}

a:hover {
  color: var(--gold-bright);
}

a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Inline link with animated underline */
.link-inline {
  position: relative;
  color: var(--gold-bright);
}

.link-inline::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--duration-base) var(--ease-out-expo);
}

.link-inline:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold-dim), var(--border-subtle));
  border-radius: 5px;
  border: 2px solid var(--bg-deep);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--gold), var(--gold-dim)); }

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

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

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

.sr-only { composes: visually-hidden; }
