:root {
  --bg: #0d0b09;
  --bg-soft: #15110c;
  --panel: #1a140e;
  --panel-2: #211a12;
  --border: #3a2b1a;
  --border-soft: #2a2015;
  --gold: #d8b44a;
  --gold-soft: #b8912f;
  --parchment: #eadfc8;
  --muted: #b3a488;
  --green: #3f8f5c;
  --red: #a53a3a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--parchment);
  background:
    radial-gradient(circle at 15% -10%, rgba(120, 72, 28, 0.22), transparent 55%),
    radial-gradient(circle at 100% 0%, rgba(70, 24, 24, 0.20), transparent 45%),
    var(--bg);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: #f1d477; text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.12;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(2.6rem, 7vw, 5.2rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.15rem; color: var(--gold); }

p { margin: 0 0 1rem; }

code, pre {
  font-family: var(--mono);
  font-size: 0.86em;
}

code {
  color: #f0d98a;
  background: rgba(216, 180, 74, 0.08);
  border: 1px solid rgba(216, 180, 74, 0.16);
  border-radius: 4px;
  padding: 0.08em 0.35em;
}

pre {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  background: #0a0806;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  color: #e4d6b6;
  font-size: 0.92rem;
  line-height: 1.55;
}

.dim { color: var(--muted); }
.amp { color: var(--gold); font-style: italic; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--gold);
  color: #120e08;
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 3rem);
  background: rgba(13, 11, 9, 0.82);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(10px);
}

.brand {
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--parchment);
}
.brand:hover { text-decoration: none; color: var(--gold); }

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topbar nav a { color: var(--muted); }
.topbar nav a:hover { color: var(--gold); text-decoration: none; }

/* ----------------------------------------------------------------- hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6.5rem) clamp(1rem, 4vw, 2rem) clamp(3rem, 6vw, 5rem);
}

.eyebrow {
  color: var(--gold-soft);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  margin-bottom: 1rem;
}

.hero h1 {
  margin: 0 0 1rem;
  background: linear-gradient(180deg, #f7e6a8 0%, var(--gold) 45%, #8f6a20 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 30px rgba(216, 180, 74, 0.16);
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.55));
}

.lede {
  font-size: clamp(1.02rem, 1.6vw, 1.22rem);
  color: #d6c8ad;
  max-width: 38ch;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.4rem 0 1.6rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge.ok { color: #b9e2c5; border-color: rgba(63, 143, 92, 0.5); background: rgba(63, 143, 92, 0.1); }
.badge.warn { color: #e0c58c; border-color: rgba(184, 145, 47, 0.5); background: rgba(184, 145, 47, 0.08); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.fineprint {
  color: var(--muted);
  font-size: 0.82rem;
  max-width: 46ch;
}

.hero-art {
  position: relative;
  justify-self: center;
  padding: 0.7rem;
  border: 1px solid rgba(216, 180, 74, 0.35);
  background: linear-gradient(145deg, rgba(216, 180, 74, 0.08), rgba(0, 0, 0, 0.35));
  box-shadow: var(--shadow), inset 0 0 0 6px rgba(0, 0, 0, 0.35);
  transform: rotate(-0.6deg);
}

.hero-art img {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  image-rendering: pixelated;
  border: 1px solid rgba(0, 0, 0, 0.7);
}

/* -------------------------------------------------------------- buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--parchment);
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.button:hover {
  text-decoration: none;
  border-color: var(--gold-soft);
  background: rgba(216, 180, 74, 0.08);
  transform: translateY(-1px);
}
.button.primary {
  color: #171008;
  background: linear-gradient(180deg, #f1d477, var(--gold-soft));
  border-color: #e3c25a;
  font-weight: 700;
}
.button.primary:hover { background: linear-gradient(180deg, #ffe89a, var(--gold)); }
.button.small { padding: 0.5rem 0.85rem; font-size: 0.85rem; }

/* --------------------------------------------------------------- layout */
.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2rem);
  border-top: 1px solid var(--border-soft);
}

.section-head {
  max-width: 62ch;
  margin-bottom: 2rem;
}
.section-head p { color: var(--muted); }

.grid { display: grid; gap: 1.1rem; }
.grid.features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.downloads { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.35rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.card.muted-card { opacity: 0.9; border-style: dashed; }

.status {
  margin-top: 1.6rem;
  padding: 1.3rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
}
.status h3 { margin-top: 0; }

.status-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem 1.5rem;
  font-size: 0.95rem;
}
.status-list li { display: flex; align-items: center; gap: 0.55rem; }

.dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  display: inline-block;
  background: var(--muted);
}
.dot.ok { background: var(--green); box-shadow: 0 0 10px rgba(63, 143, 92, 0.6); }
.dot.busy { background: var(--gold-soft); box-shadow: 0 0 10px rgba(184, 145, 47, 0.5); }

/* ---------------------------------------------------------- screenshots */
.shots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  align-items: start;
}
.shots figure {
  margin: 0;
  padding: 0.55rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.shots img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.7);
}
.shots figcaption {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
  padding: 0.6rem 0.35rem 0.2rem;
}

/* ------------------------------------------------------------ downloads */
.download-card { display: flex; flex-direction: column; }
.download-card .meta {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0.2rem 0 1rem;
}
.download-card .button { margin-top: auto; align-self: flex-start; }
.hash {
  margin: 0.8rem 0 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: #8f826b;
  word-break: break-all;
}
.hash code {
  background: none;
  border: 0;
  padding: 0;
  color: #8f826b;
}

.notice {
  margin-top: 1.4rem;
  padding: 1.3rem 1.5rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold-soft);
  border-radius: 8px;
  background: rgba(216, 180, 74, 0.04);
}
.notice h3 { margin-top: 0; }
.notice p:last-child { margin-bottom: 0; }

ul.plain { margin: 0; padding-left: 1.1rem; }
ul.plain li { margin-bottom: 0.35rem; }

/* ----------------------------------------------------------------- prose */
.prose {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem) 4rem;
}
.prose h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); margin-bottom: 0.4em; }
.prose h2 {
  margin-top: 2.2rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: 1.55rem;
}
.prose h3 {
  margin-top: 1.6rem;
  color: var(--gold);
  font-size: 1.02rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.4rem; }
.prose p { color: #d9cdb6; }
.prose .teaser h2 { margin-top: 0; border: 0; font-size: 1.1rem; }
.prose .teaser ul { margin-bottom: 0.8rem; }

/* ---------------------------------------------------------------- footer */
.footer {
  border-top: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.25);
  padding: 2rem clamp(1rem, 4vw, 2rem);
  margin-top: 1rem;
}
.footer-inner { max-width: 1180px; margin: 0 auto; }
.footer p { margin: 0 0 0.45rem; font-size: 0.85rem; }
.footer .dim { color: #8f826b; }

.legal { border-top: 1px solid var(--border-soft); }
.legal p { color: var(--muted); font-size: 0.9rem; }

/* ---------------------------------------------------------------- mobile */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { order: -1; transform: none; max-width: 320px; }
  .grid.features, .grid.downloads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shots { grid-template-columns: 1fr; max-width: 360px; }
}

@media (max-width: 620px) {
  body { font-size: 17px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .grid.features, .grid.downloads, .grid.two { grid-template-columns: 1fr; }
  .actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}

/* ------------------------------------------------- protected download */
.download-card.protected { border-color: rgba(216, 180, 74, 0.45); }

.unlock { margin: 0.2rem 0 0.4rem; }
.unlock label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.unlock-row { display: flex; gap: 0.5rem; }
.unlock-row input {
  flex: 1;
  min-width: 0;
  padding: 0.62rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0a0806;
  color: var(--parchment);
  font-family: var(--mono);
  font-size: 0.92rem;
}
.unlock-row input:focus {
  outline: 2px solid var(--gold-soft);
  outline-offset: 1px;
}
.unlock-status {
  min-height: 1.3em;
  margin: 0.2rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.protected-download { margin-top: 0.2rem; }
