/* ============================================================
   GUIN // NORRATH — "The Codex"  (layout v2)
   light parchment palette + persistent left rail + asymmetric chapters
   ============================================================ */

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

:root {
  --bg: #ece0c6;
  --bg-2: #e2d3b4;
  --card: #f6efdc;
  --card-hover: #fbf5e6;
  --ink: #2a2f42;
  --ink-soft: #5b6175;
  --ink-faint: #8b90a3;
  --gold: #b0821f;
  --gold-bright: #d9a520;
  --gold-glow: rgba(217, 165, 32, 0.25);
  --crimson: #a32638;
  --teal: #2a7f7a;
  --violet: #6d4a9e;
  --magenta: #b23a86;
  --orange: #c76b23;
  --blue: #3a6ea5;
  --red: #b3372f;
  --border: #d3c4a1;
  --border-strong: #c2b189;
  --shadow: rgba(70, 50, 20, 0.16);
  --font-display: 'Cinzel', serif;
  --font-body: 'Spectral', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --rail-w: 340px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
}

::selection { background: var(--gold); color: #fff8e8; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border-strong); }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* soft warm vignette over the whole page */
#crt-overlay {
  position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(90, 65, 25, 0.1) 100%);
}

/* ============================================================
   BOOT OVERLAY
   ============================================================ */
#boot-overlay { position: fixed; inset: 0; z-index: 9999; background: #171b28; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 6vw; cursor: pointer; transition: opacity 0.6s ease; }
#boot-overlay.hidden { opacity: 0; pointer-events: none; }
.boot-inner { width: min(760px, 100%); font-family: var(--font-mono); font-size: clamp(0.95rem, 2.4vw, 1.3rem); color: var(--gold-bright); text-shadow: 0 0 12px var(--gold-glow); }
.boot-line { white-space: pre-wrap; min-height: 1.4em; }
.boot-skip { margin-top: 2rem; font-family: var(--font-mono); font-size: 0.72rem; color: #6b7390; letter-spacing: 0.12em; }

/* ============================================================
   PARALLAX — light morning haze
   ============================================================ */
#parallax-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; overflow: hidden; pointer-events: none; }
.parallax-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; will-change: transform; }

.layer-sky {
  background:
    radial-gradient(ellipse at 50% 14%, rgba(255, 252, 240, 0.95) 0%, rgba(255, 246, 220, 0.5) 26%, transparent 55%),
    linear-gradient(180deg, #f8f0dd 0%, #f4e8cf 40%, #ecdcc0 75%, #e6d2b0 100%);
}
.layer-stars {
  background:
    radial-gradient(2px 2px at 8% 10%, rgba(255,250,230,0.9), transparent),
    radial-gradient(1px 1px at 16% 20%, rgba(255,244,214,0.7), transparent),
    radial-gradient(2px 2px at 26% 8%, rgba(255,248,224,0.8), transparent),
    radial-gradient(1px 1px at 38% 18%, rgba(255,240,208,0.6), transparent),
    radial-gradient(1px 1px at 50% 12%, rgba(255,250,230,0.7), transparent),
    radial-gradient(2px 2px at 62% 22%, rgba(255,242,212,0.7), transparent),
    radial-gradient(1px 1px at 74% 9%, rgba(255,250,230,0.8), transparent),
    radial-gradient(2px 2px at 86% 18%, rgba(255,244,214,0.7), transparent),
    radial-gradient(1px 1px at 94% 12%, rgba(255,250,230,0.6), transparent),
    radial-gradient(2px 2px at 44% 30%, rgba(255,246,220,0.5), transparent),
    radial-gradient(1px 1px at 68% 34%, rgba(255,240,208,0.5), transparent);
}
.layer-fog-far {
  background:
    radial-gradient(ellipse at 20% 84%, rgba(255, 246, 226, 0.55) 0%, transparent 56%),
    radial-gradient(ellipse at 80% 78%, rgba(255, 238, 214, 0.45) 0%, transparent 48%),
    radial-gradient(ellipse at 50% 88%, rgba(255, 242, 220, 0.5) 0%, transparent 56%);
}
.layer-mountains-far { bottom: 0; height: 62%; top: auto; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1920 600' preserveAspectRatio='none' width='1920' height='600'%3E%3Cpolygon points='0,600 100,280 200,350 350,200 500,320 650,180 800,290 950,150 1100,280 1250,220 1400,310 1550,190 1700,280 1850,240 1920,300 1920,600' fill='%23c3ac86' opacity='0.4'/%3E%3Cpolygon points='0,600 150,320 300,280 450,340 600,250 750,310 900,230 1050,300 1200,260 1350,320 1500,270 1650,300 1800,280 1920,320 1920,600' fill='%23b39a72' opacity='0.45'/%3E%3C/svg%3E") bottom center no-repeat; background-size: cover; }
.layer-mountains-mid { bottom: 0; height: 52%; top: auto; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1920 500' preserveAspectRatio='none' width='1920' height='500'%3E%3Cpolygon points='0,500 80,300 200,350 320,250 450,320 580,220 700,300 850,200 1000,280 1150,240 1300,310 1450,230 1600,290 1750,260 1920,300 1920,500' fill='%23a08355' opacity='0.5'/%3E%3Cpolygon points='0,500 120,340 280,290 420,350 560,270 700,330 850,250 1000,310 1150,280 1300,340 1450,290 1600,320 1750,300 1920,340 1920,500' fill='%238f7348' opacity='0.55'/%3E%3C/svg%3E") bottom center no-repeat; background-size: cover; }
.layer-mountains-near { bottom: 0; height: 42%; top: auto; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1920 450' preserveAspectRatio='none' width='1920' height='450'%3E%3Cpolygon points='0,450 60,320 180,360 300,280 420,340 540,260 660,320 780,240 900,300 1020,270 1140,330 1260,250 1380,310 1500,280 1620,340 1740,300 1860,330 1920,310 1920,450' fill='%237a6140' opacity='0.55'/%3E%3C/svg%3E") bottom center no-repeat; background-size: cover; }
.layer-trees-far { bottom: 0; height: 34%; top: auto; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1920 350' preserveAspectRatio='none' width='1920' height='350'%3E%3Cg fill='%236d5638' opacity='0.45'%3E%3Cpolygon points='50,350 80,150 110,350'/%3E%3Cpolygon points='200,350 230,130 260,350'/%3E%3Cpolygon points='400,350 425,170 450,350'/%3E%3Cpolygon points='600,350 630,140 660,350'/%3E%3Cpolygon points='800,350 820,160 840,350'/%3E%3Cpolygon points='1000,350 1025,150 1050,350'/%3E%3Cpolygon points='1200,350 1230,130 1260,350'/%3E%3Cpolygon points='1400,350 1425,160 1450,350'/%3E%3Cpolygon points='1600,350 1630,140 1660,350'/%3E%3Cpolygon points='1800,350 1825,150 1850,350'/%3E%3C/g%3E%3C/svg%3E") bottom center no-repeat; background-size: cover; }
.layer-trees-near { bottom: 0; height: 27%; top: auto; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1920 300' preserveAspectRatio='none' width='1920' height='300'%3E%3Cg fill='%235f4b30' opacity='0.5'%3E%3Cpolygon points='30,300 65,80 100,300'/%3E%3Cpolygon points='250,300 280,100 310,300'/%3E%3Cpolygon points='450,300 475,120 500,300'/%3E%3Cpolygon points='650,300 680,90 710,300'/%3E%3Cpolygon points='850,300 870,110 890,300'/%3E%3Cpolygon points='1050,300 1075,100 1100,300'/%3E%3Cpolygon points='1250,300 1280,80 1310,300'/%3E%3Cpolygon points='1450,300 1475,110 1500,300'/%3E%3Cpolygon points='1650,300 1680,90 1710,300'/%3E%3Cpolygon points='1850,300 1875,110 1900,300'/%3E%3C/g%3E%3C/svg%3E") bottom center no-repeat; background-size: cover; }
.layer-fog-near { bottom: 0; height: 24%; top: auto; background: radial-gradient(ellipse at 50% 100%, rgba(255, 248, 230, 0.5) 0%, transparent 50%); }

/* ============================================================
   LAYOUT — rail + main
   ============================================================ */
.layout { position: relative; z-index: 1; display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }

/* ---- left rail ---- */
.rail {
  position: sticky; top: 0; align-self: start;
  height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(248, 241, 224, 0.94), rgba(236, 224, 198, 0.94));
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 24px rgba(70, 50, 20, 0.08);
  padding: 1.7rem 1.5rem;
  backdrop-filter: blur(6px);
  z-index: 6;
}
.rail-brand { margin-bottom: 0.4rem; }
.rail-brand .logo { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--ink); letter-spacing: 0.03em; display: block; }
.rail-brand .logo::before { content: '✦ '; color: var(--gold); }
.rail-brand .tagline { font-family: var(--font-body); font-size: 0.88rem; font-style: italic; color: var(--ink-faint); }

/* ---- essence (xp) bar — inline in rail ---- */
.xp-bar-container { position: static; background: transparent; border: none; backdrop-filter: none; padding: 1.2rem 0 0.6rem; }
.xp-bar-wrapper { max-width: none; }
.xp-level-info { display: flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.xp-level-label { font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 0.14em; color: var(--ink-faint); }
.xp-level-number { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--gold); line-height: 1; text-shadow: 0 1px 0 rgba(255,255,255,0.5); }
.xp-title { font-family: var(--font-body); font-size: 0.86rem; font-style: italic; color: var(--ink-soft); }
.xp-bar-track { flex: none; height: 16px; width: 100%; background: #ded0b2; border: 1px solid var(--border-strong); border-radius: 3px; overflow: hidden; position: relative; }
.xp-bar-fill { height: 100%; background: linear-gradient(90deg, #c9971f, var(--gold-bright), #f0c94a); transition: width 0.5s ease; position: relative; box-shadow: 0 0 12px var(--gold-glow); }
.xp-bar-fill::after { content: ''; position: absolute; inset: 0 0 55% 0; background: linear-gradient(180deg, rgba(255,255,255,0.5), transparent); }
.xp-bar-track::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(10% - 1px), rgba(90,70,30,0.3) calc(10% - 1px), rgba(90,70,30,0.3) 10%); pointer-events: none; }
.xp-text { display: block; font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint); text-align: right; margin-top: 0.35rem; }

/* ---- character sheet — inline in rail ---- */
.character-panel { position: static; width: auto; margin: 0.8rem 0 0; }
.character-panel.collapsed .character-body { display: none; }
.character-header { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; padding: 0.55rem 0.8rem; background: rgba(246, 239, 220, 0.97); border: 1px solid var(--border); border-bottom: none; border-radius: 4px 4px 0 0; }
.character-race { font-family: var(--font-display); font-size: 0.62rem; letter-spacing: 0.06em; color: var(--crimson); }
.character-class { font-family: var(--font-body); font-size: 0.82rem; color: var(--ink-soft); }
.character-toggle { background: none; border: 1px solid var(--border-strong); color: var(--ink-faint); cursor: pointer; font-family: var(--font-mono); font-size: 0.8rem; padding: 0.15rem 0.45rem; border-radius: 4px; }
.character-toggle:hover { color: var(--ink); border-color: var(--gold); }
.character-body { background: rgba(246, 239, 220, 0.97); border: 1px solid var(--border); border-radius: 0 0 4px 4px; padding: 1rem; }
.character-portrait { text-align: center; margin-bottom: 0.75rem; }
.class-sprite-container { width: 84px; height: 168px; margin: 0 auto; overflow: hidden; position: relative; image-rendering: pixelated; image-rendering: crisp-edges; border: 2px solid var(--gold); background: #1b1712; box-shadow: 0 0 16px var(--gold-glow); }
.class-sprite-frame { width: 84px; height: 168px; background-repeat: no-repeat; background-size: 336px 336px; }
.class-sprite-frame.bard { background-image: url('frames/bard.f30e67be7d916033c9d7d41b8d32913e.png'); }
.class-sprite-frame.beastlord { background-image: url('frames/beastlord.d741e166c2c139a5cefb6dba19087569.png'); }
.class-sprite-frame.berserker { background-image: url('frames/berserker.ab3e29c90ab660759f1f27aa5c2f2b7b.png'); }
.class-sprite-frame.cleric { background-image: url('frames/cleric.fffa315ea722ab317817251806c2def7.png'); }
.class-sprite-frame.druid { background-image: url('frames/druid.5eeb9bbbb3bedd81c89ddb25e41fd04e.png'); }
.class-sprite-frame.enchanter { background-image: url('frames/enchanter.71e307d0f75f5a2c13252db9be4a7f29.png'); }
.class-sprite-frame.magician { background-image: url('frames/magician.e26c74ec16dcfa04b9f432f07b01ef85.png'); }
.class-sprite-frame.monk { background-image: url('frames/monk.6fb955b89f26630a609d57485606c8e4.png'); }
.class-sprite-frame.necromancer { background-image: url('frames/necromancer.ea2ab801e6b3925ef2edd301413fed1a.png'); }
.class-sprite-frame.paladin { background-image: url('frames/paladin.cb67641fd4e1633fa09f2acfccbc6cf3.png'); }
.class-sprite-frame.ranger { background-image: url('frames/ranger.223c22c415ad5042324cbb5e92a5c8a9.png'); }
.class-sprite-frame.rogue { background-image: url('frames/rogue.9f0d503f7eb2832efe9ba06d1e8a9065.png'); }
.class-sprite-frame.shadowknight { background-image: url('frames/shadowknight.9e9b4943ed5727a07da8a7cc1972c86f.png'); }
.class-sprite-frame.shaman { background-image: url('frames/shaman.9b57623e9ed18d3f22c8fbd1c192ccce.png'); }
.class-sprite-frame.warrior { background-image: url('frames/warrior.3616f2af1d17e8d0340288664dbd2e54.png'); }
.class-sprite-frame.wizard { background-image: url('frames/wizard.7a124b6064261d92aefd251703060570.png'); }
.character-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.char-stat-row { display: flex; align-items: center; gap: 0.4rem; }
.char-stat-label { font-family: var(--font-display); font-size: 0.56rem; letter-spacing: 0.08em; color: var(--ink-faint); min-width: 30px; }
.char-stat-num { font-family: var(--font-mono); font-size: 0.84rem; color: var(--ink); font-weight: 600; }
.char-hp-bar, .char-mp-bar { flex: 1; height: 9px; background: #d9c9a8; border: 1px solid var(--border-strong); overflow: hidden; }
.char-hp-fill { height: 100%; background: linear-gradient(90deg, #c05a54, var(--crimson)); transition: width 0.5s ease; }
.char-mp-fill { height: 100%; background: linear-gradient(90deg, #4a86b8, var(--blue)); transition: width 0.5s ease; }
.char-stat-value { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-soft); min-width: 26px; text-align: right; }
.character-lore { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px dashed var(--border-strong); font-size: 0.9rem; color: var(--ink-soft); font-style: italic; line-height: 1.4; }
.joke-box { margin-top: 0.75rem; padding: 0.75rem; background: rgba(217, 165, 32, 0.12); border: 1px solid rgba(217, 165, 32, 0.4); border-radius: 4px; font-size: 0.86rem; color: var(--ink-soft); line-height: 1.45; }
.joke-box::before { content: '✦ LEGENDARY   '; color: var(--gold); font-family: var(--font-display); font-size: 0.56rem; letter-spacing: 0.1em; }

/* ---- rail nav ---- */
.rail-nav { display: flex; flex-direction: column; gap: 0.15rem; margin-top: 1.5rem; }
.nav-link { display: flex; align-items: baseline; gap: 0.6rem; color: var(--ink-soft); text-decoration: none; font-family: var(--font-body); font-size: 0.98rem; padding: 0.45rem 0.6rem; border-radius: 4px; transition: all var(--transition); border-left: 2px solid transparent; }
.nav-link i { font-family: var(--font-display); font-size: 0.72rem; color: var(--gold); font-style: normal; min-width: 1.4em; }
.nav-link:hover { color: var(--ink); background: rgba(217, 165, 32, 0.09); border-left-color: var(--gold); }

/* ---- rail foot ---- */
.rail-foot { margin-top: 1.8rem; display: flex; flex-direction: column; gap: 0.9rem; align-items: flex-start; }
.nav-status { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-body); font-size: 0.86rem; font-style: italic; color: var(--ink-faint); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 8px rgba(42, 127, 122, 0.5); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
#term-toggle { position: static; background: #1e2436; border: 1px solid var(--gold); color: var(--gold-bright); font-family: var(--font-display); font-size: 0.66rem; letter-spacing: 0.08em; padding: 0.7rem 1.1rem; border-radius: 4px; cursor: pointer; transition: all var(--transition); box-shadow: 0 4px 14px var(--shadow); }
#term-toggle:hover { box-shadow: 0 0 18px var(--gold-glow); background: #232a40; }

/* ---- main column ---- */
main { padding: 0 clamp(1.2rem, 4vw, 3rem) 0; max-width: 1500px; }
main > section { scroll-margin-top: 1rem; }

/* ============================================================
   HERO — asymmetric two-column
   ============================================================ */
.hero { display: grid; grid-template-columns: 1.35fr 1fr; gap: 3rem; align-items: center; padding-top: clamp(2rem, 6vw, 4rem); padding-bottom: clamp(2rem, 6vw, 4rem); }
.hero-left { text-align: left; }
.hero-right { text-align: center; }
.hero .whoami { font-family: var(--font-mono); font-size: 0.92rem; color: var(--ink-faint); margin-bottom: 1rem; }
.hero .whoami .path { color: var(--gold); }
.hero h1 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: 0.02em; margin-bottom: 1rem; color: var(--ink); min-height: 1.1em; line-height: 1.1; }
.hero h1 .type-target { color: var(--gold); }
.hero-subtitle { font-family: var(--font-body); font-size: clamp(1rem, 2vw, 1.15rem); font-style: italic; color: var(--ink-soft); margin-bottom: 1.4rem; }
.hero-hint { font-family: var(--font-body); font-size: 1rem; font-style: italic; color: var(--ink-faint); }
.hero-hint::before { content: '✦ '; color: var(--gold); font-style: normal; }
.ascii-banner { font-family: var(--font-mono); font-size: clamp(0.5rem, 1.2vw, 0.72rem); line-height: 1.15; color: var(--gold); white-space: pre; margin: 0 0 1.6rem; display: block; overflow: hidden; text-shadow: 0 1px 0 rgba(255,255,255,0.4); }
.hero-stats { display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap; }
.stat { text-align: center; }
.stat-number { display: block; font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; color: var(--gold); line-height: 1; text-shadow: 0 2px 0 rgba(255,255,255,0.4); }
.stat-label { font-family: var(--font-body); font-size: 0.84rem; font-style: italic; color: var(--ink-soft); }

/* ============================================================
   CHAPTER HEADERS
   ============================================================ */
.chapter-head { margin-bottom: 2rem; }
.section-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: 0.03em; color: var(--ink); display: flex; align-items: baseline; gap: 0.9rem; padding-bottom: 0.6rem; position: relative; }
.section-title::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: var(--border); }
.section-title::before { content: ''; position: absolute; bottom: -2px; left: 0; width: 130px; height: 2px; background: var(--gold); z-index: 1; }
.section-title .zone-num { font-size: 1.05rem; color: var(--gold); }
.section-title .zone-count { margin-left: auto; font-family: var(--font-body); font-size: 0.85rem; font-style: italic; font-weight: 400; color: var(--ink-faint); white-space: nowrap; }
.section-sub { font-family: var(--font-body); font-size: 0.98rem; font-style: italic; color: var(--ink-soft); margin-top: 0.7rem; }
.section-sub::before { content: '✦  '; color: var(--gold); font-style: normal; }

/* ============================================================
   PROJECTS — bento
   ============================================================ */
.projects-section { padding: 3.5rem 0; }
.filter-bar { display: flex; gap: 0.5rem; margin-bottom: 1.8rem; flex-wrap: wrap; }
.filter-btn { background: var(--card); border: 1px solid var(--border-strong); color: var(--ink-soft); padding: 0.45rem 1.1rem; border-radius: 3px; font-family: var(--font-body); font-size: 0.92rem; cursor: pointer; transition: all var(--transition); }
.filter-btn:hover { border-color: var(--gold); color: var(--ink); }
.filter-btn.active { background: var(--gold); border-color: var(--gold); color: #fff8e8; box-shadow: 0 4px 14px var(--gold-glow); }
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
.project-card { cursor: pointer; position: relative; background: linear-gradient(180deg, var(--card), var(--card-hover)); border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 2px 10px var(--shadow); padding: 1.4rem; transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
.project-card:hover { border-color: var(--gold); box-shadow: 0 8px 26px var(--shadow), 0 0 0 1px var(--gold-glow); transform: translateY(-3px); }
.project-card.featured { grid-column: span 2; border-left: 4px solid var(--gold); }
.project-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.7rem; }
.project-name { font-family: var(--font-display); font-size: 1.28rem; font-weight: 700; color: var(--ink); line-height: 1.15; }
.project-card.featured .project-name { font-size: 1.5rem; }
.rarity { font-family: var(--font-display); font-size: 0.56rem; font-weight: 700; padding: 0.32rem 0.55rem; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; border: 1px solid transparent; }
.rarity-common { background: rgba(91,97,117,0.14); color: var(--ink-soft); border-color: rgba(91,97,117,0.3); }
.rarity-rare { background: rgba(42,127,122,0.14); color: var(--teal); border-color: rgba(42,127,122,0.4); }
.rarity-epic { background: rgba(109,74,158,0.14); color: var(--violet); border-color: rgba(109,74,158,0.4); }
.rarity-legendary { background: rgba(217,165,32,0.18); color: #a5770f; border-color: rgba(217,165,32,0.55); box-shadow: 0 0 12px var(--gold-glow); }
.project-desc { font-size: 0.94rem; color: var(--ink-soft); margin-bottom: 0.8rem; line-height: 1.55; }
.project-quip { font-family: var(--font-body); font-size: 1rem; font-style: italic; color: var(--ink-faint); margin-bottom: 0.9rem; }
.project-tech { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tech-tag { font-family: var(--font-mono); font-size: 0.72rem; padding: 0.22rem 0.55rem; background: rgba(176,130,31,0.08); border: 1px solid var(--border); border-radius: 3px; color: var(--ink-soft); }

/* ============================================================
   INFRASTRUCTURE — node strip
   ============================================================ */
.infra-section { padding: 3.5rem 0; }
.infra-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
.infra-card { cursor: pointer; display: flex; gap: 1rem; align-items: flex-start; position: relative; background: linear-gradient(180deg, var(--card), var(--card-hover)); border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 2px 10px var(--shadow); padding: 1.3rem; transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
.infra-card:hover { border-color: var(--gold); box-shadow: 0 8px 26px var(--shadow), 0 0 0 1px var(--gold-glow); transform: translateY(-3px); }
.infra-icon { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--gold); min-width: 58px; text-align: center; line-height: 1; padding-top: 0.2rem; }
.infra-icon::before { content: '✦ '; font-size: 0.8rem; color: var(--ink-faint); }
.infra-body { flex: 1; min-width: 0; }
.infra-body h3 { font-family: var(--font-display); font-size: 1.18rem; font-weight: 700; margin-bottom: 0.35rem; color: var(--ink); }
.infra-body > p { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 0.9rem; line-height: 1.5; }
.infra-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.6rem; }
.tag { font-family: var(--font-body); font-size: 0.82rem; padding: 0.22rem 0.6rem; background: rgba(42,127,122,0.1); border: 1px solid var(--border); border-radius: 3px; color: var(--ink-soft); cursor: pointer; transition: all var(--transition); }
.tag:hover { border-color: var(--teal); color: var(--teal); }
.infra-node { font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-faint); }
.infra-node::before { content: '● '; color: var(--teal); }

/* ============================================================
   RISK — numbered codex
   ============================================================ */
.risk-section { padding: 3.5rem 0; }
.risk-intro { font-size: 1.05rem; font-style: italic; color: var(--ink-soft); margin-top: 0.7rem; max-width: 820px; line-height: 1.6; }
.risk-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem 2.5rem; }
.risk-card { cursor: pointer; display: flex; gap: 1.1rem; align-items: flex-start; position: relative; background: linear-gradient(180deg, var(--card), var(--card-hover)); border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 2px 8px var(--shadow); padding: 1.2rem 1.3rem; transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
.risk-card:hover { border-color: var(--gold); box-shadow: 0 8px 24px var(--shadow); transform: translateY(-2px); }
.risk-num { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--gold); min-width: 46px; line-height: 1; opacity: 0.85; }
.risk-body { flex: 1; min-width: 0; }
.risk-body h3 { font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; margin-bottom: 0.45rem; color: var(--ink); }
.risk-body > p { font-size: 0.92rem; color: var(--ink-soft); margin-bottom: 0.9rem; line-height: 1.55; }
.risk-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ============================================================
   EVERQUEST
   ============================================================ */
.eq-section { padding: 3.5rem 0; }
.eq-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.1rem; }
.eq-card { cursor: pointer; position: relative; background: linear-gradient(180deg, var(--card), var(--card-hover)); border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 2px 10px var(--shadow); padding: 1.5rem; margin-bottom: 1.1rem; transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
.eq-card:hover { border-color: var(--gold); box-shadow: 0 8px 26px var(--shadow), 0 0 0 1px var(--gold-glow); transform: translateY(-3px); }
.eq-card h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; margin-bottom: 0.4rem; color: var(--ink); }
.eq-detail { font-family: var(--font-mono); font-size: 0.8rem; color: var(--gold); margin-bottom: 0.7rem; }
.eq-card > p { font-size: 0.92rem; color: var(--ink-soft); margin-bottom: 1rem; line-height: 1.55; }
.eq-stats { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.eq-stat { font-family: var(--font-body); font-size: 0.84rem; padding: 0.28rem 0.65rem; background: rgba(176,130,31,0.1); border: 1px solid rgba(176,130,31,0.4); border-radius: 3px; color: #8a6410; cursor: pointer; transition: all var(--transition); }
.eq-stat:hover { background: rgba(176,130,31,0.2); }
.eq-sidebar { display: flex; flex-direction: column; gap: 1.1rem; }
.eq-mini-card { cursor: pointer; position: relative; background: linear-gradient(180deg, var(--card), var(--card-hover)); border: 1px solid var(--border); border-left: 4px solid var(--teal); border-radius: 4px; box-shadow: 0 2px 10px var(--shadow); padding: 1.1rem; transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
.eq-mini-card:hover { border-color: var(--teal); box-shadow: 0 8px 24px var(--shadow); transform: translateY(-3px); }
.eq-mini-card h4 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; margin-bottom: 0.35rem; color: var(--ink); }
.eq-mini-card > p { font-size: 0.86rem; color: var(--ink-soft); margin-bottom: 0.4rem; }
.eq-server-status { font-family: var(--font-mono); font-size: 0.74rem; color: var(--teal); }
.eq-server-status::before { content: '● '; animation: pulse 2s infinite; }

/* ============================================================
   ABOUT — two-column
   ============================================================ */
.about-section { padding: 3.5rem 0; }
.about-card { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2.5rem; position: relative; background: linear-gradient(180deg, var(--card), var(--card-hover)); border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 2px 12px var(--shadow); padding: 2rem; }
.about-bio-col h3 { font-family: var(--font-display); font-size: 2rem; font-weight: 700; margin-bottom: 1.2rem; color: var(--ink); }
.about-bio-col h3::after { content: ''; display: block; width: 120px; height: 2px; margin-top: 0.6rem; background: linear-gradient(90deg, var(--gold), transparent); }
.about-bio { font-size: 1rem; color: var(--ink-soft); margin-bottom: 1rem; line-height: 1.7; }
.about-bio-col .about-bio:first-of-type::first-letter { font-family: var(--font-display); font-size: 3.4rem; float: left; line-height: 0.8; padding-right: 0.5rem; color: var(--gold); font-weight: 700; }
.about-stack-col { border-left: 1px solid var(--border); padding-left: 2.5rem; }
.stack-grid { display: grid; grid-template-columns: 1fr; gap: 1.4rem; }
.stack-category h4 { font-family: var(--font-display); font-size: 0.72rem; font-weight: 700; color: var(--gold); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.6rem; }
.stack-category h4::before { content: '✦ '; }
.stack-items { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.stack-badge { font-family: var(--font-body); font-size: 0.86rem; padding: 0.35rem 0.75rem; background: var(--card); border: 1px solid var(--border-strong); border-radius: 4px; color: var(--ink-soft); transition: all var(--transition); cursor: pointer; }
.stack-badge:hover { border-color: var(--gold); color: var(--gold); background: rgba(217,165,32,0.1); }

/* ============================================================
   FOOTER — multi-column
   ============================================================ */
footer { position: relative; border-top: 1px solid var(--border); background: rgba(226, 211, 180, 0.72); padding: 2.5rem 0 1.4rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 2rem; max-width: 1100px; margin: 0 auto; padding: 0 clamp(1.2rem, 4vw, 3rem); }
.footer-col h4 { font-family: var(--font-display); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.8rem; }
.footer-brand-col .footer-prompt { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--ink); display: block; margin-bottom: 0.4rem; }
.footer-brand-col .footer-prompt::before { content: '✦ '; color: var(--gold); }
.footer-line { font-family: var(--font-body); font-size: 0.9rem; font-style: italic; color: var(--ink-soft); }
.footer-col a { display: block; color: var(--ink-soft); text-decoration: none; font-size: 0.92rem; padding: 0.15rem 0; transition: color var(--transition); }
.footer-col a:hover { color: var(--gold); }
.footer-stats { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; font-family: var(--font-body); font-size: 0.86rem; color: var(--ink-faint); }
.footer-stats span b { color: var(--gold); font-weight: 700; }
.footer-bar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; max-width: 1100px; margin: 1.6rem auto 0; padding: 1rem clamp(1.2rem, 4vw, 3rem) 0; border-top: 1px solid var(--border); }

/* ============================================================
   TERMINAL — scrying glass
   ============================================================ */
#terminal { position: fixed; bottom: 1rem; right: 1rem; z-index: 999; width: min(600px, calc(100vw - 2rem)); height: 460px; background: #171b28; border: 1px solid var(--gold); border-radius: 4px; box-shadow: 0 14px 50px rgba(40,30,10,0.5); display: none; flex-direction: column; overflow: hidden; }
#terminal.open { display: flex; }
#terminal.minimized { height: auto; }
#terminal.minimized .term-body { display: none; }
.titlebar { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.9rem; border-bottom: 1px solid #333a52; font-family: var(--font-mono); font-size: 0.74rem; color: #8b93b4; letter-spacing: 0.04em; user-select: none; background: #20263a; }
.titlebar .dots { display: flex; gap: 0.35rem; }
.titlebar .dots i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.titlebar .dots i:nth-child(1) { background: var(--red); }
.titlebar .dots i:nth-child(2) { background: var(--gold-bright); }
.titlebar .dots i:nth-child(3) { background: var(--teal); }
.titlebar .path { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.titlebar .term-ctrl { display: flex; gap: 0.3rem; }
.term-ctrl-btn { background: none; border: 1px solid #3a4260; color: #8b93b4; font-family: var(--font-mono); font-size: 0.9rem; line-height: 1; width: 22px; height: 22px; cursor: pointer; border-radius: 3px; transition: all var(--transition); padding: 0; }
.term-ctrl-btn:hover { color: var(--gold-bright); border-color: var(--gold); }
#terminal .term-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; padding: 0.8rem; gap: 0.4rem; }
#terminal .term-out { flex: 1; overflow-y: auto; font-family: var(--font-mono); font-size: 1rem; line-height: 1.4; }
#terminal .term-line { white-space: pre-wrap; word-break: break-word; }
#terminal .term-line.cmd { color: #9aa3c4; }
#terminal .term-line.out { color: #d9d2be; }
#terminal .term-line.err { color: #e08a7a; }
#terminal .term-line.gold { color: var(--gold-bright); }
#terminal .term-line.accent { color: #7fd0c0; }
#terminal .term-input-row { display: flex; gap: 0.5rem; align-items: center; border-top: 1px solid #333a52; padding-top: 0.5rem; }
#terminal .term-prompt { font-family: var(--font-mono); font-size: 1rem; color: var(--gold-bright); white-space: nowrap; }
#terminal input { flex: 1; background: transparent; border: none; outline: none; font-family: var(--font-mono); font-size: 1rem; color: #e8e0cc; }

/* ============================================================
   POPUPS
   ============================================================ */
.levelup-popup { position: fixed; inset: 0; z-index: 9997; display: none; align-items: center; justify-content: center; background: rgba(23,27,40,0.82); }
.levelup-popup.show { display: flex; }
.levelup-content { text-align: center; animation: levelUpPulse 0.6s ease; }
@keyframes levelUpPulse { 0% { transform: scale(0.5); opacity: 0; } 50% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
.levelup-content .levelup-text { font-family: var(--font-display); font-size: clamp(1.2rem, 4vw, 1.8rem); font-weight: 700; letter-spacing: 0.1em; color: var(--gold-bright); text-shadow: 0 0 30px var(--gold-glow); margin-bottom: 0.6rem; }
.levelup-content .levelup-level { font-family: var(--font-display); font-size: clamp(3.5rem, 12vw, 6rem); font-weight: 700; color: #fff6df; text-shadow: 0 0 40px var(--gold-glow); line-height: 1; }
.levelup-content .levelup-title { font-family: var(--font-body); font-size: 1rem; font-style: italic; color: #e8d9b8; margin-top: 0.6rem; letter-spacing: 0.08em; }
.xp-gain-popup { position: fixed; z-index: 9996; pointer-events: none; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: var(--gold); text-shadow: 0 1px 3px rgba(255,255,255,0.6); animation: xpFloat 1.2s ease forwards; }
@keyframes xpFloat { 0% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-60px) scale(1.3); } }
.encounter-toast { position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%); z-index: 9995; background: linear-gradient(180deg, var(--card), var(--card-hover)); border: 1px solid var(--gold); box-shadow: 0 8px 26px var(--shadow); border-radius: 4px; padding: 0.75rem 1.2rem; font-family: var(--font-body); font-size: 1.02rem; color: var(--ink); max-width: min(90vw, 520px); text-align: center; animation: encounterIn 0.3s ease, encounterOut 0.4s ease 3.2s forwards; }
.encounter-toast::before { content: '✦ '; color: var(--gold); }
.encounter-toast .enc-xp { color: var(--gold); font-family: var(--font-display); font-size: 0.8rem; }
@keyframes encounterIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes encounterOut { to { opacity: 0; transform: translateX(-50%) translateY(10px); } }

/* blinking cursor */
.cursor { display: inline-block; width: 0.5em; height: 1em; background: var(--gold); margin-left: 3px; vertical-align: text-bottom; animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ============================================================
   MODAL
   ============================================================ */
.modal { display: none; position: fixed; inset: 0; background: rgba(23,27,40,0.6); z-index: 9996; align-items: center; justify-content: center; padding: 2rem; }
.modal.active { display: flex; }
.modal-content { position: relative; max-width: 640px; width: 100%; max-height: 85vh; overflow-y: auto; background: linear-gradient(180deg, var(--card), var(--card-hover)); border: 1px solid var(--gold); border-radius: 4px; box-shadow: 0 20px 60px rgba(40,30,10,0.5); padding: 1.9rem; }
.modal-close { position: absolute; top: 0.7rem; right: 1rem; background: none; border: none; color: var(--ink-soft); font-family: var(--font-body); font-size: 1.6rem; cursor: pointer; transition: color var(--transition); z-index: 2; }
.modal-close:hover { color: var(--crimson); }
#modal-body h3 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; margin-bottom: 0.4rem; color: var(--ink); }
#modal-body .modal-sub { font-family: var(--font-body); font-size: 0.82rem; color: var(--ink-faint); margin-bottom: 1rem; }
#modal-body p { font-size: 0.98rem; color: var(--ink-soft); margin-bottom: 1rem; line-height: 1.65; }
#modal-body .tech-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
#modal-body .tech-list span { font-family: var(--font-mono); font-size: 0.78rem; padding: 0.3rem 0.6rem; background: rgba(176,130,31,0.08); border: 1px solid var(--border); border-radius: 4px; color: var(--ink-soft); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  :root { --rail-w: 300px; }
  .eq-layout { grid-template-columns: 1fr; }
  .about-card { grid-template-columns: 1fr; }
  .about-stack-col { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 1.5rem; }
  .hero { grid-template-columns: 1fr; gap: 2rem; }
  .hero-right { order: -1; }
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); box-shadow: none; }
  .character-panel { display: none; }
  .rail-nav { flex-direction: row; flex-wrap: wrap; gap: 0.3rem; }
  .nav-link { border-left: none; border-bottom: 2px solid transparent; padding: 0.4rem 0.6rem; }
  .nav-link:hover { border-bottom-color: var(--gold); }
  .rail-foot { flex-direction: row; align-items: center; justify-content: space-between; }
  .projects-grid { grid-template-columns: 1fr; }
  .project-card.featured { grid-column: span 1; }
  .infra-grid { grid-template-columns: 1fr; }
  .risk-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  #terminal { width: calc(100vw - 1rem); height: 320px; }
}

@media (max-width: 520px) {
  .hero h1 { font-size: 1.9rem; }
  .hero-stats { gap: 1.4rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bar { flex-direction: column; align-items: flex-start; }
  .section-title .zone-count { display: none; }
}
