/* ===========================================================================
   TANKS — the site around the game.
   The game is marker on graph paper. So is this. Three materials only:
   paper, ink and tape. Nothing here is a "panel" or a "card" in the flat-UI
   sense — every box is a hand-ruled rectangle with corners that do not match.
   Deliberately light-only: the paper *is* the brand, and a dark mode would be
   a different game.
   =========================================================================== */

:root{
  --paper:#fbfbfa;
  --ink:#2b2b2b;
  --pencil:#5a6472;
  --blue:#196db4;
  --blue-soft:#5bb8ff;
  --red:#ee4648;
  --red-soft:#ff8080;
  --rule:rgba(90,110,140,.16);
  --rule-major:rgba(90,110,140,.30);
  --tape:rgba(226,214,166,.55);
  --wobble:12px 5px 14px 6px;      /* the house border-radius: no two corners alike */
  --wobble-alt:6px 14px 5px 13px;
}

*{box-sizing:border-box;margin:0;padding:0}

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

/* The sheet. 24px squares with a heavier rule every fifth, exactly as the
   world canvas rules itself, so the page and the game are the same paper. */
body{
  min-height:100%;
  background-color:var(--paper);
  background-image:
    linear-gradient(var(--rule-major) 1px,transparent 1px),
    linear-gradient(90deg,var(--rule-major) 1px,transparent 1px),
    linear-gradient(var(--rule) 1px,transparent 1px),
    linear-gradient(90deg,var(--rule) 1px,transparent 1px);
  background-size:120px 120px,120px 120px,24px 24px,24px 24px;
  font-family:"Patrick Hand",system-ui,-apple-system,sans-serif;
  font-size:19px;line-height:1.62;
  color:var(--ink);
  -webkit-font-smoothing:antialiased;
}

img{max-width:100%;height:auto;display:block}
a{color:var(--blue);text-decoration:none}
a:hover{text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:3px}

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

/* ---- the marker underline, used under every section heading --------------
   A clipped bar rather than a border: the polygon gives it the uneven top
   edge of a line drawn fast with a chisel tip. */
.scrawl::after{
  content:"";display:block;height:4px;margin-top:8px;max-width:220px;
  background:var(--ink);border-radius:3px;
  clip-path:polygon(0 40%,12% 10%,28% 60%,45% 15%,63% 65%,80% 20%,100% 55%,100% 100%,0 100%);
}

h1,h2,h3,h4{line-height:1.22;font-weight:400}
h1{font-size:clamp(34px,6vw,58px)}
h2{font-size:clamp(27px,3.6vw,36px);margin-top:8px}
h3{font-size:clamp(21px,2.6vw,25px)}
h4{font-size:20px;color:var(--pencil)}
.logotype{font-family:"Rock Salt",cursive;letter-spacing:1px}

/* ===== header ============================================================ */
header.top{
  position:sticky;top:0;z-index:40;
  background:rgba(251,251,250,.93);
  backdrop-filter:blur(3px);
  border-bottom:3px solid var(--ink);
}
header.top .bar{display:flex;align-items:center;gap:18px;padding:10px 22px;
  max-width:1080px;margin:0 auto}
header.top .mark{font-family:"Rock Salt",cursive;font-size:20px;color:var(--ink);
  letter-spacing:1px;flex:0 0 auto}
header.top .mark:hover{text-decoration:none;color:var(--blue)}
header.top nav{display:flex;gap:14px;flex-wrap:wrap;flex:1;font-size:17px}
header.top nav a{color:var(--pencil)}
header.top nav a:hover,header.top nav a[aria-current]{color:var(--ink)}
header.top nav a[aria-current]{text-decoration:underline;text-decoration-thickness:2px;
  text-underline-offset:4px}

/* ===== buttons =========================================================== */
.btn{
  display:inline-block;font:inherit;font-size:19px;
  padding:9px 20px;cursor:pointer;
  color:var(--ink);background:none;
  border:2px solid var(--ink);border-radius:var(--wobble);
  transition:transform .09s,background .12s,color .12s;
}
.btn:hover{background:var(--ink);color:var(--paper);text-decoration:none;
  transform:rotate(-.7deg) scale(1.03)}
.btn.big{font-size:27px;padding:13px 38px;border-width:3px}
.btn.play{background:var(--blue);border-color:var(--blue);color:#fff;
  box-shadow:0 0 0 0 rgba(25,109,180,.4)}
.btn.play:hover{background:#12558b;border-color:#12558b;color:#fff}
.btn.ghost{border-style:dashed;color:var(--pencil)}
.btn.ghost:hover{background:var(--pencil);color:var(--paper)}

/* ===== hero ============================================================== */
.hero{padding:56px 0 40px;text-align:center;position:relative;overflow:hidden}
.hero h1{font-family:"Rock Salt",cursive;font-size:clamp(40px,9vw,86px);
  letter-spacing:2px;margin-bottom:6px}
.hero .tag{font-size:clamp(19px,2.5vw,25px);color:var(--pencil);margin-bottom:6px}
.hero .sub{max-width:640px;margin:16px auto 0;font-size:20px}
.hero .cta{display:flex;gap:14px;justify-content:center;flex-wrap:wrap;margin-top:26px}
.hero .nofuss{margin-top:14px;font-size:17px;color:var(--pencil)}
.hero .nofuss b{color:var(--ink)}

/* the two sides, inked in the margins of the hero */
.armies{display:flex;align-items:center;justify-content:center;gap:clamp(14px,5vw,54px);
  margin-top:34px;flex-wrap:wrap}
.armies figure{text-align:center;flex:0 0 auto}
.armies img{height:clamp(74px,13vw,118px);width:auto;margin:0 auto}
.armies figcaption{font-size:16px;color:var(--pencil);margin-top:4px}
.armies .vs{font-family:"Rock Salt",cursive;font-size:clamp(20px,4vw,30px);color:var(--ink)}

/* ===== generic section =================================================== */
section{padding:44px 0}
/* The header is sticky, so an in-page jump would otherwise land the target
   heading underneath it. Every anchorable element keeps the bar's height clear. */
[id]{scroll-margin-top:78px}
section.tint{
  border-top:3px solid var(--ink);border-bottom:3px solid var(--ink);
  background:rgba(255,255,255,.55);
}
.lede{font-size:21px;max-width:700px}
.centered{text-align:center}
.centered .scrawl::after{margin-left:auto;margin-right:auto}

/* ===== hand-ruled boxes ================================================== */
.sheet{
  border:2px solid var(--ink);border-radius:var(--wobble);
  background:#fff;padding:18px 20px;
}
.sheet:nth-child(even){border-radius:var(--wobble-alt)}
.sheet h3{margin-bottom:4px}
.sheet .cost{color:var(--pencil);font-size:17px}

.grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(250px,1fr))}
.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}
/* Explicit two-up rather than auto-fit: this grid is used both in the 1080px
   homepage container and inside the 720px article column, and an auto-fit
   min-width that gives a tidy 2x2 in one gives three-plus-an-orphan or a single
   stacked column in the other. Two columns means two columns. */
@media (max-width:700px){.grid.two{grid-template-columns:1fr}}

/* a numbered step, for the how-to pages */
.steps{counter-reset:step;display:grid;gap:14px;margin-top:20px}
.steps li{list-style:none;counter-increment:step;position:relative;
  border:2px solid var(--ink);border-radius:var(--wobble);background:#fff;
  padding:14px 18px 14px 60px}
.steps li::before{
  content:counter(step);position:absolute;left:14px;top:12px;
  width:32px;height:32px;display:grid;place-items:center;
  border:2px solid var(--ink);border-radius:50%;
  font-family:"Rock Salt",cursive;font-size:14px;background:var(--paper);
}

/* ===== article prose ===================================================== */
.prose{max-width:720px}
.prose > * + *{margin-top:18px}
.prose h2{margin-top:38px}
.prose h3{margin-top:28px}
.prose ul,.prose ol{padding-left:26px}
.prose li + li{margin-top:6px}
.prose blockquote{
  border-left:4px solid var(--blue);padding:4px 0 4px 18px;
  color:var(--pencil);font-size:21px;
}
.prose code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.86em;
  background:rgba(90,110,140,.12);padding:1px 5px;border-radius:4px}
.prose hr{border:none;height:3px;background:var(--ink);border-radius:3px;
  clip-path:polygon(0 40%,12% 10%,28% 60%,45% 15%,63% 65%,80% 20%,100% 55%,100% 100%,0 100%);
  margin:34px 0}
.prose .pull{
  border:2px dashed var(--ink);border-radius:var(--wobble);
  padding:16px 20px;background:rgba(255,255,255,.7);
}

.meta{color:var(--pencil);font-size:17px;margin-top:6px}
.kicker{font-family:"Rock Salt",cursive;font-size:14px;color:var(--red);
  letter-spacing:1px;text-transform:uppercase}

/* ===== tables (tech tree, unit stats) ==================================== */
.tablewrap{overflow-x:auto;border:2px solid var(--ink);border-radius:var(--wobble);
  background:#fff}
table{border-collapse:collapse;width:100%;min-width:520px;font-size:18px}
th,td{text-align:left;padding:9px 14px;border-bottom:1px solid var(--rule-major)}
th{font-family:"Rock Salt",cursive;font-size:12px;letter-spacing:.5px;
  color:var(--pencil);text-transform:uppercase;border-bottom:2px solid var(--ink)}
tbody tr:last-child td{border-bottom:none}
tbody tr:hover{background:rgba(25,109,180,.06)}

/* ===== FAQ =============================================================== */
.faq{display:grid;gap:10px;margin-top:20px}
.faq details{border:2px solid var(--ink);border-radius:var(--wobble);background:#fff;
  padding:12px 18px}
.faq details[open]{background:rgba(255,255,255,.9)}
.faq summary{cursor:pointer;font-size:20px;list-style:none}
.faq summary::-webkit-details-marker{display:none}
.faq summary::before{content:"+ ";font-family:"Rock Salt",cursive;color:var(--red);font-size:15px}
.faq details[open] summary::before{content:"– "}
.faq details > p{margin-top:10px;color:var(--pencil)}

/* ===== card links (blog index, related) ================================== */
.cards{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(290px,1fr));
  margin-top:22px}
a.linkcard{
  display:block;border:2px solid var(--ink);border-radius:var(--wobble);
  background:#fff;padding:16px 18px;color:var(--ink);
  transition:transform .09s;
}
a.linkcard:nth-child(even){border-radius:var(--wobble-alt)}
a.linkcard:hover{text-decoration:none;transform:rotate(-.6deg) translateY(-2px)}
a.linkcard h3{color:var(--blue);font-size:22px}
a.linkcard p{color:var(--pencil);font-size:17px;margin-top:5px}

/* ===== the closing call to action ======================================== */
.endcta{
  text-align:center;border:3px solid var(--ink);border-radius:var(--wobble);
  background:#fff;padding:34px 24px;margin:46px 0;position:relative;
}
/* two strips of masking tape, one at each top corner */
.endcta::before,.endcta::after{
  content:"";position:absolute;top:-13px;width:92px;height:26px;
  background:var(--tape);border:1px solid rgba(160,150,110,.5);
}
.endcta::before{left:26px;transform:rotate(-4deg)}
.endcta::after{right:26px;transform:rotate(3deg)}
.endcta h2{font-family:"Rock Salt",cursive;font-size:clamp(24px,4vw,34px)}
.endcta p{color:var(--pencil);margin:12px auto 20px;max-width:520px}

/* ===== footer ============================================================ */
footer.foot{border-top:3px solid var(--ink);padding:32px 0 44px;margin-top:20px;
  background:rgba(255,255,255,.5)}
footer.foot .cols{display:grid;gap:22px;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr))}
footer.foot h4{font-family:"Rock Salt",cursive;font-size:12px;letter-spacing:1px;
  text-transform:uppercase;color:var(--pencil);margin-bottom:8px}
footer.foot ul{list-style:none;font-size:17px}
footer.foot li + li{margin-top:3px}
footer.foot a{color:var(--pencil)}
footer.foot a:hover{color:var(--ink)}
/* The ask. Sits between the link columns and the legal note -- present on every
   page, but below the fold of all of them, which is the whole brief: findable
   by somebody who went looking, invisible to somebody who came to play. */
footer.foot .support{margin-top:26px;padding-top:18px;font-size:18px;
  border-top:1px solid var(--rule-major);max-width:760px}
footer.foot .support b{color:var(--ink)}
.btn.kofi{font-size:17px;padding:5px 16px;margin-left:6px;white-space:nowrap;
  border-color:var(--red);color:var(--red)}
.btn.kofi:hover{background:var(--red);border-color:var(--red);color:#fff}
.btn.big.kofi{font-size:24px;padding:11px 30px;margin-left:0;border-width:3px}

footer.foot .legal{margin-top:20px;font-size:15px;color:var(--pencil);
  border-top:1px solid var(--rule-major);padding-top:16px;max-width:760px}

/* ===== breadcrumbs ======================================================= */
.crumbs{font-size:16px;color:var(--pencil);padding-top:22px}
.crumbs a{color:var(--pencil)}

/* ===== the note at the foot of a blog post =============================== */
/* Separated from the prose by a torn rule rather than a box, so it reads as the
   author speaking after the piece has ended, not as an advertisement stapled on. */
.postscript{margin:38px 0 0;padding-top:22px;position:relative}
.postscript::before{content:"";position:absolute;top:0;left:0;right:0;height:3px;
  background:var(--ink);border-radius:3px;
  clip-path:polygon(0 40%,12% 10%,28% 60%,45% 15%,63% 65%,80% 20%,100% 55%,100% 100%,0 100%)}
.postscript p + p{margin-top:14px}
.postscript .btn{margin:0 8px 0 0}

/* ===== the play strip that follows you down a long article =============== */
.railcta{margin:40px 0;border:2px dashed var(--ink);border-radius:var(--wobble);
  padding:18px 22px;display:flex;gap:16px;align-items:center;justify-content:space-between;
  flex-wrap:wrap;background:rgba(255,255,255,.7)}
.railcta p{margin:0}
.railcta strong{font-family:"Rock Salt",cursive;font-size:15px}

@media (max-width:640px){
  body{font-size:18px}
  /* Squeezed between the wordmark and the play button, the nav wraps into three
     ragged rows and the sticky header eats a third of a phone screen. Give it
     its own full-width row underneath instead, and it wraps to one. */
  header.top .bar{gap:8px 10px;padding:9px 16px;flex-wrap:wrap}
  header.top nav{font-size:16px;gap:14px;order:3;flex:1 0 100%;
    border-top:1px solid var(--rule-major);padding-top:7px}
  header.top .btn.play{margin-left:auto;font-size:17px;padding:6px 16px}
  [id]{scroll-margin-top:118px}
  .wrap{padding:0 16px}
  section{padding:34px 0}
  .endcta::before,.endcta::after{display:none}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *{transition:none!important}
}
