:root {
  --ink: #17262b;
  --muted: #4d5f65;
  --paper: #fafcf9;
  --mist: #edf3ee;
  --line: #c9d7ce;
  --water: #12343f;
  --reed: #4f7040;
  --reed-ink: #3b5530;
  --on-reed: #ffffff;
  --gold: #d7a02b;
  --gold-soft: #f7e6b8;
  --link: #24578a;
  --river: #9cc2d1;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e4ede7;
    --muted: #a5b5ad;
    --paper: #0e191c;
    --mist: #15262a;
    --line: #2a3f44;
    --water: #081b21;
    --reed: #8fb07c;
    --reed-ink: #aecb9d;
    --on-reed: #0e191c;
    --gold: #e3b445;
    --gold-soft: #33301a;
    --link: #8db8e8;
    --river: #2f5663;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  line-height: 1.2;
  margin: 0 0 .6em;
  font-weight: 700;
  letter-spacing: -.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); margin-top: 2.2em; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--reed);
  color: var(--on-reed);
  padding: 10px 16px;
  z-index: 10;
}
.skip:focus { left: 0; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--reed-ink);
  text-decoration: none;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
}
.logo svg { width: 32px; height: 32px; color: var(--reed); }

.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 8px 12px;
  border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--line); }
.nav a[aria-current="page"] { border-bottom-color: var(--gold); font-weight: 600; }

.burger {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 14px;
  font: inherit;
  border-radius: 4px;
  cursor: pointer;
}

@media (max-width: 860px) {
  .burger { display: inline-block; }
  .nav { display: none; flex-direction: column; width: 100%; padding-bottom: 12px; }
  .nav.open { display: flex; }
  .bar { flex-wrap: wrap; padding-top: 8px; }
}

/* ruler motif */
.ruler {
  height: 16px;
  color: var(--ink);
  opacity: .5;
  background:
    linear-gradient(90deg, currentColor 1px, transparent 1px) left bottom / 10px 7px repeat-x,
    linear-gradient(90deg, currentColor 1px, transparent 1px) left bottom / 50px 14px repeat-x;
}

/* hero */
.hero { padding: 48px 0 28px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero { padding-top: 32px; }
}

.btn {
  display: inline-block;
  background: var(--reed);
  color: var(--on-reed);
  text-decoration: none;
  padding: 11px 22px;
  border-radius: 4px;
  font-weight: 600;
  border: 2px solid var(--reed);
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--reed-ink); }

/* page head */
.page-head { padding: 36px 0 8px; }
.page-head .lead { font-size: 1.2rem; color: var(--muted); max-width: 40em; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 6px; }

.prose { max-width: 68ch; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .4em; }
.prose h2:first-child { margin-top: 0; }

main { padding-bottom: 56px; }
.section { padding-top: 12px; }

/* rows: label left, text right */
.rows { margin: 24px 0; }
.row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.row:last-child { border-bottom: 1px solid var(--line); }
.row h3 { margin: 0; }
.row p:last-child { margin-bottom: 0; }
@media (max-width: 700px) { .row { grid-template-columns: 1fr; gap: 6px; } }

.note {
  border-left: 4px solid var(--gold);
  background: var(--mist);
  padding: 14px 18px;
  margin: 24px 0;
  max-width: 68ch;
}
.note p:last-child { margin-bottom: 0; }

/* trophy ticket */
.demo { margin: 24px 0; }
.demo-caption { font-size: .85rem; color: var(--muted); margin-top: 8px; }

.ticket {
  background: linear-gradient(180deg, var(--gold-soft), var(--paper) 90%);
  border: 1px solid var(--gold);
  border-radius: 6px 6px 0 0;
  padding: 20px 22px 0;
  max-width: 460px;
}
.ticket h3 { margin: 0 0 10px; font-size: 1.6rem; }
.ticket dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; margin: 0 0 12px; }
.ticket dt { color: var(--muted); }
.ticket dd { margin: 0; font-weight: 600; }
.ticket .place { color: var(--reed-ink); margin: 0 0 14px; font-weight: 500; }
.ticket .ruler { margin: 0 -22px; opacity: .6; }

/* feed demo */
.feed { max-width: 560px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.post { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--line); display: inline-block; flex: none; }
.post-head small { color: var(--muted); }
.tag {
  font-size: .8rem;
  border: 1px solid var(--gold);
  background: var(--gold-soft);
  color: var(--ink);
  padding: 1px 8px;
  border-radius: 999px;
}
.tag.news { border-color: var(--reed); background: var(--mist); }
.post p { margin: 6px 0 10px; }
.post-foot { display: flex; gap: 18px; color: var(--muted); font-size: .9rem; }
.post-foot span { display: inline-flex; gap: 5px; align-items: center; }
.post-foot svg { width: 16px; height: 16px; }
.post .mini { margin: 8px 0 10px; padding: 8px 12px; background: var(--gold-soft); border-radius: 4px; font-size: .95rem; }

/* map demo */
.mapbox { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--mist); max-width: 640px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); background: var(--paper); }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: .88rem; color: var(--muted); }
.chip.on { background: var(--reed); border-color: var(--reed); color: var(--on-reed); }
.mapbox svg { display: block; width: 100%; height: auto; }

/* rating demo */
.rating { max-width: 460px; list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 6px; }
.rating li { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.rating li:last-child { border-bottom: 0; }
.rating .pos { width: 30px; height: 30px; border-radius: 50%; background: var(--mist); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.rating li:first-child .pos { background: var(--gold-soft); border: 1px solid var(--gold); }
.rating .who { flex: 1; }
.rating small { color: var(--muted); display: block; }

/* split layout for text + demo */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; margin: 28px 0; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 12px; } }

/* journal list */
.articles { list-style: none; padding: 0; margin: 24px 0; max-width: 760px; }
.articles li { padding: 20px 0; border-top: 1px solid var(--line); }
.articles li:last-child { border-bottom: 1px solid var(--line); }
.articles h2, .articles h3 { margin: 0 0 6px; font-size: 1.35rem; }
.articles h2 a, .articles h3 a { color: var(--ink); text-decoration: none; }
.articles h2 a:hover, .articles h3 a:hover { text-decoration: underline; }
.articles p { margin: 0; color: var(--muted); }
.meta { color: var(--muted); font-size: .9rem; margin-bottom: 6px; }

.faq details { border-top: 1px solid var(--line); padding: 14px 0; max-width: 70ch; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 10px 0 0; }

.status-list { list-style: none; padding: 0; margin: 0 0 1.4em; max-width: 68ch; }
.status-list li { padding: 8px 0 8px 28px; position: relative; border-bottom: 1px dashed var(--line); }
.status-list li::before { content: ""; position: absolute; left: 4px; top: 16px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--reed); background: var(--reed); }
.status-list.idea li::before { background: transparent; border-color: var(--gold); }

/* footer */
.site-footer { background: var(--water); color: #dbe7e0; padding: 36px 0 28px; margin-top: 24px; }
.site-footer a { color: #dbe7e0; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.site-footer h3 { font-size: 1rem; margin-bottom: .5em; color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer p { margin: 0 0 .6em; }
.legal { margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .15); font-size: .9rem; opacity: .85; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; } }

.err { text-align: left; padding: 56px 0 24px; }
.err .big { font-family: Georgia, serif; font-size: clamp(4rem, 14vw, 8rem); line-height: 1; margin: 0; color: var(--reed); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
