/* What's Your Moat, public teaser. Keeps the map's own character: pale sea, deep ink, a serif display face.
   Light by default, dark only when the visitor chose it. */
:root {
  --bg: #DCECEA; --paper: #F1F8F6; --ink: #0F2F39; --muted: #47666E; --line: #B3CFCC; --sea: #7FB6BE; --sea-deep: #4E8F9B; --stone: #F7FBFA; --hot: #C2542D;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --body: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  --bg: #071620; --paper: #0D2330; --ink: #E4EFE9; --muted: #93B3B5; --line: #1F3D49; --sea: #1E5563; --sea-deep: #2F7C8C; --stone: #12303F; --hot: #FF7F52;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
.w { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 760px) { .w { padding: 0 36px; } }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--hot); outline-offset: 3px; border-radius: 4px; }
.small { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.draft-tag { display: inline-block; vertical-align: middle; font-family: var(--mono); font-size: 10.5px; line-height: 1; color: #8A5A00; background: #FFF4D6; border: 1px solid #F0D48A; border-radius: 999px; padding: 4px 8px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.head .name { font-family: var(--display); font-size: 22px; text-decoration: none; }
.head nav { display: flex; gap: 16px; align-items: center; }
.head nav a { font-size: 14px; color: var(--muted); text-decoration: none; padding: 10px 0; }
.head nav a:hover { color: var(--ink); }
.head nav .wide { display: none; }
@media (min-width: 760px) { .head nav .wide { display: inline; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 12px 20px; border-radius: 4px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font: 600 15px var(--body); text-decoration: none; cursor: pointer; }
.btn:hover { opacity: .88; }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.quiet:hover { border-color: var(--ink); opacity: 1; }
.hero { padding: 34px 0 10px; }
@media (min-width: 880px) { .hero { padding: 72px 0 20px; } }
.hero h1 { font-size: clamp(48px, 13vw, 104px); line-height: .98; }
.hero p.lede { margin: 20px 0 0; font-size: clamp(18px, 2.3vw, 22px); line-height: 1.45; color: var(--muted); max-width: 36ch; }
.go { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
section.s { padding: 56px 0 0; }
@media (min-width: 880px) { section.s { padding-top: 96px; } }
.sh { display: grid; gap: 10px; margin-bottom: 24px; }
.sh h2 { font-size: clamp(30px, 6vw, 46px); line-height: 1.05; max-width: 20ch; }
.sh p { margin: 0; color: var(--muted); max-width: 54ch; }

/* build your castle */
.build { display: grid; gap: 18px; }
@media (min-width: 900px) { .build { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 34px; align-items: start; } }
.castle-card { position: sticky; top: 0; z-index: 5; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 12px 12px 10px; }
@media (min-width: 900px) { .castle-card { top: 18px; padding: 20px; } }
.castle-card svg { display: block; width: 100%; height: auto; }
.readout { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 4px 4px 0; }
.readout .score { font-family: var(--display); font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout .score small { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.readout .weak { font-size: 14px; color: var(--muted); text-align: end; max-width: 26ch; line-height: 1.35; }
.fun { margin: 6px 4px 0; font-size: 12px; color: var(--muted); line-height: 1.35; }
@media (max-width: 899px) { .castle-card svg { max-height: 34vh; } .readout .weak { font-size: 13px; } }
.wall-fill { fill: var(--stone); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.wall-weak { fill: var(--stone); stroke: var(--hot); stroke-width: 2; stroke-linejoin: round; }
.wall-name { font: 9.5px var(--mono); fill: var(--muted); text-anchor: middle; }
.water { fill: var(--sea); }
.wave { fill: none; stroke: var(--sea-deep); stroke-width: 1.5; stroke-linecap: round; }
.groundline { stroke: var(--ink); stroke-width: 1.5; }
.flag { fill: var(--hot); }
.walls { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.walls li { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 8px; }
.walls label { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-weight: 600; font-size: 16px; }
.walls label .kind { display: block; margin-top: 1px; }
.walls output { font-family: var(--mono); font-size: 14px; color: var(--muted); white-space: nowrap; }
.walls .ask { margin: 2px 0 0; font-size: 14px; color: var(--muted); line-height: 1.4; }
.walls input[type=range] { width: 100%; height: 44px; margin: 0; accent-color: var(--ink); }
.walls .kind { font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 400; }
.earn { margin-top: 22px; padding: 22px; border: 1px solid var(--ink); border-radius: 8px; background: var(--paper); display: grid; gap: 12px; }
.earn h3 { font-size: 26px; line-height: 1.1; }
.earn p { margin: 0; color: var(--muted); max-width: 56ch; }
.earn .btn { justify-self: start; }

.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.rows li { display: grid; gap: 4px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.rows b { font-family: var(--display); font-weight: 400; font-size: 22px; }
.rows span { color: var(--muted); font-size: 16px; }
.rows .kind { font-family: var(--mono); font-size: 11.5px; }
@media (min-width: 880px) { .rows li { grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: baseline; } }
.legend { display: grid; gap: 14px; margin-top: 26px; }
@media (min-width: 880px) { .legend { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.legend div { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.legend h3 { font-size: 22px; margin-bottom: 6px; }
.legend p { margin: 0; color: var(--muted); font-size: 15.5px; }
.honest { margin: 26px 0 0; padding: 0 0 0 18px; color: var(--muted); display: grid; gap: 8px; max-width: 62ch; }
.counts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
@media (min-width: 760px) { .counts { grid-template-columns: repeat(5, 1fr); } }
.counts div { background: var(--paper); padding: 18px 16px; display: grid; gap: 2px; }
.counts b { font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.counts span { font-size: 14px; color: var(--muted); }
.regions { margin: 18px 0 0; color: var(--muted); max-width: 62ch; }
.offer { display: grid; gap: 14px; }
@media (min-width: 880px) { .offer { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.offer > div { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.offer h3 { font-size: 26px; }
.offer p { margin: 0; color: var(--muted); font-size: 15.5px; flex: 1; }
.offer .price { font-family: var(--mono); font-size: 13px; color: var(--ink); margin: 6px 0; flex: none; }
.end { margin-top: 64px; padding: 44px 0 56px; border-top: 1px solid var(--ink); display: grid; gap: 14px; }
.end h2 { font-size: clamp(34px, 7vw, 60px); line-height: 1.02; max-width: 16ch; }
.end p { margin: 0; color: var(--muted); max-width: 48ch; }
.themeswitch { display: flex; justify-content: center; padding: 0 0 26px; }
.themeswitch button { min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font: 13px var(--mono); cursor: pointer; }
:root[data-theme="dark"] .lgbar, :root[data-theme="dark"] .lgfoot { --lg-bg: #0F0F10; --lg-ink: #F5F5F7; --lg-muted: #A1A1A6; --lg-rule: #2C2C2E; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
@media (prefers-reduced-motion: no-preference) { .wall-fill, .wall-weak, .water { transition: all .25s ease; } }
