@font-face { font-family: "Martian"; src: url("/assets/fonts/martian-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Martian"; src: url("/assets/fonts/martian-mono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Pixel"; src: url("/assets/fonts/press-start-2p.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --ground: #0b0a09;
  --surface: #151310;
  --bone: #e9e2d0;
  --muted: #8f897b;
  --verdigris: #6fa892;
  --verdigris-deep: #2c4f44;
  --blood: #b3262c;
  --blood-ink: #e2474d;
  --line: #2b2620;
  --gutter: clamp(16px, 4vw, 48px);
  --measure: 78ch;
  --step: clamp(56px, 9vw, 112px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--bone); font: 400 14px/1.7 "Martian", ui-monospace, Menlo, Consolas, monospace; }
pre { font: inherit; margin: 0; }
a { color: var(--bone); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--verdigris); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--verdigris); outline-offset: 3px; }
h2, h3 { font-weight: 600; font-size: 14px; margin: 0; letter-spacing: 0; }
h2::before { content: "## "; color: var(--verdigris); }
h3::before { content: "### "; color: var(--muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 12px; z-index: 5; background: var(--ground); padding: 8px 12px; }

/* 1. threshold */
.threshold { min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 56px var(--gutter); text-align: center; }
.title { margin: 0; font: 400 clamp(20px, 4.2vw, 46px)/1.2 "Pixel", monospace; color: var(--verdigris); text-shadow: 0 0.12em 0 var(--verdigris-deep), 0 0.18em 0 #000; }
.liver { color: var(--verdigris-deep); font-size: min(15px, calc((100vw - 2 * var(--gutter)) / 41)); line-height: 1.25; white-space: pre; text-align: left; margin-top: 10px; }
.liver .house { color: var(--verdigris); transition: color .4s, background-color .4s; }
.liver .house.lit { color: var(--ground); background: var(--verdigris); }
.liver .house.lit.bad { background: var(--blood); color: var(--bone); }
.liver .eye { color: var(--blood-ink); font-weight: 600; }
.premise { margin: 12px 0 0; font-size: 16px; text-wrap: balance; }
.warning { margin: 0; color: var(--muted); font-size: 11px; letter-spacing: .05em; max-width: 46ch; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; margin-top: 6px; }
.cta { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; font-weight: 600; color: var(--verdigris); text-decoration: none; }
.cta.alt { color: var(--bone); }
.cta:hover { color: var(--bone); }
.cta.alt:hover { color: var(--verdigris); }

main > section, .foot { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: var(--step) var(--gutter) 0; }

/* 2. status */
.status { padding-top: clamp(24px, 4vw, 48px) !important; }
.row { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; }
.row span { white-space: nowrap; color: var(--muted); }
.row b { color: var(--bone); font-weight: 600; }
.disclaimer { margin: 18px 0 0; font-size: 11px; line-height: 1.75; color: var(--muted); letter-spacing: .03em; border-top: 1px solid var(--line); padding-top: 14px; }

/* 3. the stone */
.lede { margin: 10px 0 0; color: var(--muted); max-width: 64ch; }
.altar { margin: 22px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.altar label { color: var(--muted); }
.altar input { flex: 1 1 32ch; min-width: 0; min-height: 48px; padding: 0 14px; background: var(--surface); color: var(--bone); border: 1px solid var(--line); border-radius: 0; font: 400 14px "Martian", monospace; }
.altar input:focus-visible { border-color: var(--verdigris); outline: none; }
.altar button { min-height: 48px; padding: 0 18px; background: var(--verdigris); color: var(--ground); font-weight: 600; }
.altar button[disabled] { opacity: .6; cursor: progress; }
.omen { margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-left: 2px solid var(--blood); }
.omen header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.omen header button { min-height: 44px; padding: 0 6px; color: var(--bone); }
.omen header button::before { content: "[ "; } .omen header button::after { content: " ]"; }
.houses { list-style: none; margin: 0; padding: 14px 16px 4px; display: grid; gap: 8px; }
.houses li { display: grid; grid-template-columns: 9ch 1fr; gap: 14px; }
.houses .h { color: var(--verdigris); font-weight: 600; }
.houses .h.bad { color: var(--blood-ink); }
.verdict { margin: 0; padding: 10px 16px 18px; font-weight: 600; }
.note { min-height: 1.7em; color: var(--blood-ink); margin: 10px 0 0; }

/* 4. archive */
.head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; }
.sort { display: flex; gap: 4px; }
.sort button { min-height: 44px; padding: 0 8px; color: var(--muted); }
.sort button::before { content: "[ "; } .sort button::after { content: " ]"; }
.sort button[aria-pressed="true"] { color: var(--bone); font-weight: 600; }
.files { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--line); }
.files > li { border-bottom: 1px solid var(--line); }
.files li.empty { padding: 14px 0; color: var(--muted); }
.files li.reader-row { border-bottom: 0; }
.files > li > button { width: 100%; min-height: 48px; display: grid; grid-template-columns: minmax(0, 1fr) 8ch 11ch; gap: 0 16px; align-items: center; padding: 10px 0; text-align: left; }
.files > li > button:hover .name, .files > li > button[aria-expanded="true"] .name { color: var(--verdigris); }
.files .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.files .kind, .files .date { color: var(--muted); font-size: 12px; }
.files .date { text-align: right; }
.reader { background: var(--surface); border: 1px solid var(--line); border-top: 0; }
.reader header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.reader header button { min-height: 44px; padding: 0 6px; color: var(--bone); }
.reader header button::before { content: "[ "; } .reader header button::after { content: " ]"; }
.reader pre { padding: 20px 16px 24px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.reader footer { padding: 0 16px 16px; font-size: 12px; color: var(--muted); }
.reader footer:empty { display: none; }

/* 5. discipline */
.lines { list-style: none; margin: 18px 0 0; padding: 0; }
.lines li { display: grid; grid-template-columns: 5ch 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lines span { color: var(--verdigris); font-weight: 600; }

/* 6. offering */
.arrows { margin: 20px 0 0; padding: 14px 16px; background: var(--surface); border-left: 2px solid var(--verdigris); line-height: 1.6; }
.arrows p { margin: 0; padding: 4px 0 4px calc(var(--d) * 4ch + 2ch); text-indent: -2ch; }
.plain { margin: 20px 0 0; max-width: 64ch; font-size: 15px; }
.mechanism h3 { margin-top: 28px; }
.see { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; color: var(--muted); }
.see li::before { content: "- "; }
.see span, .see a { color: var(--bone); }

.foot { padding-bottom: 64px; }
.foot p { margin: 0; padding-top: 22px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.foot a { min-height: 44px; display: inline-flex; align-items: center; }

@media (max-width: 640px) {
  body { font-size: 13px; }
  .files > li > button { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 2px 12px; }
  .files .kind { grid-column: 1; grid-row: 2; }
  .files .date { grid-column: 2; grid-row: 2; }
  .houses li { grid-template-columns: 1fr; gap: 0; }
  .arrows p { padding-left: calc(var(--d) * 2ch + 2ch); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .liver .house { transition: none; } }

.ca { margin: 4px 0 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 12px; font-size: 12px; max-width: 100%; }
.ca-label { color: var(--verdigris); font-weight: 600; }
.ca code { font: inherit; color: var(--bone); overflow-wrap: anywhere; user-select: all; }
.ca button, .ca a { min-height: 44px; display: inline-flex; align-items: center; color: var(--verdigris); text-decoration: underline; text-underline-offset: 3px; }
.pending { margin: 20px 0 0; padding: 12px 16px; border-left: 2px solid var(--blood); background: var(--surface); color: var(--bone); max-width: 64ch; }
