/* ===== Design tokens ===== */
:root {
  --ink: #1C2321;
  --ink-soft: #4A524E;
  --paper: #EDEEE9;
  --surface: #FFFFFF;
  --ledger: #2F5D50;
  --ledger-light: #DCE8E2;
  --brass: #B08D57;
  --brass-light: #F0E6D6;
  --line: #C9C4B4;
  --danger: #A3402F;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-data: 'IBM Plex Mono', 'Courier New', monospace;

  --radius: 3px;
  --max-width: 1080px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ledger); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--ledger);
  outline-offset: 2px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}
h1 { font-size: 2.4rem; line-height: 1.15; letter-spacing: -0.01em; }
h2 { font-size: 1.6rem; line-height: 1.25; }
h3 { font-size: 1.15rem; }

p { margin: 0; color: var(--ink-soft); }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Tally divider — signature element ===== */
.tally {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--brass);
  margin: 0 0 16px;
  user-select: none;
}
.tally span {
  display: inline-block;
  width: 2px;
  height: 18px;
  background: var(--brass);
}
.tally .strike {
  width: 26px;
  height: 2px;
  transform: rotate(-32deg);
  margin: 0 -8px;
}
.tally-rule {
  height: 1px;
  background: var(--line);
  border: none;
  margin: 48px 0;
}

/* ===== Header ===== */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}
.logo .mark { color: var(--brass); }
.logo .tld { color: var(--ink-soft); font-weight: 400; font-size: 0.95rem; }

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
}
.nav-links a:hover { color: var(--ledger); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--surface); }
.btn-primary {
  background: var(--ledger);
  border-color: var(--ledger);
  color: var(--surface);
}
.btn-primary:hover { background: #264C41; }
.btn-quiet {
  border-color: var(--line);
  color: var(--ink-soft);
  padding: 9px 16px;
  font-size: 0.85rem;
}

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.card-flat {
  background: var(--ledger-light);
  border-radius: var(--radius);
  padding: 16px;
}

/* ===== Data output — every calculated number uses this ===== */
.data {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.stat {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.stat-value {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--ink);
}

/* ===== Form controls ===== */
label {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
input[type="number"], select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  font-family: var(--font-data);
  font-size: 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}
select { font-family: var(--font-body); }

/* ===== Tool grid ===== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.tool-tile {
  display: block;
  text-decoration: none;
  background: var(--ledger-light);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--ledger);
  text-align: left;
  transition: background 0.15s ease;
}
.tool-tile:hover { background: #CDE0D7; }
.tool-tile .name {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--ink);
  display: block;
  margin-top: 8px;
}

/* ===== Event type cards ===== */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.type-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  display: block;
}
.type-card .name { color: var(--ink); font-weight: 600; font-family: var(--font-display); font-size: 1.05rem; display: block; margin-bottom: 4px; }
.type-card .desc { color: var(--ink-soft); font-size: 0.85rem; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 80px;
  padding: 32px 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--ledger); }

/* ===== FAQ ===== */
.faq-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.faq-item:first-child { border-top: 1px solid var(--line); }
.faq-q {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.faq-a { font-size: 0.9rem; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  h1 { font-size: 1.9rem; }
  .nav-links { display: none; }
  .site-header .wrap { height: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
