/* ============================================================
   HOLLOW KNIGHT — Shared Stylesheet
   Aesthetic: Dark Gothic · Soul Ink · Hallownest Depths
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;900&family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=Cinzel+Decorative:wght@400;700&display=swap');

/* ── CSS Variables ─────────────────────────────────────── */
:root {
  --bg:        #080b12;
  --bg2:       #0d1120;
  --bg3:       #111827;
  --surface:   #161d2e;
  --border:    #1e2a42;
  --soul:      #7ecfeb;
  --soul2:     #4ab8d8;
  --soul-glow: rgba(126,207,235,0.18);
  --gold:      #c9a84c;
  --gold2:     #e8c96b;
  --cream:     #e8dfc8;
  --muted:     #8a9ab5;
  --red:       #c44b3b;
  --white:     #f4f0e8;
  --font-head: 'Cinzel', serif;
  --font-deco: 'Cinzel Decorative', serif;
  --font-body: 'Crimson Text', serif;
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 18px; }

body {
  background-color: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Ccircle cx='10' cy='10' r='4' fill='%237ecfeb' opacity='0.9'/%3E%3C/svg%3E") 10 10, auto;
}

/* ── Noise Overlay ──────────────────────────────────────── */
body::before {
  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.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 999;
  opacity: 0.4;
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--soul2); border-radius: 3px; }

/* ── Navigation ─────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(8,11,18,0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  transition: box-shadow 0.3s;
}

#navbar.scrolled {
  box-shadow: 0 4px 40px rgba(126,207,235,0.08);
}

.nav-logo {
  font-family: var(--font-deco);
  font-size: 1rem;
  color: var(--soul);
  text-decoration: none;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo .logo-mark {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-head);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border-radius: 2px;
  transition: color 0.25s, background 0.25s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 50%; right: 50%;
  height: 1px;
  background: var(--soul);
  transition: left 0.25s, right 0.25s;
}

.nav-links a:hover { color: var(--soul); }
.nav-links a:hover::after { left: 0.85rem; right: 0.85rem; }
.nav-links a.active { color: var(--soul); }
.nav-links a.active::after { left: 0.85rem; right: 0.85rem; }

/* Intra-page anchors (only shown on relevant pages) */
.nav-intra {
  display: flex;
  gap: 0.15rem;
  list-style: none;
  padding-left: 1rem;
  border-left: 1px solid var(--border);
  margin-left: 0.5rem;
}

.nav-intra a {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-head);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  transition: color 0.2s;
}

.nav-intra a:hover { color: var(--gold); }

/* Hamburger */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-burger span {
  display: block; width: 24px; height: 2px;
  background: var(--soul);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* Mobile nav */
@media (max-width: 768px) {
  .nav-burger { display: flex; }
  .nav-links, .nav-intra {
    display: none;
    position: fixed;
    top: 60px; left: 0; right: 0;
    background: rgba(8,11,18,0.97);
    flex-direction: column;
    padding: 1rem 2rem 2rem;
    border-bottom: 1px solid var(--border);
    gap: 0.5rem;
  }
  .nav-links.open, .nav-intra.open { display: flex; }
  .nav-intra { top: auto; border-left: none; margin-left: 0; padding-top: 0; }
  .nav-links a, .nav-intra a { font-size: 0.8rem; padding: 0.6rem 0; }
}

/* ── Page Wrapper ───────────────────────────────────────── */
.page-wrap { padding-top: 60px; }

/* ── Section Utility ────────────────────────────────────── */
section { padding: 5rem 0; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container--narrow { max-width: 780px; }

/* ── Section Label ──────────────────────────────────────── */
.section-label {
  font-family: var(--font-head);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--soul2);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-label::before {
  content: '';
  display: inline-block;
  width: 28px; height: 1px;
  background: var(--soul2);
}

/* ── Headings ───────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.2;
  color: var(--white);
}

h1 { font-size: clamp(2.2rem, 6vw, 4.5rem); font-weight: 900; }
h2 { font-size: clamp(1.6rem, 4vw, 2.8rem); font-weight: 600; }
h3 { font-size: 1.3rem; font-weight: 600; color: var(--cream); }

.title-gold { color: var(--gold2); }
.title-soul { color: var(--soul); }

/* ── Paragraph ──────────────────────────────────────────── */
p { margin-bottom: 1.2rem; font-size: 1rem; color: var(--cream); }
p:last-child { margin-bottom: 0; }

/* ── Divider ────────────────────────────────────────────── */
.divider {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  margin: 3rem 0;
}

/* ── Soul Glow Effect ───────────────────────────────────── */
.glow-text {
  text-shadow: 0 0 30px rgba(126,207,235,0.5), 0 0 60px rgba(126,207,235,0.2);
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2rem;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--soul), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover {
  border-color: var(--soul2);
  box-shadow: 0 8px 40px rgba(126,207,235,0.1);
  transform: translateY(-3px);
}
.card:hover::before { opacity: 1; }

/* ── Grid ───────────────────────────────────────────────── */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ── Table ──────────────────────────────────────────────── */
.styled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.styled-table th {
  background: var(--surface);
  color: var(--soul);
  font-family: var(--font-head);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.85rem 1.2rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.styled-table td {
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid rgba(30,42,66,0.5);
  color: var(--cream);
}
.styled-table tr:hover td { background: rgba(126,207,235,0.04); }

/* ── Quote Block ────────────────────────────────────────── */
blockquote {
  border-left: 2px solid var(--soul);
  padding: 1.25rem 2rem;
  margin: 2rem 0;
  background: rgba(126,207,235,0.04);
  border-radius: 0 4px 4px 0;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--muted);
  position: relative;
}
blockquote::before {
  content: '"';
  font-family: var(--font-deco);
  font-size: 4rem;
  color: var(--soul);
  opacity: 0.2;
  position: absolute;
  top: -0.5rem; left: 1rem;
  line-height: 1;
}

/* ── Badge ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  border-radius: 2px;
  border: 1px solid currentColor;
  margin-bottom: 0.5rem;
}
.badge--soul { color: var(--soul); border-color: var(--soul2); background: rgba(126,207,235,0.08); }
.badge--gold { color: var(--gold2); border-color: var(--gold); background: rgba(201,168,76,0.08); }
.badge--red  { color: #e87060; border-color: var(--red); background: rgba(196,75,59,0.08); }

/* ── Button ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-head);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.75rem 1.75rem;
  border-radius: 2px;
  text-decoration: none;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
}
.btn--primary {
  background: var(--soul);
  color: var(--bg);
  font-weight: 600;
}
.btn--primary:hover {
  background: var(--soul2);
  box-shadow: 0 0 30px rgba(126,207,235,0.4);
}
.btn--outline {
  border: 1px solid var(--soul);
  color: var(--soul);
  background: transparent;
}
.btn--outline:hover {
  background: var(--soul-glow);
  box-shadow: 0 0 20px rgba(126,207,235,0.2);
}

/* ── Fade In Animation ──────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}
@keyframes soulPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(126,207,235,0.3); }
  50%       { box-shadow: 0 0 30px rgba(126,207,235,0.7); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.anim-fadeup {
  animation: fadeUp 0.8s ease both;
}
.anim-delay-1 { animation-delay: 0.15s; }
.anim-delay-2 { animation-delay: 0.3s; }
.anim-delay-3 { animation-delay: 0.45s; }
.anim-delay-4 { animation-delay: 0.6s; }

/* ── Scroll Reveal ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Progress Bar ───────────────────────────────────────── */
.stat-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.stat-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-head);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.stat-fill {
  height: 100%;
  background: linear-gradient(to right, var(--soul2), var(--soul));
  border-radius: 2px;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}
.stat-fill.animate { transform: scaleX(1); }

/* ── Footer ─────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-family: var(--font-head);
  letter-spacing: 0.1em;
}
footer span { color: var(--soul); }

/* ── Particles canvas ───────────────────────────────────── */
#particles-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* ── Lists ──────────────────────────────────────────────── */
ul.styled-list {
  list-style: none;
  padding: 0;
}
ul.styled-list li {
  padding: 0.4rem 0 0.4rem 1.5rem;
  position: relative;
  color: var(--cream);
}
ul.styled-list li::before {
  content: '◆';
  position: absolute;
  left: 0;
  color: var(--soul);
  font-size: 0.5rem;
  top: 0.65rem;
}

/* ── Image Frames ───────────────────────────────────────── */
.img-frame {
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.img-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(8,11,18,0.6));
  pointer-events: none;
}
.img-frame img {
  width: 100%;
  display: block;
  transition: transform 0.5s ease;
}
.img-frame:hover img { transform: scale(1.03); }

/* ── Video embed ────────────────────────────────────────── */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
}
.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ── Parallax hero ──────────────────────────────────────── */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 50%, rgba(126,207,235,0.06) 0%, transparent 70%),
              radial-gradient(ellipse 40% 40% at 20% 80%, rgba(201,168,76,0.04) 0%, transparent 60%),
              var(--bg);
}
.hero-content {
  position: relative;
  z-index: 2;
}

/* ── Lore pill ──────────────────────────────────────────── */
.lore-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(126,207,235,0.08);
  border: 1px solid rgba(126,207,235,0.2);
  border-radius: 20px;
  padding: 0.3rem 1rem;
  font-family: var(--font-head);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--soul);
  margin-bottom: 1.5rem;
}

/* ── Character Card ─────────────────────────────────────── */
.char-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.char-card:hover {
  border-color: var(--soul2);
  box-shadow: 0 8px 40px rgba(126,207,235,0.1);
  transform: translateY(-4px);
}
.char-card-header {
  padding: 1.5rem 1.5rem 0;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.char-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.char-card-body { padding: 1rem 1.5rem 1.5rem; }
.char-card-body p { font-size: 0.9rem; color: var(--muted); margin: 0; }

/* ── Section splitter ───────────────────────────────────── */
.section-ornament {
  text-align: center;
  font-family: var(--font-deco);
  font-size: 1.2rem;
  color: var(--soul);
  opacity: 0.3;
  margin: 1rem 0;
  letter-spacing: 0.3em;
}
