/* ==========================================================================
   Labyrinth — theme.css
   "The maze is alive. The gold is bait. You're the meal."

   Dark, grim, diegetic. Chiaroscuro as the primary mood tool: a muted,
   earthen base, with saturated color spent only on the three things the game
   itself reserves it for — magic, blood, and gold. Chrome should feel like
   ink, parchment, and tarnished metal, not a modern interface.
   ========================================================================== */

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/fonts/cinzel-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/eb-garamond-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/eb-garamond-italic-latin.woff2') format('woff2');
}

:root {
  /* --- earthen base --- */
  --bg: #100d0b;
  --bg-elevated: #17130f;
  --surface: #1f1912;
  --surface-raised: #271f16;
  --border: #3c3021;
  --border-bright: #52412a;

  --ash: #8a8074;
  --parchment: #e8dfc8;
  --parchment-dim: #bdb190;
  --bronze: #a9803f;
  --bronze-bright: #c99a52;

  /* --- saturated accents: spend these on magic, blood, gold ONLY --- */
  --magic: #7d5cff;
  --magic-bright: #a08bff;
  --blood: #9c2a35;
  --blood-bright: #c8404d;
  --gold: #c9a227;
  --gold-bright: #e6c34a;

  --font-display: 'Cinzel', 'Times New Roman', serif;
  --font-body: 'EB Garamond', Georgia, 'Times New Roman', serif;

  --radius: 0;
  --shadow-deep: 0 12px 28px rgba(0, 0, 0, 0.55);
}

/* --- reset ---------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; }

/* --- base ------------------------------------------------------------ */

html {
  color-scheme: dark;
}

body {
  background: var(--bg);
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--parchment);
  line-height: 1.25;
}

h1 { font-size: 2.6rem; letter-spacing: 0.04em; }
h2 { font-size: 1.8rem; color: var(--bronze-bright); }
h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0;
  color: var(--parchment);
}

/* Homepage section headings carry the grave-mark. */
h2.marked::before {
  content: '‡';
  color: var(--bronze);
  font-size: 0.8em;
  margin-right: 0.5em;
  vertical-align: 0.08em;
}

p { margin: 0 0 1em; }
a { text-decoration: none; }
a.text-link {
  color: var(--bronze-bright);
  border-bottom: 1px solid rgba(169, 128, 63, 0.4);
}
a.text-link:hover { color: var(--gold-bright); border-color: var(--gold); }

small, .muted { color: var(--parchment-dim); }

hr.divider {
  border: none;
  text-align: center;
  margin: 2.5em 0;
  height: 1em;
}
hr.divider::before {
  content: '‡';
  color: var(--border-bright);
  font-size: 1.4rem;
}

blockquote.epigraph {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--parchment-dim);
  border: none;
  margin: 0;
  padding: 0;
}

code, pre {
  font-family: 'Consolas', 'Courier New', monospace;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 2px;
}
code { padding: 0.1em 0.4em; font-size: 0.9em; }
pre { padding: 1em; overflow-x: auto; }

/* --- layout shell ------------------------------------------------------ */

.site-header {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, var(--bg-elevated), var(--bg));
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.12em;
  color: var(--parchment);
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.brand .glyph { color: var(--gold); font-size: 1.1em; }
.brand:hover { color: var(--gold-bright); }

nav.site-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

nav.site-nav a {
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-variant: small-caps;
  letter-spacing: 0.03em;
  color: var(--parchment-dim);
  padding-bottom: 0.25em;
  border-bottom: 2px solid transparent;
}

nav.site-nav a:hover { color: var(--parchment); }
nav.site-nav a.active {
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
}

main.content {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 2rem 1.5rem;
  margin-top: 2rem;
}
.site-footer .wrap {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.site-footer .epigraph { max-width: 32em; }
.site-footer .links { display: flex; gap: 1.25rem; }
.site-footer .links a { color: var(--parchment-dim); font-size: 0.9rem; }
.site-footer .links a:hover { color: var(--gold-bright); }

/* --- hero ----------------------------------------------------------
   The homepage hero sits on the title-screen ink drawing: full-bleed art,
   dimmed, edges vignetted into the page black, text landing on the
   sinkhole's dark center — the same composition the game's own title
   screen uses. */

.hero-art {
  position: relative;
  margin: -2.5rem calc(50% - 50vw) 3.5rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero-art > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* dim + edge vignette so the parchment edges melt into the chrome */
.hero-art::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 72% at 50% 46%, transparent 30%, rgba(16, 13, 11, 0.95) 98%),
    rgba(16, 13, 11, 0.45);
}
.hero-inner {
  position: relative;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 4rem;
  min-height: clamp(420px, 55vh, 620px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-inner h1,
.hero-inner .tagline,
.hero-inner .lede {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85), 0 0 24px rgba(0, 0, 0, 0.6);
}
.hero-inner h1 { margin-bottom: 0.5rem; }
.hero-inner .lede { color: var(--parchment); }

.tagline {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--gold-bright);
  margin-bottom: 1.5rem;
}
.lede {
  max-width: 42em;
  margin: 0 auto 2rem;
  color: var(--parchment-dim);
  font-size: 1.1rem;
}
.cta-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- buttons ---------------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  padding: 0.55em 1.5em;
  border-radius: 2px;
  border: 1px solid var(--border-bright);
  background: var(--surface);
  color: var(--parchment);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--gold); color: var(--gold-bright); }

.btn-primary {
  background: linear-gradient(to bottom, var(--bronze), #8a6a34);
  border-color: var(--bronze-bright);
  color: #1a1408;
  font-weight: 600;
}
.btn-primary:hover {
  background: linear-gradient(to bottom, var(--gold-bright), var(--gold));
  border-color: var(--gold-bright);
  color: #1a1408;
}

/* --- forms (the mailing-list signup, GH #362) ---------------------------
   The site's only form. Same materials as everything else: square corners,
   sunken surface fill, a bronze keyline that brightens to gold on focus.
   No browser-default chrome, no accent spent outside magic/blood/gold. */

.signup { max-width: 34rem; margin: 0 auto; text-align: left; }

.signup label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-variant: small-caps;
  letter-spacing: 0.04em;
  color: var(--parchment-dim);
  margin-bottom: 0.35em;
}

.signup-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.signup-row input[type="email"] { flex: 1 1 16rem; min-width: 0; }
.signup-row .btn { flex: 0 0 auto; }

input[type="email"], input[type="text"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.02rem;
  color: var(--parchment);
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
  border-radius: 2px;
  padding: 0.55em 0.75em;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="email"]::placeholder { color: var(--ash); }
input[type="email"]:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.25);
}

.signup-terms { font-size: 0.9rem; margin: 0.9em 0 0; }

/* Honeypot: pushed off-screen rather than display:none — a bot reading the DOM
   fills every input it finds; a person never sees or tabs into this one. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- cards --------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-deep);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

/* --- badges ---------------------------------------------------------- */

.badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-variant: small-caps;
  letter-spacing: 0.04em;
  padding: 0.1em 0.6em 0.2em;
  border-radius: 2px;
  border: 1px solid currentColor;
}
.badge-won   { color: var(--gold-bright); background: rgba(201, 162, 39, 0.12); }
.badge-lost  { color: var(--blood-bright); background: rgba(156, 42, 53, 0.12); }
.badge-ongoing, .badge-pending { color: var(--ash); background: rgba(138, 128, 116, 0.12); }
.badge-rejected { color: var(--blood-bright); background: rgba(156, 42, 53, 0.12); }
.badge-certified { color: var(--gold-bright); background: rgba(201, 162, 39, 0.12); }

/* --- notices ------------------------------------------------------------
   Same two-color vocabulary as the badges above: gold for the thing that
   worked, blood for the one that didn't. */

.notice {
  border: 1px solid currentColor;
  border-radius: 2px;
  padding: 0.7em 1em;
  margin: 0 0 1em;
  text-align: left;
}
.notice p { margin: 0; }
.notice-good { color: var(--gold-bright); background: rgba(201, 162, 39, 0.12); }
.notice-bad  { color: var(--blood-bright); background: rgba(156, 42, 53, 0.12); }

/* Mood tiers — Curious (calm) escalating to Furious (blood-red). */
.mood-0 { color: var(--ash); }
.mood-1 { color: var(--parchment-dim); }
.mood-2 { color: var(--bronze-bright); }
.mood-3 { color: #d16a3a; }
.mood-4 { color: var(--blood-bright); }

/* --- tables (leaderboards) --------------------------------------------- */

.table-wrap { overflow-x: auto; }

table.board {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
table.board caption {
  text-align: left;
  font-family: var(--font-display);
  color: var(--bronze-bright);
  margin-bottom: 0.75rem;
  letter-spacing: 0.04em;
}
table.board th {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-variant: small-caps;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--parchment-dim);
  text-align: left;
  padding: 0.5em 0.9em;
  border-bottom: 1px solid var(--border-bright);
}
table.board td {
  padding: 0.65em 0.9em;
  border-bottom: 1px solid var(--border);
}
table.board tbody tr:hover { background: rgba(201, 162, 39, 0.05); }
table.board .rank {
  font-family: var(--font-display);
  color: var(--gold);
  width: 2.5em;
}
table.board tbody tr:nth-child(1) .rank { color: var(--gold-bright); }

/* Rank-1-only replay download link (GH #196) — small, quiet, doesn't compete with the hero name. */
.replay-link {
  display: inline-block;
  margin-left: 0.6em;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  text-decoration: none;
}
.replay-link:hover { text-decoration: underline; }

/* --- victory cards (Hall of Fame) --------------------------------------- */

.victory-card {
  background: linear-gradient(to bottom, var(--surface-raised), var(--surface));
  border: 1px solid var(--border-bright);
  border-radius: 8px 8px var(--radius) var(--radius);
  padding: 1.5rem;
  position: relative;
  box-shadow: var(--shadow-deep);
}
.victory-card::before {
  content: '‡';
  position: absolute;
  top: -0.6em;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  color: var(--gold);
  padding: 0 0.4em;
  font-size: 1.3rem;
}
.victory-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  text-align: center;
  margin-top: 0.5em;
  margin-bottom: 0.1em;
}
.victory-card .boss {
  text-align: center;
  color: var(--blood-bright);
  font-style: italic;
  margin-bottom: 1em;
}
.victory-card .stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4em 1em;
  font-size: 0.9rem;
  color: var(--parchment-dim);
  margin-bottom: 1em;
}
.victory-card .stats strong { color: var(--parchment); }
.victory-card .epitaph {
  font-style: italic;
  color: var(--gold-bright);
  border-top: 1px solid var(--border);
  padding-top: 0.8em;
  margin: 0;
}

/* --- plates ----------------------------------------------------------
   Ink scene art mounted on the dark chrome. `.plate` mats a print in a
   bordered frame with a bronze keyline; `.plate--bare` is for art that
   carries its own ragged parchment edge; `.plate--screen` mats dark
   gameplay screenshots on near-black. */

.plate {
  background: var(--surface);
  border: 1px solid var(--border-bright);
  padding: 10px;
  box-shadow: var(--shadow-deep);
  margin: 0;
}
.plate img {
  width: 100%;
  outline: 1px solid rgba(169, 128, 63, 0.35);
  outline-offset: -5px;
}
.plate--bare {
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
}
.plate--bare img { outline: none; }
.plate--screen { background: var(--bg-elevated); }
.plate--screen img { outline-color: rgba(169, 128, 63, 0.25); }
figure.plate figcaption {
  font-style: italic;
  color: var(--parchment-dim);
  font-size: 0.95rem;
  padding: 0.6em 0.2em 0.1em;
}

/* --- feature bands (homepage) ---------------------------------------- */

.feature-band {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  gap: 2.75rem;
  align-items: center;
}
.feature-band--flip { grid-template-columns: 1fr minmax(220px, 340px); }
.feature-band--flip .band-art { order: 2; }
.feature-band h2 { margin-top: 0; }

/* --- ledger (ruled list, no boxes) ------------------------------------ */

.ledger > * {
  border-top: 1px solid var(--border);
  padding: 1.6rem 0;
  margin: 0;
}
.ledger > *:last-child { border-bottom: 1px solid var(--border); }
.ledger h2, .ledger h3 { margin-top: 0; }

/* --- screenshot grid --------------------------------------------------- */

.shot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.shot-grid a { display: block; }
.shot-grid a:hover .plate { border-color: var(--gold); }
.shot-grid .shot-wide { grid-column: 1 / -1; }

/* --- video plates (trailers) -------------------------------------------
   Same mat as a screenshot plate, thinner because the player's own chrome
   already frames it. `.trailer` is the homepage's headline slot. */

.trailer { max-width: 960px; margin: 0 auto 3.5rem; }
.plate--video { padding: 6px; }
.plate--video video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #000;
  outline: 1px solid rgba(169, 128, 63, 0.25);
  outline-offset: -3px;
}
.plate--video figcaption { padding: 0.7em 0.4em 0.2em; }

/* --- split (copy beside a plate) ---------------------------------------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
.tactics {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tactics li {
  border-top: 1px solid var(--border);
  padding: 0.8rem 0;
  color: var(--parchment-dim);
}
.tactics li:last-child { border-bottom: 1px solid var(--border); }
.tactics li strong { color: var(--parchment); }

/* --- misc utility ---------------------------------------------------- */

.stack { display: flex; flex-direction: column; gap: 1.5rem; }
.center { text-align: center; }
.empty-state {
  text-align: center;
  color: var(--parchment-dim);
  padding: 3rem 1rem;
  border: 1px dashed var(--border-bright);
  border-radius: var(--radius);
}

/* --- rendered markdown (dev log posts, playtest notes) ------------------ */

.devlog-body h2, .playtest-body h2 { margin-top: 1.75em; font-size: 1.5rem; }
.devlog-body h3, .playtest-body h3 { margin-top: 1.5em; font-size: 1.2rem; }
.devlog-body ul, .devlog-body ol, .playtest-body ul, .playtest-body ol { padding-left: 1.4em; }
.devlog-body li, .playtest-body li { margin-bottom: 0.4em; }
.devlog-body a, .playtest-body a { color: var(--bronze-bright); border-bottom: 1px solid rgba(169, 128, 63, 0.4); }
.devlog-body a:hover, .playtest-body a:hover { color: var(--gold-bright); border-color: var(--gold); }
.devlog-body blockquote, .playtest-body blockquote {
  margin: 1.5em 0;
  padding: 0.5em 1.25em;
  border-left: 3px solid var(--bronze);
  color: var(--parchment-dim);
  font-style: italic;
}
.devlog-body img, .playtest-body img { border: 1px solid var(--border); border-radius: var(--radius); margin: 1em 0; }

@media (max-width: 720px) {
  .feature-band, .feature-band--flip { grid-template-columns: 1fr; gap: 1.5rem; }
  .feature-band--flip .band-art { order: 0; }
  .feature-band .band-art { max-width: 420px; }
  .shot-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 640px) {
  h1 { font-size: 2rem; }
  .site-header .wrap { flex-direction: column; align-items: flex-start; }
  main.content { padding: 1.5rem 1rem 3rem; }
  .hero-art { margin-top: -1.5rem; }
  .hero-art::before {
    background:
      radial-gradient(ellipse 95% 80% at 50% 46%, transparent 20%, rgba(16, 13, 11, 0.95) 100%),
      rgba(16, 13, 11, 0.6);
  }
  .hero-inner { min-height: 380px; padding: 3rem 1rem 2.5rem; }
  .signup-row .btn { flex: 1 1 100%; text-align: center; }
}
