:root {
  --ink: #0d1110;
  --panel: #171d1a;
  --gold: #c7a85b;
  --gold-soft: #8f7943;
  --jade: #55b08a;
  --danger: #ef8f83;
  --paper: #e5ddc9;
  --muted: #a9aa9d;
  --line: rgba(229, 221, 201, .16);
  --line-strong: rgba(199, 168, 91, .5);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  line-height: 1.6;
}

a { color: var(--jade); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--paper); }

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

.shell { width: min(1120px, calc(100% - 2.5rem)); margin-inline: auto; }
.site-body { display: flex; flex-direction: column; }
.site-main { flex: 1; padding-block: clamp(3.5rem, 8vw, 7rem); }

.site-header { border-bottom: 1px solid var(--line); background: rgba(13, 17, 16, .94); }
.site-nav { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--paper); text-decoration: none; letter-spacing: .08em; }
.brand:hover { color: var(--paper); }
.brand strong, .brand small { display: block; line-height: 1; }
.brand strong { font-size: .95rem; }
.brand small { margin-top: .35rem; color: var(--gold); font-size: .58rem; letter-spacing: .2em; }
.brand__mark { display: grid; width: 2.4rem; height: 2.4rem; place-items: center; border: 1px solid var(--gold); color: var(--gold); font-weight: 800; letter-spacing: -.08em; }
.site-nav__links { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.2rem); }
.site-nav__links a { color: var(--muted); text-decoration: none; font-size: .9rem; }
.site-nav__links a:hover { color: var(--paper); }
.nav-toggle { display: none; border: 1px solid var(--line); background: transparent; color: var(--paper); padding: .45rem .7rem; cursor: pointer; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.site-footer__inner { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1.5rem; }
.site-footer a { color: var(--muted); }

.eyebrow { margin: 0 0 1rem; color: var(--gold); font-size: .72rem; font-weight: 700; letter-spacing: .2em; }
h1, h2, h3 { margin: 0; color: var(--paper); font-weight: 650; letter-spacing: -.035em; line-height: 1.1; }
h1 { max-width: 12ch; font-size: clamp(2.8rem, 8vw, 6.3rem); }
h2 { font-size: clamp(1.35rem, 3vw, 2rem); }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }

.hero { max-width: 850px; padding-bottom: clamp(4rem, 9vw, 8rem); }
.hero__lede { max-width: 600px; margin: 2rem 0 2.2rem; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.action-row { display: flex; flex-wrap: wrap; gap: .8rem; }
.button { display: inline-flex; min-height: 2.8rem; align-items: center; justify-content: center; border: 1px solid transparent; padding: .65rem 1rem; cursor: pointer; font-weight: 650; text-decoration: none; transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease; }
.button:hover { transform: translateY(-1px); text-decoration: none; }
.button--primary { background: var(--gold); color: var(--ink); }
.button--primary:hover { background: var(--paper); color: var(--ink); }
.button--quiet { border-color: var(--gold-soft); background: transparent; color: var(--paper); }
.button--quiet:hover { border-color: var(--gold); color: var(--gold); }
.text-link { display: inline-flex; gap: .5rem; align-items: center; font-weight: 650; }

.screenshots { margin-bottom: clamp(4rem, 9vw, 8rem); }
.screenshots__intro { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; }
.screenshots__intro h2 { max-width: 16ch; }
.screenshots__intro > p:last-child { max-width: 32ch; margin: 0; color: var(--muted); }
.screenshot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.screenshot-card { margin: 0; border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.screenshot-card a { display: block; overflow: hidden; background: #080a09; }
.screenshot-card img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; opacity: .9; transition: transform .35s ease, opacity .35s ease; }
.screenshot-card a:hover img { transform: scale(1.025); opacity: 1; }
.screenshot-card figcaption { display: grid; grid-template-columns: auto 1fr; column-gap: .8rem; padding: 1rem 1.1rem 1.15rem; }
.screenshot-card figcaption span { grid-row: span 2; color: var(--gold-soft); font: .8rem/1 "SFMono-Regular", Consolas, monospace; }
.screenshot-card figcaption strong { color: var(--paper); font-size: .98rem; }
.screenshot-card figcaption small { color: var(--muted); font-size: .82rem; }

.panel { border: 1px solid var(--line); background: var(--panel); padding: clamp(1.5rem, 4vw, 3rem); }
.download-panel { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 920px; }
.download-panel h2 { margin-bottom: 1.5rem; max-width: 26ch; }
.download-intro { max-width: 760px; }
.download-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: stretch; }
.download-option { position: relative; display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 1rem; }
.download-option--recommended { border-color: var(--gold-soft); background: linear-gradient(155deg, rgba(199,168,91,.1), var(--panel) 55%); }
.download-option .eyebrow, .download-option p { margin-bottom: 0; }
.download-option h2 { font-size: clamp(1.8rem, 3vw, 2.7rem); }
.download-option > p:not(.eyebrow):not(.download-option__hash):not(.download-option__meta) { color: var(--muted); }
.download-option .button { margin-top: auto; }
.download-option__meta { border-top: 1px solid var(--line); padding-top: .8rem; color: var(--paper); font-size: .88rem; }
.download-option__hash { max-width: 100%; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.download-option__footnote { padding-top: .5rem; font-size: .84rem; }
.download-legacy { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 2rem; }
.download-legacy > div { min-width: 0; }
.download-legacy h2 { margin-bottom: .7rem; }
.download-legacy .download-option__hash { margin-top: .7rem; }
.download-cleanup { max-width: 70ch; margin-top: 1.75rem; font-size: .85rem; }
.metadata-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.8rem 0; }
.metadata-grid div { border-top: 1px solid var(--line); padding-top: .7rem; }
.metadata-grid__wide { grid-column: 1 / -1; }
dt { color: var(--muted); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
dd { margin: .2rem 0 0; overflow-wrap: anywhere; font-weight: 600; }
code { color: var(--gold); font-family: "SFMono-Regular", Consolas, monospace; font-size: .85em; overflow-wrap: anywhere; }

.status-note, .status-badge { display: inline-flex; width: fit-content; align-items: center; gap: .55rem; border: 1px solid; padding: .5rem .7rem; font-weight: 650; }
.status-note { margin: 0 0 1rem; }
.status-icon { display: inline-grid; width: 1.15rem; height: 1.15rem; flex: 0 0 1.15rem; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: .75rem; font-weight: 800; line-height: 1; }
.status-note--ready { border-color: rgba(85, 176, 138, .55); color: var(--jade); }
.status-note--info { border-color: var(--line-strong); color: var(--gold); }
.status-note--unavailable, .status-note--error { border-color: rgba(239, 143, 131, .65); color: var(--danger); }
.status-badge--pending { border-color: var(--line-strong); color: var(--gold); }
.status-badge--processing { border-color: rgba(168, 208, 250, .65); color: #a8d0fa; }
.status-badge--active { border-color: rgba(85, 176, 138, .65); color: var(--jade); }
.status-badge--unavailable, .status-badge--delayed { border-color: rgba(239, 143, 131, .65); color: var(--danger); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: clamp(4rem, 9vw, 8rem); background: var(--line); border: 1px solid var(--line); }
.feature-card { min-height: 190px; padding: 1.5rem; background: var(--ink); }
.feature-card__number { display: block; margin-bottom: 2.5rem; color: var(--gold-soft); font: .8rem/1 "SFMono-Regular", Consolas, monospace; }
.feature-card h2 { margin-bottom: .7rem; font-size: 1.25rem; }
.feature-card p { color: var(--muted); font-size: .92rem; }

.page-intro { max-width: 680px; margin-bottom: 2.5rem; }
.page-intro h1 { max-width: 15ch; margin-bottom: 1.3rem; font-size: clamp(2.4rem, 6vw, 4.5rem); }
.page-intro > p:not(.eyebrow):not(.status-badge) { color: var(--muted); font-size: 1.08rem; }
.form-card { max-width: 600px; border: 1px solid var(--line); background: var(--panel); padding: clamp(1.4rem, 4vw, 2.4rem); }
.field { margin-bottom: 1.25rem; }
.field label, .check-field label { display: block; margin-bottom: .45rem; color: var(--paper); font-weight: 600; }
.field input:not([type=checkbox]), .form-control { width: 100%; border: 1px solid var(--line-strong); border-radius: 0; background: var(--ink); color: var(--paper); padding: .7rem .8rem; }
.field input:not([type=checkbox]):hover { border-color: var(--gold); }
.field-error, .validation-summary, .text-danger { display: block; margin-top: .35rem; color: var(--danger); font-size: .86rem; }
.validation-summary ul { margin: 0; padding-left: 1.2rem; }
.check-field { margin: 1.5rem 0; }
.check-field input { accent-color: var(--gold); margin-right: .45rem; }
.check-field label { display: inline; font-weight: 400; }
.inline-form { margin-top: 1.5rem; }
.compact-panel { max-width: 680px; }
.prose { max-width: 760px; }
.prose h2 { margin-bottom: .7rem; }
.prose h2:not(:first-child) { margin-top: 2rem; }
.prose p { color: var(--muted); }

/* Existing administrator pages keep their semantic table and form structure. */
.admin-shell { max-width: 1180px; margin: 0 auto; }
.admin-shell .d-flex { display: flex; gap: 1rem; }
.admin-shell .d-inline-flex { display: inline-flex; }
.admin-shell .justify-content-between { justify-content: space-between; }
.admin-shell .align-items-center { align-items: center; }
.admin-shell .gap-1 { gap: .25rem; }
.admin-shell .mb-0 { margin-bottom: 0; }
.admin-shell .mb-3 { margin-bottom: 1rem; }
.admin-shell .mt-5 { margin-top: 3rem; }
.admin-shell .text-muted { color: var(--muted); }
.admin-shell .align-middle { vertical-align: middle; }
.admin-shell .alert { margin-bottom: 1rem; border: 1px solid; padding: .75rem 1rem; }
.admin-shell .alert-info { border-color: var(--line-strong); background: var(--panel); color: var(--gold); }
.admin-shell .form-label { display: block; margin-bottom: .45rem; color: var(--paper); font-weight: 600; }
.admin-shell .form-check { display: flex; align-items: center; gap: .6rem; min-height: 1.5rem; }
.admin-shell .form-check-input { width: 1rem; height: 1rem; flex: 0 0 1rem; margin: 0; accent-color: var(--gold); }
.admin-shell .form-check-label { color: var(--paper); }
.admin-shell .table-responsive { overflow-x: auto; }
.admin-shell table { width: 100%; border-collapse: collapse; }
.admin-shell th, .admin-shell td { border-bottom: 1px solid var(--line); padding: .75rem .5rem; text-align: left; }
.admin-shell .table-sm th, .admin-shell .table-sm td { padding: .4rem .5rem; }
.admin-shell th { color: var(--muted); font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.admin-shell .btn, .admin-shell button { display: inline-flex; min-height: 2.4rem; align-items: center; border: 1px solid var(--gold-soft); background: transparent; color: var(--paper); padding: .45rem .75rem; cursor: pointer; text-decoration: none; }
.admin-shell .btn-sm { min-height: 2rem; padding: .3rem .55rem; font-size: .875rem; }
.admin-shell .btn-outline-secondary { border-color: var(--muted); color: var(--paper); }
.admin-shell .btn-outline-secondary:hover { border-color: var(--paper); background: rgba(229, 221, 201, .12); color: var(--paper); }
.admin-shell .btn-primary, .admin-shell .btn-success { border-color: var(--gold); background: var(--gold); color: var(--ink); }
.admin-shell .btn-danger { border-color: var(--danger); color: var(--danger); }
.admin-shell .form-control { max-width: 18rem; }
.admin-shell .form-control-sm { min-height: 2rem; padding: .3rem .5rem; font-size: .875rem; }
.admin-login { max-width: 480px; }
.status-pending-email, .status-awaiting-admin, .status-queue-pending, .status-active, .status-disabled, .status-failed { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid; padding: .35rem .55rem; font-weight: 600; }
.status-pending-email, .status-awaiting-admin { border-color: var(--gold); color: var(--gold); }
.status-queue-pending { border-color: #7ba8d8; color: #a8d0fa; }
.status-active { border-color: var(--jade); color: var(--jade); }
.status-disabled, .status-failed { border-color: var(--danger); color: var(--danger); }

.sr-only, .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.lang-switch { display: inline-flex; align-items: center; gap: .25rem; margin: 0 0 0 .75rem; padding: 0; }
.lang-switch button { min-width: 2.4rem; min-height: 2.2rem; padding: .3rem .55rem; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-weight: 600; letter-spacing: .1em; }
.lang-switch button:hover { color: var(--paper); border-color: var(--paper); }
.lang-switch button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; color: var(--paper); }
.lang-switch button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); }

@media (max-width: 700px) {
  .lang-switch { margin: .5rem 0 0; }
  .shell { width: min(100% - 1.5rem, 1120px); }
  .site-nav { min-height: 66px; flex-wrap: wrap; }
  .nav-toggle { display: block; }
  .site-nav__links { display: none; width: 100%; flex-direction: column; align-items: flex-start; gap: 0; padding: .5rem 0 1rem; }
  .site-nav__links[data-open="true"] { display: flex; }
  .site-nav__links a { width: 100%; border-top: 1px solid var(--line); padding: .7rem 0; }
  .feature-grid { grid-template-columns: 1fr; }
  .screenshots__intro { align-items: flex-start; flex-direction: column; gap: .8rem; }
  .screenshot-grid { grid-template-columns: 1fr; }
  .download-options { grid-template-columns: 1fr; }
  .download-legacy { flex-direction: column; gap: 1rem; }
  .metadata-grid { grid-template-columns: 1fr; }
  .metadata-grid__wide { grid-column: auto; }
  .site-footer__inner { flex-direction: column; }
  .admin-shell .d-flex { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
