/* Boombaland website. Colours are the game's menu tokens (Assets/_Project/Code/Menu/UI/USS/tokens.uss); frames are the
   game's leafless R3 kit pieces (assets/kit/, from Assets/_Project/Art/UI/Menu). Fonts are the game's own (OFL 1.1). */

@font-face { font-family: "Lilita One"; src: url("/assets/fonts/LilitaOne-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("/assets/fonts/Fredoka-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("/assets/fonts/Fredoka-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --wood: rgb(124, 78, 40);
  --wood-dark: rgb(74, 44, 22);
  --parchment: rgb(242, 226, 192);
  --parchment-pressed: rgb(218, 196, 156);
  --ink: rgb(66, 38, 18);
  --ink-muted: rgb(102, 70, 44);
  --leaf: rgb(58, 128, 34);
  --leaf-pressed: rgb(44, 100, 26);
  --leaf-edge: rgb(32, 76, 18);
  --cream: rgb(255, 247, 228);
  --gold: rgb(232, 178, 48);
  --gold-edge: rgb(160, 110, 20);
  --sky: rgb(112, 184, 236);
  --outline: rgb(24, 14, 6);
  --focus: rgb(240, 118, 26);
  --gutter: 16px;
  --max: 72rem;
  --display: "Lilita One", "Fredoka", system-ui, sans-serif;
  --ui: "Fredoka", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --prose: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font: 600 1.0625rem/1.55 var(--ui); overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--leaf-pressed); text-decoration-thickness: 2px; text-underline-offset: 2px; }
a:hover { color: var(--leaf-edge); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; letter-spacing: .01em; margin: 0 0 .5em; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--cream); padding: .5rem 1rem; }
.skip:focus { left: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Top bar: dark wood plank ---------------------------------------------------------------------------------- */
.topbar { background: var(--wood-dark); border-bottom: 4px solid var(--wood); box-shadow: 0 2px 0 var(--outline); position: relative; z-index: 5; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 60px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--cream);
  font: 400 1.5rem/1 var(--display); letter-spacing: .01em; text-shadow: 0 2px 0 var(--outline); }
.brand:hover { color: var(--gold); }
.brand img { width: 40px; height: 40px; border-radius: 9px; border: 2px solid var(--wood); box-shadow: 0 2px 0 var(--outline); }
.nav { display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin: 0; padding: 0; list-style: none; }
.nav a { color: var(--cream); text-decoration: none; font-weight: 700; padding: .35rem .1rem; display: inline-block;
  text-shadow: 0 2px 0 var(--outline); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--gold); }

/* Phone menu (nav.js): below 800px, with JS, the main nav becomes a wood panel under the bar, opened by the game's own
   home-screen menu button. Without JS the nav simply wraps, as before. The panel overlays the page: no layout shift. */
.menu-btn { display: none; }
@media (max-width: 799px) {
  .js .topbar .wrap { flex-wrap: nowrap; }
  .js .menu-btn { display: inline-flex; flex: none; width: 48px; height: 48px; padding: 0; border: 0; background: none;
    border-radius: 50%; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .js .menu-btn img { width: 48px; height: 48px; display: block; }
  .js .menu-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
  .js .site-nav { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--wood-dark);
    border-bottom: 4px solid var(--wood); box-shadow: 0 2px 0 var(--outline), 0 10px 18px rgba(0, 0, 0, .3);
    padding: .25rem var(--gutter) .75rem; }
  .js .topbar.menu-open .site-nav { display: block; }
  .js .site-nav .nav { flex-direction: column; flex-wrap: nowrap; gap: 0; }
  .js .site-nav .nav li + li { border-top: 1px solid rgba(255, 255, 255, .1); }
  .js .site-nav .nav a { display: block; padding: .75rem .25rem; font-size: 1.15rem; }
}

/* ---- Buttons: the game's green kit button (9-slice) ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 60px; min-width: 12rem;
  padding: .2rem .6rem; color: var(--cream); font: 700 1.15rem/1.1 var(--ui); text-decoration: none; text-align: center;
  border-style: solid; border-width: 14px 22px; border-image: url("/assets/kit/btn-green.png") 24 36 fill / 14px 22px / 0 stretch;
  text-shadow: -1px -1px 0 var(--outline), 1px -1px 0 var(--outline), -1px 1px 0 var(--outline), 1px 2px 0 var(--outline);
}
.btn:hover { color: #fff; filter: brightness(1.06); }
.btn:active { border-image-source: url("/assets/kit/btn-green-pressed.png"); }
.btn small { display: block; font-size: .78rem; font-weight: 600; opacity: .95; }
.btn .stack { display: flex; flex-direction: column; align-items: center; }
.btn[aria-disabled="true"] { cursor: default; }

/* ---- Hero ---------------------------------------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; background: var(--sky); color: #fff; }
.hero picture.bg, .hero picture.bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,12,6,.05) 0%, rgba(20,12,6,.0) 45%, rgba(20,12,6,.55) 100%); }
.hero .wrap { position: relative; z-index: 1; display: grid; gap: 1rem; padding-top: 1.5rem; padding-bottom: 2rem; align-items: end; }
.hero-logo { width: min(100%, 520px); margin: 0 auto; filter: drop-shadow(0 4px 6px rgba(20,12,6,.35)); }
.hero-copy { text-align: center; }
.hero h1 { font-size: clamp(1.6rem, 6vw, 2.6rem); color: #fff;
  text-shadow: -2px -2px 0 var(--outline), 2px -2px 0 var(--outline), -2px 2px 0 var(--outline), 2px 3px 0 var(--outline); margin-bottom: .35rem; }
.date-plank { display: inline-block; margin: .25rem 0 1rem; padding: .3rem 1rem .4rem; background: var(--wood); border: 3px solid var(--wood-dark);
  border-radius: 10px; color: var(--gold); font: 400 clamp(1.2rem, 4.5vw, 1.6rem)/1.2 var(--display); text-shadow: 0 2px 0 var(--outline);
  box-shadow: 0 3px 0 var(--outline); }
.stores { display: flex; flex-wrap: wrap; gap: .6rem 1rem; justify-content: center; }
.hero-blom { display: none; }
/* Phones keep only ~38% of the backdrop's width: aim that window at the castle (left of centre) instead of the trees. */
@media (max-width: 599px) { .hero picture.bg img { object-position: 25% 60%; } }
@media (min-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr minmax(240px, 34%); min-height: 560px; padding-top: 2.5rem; padding-bottom: 2.5rem; }
  .hero-copy { align-self: center; }
  .hero-blom { display: block; align-self: end; margin-bottom: -2.5rem; width: 100%; max-width: 360px; justify-self: center;
    filter: drop-shadow(0 8px 10px rgba(20,12,6,.35)); }
}

/* ---- Sections and panels: the R3 wood-rim, cream-body panel with the green header ------------------------------ */
.section { padding: 2.5rem 0; }
.section--wood { background: var(--wood); background-image: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,0) 30%, rgba(0,0,0,.12)); }
.section-title { text-align: center; font-size: clamp(1.7rem, 6vw, 2.4rem); color: var(--ink); }
.section--wood .section-title { color: var(--cream); text-shadow: 0 3px 0 var(--outline); }
.lede { text-align: center; max-width: 40rem; margin: 0 auto 1.5rem; }
.section--wood .lede { color: var(--cream); }

.panel {
  border-style: solid; border-width: 24px 24px 34px; border-image: url("/assets/kit/panel.png") 48 48 68 fill / 24px 24px 34px / 0 stretch;
  padding: .5rem .6rem .3rem; color: var(--ink);
}
.panel-header {
  display: block; text-align: center; color: var(--cream); font: 400 1.3rem/1.2 var(--display); margin: -6px 0 .8rem;
  border-style: solid; border-width: 9px 30px; border-image: url("/assets/kit/header.png") 11 52 fill / 9px 30px / 0 stretch;
  padding: 0 .2rem; text-shadow: -1px -1px 0 var(--outline), 1px -1px 0 var(--outline), -1px 1px 0 var(--outline), 1px 2px 0 var(--outline);
}
.features { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .features { grid-template-columns: 1fr 1fr; } }
.feature p { margin: 0 0 .75rem; }
.feature ul { margin: 0 0 .75rem; padding-left: 1.1rem; }
.feature .art { margin: 0 auto .75rem; }
.feature .art--tall { max-width: 220px; }
.feature .art--badge { max-width: 140px; }
.feature .art--shot { border-radius: 10px; border: 3px solid var(--wood); }

/* ---- Gallery ------------------------------------------------------------------------------------------------- */
.gallery { display: grid; gap: .9rem; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
@media (min-width: 600px) { .gallery { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.gallery a { display: block; border-radius: 12px; border: 4px solid var(--wood-dark); overflow: hidden; background: var(--wood-dark); box-shadow: 0 3px 0 var(--outline); }
.gallery a:hover img { transform: scale(1.02); }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .2s; }
.gallery figcaption { color: var(--cream); font-size: .92rem; padding: .35rem .2rem 0; text-align: center; }
.gallery figure { margin: 0; }

dialog.lightbox { border: 4px solid var(--wood-dark); border-radius: 12px; padding: 0; background: var(--wood-dark); max-width: min(96vw, 1280px); width: 100%; }
dialog.lightbox::backdrop { background: rgba(20, 12, 6, .8); }
dialog.lightbox img { width: 100%; height: auto; }
dialog.lightbox p { color: var(--cream); margin: .4rem .8rem .6rem; }
dialog.lightbox button { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--wood-dark);
  background: rgb(204, 46, 40); color: #fff; font: 700 1.4rem/1 var(--ui); cursor: pointer; }

/* ---- CTA band ------------------------------------------------------------------------------------------------ */
.cta { text-align: center; }
.cta .art { max-width: min(100%, 640px); margin: 0 auto 1rem; }  /* min(): a bare 640px outranks img's 100% cap and overflowed phones */

/* ---- Prose pages (legal, support, press) --------------------------------------------------------------------- */
.page { padding: 1.5rem 0 3rem; background: var(--parchment); }
.page .wrap { max-width: 50rem; }
.prose { font: 400 1.0625rem/1.65 var(--prose); color: var(--ink); overflow-wrap: anywhere; }
.prose h1 { font-size: clamp(1.8rem, 6vw, 2.4rem); }
.prose h2 { font-size: 1.45rem; margin-top: 2rem; }
.prose h3 { font-size: 1.15rem; margin-top: 1.5rem; font-family: var(--ui); font-weight: 700; }
.prose strong { font-weight: 700; }
.prose code { font-size: .9em; background: var(--parchment-pressed); padding: .05em .3em; border-radius: 4px; }
.prose blockquote { margin: 1rem 0; padding: .6rem 1rem; background: var(--cream); border-left: 5px solid var(--leaf); border-radius: 6px; }
.prose .t { overflow-x: auto; }
.prose table { border-collapse: collapse; width: 100%; font-size: .93rem; margin: 1rem 0; background: var(--cream);
  overflow-wrap: normal; hyphens: auto; }  /* not .prose's 'anywhere': that let cells shrink and split words letter by letter */
.prose th, .prose td { border: 1px solid var(--parchment-pressed); padding: .45rem .6rem; text-align: left; vertical-align: top; }
.prose th { background: var(--parchment-pressed); }
@media (max-width: 480px) { .prose table { font-size: .85rem; } .prose th, .prose td { padding: .35rem .4rem; } }
.prose table a { overflow-wrap: anywhere; hyphens: manual; }  /* long policy URLs may break, without a hyphen that reads as part of the URL */
/* table.stack (build_wiki.py): below 700px each row is a card; icon + name, then the text, then one small column per rarity. */
@media (max-width: 699px) {
  .prose table.stack, .prose table.stack tbody { display: block; background: none; }
  .prose table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .prose table.stack tr { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .3rem .4rem; margin: 0 0 .7rem;
    padding: .5rem .6rem; background: var(--cream); border: 1px solid var(--parchment-pressed); border-radius: 8px; }
  .prose table.stack td { display: block; border: 0; padding: 0; width: auto !important; }
  .prose table.stack td:nth-child(1) { grid-column: 1; align-self: center; }
  .prose table.stack td:nth-child(2) { grid-column: 2 / -1; align-self: center; }
  .prose table.stack td:nth-child(3) { grid-column: 1 / -1; }
  .prose table.stack td:nth-child(n+4)::before { content: attr(data-label); display: block; font-size: .66rem; font-weight: 700;
    color: var(--ink-muted); }
}
@media (max-width: 360px) { .prose table { font-size: .75rem; } .prose th, .prose td { padding: .3rem .2rem; }
  .prose table.stack td:nth-child(n+4)::before { font-size: .62rem; } }
.prose a { color: var(--leaf-edge); }
.prose .panel { margin: 1.5rem 0; font-family: var(--ui); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: .4rem; } }
.downloads { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 0; list-style: none; }
.downloads li { background: var(--cream); border: 3px solid var(--wood); border-radius: 10px; padding: .5rem; font: 600 .92rem/1.35 var(--ui); }
.downloads img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; background: var(--parchment-pressed); border-radius: 6px; margin-bottom: .4rem; }

/* ---- Footer -------------------------------------------------------------------------------------------------- */
.footer { background: var(--wood-dark); color: var(--cream); padding: 2rem 0 2.5rem; font-size: .95rem; border-top: 4px solid var(--wood); }
.footer a { color: var(--gold); }
.footer a:hover { color: #fff; }
.footer .nav { margin-bottom: 1rem; }
.footer .nav a { color: var(--gold); }
.footer p { margin: .3rem 0; font-weight: 600; }
.footer .legal-id { opacity: .92; font-size: .88rem; }

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

/* Hero text over the art: white with the game's dark outline (tokens --color-hud-text / --color-hud-outline). */
.hero-tag { margin: .6rem 0 .3rem; font: 400 clamp(1.5rem, 6vw, 2.4rem)/1.15 var(--display);
  text-shadow: -2px -2px 0 var(--outline), 2px -2px 0 var(--outline), -2px 2px 0 var(--outline), 2px 3px 0 var(--outline); }
.hero-pitch { margin: 0 auto .4rem; max-width: 34rem; font-size: 1.15rem; font-weight: 700;
  text-shadow: -1px -1px 0 var(--outline), 1px -1px 0 var(--outline), -1px 1px 0 var(--outline), 1px 2px 0 var(--outline), 0 0 8px var(--outline); }
.hero-note { margin: .8rem 0 0; font-size: .95rem; text-shadow: -1px -1px 0 var(--outline), 1px -1px 0 var(--outline), -1px 1px 0 var(--outline), 1px 1px 0 var(--outline); }
.center { text-align: center; }
.prose .btn { color: var(--cream); }
.downloads a { text-decoration: none; color: var(--ink); display: block; }
.downloads a span { text-decoration: underline; color: var(--leaf-edge); }
.hero-h1 { margin: 0; }
@media (min-width: 860px) {
  .hero-pitch { font-size: 1.35rem; }
  .hero-logo { width: min(100%, 620px); }
}
.hero-classic { margin: 0 auto .6rem; font: 400 clamp(1.05rem, 4vw, 1.3rem)/1.2 var(--display); color: var(--gold);
  text-shadow: -1px -1px 0 var(--outline), 1px -1px 0 var(--outline), -1px 1px 0 var(--outline), 1px 2px 0 var(--outline); }

/* ---- Wiki ---------------------------------------------------------------------------------------------------- */
.wiki-wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .wiki-wrap { grid-template-columns: 15rem minmax(0, 1fr); gap: 2rem; } .wiki-side { position: sticky; top: 1rem; align-self: start; } }
.wiki-body { min-width: 0; }
.wiki-search input { width: 100%; font: 600 1rem var(--ui); padding: .6rem .8rem; border: 3px solid var(--wood); border-radius: 10px; background: var(--cream); color: var(--ink); }
.wiki-results { list-style: none; margin: .3rem 0 0; padding: 0; }
.wiki-results li { background: var(--cream); border: 2px solid var(--parchment-pressed); border-radius: 8px; padding: .4rem .6rem; margin-bottom: .3rem; }
.wiki-results small { display: block; color: var(--ink-muted); font-weight: 600; font-size: .8rem; }
.wiki-nav { margin-top: .8rem; background: var(--wood-dark); border-radius: 12px; border: 3px solid var(--wood); }
.wiki-nav summary { cursor: pointer; padding: .6rem .9rem; color: var(--cream); font: 400 1.1rem var(--display); }
.wiki-nav ul { list-style: none; margin: 0; padding: 0 .5rem .6rem; }
.wiki-nav a { display: block; padding: .4rem .5rem; color: var(--cream); text-decoration: none; border-radius: 6px; font-weight: 700; }
.wiki-nav a:hover, .wiki-nav a[aria-current="page"] { background: var(--wood); color: var(--gold); }
.crumbs { font: 600 .9rem var(--ui); margin: 0 0 .3rem; }
.lede-left { font-size: 1.1rem; }
.wiki-card, .wiki-level { background: var(--cream); border: 3px solid var(--wood); border-radius: 12px; padding: .8rem 1rem; margin: 1rem 0; box-shadow: 0 3px 0 var(--wood-dark); }
.wiki-card h2, .wiki-card h3, .wiki-level h3 { margin-top: .2rem; }
.wiki-card-head { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.wiki-card-head > div { flex: 1 1 14rem; min-width: 0; }
.wiki-icon { width: 96px; height: auto; flex: none; }
.wiki-card-head .wiki-icon { width: 112px; border-radius: 10px; background: var(--parchment); }
.wiki-icon--sm { width: 32px !important; display: inline-block; vertical-align: middle; background: none !important; }
.prose table.icons td:first-child { width: 48px; }
.prose table.icons img { width: 40px; height: auto; display: block; }
.prose table.kv th { width: 40%; text-align: left; }
.skills { list-style: none; padding: 0; display: flex; gap: 1rem; flex-wrap: wrap; }
.muted { color: var(--ink-muted); }
.wiki-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .8rem; list-style: none; padding: 0; }
.wiki-index a { display: block; background: var(--cream); border: 3px solid var(--wood); border-radius: 12px; padding: .9rem 1rem; font: 400 1.2rem var(--display); color: var(--ink); text-decoration: none; box-shadow: 0 3px 0 var(--wood-dark); }
.wiki-index a:hover { border-color: var(--leaf); }
.wiki-source { margin-top: 2rem; font-size: .9rem; color: var(--ink-muted); }

/* ---- Clips --------------------------------------------------------------------------------------------------- */
.clip { margin: 1rem 0; }
.clip video { width: 100%; height: auto; display: block; border-radius: 12px; border: 4px solid var(--wood-dark); background: var(--wood-dark); aspect-ratio: 16 / 9; }
.clip figcaption { font: 600 .9rem var(--ui); text-align: center; margin-top: .3rem; }
.section--wood .clip figcaption { color: var(--cream); }
.clips { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .clips { grid-template-columns: 1fr 1fr; } }

/* ---- Idea form ----------------------------------------------------------------------------------------------- */
.idea-form { display: grid; gap: .35rem; font-family: var(--ui); }
.idea-form label { font-weight: 700; margin-top: .5rem; }
.idea-form input[type=text], .idea-form input[type=email], .idea-form textarea { width: 100%; font: 600 1rem var(--ui); color: var(--ink);
  background: #fff; border: 3px solid var(--wood); border-radius: 10px; padding: .55rem .7rem; }
.idea-form textarea { resize: vertical; min-height: 9rem; }
.idea-form fieldset { border: 2px dashed var(--parchment-pressed); border-radius: 10px; padding: .4rem .8rem .7rem; margin: .8rem 0 .2rem; display: grid; gap: .3rem; }
.idea-form legend { font-weight: 700; padding: 0 .3rem; }
.idea-form .check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 600; }
.idea-form .check input { width: 1.3rem; height: 1.3rem; margin-top: .15rem; flex: none; accent-color: var(--leaf); }
.idea-form .btn { justify-self: start; margin-top: .8rem; border-left-width: 22px; }
.form-note { font-size: .9rem; color: var(--ink-muted); margin: .2rem 0; }
.form-error { color: rgb(160, 24, 24); font-weight: 700; margin: .4rem 0 0; }
.form-done { color: var(--leaf-edge); font-weight: 700; background: var(--cream); border-left: 5px solid var(--leaf); padding: .6rem .8rem; border-radius: 6px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Development: "How a change reaches players" flow chart ------------------------------------------------------
   Real text in kit-coloured boxes; arrows are CSS (::before shaft, ::after head) drawn in the gaps. Phones: one column,
   arrows down. From 760px: a loop of two rows (1-4 left to right, 5-7 back right to left, then "Back to the start",
   whose arrow points up to step 1). Corners stay square-ish: no oval pills. */
.flow-fig { margin: 1.25rem 0 1.5rem; }
.flow { --g: 2.1rem; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--g); font-family: var(--ui); }
.flow-step { position: relative; margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .6rem; align-content: start;
  background: var(--cream); border: 3px solid var(--wood); border-radius: 12px; padding: .6rem .8rem .7rem; box-shadow: 0 3px 0 var(--wood-dark); }
.flow-n { grid-row: 1 / span 2; align-self: start; display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem;
  background: var(--leaf); color: var(--cream); border: 2px solid var(--leaf-edge); border-radius: 8px;
  font: 400 1.15rem/1 var(--display); text-shadow: 0 1px 0 var(--outline); }
.flow-t { font: 400 1.2rem/1.2 var(--display); color: var(--ink); letter-spacing: .01em; }
.flow-d { font: 600 .95rem/1.4 var(--ui); color: var(--ink-muted); grid-column: 2; }
.flow-loop { background: var(--parchment-pressed); border-style: dashed; color: var(--leaf-edge); }
.flow-icon { grid-row: 1 / span 2; align-self: start; width: 2rem; height: 2rem; padding: 2px; }
.flow-fig figcaption { font: 600 .9rem/1.45 var(--ui); color: var(--ink-muted); margin-top: 1rem; }
/* Arrows. Phones: every step but the last points down to the next one. */
.flow-step::before, .flow-step::after { content: ""; position: absolute; pointer-events: none; }
.flow-step:not(.flow-loop)::before { left: 50%; top: calc(100% + 3px); width: 4px; height: calc(var(--g) - 13px); margin-left: -2px; background: var(--wood-dark); }
.flow-step:not(.flow-loop)::after { left: 50%; bottom: calc(-3px - var(--g)); margin-left: -9px; border: 9px solid transparent; border-bottom: 0;
  border-top: 11px solid var(--wood-dark); }
@media (min-width: 760px) {
  .flow { --g: 1.9rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .flow-step { grid-template-columns: minmax(0, 1fr); row-gap: .25rem; padding: .6rem .65rem .7rem; }
  .flow-n, .flow-icon { grid-row: auto; }
  .flow-d { grid-column: 1; font-size: .9rem; }
  .flow-step:nth-child(5) { grid-area: 2 / 4; }
  .flow-step:nth-child(6) { grid-area: 2 / 3; }
  .flow-step:nth-child(7) { grid-area: 2 / 2; }
  .flow-step:nth-child(8) { grid-area: 2 / 1; }
  /* 1-3: right. */
  .flow-step:nth-child(-n+3)::before { left: calc(100% + 3px); top: 50%; width: calc(var(--g) - 13px); height: 4px; margin: -2px 0 0; }
  .flow-step:nth-child(-n+3)::after { left: auto; right: calc(-3px - var(--g)); top: 50%; bottom: auto; margin: -9px 0 0;
    border: 9px solid transparent; border-right: 0; border-left: 11px solid var(--wood-dark); }
  /* 5-7: left. */
  .flow-step:nth-child(n+5):nth-child(-n+7)::before { left: auto; right: calc(100% + 3px); top: 50%; width: calc(var(--g) - 13px); height: 4px; margin: -2px 0 0; }
  .flow-step:nth-child(n+5):nth-child(-n+7)::after { left: calc(-3px - var(--g)); top: 50%; bottom: auto; margin: -9px 0 0;
    border: 9px solid transparent; border-left: 0; border-right: 11px solid var(--wood-dark); }
  /* 4: down (the phone arrow already points down). "Back to the start": up to step 1. */
  .flow-loop::before { left: 50%; bottom: calc(100% + 3px); width: 4px; height: calc(var(--g) - 13px); margin-left: -2px; background: var(--wood-dark); }
  .flow-loop::after { left: 50%; top: calc(-3px - var(--g)); margin-left: -9px; border: 9px solid transparent; border-top: 0;
    border-bottom: 11px solid var(--wood-dark); }
}
