/* Nivorance: dark, gold, serif. No external fonts: system serif stacks only. */

:root {
  --bg: #0e0d0b;
  --bg-raised: #17150f;
  --line: #2e2a20;
  --text: #ece6d8;
  --muted: #a69f8e;
  --gold: #c9a961;
  --gold-bright: #e2c78a;
  --ok: #8fc79a;
  --bad: #ef8f80;
  --old: #d9bf7a;
  --serif-display: "Didot", "Bodoni 72", "Bodoni MT", "Playfair Display", "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.6 var(--sans);
  min-height: 100vh;
}

a { color: var(--gold); text-underline-offset: 0.18em; }
a:hover { color: var(--gold-bright); }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; border-radius: 2px; }

code, pre { font-family: var(--mono); font-size: 0.86em; }
code { overflow-wrap: anywhere; }
pre {
  background: #0a0908;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.5;
}
pre code { overflow-wrap: normal; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.2; letter-spacing: 0.01em; }
h1 { font-family: var(--serif-display); font-size: clamp(2rem, 6vw, 3rem); margin: 0.2em 0 0.4em; }
h2 { font-size: 1.5rem; color: var(--gold); margin: 2.2rem 0 0.8rem; }
h3 { font-size: 1.25rem; margin: 0; }
h4 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-family: var(--sans); margin: 1.4rem 0 0.5rem; }

.site-header, main#main, .site-footer { max-width: 60rem; margin: 0 auto; padding: 0 1.25rem; }
.site-header {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: 1.4rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line);
}
.wordmark {
  font-family: var(--serif-display); font-size: 1.45rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text); text-decoration: none;
}
.site-header nav a { font-size: 0.85rem; letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; }
.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 1rem; padding-bottom: 2.5rem; color: var(--muted); font-size: 0.9rem; }

.eyebrow { font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 2rem 0 0; }
.eyebrow a { text-decoration: none; }
.lede { font-family: var(--serif); font-size: 1.25rem; line-height: 1.5; }
.release-title { margin-bottom: 0.1em; }
.release-sub { color: var(--muted); letter-spacing: 0.08em; margin-top: 0; }
.muted { color: var(--muted); }
.fineprint { color: var(--muted); font-size: 0.88rem; }
.break { word-break: break-all; }

.panel, .version {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.4rem 1.4rem 1.2rem;
  margin: 1.5rem 0;
}
.panel > h2 { margin-top: 1rem; }
.version { border-left: 3px solid var(--line); }
.version.current { border-left-color: var(--gold); }
.version-head { padding-top: 1rem; }
.badge {
  display: inline-block; vertical-align: middle; margin-left: 0.5rem;
  font: 600 0.7rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bg); background: var(--gold); padding: 0.35em 0.6em; border-radius: 99px;
}
.superseded-note { color: var(--old); margin: 0.4rem 0 0; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.45rem 1.2rem; margin: 1rem 0; }
.facts dt { color: var(--muted); font-size: 0.92rem; }
.facts dd { margin: 0; min-width: 0; }
@media (max-width: 34rem) {
  .facts { grid-template-columns: 1fr; gap: 0.1rem; }
  .facts dd { margin-bottom: 0.6rem; }
}

.sig-status[data-state="ok"] .text, .overall[data-state="ok"] { color: var(--ok); }
.sig-status[data-state="bad"] .text, .overall[data-state="bad"] { color: var(--bad); font-weight: 600; }
.ots-status[data-state="bitcoin"] { color: var(--ok); }
.overall { margin: 0.5rem 0 0; }
.overall:empty { display: none; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; background: #13110d; }
tbody tr:last-child td { border-bottom: 0; }
td.size { white-space: nowrap; }
td.role { white-space: nowrap; color: var(--muted); }
td.hash code { font-size: 0.78rem; word-break: break-all; }
td.name .path { overflow-wrap: anywhere; }
table.files td.hash { min-width: 16rem; }
.tag { display: inline-block; margin-left: 0.5rem; font-size: 0.72rem; letter-spacing: 0.04em; padding: 0.05em 0.5em; border-radius: 4px; border: 1px solid var(--line); white-space: nowrap; }
.tag-private { color: var(--muted); }
.tag-dist { color: var(--gold); border-color: #5a4b2a; }

details { margin-top: 1rem; }
summary { cursor: pointer; color: var(--gold); padding: 0.3rem 0; }
details[open] > summary { margin-bottom: 0.7rem; }

.downloads { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.3rem; }
.downloads a { font-family: var(--mono); font-size: 0.9rem; }

.notice { border: 1px solid #5a4b2a; background: #1d190f; padding: 0.8rem 1rem; border-radius: 6px; }

.steps { padding-left: 1.3rem; }
.steps li { margin: 0.4rem 0; }

/* File check */
html:not(.js) .js-required, html:not(.js) .js-only { display: none; }
.picker {
  border: 1px dashed #5a4b2a; border-radius: 8px; padding: 1.2rem; text-align: center; margin: 1rem 0;
}
.picker.drag { border-color: var(--gold-bright); background: #1d190f; }
.picker:focus-within .button { outline: 2px solid var(--gold-bright); outline-offset: 3px; }
.button {
  display: inline-block; cursor: pointer; font: 600 0.95rem/1 var(--sans); letter-spacing: 0.06em;
  color: var(--bg); background: var(--gold); padding: 0.8rem 1.3rem; border-radius: 6px; min-height: 44px;
}
.button:hover { background: var(--gold-bright); }
.visually-hidden-input, .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.drop-hint { margin: 0.6rem 0 0; font-size: 0.88rem; }
.result { border-top: 1px solid var(--line); padding: 0.8rem 0; }
.result-name { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.result-msg { margin: 0.3rem 0; }
.result[data-state="ok"] .result-msg { color: var(--ok); }
.result[data-state="old"] .result-msg { color: var(--old); }
.result[data-state="bad"] .result-msg { color: var(--bad); }
.result-hash { margin: 0; font-size: 0.85rem; color: var(--muted); }
progress { width: 100%; accent-color: var(--gold); height: 0.6rem; }

/* Home */
.home-body { display: grid; place-items: center; background: radial-gradient(ellipse at 50% 35%, #1b1810 0%, var(--bg) 62%); }
.home { width: 100%; padding: 2rem 1.25rem; }
.home-inner { text-align: center; }
.home-mark { color: var(--gold); font-size: 1.4rem; margin: 0 0 1.2rem; }
.home-title {
  font-family: var(--serif-display); font-weight: 400; margin: 0;
  font-size: clamp(2.6rem, 11vw, 6rem); letter-spacing: 0.18em; text-transform: uppercase;
  padding-left: 0.18em; /* balance the trailing letter-spacing */
  color: var(--text);
}
.home-rule { width: 4.5rem; height: 1px; background: var(--gold); margin: 1.6rem auto; }

@media (prefers-reduced-motion: no-preference) {
  a, .button { transition: color 0.15s, background-color 0.15s, border-color 0.15s; }
}

/* Narrow screens: long hex values wrap, file tables become stacked cards. */
.facts dd { overflow-wrap: anywhere; }
@media (max-width: 40rem) {
  .panel, .version { padding: 0.2rem 1rem 1rem; }
  table.files thead { display: none; }
  table.files, table.files tbody { display: block; }
  table.files tr { display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 0.8rem; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); }
  table.files tbody tr:last-child { border-bottom: 0; }
  table.files td { display: block; border: 0; padding: 0; }
  table.files td.role { grid-column: 1; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
  table.files td.size { grid-column: 2; text-align: right; color: var(--muted); }
  table.files td.name, table.files td.hash { grid-column: 1 / -1; }
  table.files td.hash { min-width: 0; }
  .tag { margin-left: 0; margin-top: 0.2rem; }
  td.name .tag { display: table; }
}

/* Logo (white SVG wordmark) */
.wordmark img { display: block; height: 1.15rem; width: auto; }
.home-title img { display: block; width: min(38rem, 82vw); height: auto; margin: 0 auto; }
.home-title { padding-left: 0; letter-spacing: 0; line-height: 0; }

/* Home: three square links, verification link in the footer */
.home-body { grid-template-rows: 1fr auto; }
.home-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.9rem; }
.home-links a {
  font-size: 0.85rem; letter-spacing: 0.28em; text-transform: uppercase; text-decoration: none;
  border: 1px solid #5a4b2a; padding: 0.85rem 0 0.85rem 0.28em; border-radius: 2px;
  display: inline-block; min-width: 8.5rem; text-align: center;
}
.home-links a:hover { border-color: var(--gold); }
.home-footer { text-align: center; padding: 1.5rem 1rem 2rem; }
.home-footer a { font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.home-footer a:hover { color: var(--gold); }
@media (prefers-reduced-motion: no-preference) { .home-links a, .home-footer a { transition: color 0.15s, border-color 0.15s; } }

/* Bio */
main.bio { max-width: 40rem; }
main.bio p { font-family: var(--serif); font-size: 1.15rem; line-height: 1.7; }
main.bio .bio-links { font-family: var(--sans); font-size: 0.95rem; margin-top: 2rem; }
@media (max-width: 30rem) {
  .home-links { gap: 0.55rem; flex-wrap: nowrap; width: min(22rem, 100%); margin: 0 auto; }
  .home-links a { min-width: 0; flex: 1 1 0; letter-spacing: 0.2em; padding-left: 0.2em; font-size: 0.8rem; }
}

/* Icons in the home links */
.home-links a { display: inline-flex; align-items: center; justify-content: center; gap: 0.65em; }
.home-links .icon { width: 1.05rem; height: 1.05rem; flex: none; }
@media (max-width: 30rem) { .home-links a { gap: 0.45em; } .home-links .icon { width: 0.95rem; height: 0.95rem; } }
@media (max-width: 30rem) {
  .home-links a { flex-direction: column; gap: 0.5em; padding: 0.9rem 0 0.8rem 0.2em; }
  .home-links .icon { width: 1.15rem; height: 1.15rem; }
}

/* Signed challenge text: wrap so the whole challenge is readable on phones */
pre.wrap, pre.wrap code { white-space: pre-wrap; overflow-wrap: anywhere; }
