:root{
  --bg:#f5f0e4;
  --surface:#fffdf6;
  --text:#221d17;
  --muted:#6d6155;
  --primary:#8c2f1f;
  --accent:#1f5c4d;
  --line:rgb(34 29 23 / .12);
  --radius:6px;
  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px;
  --space-5:24px; --space-6:32px; --space-7:48px; --space-8:64px;
  --fs-xs:13px; --fs-sm:15px; --fs-base:17px; --fs-lg:20px;
  --fs-xl:26px; --fs-2xl:34px; --fs-3xl:52px;
  --shadow:0 1px 0 var(--line), 0 12px 28px rgb(34 29 23 / .06);
}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  background-color:var(--bg);
  background-image:linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size:28px 28px;
  background-position:-1px -1px;
  color:var(--text);
  font-family:Inter, system-ui, -apple-system, sans-serif;
  font-size:var(--fs-base);
  line-height:1.65;
  -webkit-font-smoothing:antialiased;
}
img{max-width:100%;height:auto;display:block}
a{color:var(--primary);text-decoration-thickness:1px;text-underline-offset:2px}
a:hover{color:var(--text)}
:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
::selection{background:rgb(140 47 31 / .16)}
h1,h2,h3,h4{font-family:Fraunces, Georgia, serif;font-weight:700;line-height:1.15;letter-spacing:-.01em;text-wrap:balance;margin:0 0 var(--space-3)}
h1{font-size:var(--fs-3xl)}
h2{font-size:var(--fs-2xl);margin-top:var(--space-7)}
h3{font-size:var(--fs-lg);margin-top:var(--space-5)}
p{margin:0 0 var(--space-4);max-width:68ch;text-wrap:pretty}
ul,ol{margin:0 0 var(--space-4);padding-left:22px;max-width:68ch}
li{margin-bottom:var(--space-2)}
strong{font-weight:600}
.wrap{max-width:1140px;margin-inline:auto;padding-inline:20px}
.skip-link{position:absolute;left:-9999px}
.skip-link:focus{left:16px;top:16px;z-index:20;background:var(--surface);padding:10px 14px;border-radius:var(--radius)}
.site-header{position:sticky;top:0;z-index:10;background:rgb(245 240 228 / .94);border-bottom:1px solid var(--line);backdrop-filter:saturate(1.1) blur(4px)}
.header-inner{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4);min-height:66px}
.brand{display:inline-flex;align-items:center;gap:10px;font-family:Fraunces, Georgia, serif;font-size:20px;font-weight:700;color:var(--text);text-decoration:none;letter-spacing:-.01em}
.brand-mark{display:grid;place-items:center;width:30px;height:30px;border:1.5px solid var(--primary);border-radius:4px;font-size:12px;letter-spacing:.04em;color:var(--primary);font-family:Inter, sans-serif}
.site-nav{display:flex;gap:var(--space-5);font-size:var(--fs-sm)}
.site-nav a{color:var(--muted);text-decoration:none;padding-block:6px;border-bottom:2px solid transparent}
.site-nav a:hover{color:var(--text)}
.site-nav a[aria-current="page"]{color:var(--text);border-bottom-color:var(--primary)}
.site-footer{margin-top:var(--space-8);border-top:1px solid var(--line);padding-block:var(--space-7) var(--space-6);font-size:var(--fs-sm);color:var(--muted)}
.footer-inner{display:grid;grid-template-columns:1.6fr 1fr 1fr;gap:var(--space-6)}
.footer-col h2{font-family:Inter, sans-serif;font-size:var(--fs-xs);text-transform:uppercase;letter-spacing:.08em;color:var(--text);margin:0 0 var(--space-3)}
.footer-col ul{list-style:none;padding:0;margin:0}
.footer-col li{margin-bottom:6px}
.footer-col a{color:var(--muted);text-decoration:none}
.footer-col a:hover{color:var(--primary)}
.footer-legal{margin-top:var(--space-6);padding-top:var(--space-4);border-top:1px solid var(--line);font-size:var(--fs-xs)}
.footer-legal p{margin:0;max-width:80ch}


/* ---------- components ---------- */
.hero{padding-block:var(--space-8) var(--space-7);border-bottom:1px solid var(--line)}
.hero-eyebrow{font-size:var(--fs-xs);text-transform:uppercase;letter-spacing:.09em;color:var(--primary);font-weight:600;margin-bottom:var(--space-3)}
.hero h1{font-size:clamp(38px, 5.2vw, var(--fs-3xl));max-width:19ch;margin-bottom:var(--space-4)}
.hero-lead{font-size:var(--fs-lg);color:var(--muted);max-width:62ch;margin-bottom:var(--space-5)}
.hero-actions{display:flex;flex-wrap:wrap;gap:var(--space-3);align-items:center}
.btn{display:inline-flex;align-items:center;justify-content:center;min-height:46px;padding:0 22px;border-radius:var(--radius);background:var(--primary);color:#fffdf6;font-weight:600;font-size:var(--fs-sm);text-decoration:none;border:1px solid var(--primary);transition:transform 160ms ease, background-color 160ms ease}
.btn:hover{background:#75261a;color:#fffdf6;transform:translateY(-1px)}
.btn-ghost{background:transparent;color:var(--text);border-color:var(--line)}
.btn-ghost:hover{background:var(--surface);color:var(--text);border-color:var(--primary)}
.fact-strip{display:flex;flex-wrap:wrap;gap:var(--space-5);list-style:none;padding:0;margin:var(--space-6) 0 0;font-size:var(--fs-sm)}
.fact-strip li{color:var(--muted)}
.fact-strip b{display:block;font-family:Fraunces, Georgia, serif;font-size:var(--fs-xl);color:var(--text);font-weight:700;font-variant-numeric:tabular-nums}
.puzzle-list{list-style:none;padding:0;margin:var(--space-5) 0 0;border-top:1px solid var(--line)}
.puzzle-list li{display:grid;grid-template-columns:56px 1fr auto;gap:var(--space-4);align-items:baseline;padding:var(--space-4) 0;margin:0;border-bottom:1px solid var(--line)}
.puzzle-num{font-family:Fraunces, Georgia, serif;font-size:24px;color:rgb(140 47 31 / .42);font-variant-numeric:tabular-nums}
.puzzle-list h3{margin:0 0 2px;font-size:var(--fs-base);font-family:Inter, sans-serif;font-weight:600}
.puzzle-list p{margin:0;font-size:var(--fs-sm);color:var(--muted)}
.puzzle-tag{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:#16453a;font-weight:600;border:1px solid rgb(31 92 77 / .3);border-radius:4px;padding:2px 8px;white-space:nowrap}
.table-scroll{overflow-x:auto;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);margin:var(--space-4) 0 var(--space-5)}
table{width:100%;border-collapse:collapse;font-size:var(--fs-sm);min-width:520px}
th,td{text-align:left;padding:11px 14px;border-bottom:1px solid var(--line);vertical-align:top}
thead th{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);background:rgb(34 29 23 / .035);font-weight:600}
tbody th{font-weight:600;white-space:nowrap}
tbody tr:last-child td, tbody tr:last-child th{border-bottom:0}
.num{font-variant-numeric:tabular-nums;white-space:nowrap}
.steps{list-style:none;padding:0;margin:var(--space-5) 0;counter-reset:step}
.steps li{counter-increment:step;display:grid;grid-template-columns:38px 1fr;gap:var(--space-4);padding:var(--space-4) 0;border-bottom:1px solid var(--line);margin:0;max-width:none}
.steps li::before{content:counter(step, decimal-leading-zero);font-family:Fraunces, Georgia, serif;font-size:20px;color:var(--primary);line-height:1.3}
.steps b{display:block;margin-bottom:2px}
.steps span{color:var(--muted);font-size:var(--fs-sm)}
.callout{background:var(--surface);border:1px solid var(--line);border-left:4px solid var(--accent);border-radius:var(--radius);padding:var(--space-4) var(--space-5);margin:var(--space-5) 0}
.callout p:last-child{margin-bottom:0}
.callout strong{color:var(--accent)}
.warn{border-left-color:var(--primary)}
.warn strong{color:var(--primary)}
.faq{margin-top:var(--space-5);border-top:1px solid var(--line)}
.faq details{border-bottom:1px solid var(--line);padding:var(--space-3) 0}
.faq summary{font-weight:600;cursor:pointer;padding-block:4px}
.faq summary::marker{color:var(--primary)}
.faq p{margin:var(--space-2) 0 0;color:var(--muted);font-size:var(--fs-sm)}
.grid-2{display:grid;grid-template-columns:repeat(2, 1fr);gap:var(--space-5);margin-block:var(--space-5)}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:var(--space-5)}
.card h3{margin-top:0}
.card p:last-child{margin-bottom:0}


/* ---------- article / guide ---------- */
.article{padding-block:var(--space-6) 0}
.breadcrumb{font-size:var(--fs-xs);color:var(--muted);margin-bottom:var(--space-4)}
.breadcrumb ol{display:flex;flex-wrap:wrap;gap:6px;list-style:none;padding:0;margin:0;max-width:none}
.breadcrumb li+li::before{content:"/";margin-right:6px;color:var(--line)}
.breadcrumb a{color:var(--muted);text-decoration:none}
.breadcrumb a:hover{color:var(--primary)}
.article-header{border-bottom:1px solid var(--line);padding-bottom:var(--space-5);margin-bottom:var(--space-6)}
.article-header h1{max-width:24ch}
.article-dek{font-size:var(--fs-lg);color:var(--muted);max-width:62ch;margin-bottom:0}
.article-meta{font-size:var(--fs-xs);color:var(--muted);margin-top:var(--space-3);margin-bottom:0}
.article-body h2{margin-top:var(--space-7)}
.article-body h2:first-child{margin-top:0}
.article-body>:is(p,ul,ol,.callout,.table-scroll,.faq,.steps){max-width:72ch}
.article-body blockquote{margin:var(--space-5) 0;padding-left:var(--space-4);border-left:3px solid var(--line);color:var(--muted);font-style:italic}
.more-guides{margin-top:var(--space-8);padding-top:var(--space-5);border-top:1px solid var(--line)}
.more-guides h2{font-size:var(--fs-lg);margin-top:0}
.more-guides dl{display:grid;gap:var(--space-4);margin:0}
.more-guides dt{font-weight:600;margin-bottom:2px}
.more-guides dd{margin:0;color:var(--muted);font-size:var(--fs-sm)}
.more-guides a{text-decoration:none}
.more-guides a:hover{text-decoration:underline}
/* ---------- mobile ---------- */
@media (max-width:760px){
  :root{--fs-3xl:38px;--fs-2xl:27px;--fs-xl:22px}
  .header-inner{flex-direction:column;align-items:flex-start;gap:var(--space-2);padding-block:12px}
  .site-nav{gap:var(--space-4);font-size:14px;overflow-x:auto;max-width:100%}
  .hero{padding-block:var(--space-6) var(--space-5)}
  .hero-actions{flex-direction:column;align-items:stretch}
  .hero-actions .btn{width:100%}
  .fact-strip{flex-direction:column;gap:var(--space-4)}
  .footer-inner{grid-template-columns:1fr;gap:var(--space-5)}
  .grid-2{grid-template-columns:1fr}
  .puzzle-list li{grid-template-columns:40px 1fr;row-gap:var(--space-2)}
  .puzzle-tag{grid-column:2}
  .steps li{grid-template-columns:30px 1fr;gap:var(--space-3)}
  table{min-width:480px}
}
@media (prefers-reduced-motion:reduce){
  *{animation:none!important;transition:none!important}
}


/* Interactive puzzle boards */
.solver{scroll-margin-top:6.5rem;margin:0 0 var(--space-6);padding:clamp(12px,2vw,24px);background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
.solver [hidden]{display:none!important}
.solver h2,.solver h3{margin-top:0}
.solver-controls,.solver-actions{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:end}
.solver-controls label,.solver-piece label{display:grid;gap:3px;font-size:var(--fs-sm);font-weight:600}
.solver-controls input,.solver-piece input{width:5rem}
.solver select,.solver input,.solver button:not(.btn){min-height:36px;border:1px solid var(--line);border-radius:4px;background:var(--surface);color:var(--text);font:inherit;font-size:var(--fs-sm);padding:4px 8px;max-width:100%}
.solver button{cursor:pointer}
.solver button:disabled{cursor:wait;opacity:.72}
.solver button:not(.btn):hover{border-color:var(--accent)}
.solver button[aria-pressed="true"]:not(.solver-tile){background:var(--accent);border-color:var(--accent);color:var(--surface)}
.solver-columns{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;margin-top:14px}
.solver-panel{min-width:0;padding:12px;border:1px solid var(--line);border-radius:var(--radius);background:var(--bg)}
.solver-result{background:color-mix(in srgb,var(--accent) 7%,var(--surface))}
.solver-help,.solver-board-label{font-size:var(--fs-sm);color:var(--muted);margin:8px 0}
.solver-help:empty{display:none}
.solver-tools{padding:0;border:0;margin:0;min-width:0;display:flex;flex-wrap:wrap;gap:6px}
.solver-tools legend{font-size:var(--fs-sm);padding:0;margin-bottom:5px;font-weight:600}
.solver-sockets{margin:8px 0}
.solver-grid{display:grid;gap:2px;grid-template-columns:repeat(var(--columns),minmax(36px,44px));margin:8px 0;width:fit-content;max-width:100%}
.solver-grid-scroll{overflow-x:auto;max-width:100%;margin:8px 0}
.solver-grid-scroll .solver-grid{max-width:none}
.solver-tile,.solver button.solver-tile{isolation:isolate;position:relative;display:grid;place-items:center;border:1px solid var(--line);border-radius:4px;min-width:36px;min-height:36px;aspect-ratio:1;margin:0;padding:0;background:var(--surface);text-align:center}
.solver-tile:focus-visible{z-index:1;outline-offset:-2px}
.solver button.solver-tile[data-socket]{border-color:var(--accent)}
.solver-tile[data-socket]::after{content:attr(data-socket);position:absolute;top:0;left:2px;font-size:12px;font-weight:700;line-height:1.2;color:var(--accent)}
.solver-glyph{font-size:24px;line-height:1;color:var(--accent)}
.solver-tile[data-pipe-result="wet"]{background:color-mix(in srgb,var(--accent) 14%,var(--surface));color:var(--accent);font-weight:700}
.solver-tile[data-pipe-result="dry"]{background:var(--bg);color:var(--text);font-size:12px;font-weight:600}
.solver-actions{margin:12px 0 0}
.solver-actions .btn{font-family:inherit}
.solver-guide{border-top:1px solid var(--line);margin-top:16px;padding-top:12px}
.solver-guide summary{cursor:pointer;font-weight:600;margin-bottom:8px}
.solver-guide p:last-child{margin-bottom:0}
@media (max-width:820px){.solver-columns{grid-template-columns:minmax(0,1fr)}}
@media (max-width:500px){.solver{padding:8px}.solver-panel{padding:6px}.solver-grid{gap:0}}


.solver-piece-heading{margin:12px 0 6px!important}
.solver-piece-controls{display:flex;flex-wrap:wrap;gap:5px}
.solver-piece{min-width:0;padding:4px;border:1px solid var(--line);border-radius:4px;background:var(--surface);text-align:center}
.solver-piece input{width:3.6rem;padding:3px 4px}
.solver-piece-icon{display:grid;grid-template-columns:repeat(4,6px);grid-template-rows:repeat(3,6px);place-self:center;gap:1px}
.solver-piece-icon span{background:var(--block-color);border-radius:1px}
.solver-tile[data-crate="blocked"],.solver button.solver-tile[data-crate="blocked"]{background:repeating-linear-gradient(135deg,var(--line) 0 3px,var(--bg) 3px 7px);color:var(--muted)}
.solver-tile[data-crate="placed"]{background:var(--tile-color);color:var(--text);border-color:var(--muted);font-weight:700}
.solver-tile[data-crate="unfilled"]{border:1px dashed var(--muted);color:var(--muted)}
.solver textarea{display:block;width:100%;padding:6px;border:1px solid var(--line);border-radius:4px;font:inherit}


.solver input[data-share-fallback]{width:100%}
.solver-entry{display:flex;gap:8px 12px;flex-wrap:wrap;margin-top:var(--space-5)}
.solver-entry .btn{padding-inline:15px}
.puzzle-solver-link{display:block;margin-top:4px;font-weight:600;font-size:var(--fs-sm)}
