/* =========================================================================
   PIT ROT — marketing site
   Torch-lit amber on dark stone. Palette lifted from the game's UITheme /
   menuPalette (candle). Brass text, ember glow, gold reserved for moments,
   rot-green used sparingly for "the Rot".
   ========================================================================= */

/* ---- Fonts (self-hosted; license-clean, same faces the game uses) -------- */
@font-face {
  font-family: 'Cinzel';
  src: url('/fonts/cinzel-var.woff2') format('woff2-variations'),
       url('/fonts/cinzel-var.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Crimson Text';
  src: url('/fonts/crimson-text-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Crimson Text';
  src: url('/fonts/crimson-text-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Crimson Text';
  src: url('/fonts/crimson-text-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ---- Design tokens ------------------------------------------------------- */
:root {
  --bg:        #120d09;
  --bg-deep:   #0b0704;
  --panel:     #1a1410;
  --panel-2:   #211a13;
  --panel-edge:#0d0905;

  --ink:       #c7b377;  /* brass — body */
  --ink-bone:  #e6d9b0;  /* bone — headings highlight */
  --ink-pale:  #c0a060;
  --ink-dim:   #9a8147;  /* muted brass */
  --etch:      #6f571f;  /* engraved labels */

  --amber:     #c97f33;  /* primary accent */
  --amber-hi:  #ffd9a0;
  --amber-dim: #7d4e1f;
  --ember:     #ffc83e;  /* warm glow */
  --gold:      #ffd700;  /* hot — moments only */

  --rot:       #7da654;  /* the Rot — sparingly */
  --rot-bright:#a9d77f;
  --blood:     #d4543f;  /* death / loss accents */

  --line:      rgba(199, 179, 119, 0.18);
  --line-strong: rgba(199, 179, 119, 0.34);

  --font-display: 'Cinzel', 'Trajan Pro', 'Times New Roman', Georgia, serif;
  --font-body:    'Crimson Text', Georgia, 'Times New Roman', serif;

  --maxw: 1120px;
  --ease: cubic-bezier(0.16, 0.84, 0.44, 1);
}

/* ---- Reset / base -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px; /* clear the sticky top bar on anchor jumps */
  -webkit-text-size-adjust: 100%;
  background: var(--bg-deep);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.22rem);
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Atmosphere: amber pool up top, darkening + vignette toward the edges. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(130% 70% at 50% -12%, rgba(201, 127, 51, 0.26), transparent 58%),
    radial-gradient(90% 60% at 50% -4%, rgba(255, 200, 62, 0.10), transparent 52%),
    radial-gradient(150% 120% at 50% 50%, transparent 52%, rgba(5, 3, 2, 0.82) 100%),
    linear-gradient(180deg, #160f0a 0%, var(--bg) 30%, var(--bg-deep) 100%);
}

/* Film grain. Static (no flicker) — disabled cost is trivial. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--amber-hi); text-decoration: none; }
a:hover { color: var(--gold); }

/* Focus visibility for keyboard users */
:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: rgba(201, 127, 51, 0.35); color: var(--ink-bone); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--panel-2);
  color: var(--ink-bone);
  padding: 0.7em 1.1em;
  border: 1px solid var(--amber);
  z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---- Layout helpers ------------------------------------------------------ */
.wrap { width: min(var(--maxw), 100% - 2.5rem); margin-inline: auto; }
.section { padding-block: clamp(3.5rem, 8vw, 7rem); position: relative; }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.measure { max-width: 64ch; }
.center { text-align: center; margin-inline: auto; }

/* ---- Type ---------------------------------------------------------------- */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  color: var(--ink-bone);
  letter-spacing: 0.01em;
}
h2 {
  font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem);
  font-weight: 800;
}
h3 {
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.5rem);
  font-weight: 600;
  color: var(--amber-hi);
  letter-spacing: 0.04em;
}
p + p { margin-top: 1rem; }
strong { color: var(--ink-bone); font-weight: 600; }
em { color: var(--ink-pale); }

.lede {
  font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.5rem);
  color: var(--ink-pale);
  line-height: 1.6;
}

/* Eyebrow label with an ember diamond — echoes the game's carved banners. */
.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--amber);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: '';
  width: 7px; height: 7px;
  background: var(--ember);
  transform: rotate(45deg);
  box-shadow: 0 0 10px rgba(255, 200, 62, 0.7);
  flex: none;
}

/* A brass hairline rule with a centered ember diamond. */
.rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.6rem 0;
  color: var(--ember);
}
.rule::before, .rule::after {
  content: '';
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}
.rule .diamond { width: 8px; height: 8px; background: var(--ember); transform: rotate(45deg); box-shadow: 0 0 10px rgba(255,200,62,0.6); }

.accent { color: var(--amber); }
.rot { color: var(--rot); }
.bone { color: var(--ink-bone); }
.blood { color: var(--blood); }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  --glow: rgba(255, 200, 62, 0);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.96rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.95em 1.7em;
  color: var(--ink-bone);
  background: linear-gradient(180deg, #241910, #150e07);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease),
              box-shadow 0.35s var(--ease), transform 0.15s var(--ease);
  box-shadow: inset 0 1px 0 rgba(255, 217, 160, 0.08), 0 0 18px var(--glow);
}
.btn:hover { border-color: var(--amber); color: var(--amber-hi); --glow: rgba(201, 127, 51, 0.22); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  color: var(--bg-deep);
  background: linear-gradient(180deg, var(--ember) 0%, var(--amber) 60%, var(--amber-dim) 100%);
  border-color: var(--amber-hi);
  text-shadow: 0 1px 0 rgba(255, 233, 196, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 240, 210, 0.55), 0 6px 26px rgba(201, 127, 51, 0.28);
}
.btn--primary:hover {
  color: #100a05;
  background: linear-gradient(180deg, #ffe08a 0%, var(--ember) 55%, var(--amber) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 245, 220, 0.7), 0 8px 34px rgba(255, 200, 62, 0.4);
}
.btn .chev { transition: transform 0.25s var(--ease); }
.btn:hover .chev { transform: translateX(3px); }

/* ---- Top bar ------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(7px);
  background: linear-gradient(180deg, rgba(11, 7, 4, 0.82), rgba(11, 7, 4, 0.32));
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.7rem;
}
.topbar__brand {
  display: inline-flex;
  align-items: center;
  /* Reserve the logo's height so the bar doesn't reflow when it fades in. */
  min-height: 38px;
}
/* The duotone wordmark only appears once you've scrolled past the hero logo. */
.topbar__logo {
  height: 38px;
  width: auto;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  pointer-events: none;
}
.topbar.is-scrolled .topbar__logo { opacity: 1; transform: none; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) {
  .topbar__logo { transition: opacity 0.2s linear; transform: none; }
}
.topbar__nav { display: flex; align-items: center; gap: 1.6rem; }
.topbar__nav a.navlink {
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.topbar__nav a.navlink:hover { color: var(--amber-hi); }
.topbar .btn { padding: 0.6em 1.15em; font-size: 0.8rem; }
@media (max-width: 760px) {
  .topbar__nav .navlink { display: none; }
}

/* ---- Hero ---------------------------------------------------------------- */
.hero {
  min-height: clamp(640px, 92vh, 1000px);
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: clamp(3rem, 8vh, 6rem);
  position: relative;
}
.hero__inner { display: grid; justify-items: center; gap: 1.5rem; width: min(760px, 100%); }
.hero__logo {
  width: min(660px, 88vw);
}
.hero__tagline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 1rem + 2.4vw, 2.5rem);
  letter-spacing: 0.16em;
  color: var(--ink-bone);
  text-transform: uppercase;
  max-width: 100%;
  overflow-wrap: break-word;
}
.hero__tagline .sep { color: var(--amber); margin-inline: 0.15em; }
.hero__pitch { max-width: 60ch; color: var(--ink-pale); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin-top: 0.6rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  padding: 0.4em 0.95em;
  border-radius: 999px;
  background: rgba(26, 20, 16, 0.6);
}
.badge .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--rot);
  box-shadow: 0 0 8px rgba(125, 166, 84, 0.9);
}

/* Scroll hint */
.scrolldown {
  position: absolute;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--amber);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-family: var(--font-display);
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  opacity: 0.7;
}
.scrolldown .arrow { width: 1px; height: 34px; background: linear-gradient(var(--amber), transparent); animation: descend 2.4s var(--ease) infinite; }
@keyframes descend { 0% { transform: translateY(-6px); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }

/* ---- Section heading block ----------------------------------------------- */
.heading { margin-bottom: 2.6rem; }
.heading--center { text-align: center; }
.heading--center .eyebrow { justify-content: center; }
.heading p { color: var(--ink-pale); margin-top: 0.8rem; }

/* ---- Panels / cards ------------------------------------------------------ */
.panel {
  background:
    linear-gradient(180deg, rgba(33, 26, 19, 0.9), rgba(18, 13, 9, 0.92));
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: clamp(1.5rem, 3vw, 2.4rem);
  box-shadow: inset 0 1px 0 rgba(255, 217, 160, 0.05), 0 18px 40px rgba(0, 0, 0, 0.35);
  position: relative;
}
.panel::before {
  /* faint engraved inner keyline */
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(111, 87, 31, 0.18);
  border-radius: 3px;
  pointer-events: none;
}

.grid { display: grid; gap: 1.4rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 880px) { .grid--3 { grid-template-columns: 1fr; } .grid--2 { grid-template-columns: 1fr; } }

/* Feature card (pillars / death-loop facets) */
.feature { display: grid; gap: 0.7rem; align-content: start; }
.feature__icon {
  width: 38px; height: 38px;
  color: var(--amber);
  filter: drop-shadow(0 0 8px rgba(201, 127, 51, 0.3));
}
.feature h3 { color: var(--ink-bone); }
.feature p { color: var(--ink); font-size: 0.98em; }

/* ---- "What is" split ----------------------------------------------------- */
.split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

.lore-quote {
  font-style: italic;
  font-size: clamp(1.5rem, 1.1rem + 1.75vw, 2.4rem);
  line-height: 1.45;
  color: var(--rot-bright);
  border-left: 2px solid var(--rot);
  padding-left: 1.4rem;
}
.lore-quote .drop { color: var(--ember); }

/* ---- Death loop motto ---------------------------------------------------- */
/* `.heading .motto` outranks the `.heading p` colour rule above. */
.heading .motto, .motto {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 1rem + 1.8vw, 2.1rem);
  letter-spacing: 0.04em;
  color: var(--blood);
  text-shadow: 0 0 26px rgba(212, 84, 63, 0.25);
  margin: 0 auto;
  max-width: 22ch;
  line-height: 1.3;
}

/* ---- The descent — depth shaft ------------------------------------------- */
.shaft {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: clamp(1.2rem, 3vw, 2.2rem);
  margin-top: 2.4rem;
}
/* The shaft itself: daylight at the surface, fading to dark green Rot, then near-black. */
.shaft__rail {
  border-radius: 8px;
  background: linear-gradient(180deg, #c79a52 0%, #6a4a22 16%, #2c3a1f 52%, #0f1a0c 78%, #070806 100%);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.6), 0 0 26px rgba(125, 166, 84, 0.12);
}
.shaft__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.6rem;
}
.shaft__steps li { position: relative; }
.shaft__depth {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--amber);
  margin-bottom: 0.3rem;
}
.shaft__steps li:last-child .shaft__depth { color: var(--rot, #7da654); }
.shaft__steps p { margin: 0; font-size: 1rem; color: var(--ink); }

/* ---- The Rot triangle ---------------------------------------------------- */
.rot-block { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
@media (max-width: 900px) { .rot-block { grid-template-columns: 1fr; } }
.rot-art {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(10, 7, 4, 0.6);
  padding: 0.5rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.rot-tracks { display: grid; gap: 1.1rem; margin-top: 1.4rem; }
.rot-track { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: baseline; padding-left: 1rem; border-left: 2px solid var(--rot); }
.rot-track .name { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.08em; color: var(--rot-bright); white-space: nowrap; }
.rot-track p { font-size: 0.96rem; color: var(--ink); }

/* ---- The fallen — boss cards (item-tooltip styling) ---------------------- */
.fallen { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; }
.boss {
  background: linear-gradient(180deg, rgba(20, 14, 9, 0.95), rgba(10, 7, 4, 0.95));
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 1.2rem 1.3rem 1.3rem;
  position: relative;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.boss:hover { border-color: var(--amber); transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0,0,0,0.45), 0 0 24px rgba(201,127,51,0.12); }
.boss__depth { font-family: var(--font-display); font-size: 0.7rem; letter-spacing: 0.2em; color: var(--etch); text-transform: uppercase; }
.boss__name { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; color: var(--gold); margin: 0.25rem 0 0.5rem; letter-spacing: 0.02em; }
.boss__epithet { font-size: 0.96rem; color: var(--ink-pale); font-style: italic; }

/* ---- Inspirations -------------------------------------------------------- */
.inspirations { display: flex; flex-wrap: wrap; gap: 0.7rem 1rem; justify-content: center; }
.chip {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--ink-pale);
  border: 1px solid var(--line);
  padding: 0.5em 1.1em;
  border-radius: 999px;
  background: rgba(26, 20, 16, 0.5);
}

/* ---- Signup -------------------------------------------------------------- */
.signup { position: relative; }
.signup__panel {
  max-width: 680px;
  margin-inline: auto;
  text-align: center;
  padding: clamp(2rem, 5vw, 3.4rem);
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(201, 127, 51, 0.16), transparent 60%),
    linear-gradient(180deg, rgba(33, 26, 19, 0.95), rgba(13, 9, 6, 0.96));
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.signup__form { margin-top: 1.6rem; }
.field-row { display: flex; gap: 0.7rem; }
@media (max-width: 560px) { .field-row { flex-direction: column; } }
.field-row input[type="email"] {
  flex: 1;
  font-family: var(--font-body);
  font-size: 1.08rem;
  color: var(--ink-bone);
  background: rgba(8, 5, 3, 0.7);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 0.85em 1.1em;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  min-width: 0;
}
.field-row input::placeholder { color: var(--etch); }
.field-row input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(201, 127, 51, 0.18); }
.signup__form .btn { white-space: nowrap; }

/* honeypot — visually & a11y hidden, still in the DOM for bots */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

.form-status {
  min-height: 1.4em;
  margin-top: 1rem;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
}
.form-status.is-ok { color: var(--rot-bright); }
.form-status.is-err { color: var(--blood); }
.form-status.is-pending { color: var(--ink-dim); }

.descent__hint { margin-top: 1.2rem; color: var(--ink-dim); font-style: italic; }

.privacy { margin-top: 1.1rem; font-size: 0.82rem; color: var(--etch); letter-spacing: 0.02em; }

.signup__alt { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: 0.92rem; color: var(--ink-dim); }
.signup__alt a { font-weight: 600; }

/* ---- Footer -------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); padding-block: 2.6rem; color: var(--ink-dim); }
.footer__inner { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.footer__brand { font-family: var(--font-display); font-weight: 800; letter-spacing: 0.3em; color: var(--ink-pale); text-transform: uppercase; font-size: 0.9rem; }
.footer small { color: var(--etch); font-size: 0.82rem; letter-spacing: 0.03em; }
.footer__links { display: flex; gap: 1.3rem; }
.footer__links a { font-family: var(--font-display); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); }
.footer__links a:hover { color: var(--amber-hi); }

/* ---- Reveal on scroll ---------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .scrolldown .arrow { animation: none; }
  .badge .pulse { box-shadow: 0 0 8px rgba(125,166,84,0.9); }
}

/* ---- noscript notice ----------------------------------------------------- */
.noscript {
  text-align: center;
  background: rgba(212, 84, 63, 0.1);
  border: 1px solid rgba(212, 84, 63, 0.4);
  color: var(--ink-bone);
  padding: 0.9em 1.2em;
  border-radius: 3px;
  margin-top: 1rem;
}

/* ---- Sign-in modal ------------------------------------------------------- */
body.modal-open { overflow: hidden; }
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 5, 3, 0.8);
  backdrop-filter: blur(3px);
}
.modal__dialog {
  position: relative;
  width: min(420px, 100%);
  background: linear-gradient(180deg, #181009, #0d0905);
  border: 1px solid var(--amber-dim);
  border-radius: 8px;
  padding: 2.6rem 2rem 2rem;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 217, 160, 0.06);
  animation: modal-in 0.28s var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.8rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--ink-dim);
}
.modal__close:hover { color: var(--amber-hi); }
.modal__title { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin: 0.4rem 0 0.7rem; }
.modal__lead { color: var(--ink-dim); font-size: 0.95rem; margin-bottom: 1.7rem; }
.modal__google { display: flex; align-items: center; justify-content: center; gap: 0.7rem; width: 100%; }
.modal__google .modal__g { flex: none; }
.modal__note { min-height: 1.2em; margin-top: 0.9rem; font-size: 0.85rem; color: var(--ink-dim); }
.modal__alt { margin-top: 1.3rem; font-size: 0.9rem; color: var(--ink-dim); }
.modal__email { width: 100%; justify-content: center; margin-top: 0.7rem; }
@media (prefers-reduced-motion: reduce) { .modal__dialog { animation: none; } }

/* ---- Account page (/account.html) ---------------------------------------- */
.acct-body { min-height: 100vh; display: flex; flex-direction: column; }
.acct-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.9rem;
}
.topbar__logo--static { opacity: 1; transform: none; pointer-events: auto; }
.acct-main { flex: 1; display: grid; place-items: center; padding: 2rem 1.25rem 4rem; }
.acct-card {
  width: min(440px, 100%);
  background: linear-gradient(180deg, #181009, #0d0905);
  border: 1px solid var(--amber-dim);
  border-radius: 8px;
  padding: 2.4rem 2rem 2rem;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 217, 160, 0.06);
}
.acct-title { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); margin: 0.4rem 0 0.7rem; }
.acct-lead { color: var(--ink-dim); font-size: 0.95rem; line-height: 1.5; margin-bottom: 1.6rem; }
.acct-form { display: flex; flex-direction: column; gap: 0.7rem; }
.acct-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink-bone);
  background: #0a0705;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 0.85em 1em;
}
.acct-input::placeholder { color: var(--etch); }
.acct-input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(201, 127, 51, 0.18); }
.acct-input--code { text-align: center; letter-spacing: 0.5em; font-size: 1.4rem; font-family: var(--font-display); }
.acct-input--key { text-align: center; letter-spacing: 0.18em; text-transform: uppercase; }
.acct-submit { width: 100%; justify-content: center; margin-top: 0.2rem; }
.acct-google { width: 100%; justify-content: center; }
.acct-or { display: flex; align-items: center; gap: 0.8rem; color: var(--etch); font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; margin: 1.1rem 0; }
.acct-or::before, .acct-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.acct-status { min-height: 1.2em; margin-top: 0.9rem; font-size: 0.88rem; }
.acct-status.is-ok { color: var(--rot-bright); }
.acct-status.is-err { color: var(--blood); }
.acct-status.is-pending { color: var(--ink-dim); }
.acct-alt { margin-top: 1.3rem; font-size: 0.9rem; color: var(--ink-dim); }

/* ===== download page ===== */
.dl-primary.is-disabled { opacity: 0.55; pointer-events: none; cursor: default; }
.dl-others { margin-top: 1.6rem; }
.dl-others__label { display: block; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 0.6rem; }
.dl-others__row { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }
.dl-other {
  padding: 0.45rem 1rem; border: 1px solid var(--line); border-radius: 8px;
  font-size: 0.9rem; color: var(--ink); text-decoration: none; transition: border-color 0.15s, color 0.15s;
}
.dl-other:hover { border-color: var(--rot-bright); color: var(--rot-bright); }

.acct-access { margin-top: 1.2rem; }
.acct-access__ok { color: var(--rot-bright); font-weight: 600; margin-bottom: 1rem; }
.acct-access__none { color: var(--ink-dim); line-height: 1.5; margin-bottom: 1rem; }

/* ===== Ported from the marketing build 2026-07-09: showcase + bestiary + loot/inventory ===== */
/* ---- Section showcase — full-bleed cinematic capture --------------------- */
/* Breaks out of the centered column to span the full viewport width. */
.showcase {
  position: relative;
  width: 100vw; margin-left: calc(50% - 50vw);
  margin-top: clamp(2.8rem, 5vw, 4.4rem);
  border-block: 1px solid var(--line-strong); overflow: hidden;
  background: #0a0705;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5);
}
.showcase img { width: 100%; height: auto; display: block; aspect-ratio: 2.5 / 1; max-height: 76vh; object-fit: cover; }
.showcase::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(130% 90% at 50% 42%, transparent 52%, rgba(6, 4, 2, 0.5)),
    linear-gradient(180deg, transparent 56%, rgba(6, 4, 2, 0.92) 100%);
}
.showcase figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  display: flex; align-items: center; gap: 0.7em;
  padding: 1.4rem clamp(1.6rem, 6vw, 5.5rem);
  font-family: var(--font-display); font-size: 0.84rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-bone);
}
.showcase figcaption::before { content: ''; width: 7px; height: 7px; flex: none; background: var(--ember); transform: rotate(45deg); box-shadow: 0 0 10px rgba(255, 194, 58, 0.7); }

/* ---- Bestiary / enemy roster --------------------------------------------------
   No frames. Things caught in your torchlight in the dark: the section sinks into a
   pool of black with the Rot seeping up from below, mist at the creatures' feet, and
   each is lit by its own torch halo. Signature: hover and your torch turns to one
   creature while the rest fall into the dark. Light, not chrome. */
#bestiary { position: relative; overflow: hidden; }
#bestiary::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(56% 50% at 50% 74%, rgba(224, 138, 52, 0.14), transparent 60%),
    radial-gradient(85% 44% at 50% 126%, rgba(142, 201, 92, 0.14), transparent 60%),
    radial-gradient(120% 108% at 50% 46%, transparent 30%, rgba(3, 2, 2, 0.84) 100%);
}
#bestiary > .wrap { position: relative; z-index: 1; }

/* Roster breaks wider than the text column (bigger creatures), centered with margin
   — not transform — so the .reveal fade-up still works. */
.roster {
  position: relative;
  width: min(1680px, 100vw - 2rem);
  margin-left: calc(50% - min(840px, 50vw - 1rem));
  display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(0.3rem, 0.9vw, 1rem);
  margin-top: 2.6rem; align-items: end;
}
@media (max-width: 1000px) { .roster { grid-template-columns: repeat(3, 1fr); row-gap: 2.8rem; } }
@media (max-width: 620px)  { .roster { grid-template-columns: repeat(2, 1fr); } }

/* mist the row rises from — also softens the uneven baselines */
.roster::before {
  content: ''; position: absolute; z-index: 0; left: -3%; right: -3%; bottom: 14%; height: 30%;
  background: linear-gradient(0deg, rgba(22, 17, 11, 0.6), rgba(22, 17, 11, 0.14) 55%, transparent);
  filter: blur(12px); pointer-events: none;
}

.enemy { position: relative; margin: 0; text-align: center; transition: opacity 0.35s var(--ease), filter 0.35s var(--ease); }
.enemy__stage { position: relative; }
.enemy__stage::before {                 /* torch halo behind the creature */
  content: ''; position: absolute; z-index: 0; inset: -6% -6% 2% -6%;
  background: radial-gradient(50% 50% at 50% 54%, rgba(224, 138, 52, 0.2), rgba(142, 201, 92, 0.06) 52%, transparent 72%);
  filter: blur(5px);
}
.enemy__img {
  position: relative; z-index: 1; display: block; width: 100%; height: auto;
  transform: scale(1.3); transform-origin: bottom center;
  filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.6));
  transition: transform 0.4s var(--ease), filter 0.4s var(--ease);
}
.enemy__name {
  position: relative; z-index: 1; font-family: var(--font-display); font-weight: 600;
  font-size: 0.94rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-bone); margin-top: 1.1rem;
}
.enemy__tag {
  display: block; margin-top: 0.35rem;
  font-family: var(--font-body); font-style: italic; font-size: 0.92rem;
  letter-spacing: 0.01em; text-transform: none; color: var(--ink-dim);
}
/* your torch turns to one — the rest fall into the dark */
.roster:hover .enemy { opacity: 0.32; filter: brightness(0.6) grayscale(0.35); }
.roster:hover .enemy:hover { opacity: 1; filter: none; }
.enemy:hover .enemy__img {
  transform: scale(1.4);
  filter: drop-shadow(0 20px 26px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 24px rgba(224, 138, 52, 0.38));
}
@media (prefers-reduced-motion: reduce) { .enemy:hover .enemy__img { transform: scale(1.3); } }
@media (hover: none) { .roster:hover .enemy { opacity: 1; filter: none; } } /* no dimming on touch */

/* ---- Loot: featured drop + inventory grid -------------------------------- */
.loot-feature, .loot-grid-block {
  display: grid; gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
  margin-top: clamp(2.6rem, 5vw, 4.4rem);
}
.loot-feature   { grid-template-columns: 0.82fr 1.18fr; }
.loot-grid-block { grid-template-columns: 1fr 1.15fr; }
@media (max-width: 820px) {
  .loot-feature, .loot-grid-block { grid-template-columns: 1fr; gap: 1.8rem; }
  .loot-grid-block .loot-copy { order: -1; }
}
.loot-copy__h {
  font-family: var(--font-display); font-weight: 800; color: var(--ink-bone);
  font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.4rem); line-height: 1.05; margin: 0.25rem 0 0.8rem;
}
.loot-copy p { color: var(--ink); max-width: 46ch; }

/* featured rotating drop — no frame; lit on a torch-lit plinth */
.loot-item { margin: 0; }
.loot-item__stage {
  position: relative; aspect-ratio: 7 / 10; max-width: 400px; margin-inline: auto;
  display: grid; place-items: center;
  background:
    radial-gradient(58% 42% at 50% 90%, rgba(224, 138, 52, 0.16), transparent 70%),
    radial-gradient(60% 55% at 50% 42%, rgba(224, 138, 52, 0.10), transparent 72%);
}
.loot-item__stage::after {
  content: ''; position: absolute; bottom: 6%; left: 50%; transform: translateX(-50%);
  width: 54%; height: 16px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.6), transparent);
}
.loot-item__img {
  position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.6));
}

/* the pack — a grid you solve */
.invgrid {
  aspect-ratio: 5 / 4;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line-strong); border-radius: 5px; overflow: hidden;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 217, 160, 0.05);
  background:
    linear-gradient(rgba(219, 200, 140, 0.09) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(90deg, rgba(219, 200, 140, 0.09) 1px, transparent 1px) 0 0 / 20% 100%,
    linear-gradient(180deg, rgba(24, 18, 11, 0.75), rgba(8, 5, 3, 0.8));
}
.invitem {
  margin: 3px; border-radius: 3px; position: relative; cursor: pointer;
  min-width: 0; min-height: 0;                    /* keep tall sprites inside their footprint */
  display: flex; align-items: center; justify-content: center; padding: 6%;
  border: 1px solid rgba(219, 200, 140, 0.14);    /* faint footprint outline; grid shows behind */
  background: transparent;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.invitem:hover, .invitem:focus-visible {
  outline: none; border-color: var(--amber);
  background: rgba(224, 138, 52, 0.06);
  box-shadow: inset 0 0 16px rgba(224, 138, 52, 0.14), 0 0 0 1px var(--amber);
}
.invitem img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55)); }

/* game-style item tooltip — fixed position (escapes the grid), shown on hover / focus / tap */
.item-tip {
  position: fixed; z-index: 90; width: 232px; padding: 0.9rem 1rem 1rem;
  background: linear-gradient(180deg, rgba(20, 14, 9, 0.98), rgba(9, 6, 4, 0.98));
  border: 1px solid var(--line-strong); border-top: 2px solid var(--amber-dim);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 217, 160, 0.06);
  opacity: 0; visibility: hidden; transition: opacity 0.14s var(--ease);
  pointer-events: none; font-family: var(--font-body);
}
.item-tip.show { opacity: 1; visibility: visible; }
.item-tip.t-uncommon { border-top-color: #4f6f9f; }
.tip__name { font-family: var(--font-display); font-weight: 700; font-size: 1.06rem; letter-spacing: 0.01em; color: var(--ink-bone); line-height: 1.15; }
.tip__name.r-uncommon { color: #82abe8; }
.tip__type { font-family: var(--font-display); font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-dim); margin-top: 0.2rem; }
.tip__stats { margin-top: 0.7rem; border-top: 1px solid var(--line); padding-top: 0.6rem; display: grid; gap: 0.26rem; }
.tip__stat { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.92rem; color: var(--ink); }
.tip__stat span:last-child { color: var(--ink-bone); font-variant-numeric: tabular-nums; }
.tip__stat--good span:last-child { color: var(--rot-bright); }
.tip__mod { margin-top: 0.55rem; font-size: 0.9rem; color: var(--rot-bright); font-style: italic; }
.tip__req { margin-top: 0.6rem; font-size: 0.82rem; color: var(--ink-dim); }
.tip__flavor { margin-top: 0.5rem; font-size: 0.86rem; color: var(--etch); font-style: italic; }
