/* EigenSelect — hand-written, restrained. No frameworks, no build step. */

:root {
  --paper: #faf9f6;
  --panel: #f3f1ea;
  --ink: #191b1f;
  --muted: #5a5f68;
  --accent: #17427b;
  --accent-ink: #ffffff;
  --hairline: #e0ddd4;
  --code-bg: #f0eee7;
  --good: #2e6b46;
  --bad: #8c3232;
  --serif: Georgia, 'Times New Roman', 'Liberation Serif', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141519;
    --panel: #1b1d22;
    --ink: #e8e6e1;
    --muted: #9aa0a8;
    --accent: #8db2e3;
    --accent-ink: #10151d;
    --hairline: #2a2d33;
    --code-bg: #1e2126;
    --good: #7dbb96;
    --bad: #d98c8c;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; }
.prose { max-width: 70ch; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 2.6rem; margin: 0 0 0.5em; }
h2 { font-size: 1.7rem; margin: 2.2em 0 0.6em; }
h3 { font-size: 1.2rem; margin: 1.8em 0 0.5em; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); }
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px; font-size: 0.88em; }
pre {
  background: var(--code-bg);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.55;
}
pre code { background: none; padding: 0; }
hr { border: none; border-top: 1px solid var(--hairline); margin: 3em 0; }

.kicker {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1em;
}

/* Header */
.site-header { border-bottom: 1px solid var(--hairline); }
.header-row { display: flex; align-items: baseline; justify-content: space-between; padding-top: 20px; padding-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.wordmark {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.wordmark:hover { text-decoration: none; }
.site-nav { display: flex; gap: 22px; align-items: baseline; flex-wrap: wrap; }
.site-nav a { color: var(--ink); font-size: 0.92rem; }
.site-nav a.nav-cta {
  color: var(--accent);
  font-weight: 600;
}

/* Hero */
.hero { padding: 84px 0 64px; }
.hero h1 { font-size: 3.1rem; max-width: 17ch; }
.hero .lede { font-size: 1.22rem; max-width: 56ch; color: var(--muted); }
.cta-row { margin-top: 2em; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75em 1.5em;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn[disabled] { opacity: 0.5; cursor: default; }

/* Cards / grid */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 2em 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin: 2em 0; }
@media (max-width: 820px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.card {
  border: 1px solid var(--hairline);
  background: var(--panel);
  border-radius: 8px;
  padding: 26px 26px 18px;
}
.card h3 { margin-top: 0; }
.card p { color: var(--muted); font-size: 0.96rem; }

/* Steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 2em 0; max-width: 70ch; }
.steps li { counter-increment: step; padding: 18px 0 14px 62px; position: relative; border-top: 1px solid var(--hairline); }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 16px;
  font-family: var(--mono); font-size: 1.1rem; color: var(--muted);
}
.steps b { display: block; font-family: var(--serif); font-size: 1.08rem; font-weight: 500; }
.steps span { color: var(--muted); font-size: 0.95rem; }

/* Spec strip / fact tables */
.facts { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 0.95rem; }
.facts th, .facts td { text-align: left; padding: 9px 14px 9px 0; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.facts th { font-weight: 600; white-space: nowrap; width: 34%; }
.facts td.num { font-family: var(--mono); }
.facts caption { text-align: left; font-family: var(--serif); font-size: 1.1rem; padding-bottom: 10px; }

/* Sections */
.section { padding: 34px 0; }
.section.alt { background: var(--panel); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }

/* Forms */
.field { margin-bottom: 1.3em; max-width: 46ch; }
.field label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.35em; }
.field .help { font-size: 0.85rem; color: var(--muted); margin-top: 0.35em; }
input[type="text"], input[type="email"], input[type="number"], textarea, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 0.55em 0.7em;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 9em; font-family: var(--mono); font-size: 0.9rem; }

/* Mode selector */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 1.5em 0 2em; }
@media (max-width: 820px) { .modes { grid-template-columns: repeat(2, 1fr); } }
.mode-card { position: relative; }
.mode-card input { position: absolute; opacity: 0; }
.mode-card label {
  display: block;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: var(--panel);
  padding: 16px 16px 12px;
  cursor: pointer;
  height: 100%;
}
.mode-card input:checked + label { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -1px; }
.mode-card b { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.02rem; }
.mode-card span { font-size: 0.82rem; color: var(--muted); }
fieldset.mode-fields { border: 1px solid var(--hairline); border-radius: 7px; padding: 20px 22px 8px; margin: 0 0 1.5em; }
fieldset.mode-fields legend { font-weight: 600; font-size: 0.9rem; padding: 0 8px; }
.hidden { display: none; }

.form-error {
  border: 1px solid var(--bad);
  color: var(--bad);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 1em 0;
  font-size: 0.95rem;
}
.notice {
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: var(--panel);
  padding: 14px 18px;
  margin: 1.5em 0;
  font-size: 0.95rem;
}

/* Preview list */
.preview-list { font-family: var(--mono); font-size: 0.88rem; background: var(--code-bg); border: 1px solid var(--hairline); border-radius: 6px; padding: 12px 16px; margin: 1em 0; column-width: 16em; column-gap: 2.5em; }
.preview-list div { break-inside: avoid; padding: 1px 0; }
.preview-more { color: var(--muted); font-style: italic; }

/* Status timeline */
.timeline { list-style: none; padding: 0; margin: 2em 0; max-width: 62ch; }
.timeline li { position: relative; padding: 0 0 22px 30px; border-left: 2px solid var(--hairline); margin-left: 8px; }
.timeline li:last-child { padding-bottom: 4px; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--muted);
}
.timeline li.done::before { background: var(--accent); border-color: var(--accent); }
.timeline li.current::before { background: var(--paper); border-color: var(--accent); }
.timeline .t-label { font-weight: 600; }
.timeline .t-ts { display: block; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.state-line { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }

.result-panel {
  border: 1px solid var(--hairline);
  background: var(--panel);
  border-radius: 8px;
  padding: 40px 30px;
  text-align: center;
  margin: 2em 0;
}
.result-panel .kicker { margin-bottom: 0.6em; }
.result-outcome { font-family: var(--serif); font-size: 2.6rem; line-height: 1.15; margin: 0.2em 0 0.4em; overflow-wrap: anywhere; }
.result-sub { color: var(--muted); font-size: 0.95rem; }

/* Hash display */
.hash { font-family: var(--mono); font-size: 0.8rem; overflow-wrap: anywhere; word-break: break-all; }

/* Articles */
.article-list { list-style: none; padding: 0; margin: 2em 0; max-width: 70ch; }
.article-list li { border-top: 1px solid var(--hairline); padding: 22px 0; }
.article-list h3 { margin: 0 0 0.3em; }
.article-list .date { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.article-list p { color: var(--muted); margin: 0.4em 0 0; }
article.prose { padding: 40px 0 60px; }
article.prose h1 { max-width: 24ch; }
article.prose .date { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); display: block; margin-bottom: 2.5em; }
article.prose blockquote { border-left: 3px solid var(--hairline); margin: 1.5em 0; padding: 0.2em 0 0.2em 1.4em; color: var(--muted); }
article.prose h2 { font-size: 1.45rem; }
article.prose .refs { font-size: 0.85rem; color: var(--muted); }
article.prose .refs p { margin-bottom: 0.5em; }
sup { font-size: 0.75em; }

/* Price */
.price-line { font-family: var(--serif); font-size: 1.5rem; }
.price-line small { font-family: var(--sans); font-size: 0.9rem; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--hairline); margin-top: 70px; padding: 44px 0 34px; font-size: 0.88rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 2fr; gap: 30px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-wordmark { font-family: var(--serif); font-size: 1.05rem; margin-bottom: 0.5em; }
.footer-heading { font-weight: 600; margin-bottom: 0.5em; }
.footer-note { color: var(--muted); }
.site-footer a { color: var(--ink); }
.footer-meta { margin-top: 2.5em; padding-top: 1.2em; border-top: 1px solid var(--hairline); color: var(--muted); font-family: var(--mono); font-size: 0.78rem; }
