:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --text: #1d2024;
  --muted: #5d636b;
  --line: #dcd9d1;
  --accent: #8a5a22;
  --accent-soft: #f1e6d6;
  --notice: #faf3e8;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181b;
    --surface: #1e2125;
    --text: #e9e7e2;
    --muted: #a3a8ae;
    --line: #33373d;
    --accent: #d6a462;
    --accent-soft: #3a2e1f;
    --notice: #24201a;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--sans);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-wrap: break-word;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 16px; padding-bottom: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--serif); font-size: 1.2rem; font-weight: 600; letter-spacing: 0.01em; }
.brand .mark { width: 30px; height: 30px; color: var(--text); flex: none; }
.brand .ltd { color: var(--muted); font-weight: 400; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.95rem; }
.site-header nav a { color: var(--muted); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.site-header nav a:hover { color: var(--text); }
.site-header nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

main { flex: 1; padding-top: 48px; padding-bottom: 72px; }

/* Type */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -0.005em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); margin: 0 0 20px; }
h2 { font-size: 1.5rem; margin: 44px 0 12px; }
h3 { font-size: 1.2rem; margin: 28px 0 8px; }
p, ul, dl { margin: 0 0 16px; }
ul { padding-left: 1.2em; }
li { margin-bottom: 8px; }
.lead { font-size: 1.15rem; color: var(--text); }
.muted { color: var(--muted); }
.updated { color: var(--muted); font-size: 0.95rem; margin-top: -8px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; color: var(--muted); margin-bottom: 18px; }
.working { font-family: var(--sans); font-size: 0.55em; font-weight: 400; color: var(--muted); white-space: nowrap; vertical-align: middle; }
h3 .working { font-size: 0.7em; }
.crumbs { font-size: 0.9rem; color: var(--muted); margin-bottom: 20px; }

.status {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 14px;
}

/* Home */
.hero { max-width: 760px; padding: 24px 0 16px; }
.hero h1 { font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.6rem); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { margin-top: 0; }
.card p { color: var(--muted); }
.card .more { margin-top: auto; color: var(--accent); font-weight: 600; font-size: 0.95rem; }
.card-icon { width: 48px; height: 48px; color: var(--accent); margin-bottom: 16px; }
.card-icon svg { width: 100%; height: 100%; }

.contact { max-width: 760px; }

/* Content blocks */
.notice { background: var(--notice); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; padding: 4px 22px 6px; margin: 32px 0; }
.notice h2 { font-size: 1.15rem; margin-top: 16px; }

.contact-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px 6px; margin: 24px 0; }

.app-links { display: flex; flex-wrap: wrap; gap: 10px; }
.app-links a { border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px; text-decoration: none; background: var(--surface); }
.app-links a:hover { border-color: var(--accent); }

details { border-bottom: 1px solid var(--line); padding: 14px 0; }
details:first-of-type { border-top: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 10px 0 4px; color: var(--muted); }

.toc { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin: 28px 0; font-size: 0.95rem; }
.toc a { text-decoration: none; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
@media (max-width: 560px) {
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 12px; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 36px; font-size: 0.88rem; color: var(--muted); }
.site-footer p { margin: 0 0 6px; }

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
}
