/* Landing page — the game's own look: parchment pages, dark-wood outlines, orange beveled buttons and pixel fonts
   (public/style.css .wood / .btn), laid out on a line grid: every section is a frame between two long vertical rails,
   with square "nail" joints where lines meet. Map colours (sky, grass, coin gold) are used only as small accents. */
@font-face { font-family: "Pixelify Sans"; src: url(/fonts/pixelify-sans-latin-500-normal.woff2) format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Pixelify Sans"; src: url(/fonts/pixelify-sans-latin-700-normal.woff2) format("woff2"); font-weight: 600 800; font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url(/fonts/silkscreen-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #fbf3e2;          /* page parchment */
  --paper: #fffaf0;       /* bubbles, cells */
  --parch: #f7e8c4;       /* HUD parchment */
  --ink: #3b2412;         /* game text */
  --muted: #7a5a3c;
  --line: #e6d2aa;        /* the grid */
  --line-dk: #d4b886;
  --wood: #c26b2a;        /* game .btn */
  --wood-hi: #e59a55;
  --wood-lo: #8a4516;
  --wood-dk: #4a2410;     /* game outline */
  --gold: #ffd54f;
  --sky: #5b9bd5;
  --grass: #5fa83a;
  --rail: clamp(0px, 5.5vw, 88px);
  --pad: clamp(20px, 3vw, 40px);
  /* Pixel outlines: four offset shadows leave the corner pixel empty, so boxes get a notched pixel corner. */
  --o2: 0 -2px 0 var(--wood-dk), 0 2px 0 var(--wood-dk), -2px 0 0 var(--wood-dk), 2px 0 0 var(--wood-dk);
  --o3: 0 -3px 0 var(--wood-dk), 0 3px 0 var(--wood-dk), -3px 0 0 var(--wood-dk), 3px 0 0 var(--wood-dk);
  --px: "Pixelify Sans", "Trebuchet MS", sans-serif;
  --label: "Silkscreen", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.65 "Trebuchet MS", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: var(--px); font-weight: 700; line-height: 1.08; letter-spacing: 0; }
/* Highlighted words: orange ink on a gold marker stroke, like a coin-coloured highlighter. */
.ink { color: var(--wood); background: linear-gradient(transparent 64%, #ffd54f99 64% 92%, transparent 92%); padding: 0 .06em; }
canvas.px { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }

/* ---------- The line grid ---------- */
.sec { position: relative; padding: 0 var(--rail); border-bottom: 2px solid var(--line); }
.sec.last { border-bottom: 0; }
.frame { position: relative; max-width: 1240px; margin: 0 auto; padding: 0 var(--pad); border-left: 2px solid var(--line); border-right: 2px solid var(--line); }
.dia { /* square nail where a rail meets a section line */
  position: absolute; bottom: -6px; z-index: 5; width: 10px; height: 10px;
  background: var(--bg); border: 2px solid var(--line-dk); box-shadow: inset 0 0 0 2px var(--bg), inset 0 0 0 4px var(--wood);
}
.dia.bl { left: -6px; } .dia.br { right: -6px; }
@media (max-width: 720px) { .dia { display: none; } }

.pat { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; shape-rendering: crispEdges; }
.pat.dots { color: var(--wood-lo); opacity: .14; }
.pat.hatch { color: var(--wood-lo); opacity: .16; }
.pat.stripes { color: var(--line-dk); opacity: .75; }
.fade-radial { -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, #0006 50%, transparent 100%); mask-image: radial-gradient(ellipse at center, #000 0%, #0006 50%, transparent 100%); }
.fade-down { -webkit-mask-image: linear-gradient(#000b, #0001); mask-image: linear-gradient(#000b, #0001); }

/* Pixel clouds drifting behind the hero and the CTA (landing.js clouds). */
.clouds { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.clouds canvas { position: absolute; opacity: .9; animation: drift linear infinite; }
@keyframes drift { from { transform: translateX(-30px); } to { transform: translateX(30px); } }
.clouds canvas:nth-child(odd) { animation-direction: alternate; }
.clouds canvas:nth-child(even) { animation-direction: alternate-reverse; }

/* ---------- Header ---------- */
.head { position: sticky; top: 0; z-index: 50; background: #fbf3e2e6; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.head-in { display: flex; align-items: center; gap: 24px; height: 66px; }
.brand { display: flex; align-items: center; gap: 12px; font: 700 22px/1 var(--px); }
.logo { width: 32px; height: 32px; image-rendering: pixelated; box-shadow: var(--o2); }
.head nav { display: flex; gap: 2px; margin-left: auto; }
.head nav a { padding: 8px 12px; color: var(--muted); font: 12px/1 var(--label); text-transform: uppercase; letter-spacing: .02em; }
.head nav a:hover { color: var(--ink); background: var(--parch); box-shadow: var(--o2); }

/* Language switcher: a quiet, icon-only globe that blends into the nav and opens a small list of languages. */
.lang { position: relative; }
.lang-btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px;
  border: 0; background: none; cursor: pointer; }
.lang-btn:hover { background: var(--parch); box-shadow: var(--o2); }
.lang-globe { width: 16px; height: 16px; flex: none; }
.lang-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 150px; padding: 6px;
  background: var(--paper); box-shadow: var(--o3), 0 8px 0 #3b241233; }
.lang-menu[hidden] { display: none; }
.lang-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none;
  font: 700 15px/1 var(--px); color: var(--ink); text-align: left; cursor: pointer; }
.lang-menu button:hover { background: var(--parch); }
.lang-menu button[aria-selected="true"] { color: var(--wood); }
.lang-menu button[aria-selected="true"]::after { content: "✓"; margin-left: auto; }

@media (max-width: 720px) { .head nav a { display: none; } }

/* ---------- Buttons: the game's beveled wood buttons with a notched pixel outline ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; position: relative;
  padding: 12px 22px 14px; font: 700 17px/1 var(--px); white-space: nowrap; color: #fff4d6; background: var(--wood);
  text-shadow: 0 2px 0 var(--wood-lo);
  box-shadow: var(--o3), inset 0 -4px 0 var(--wood-lo), inset 0 3px 0 var(--wood-hi), 0 8px 0 #3b241233;
  transition: transform .08s, background .15s;
}
.btn .arr { transition: transform .15s steps(2); }
.btn:hover { background: #d67b35; }
.btn:hover .arr { transform: translateX(4px); }
.btn:active { transform: translateY(3px); box-shadow: var(--o3), inset 0 -2px 0 var(--wood-lo), inset 0 3px 0 var(--wood-hi), 0 4px 0 #3b241233; }
.btn.ghost { color: var(--ink); background: var(--parch); text-shadow: none;
  box-shadow: var(--o3), inset 0 -4px 0 #dcc08e, inset 0 3px 0 #fffaf0, 0 8px 0 #3b241233; }
.btn.ghost:hover { background: #fbefd0; }
.btn.sm { padding: 8px 14px 10px; font-size: 15px; box-shadow: var(--o2), inset 0 -3px 0 var(--wood-lo), inset 0 2px 0 var(--wood-hi); }
.btn.sm:active { box-shadow: var(--o2), inset 0 -1px 0 var(--wood-lo), inset 0 2px 0 var(--wood-hi); transform: translateY(2px); }
.btn.lg { padding: 16px 32px 18px; font-size: 20px; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.3fr); gap: clamp(32px, 5vw, 72px); align-items: center; padding-top: clamp(56px, 8vw, 112px); padding-bottom: clamp(64px, 9vw, 124px); }
.hero > :not(.dia):not(.pat):not(.glow):not(.clouds) { position: relative; z-index: 1; }
.glow { position: absolute; z-index: 0; left: 60%; top: 50%; width: 900px; height: 700px; transform: translate(-50%, -50%); background: radial-gradient(closest-side, #ffd54f2e, transparent); pointer-events: none; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; font: 12px/1.3 var(--label); text-transform: uppercase; letter-spacing: .02em; color: var(--wood-lo); }
.eyebrow::before { content: ""; width: 8px; height: 8px; background: var(--wood); box-shadow: 2px 2px 0 var(--wood-dk); }
.eyebrow.live::before { background: var(--grass); animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.hero h1 { font-size: clamp(38px, 4.3vw, 66px); }
.lead { margin: 24px 0 0; font-size: clamp(16.5px, 1.35vw, 18.5px); color: var(--muted); max-width: 34em; }
.lead b { color: var(--ink); }
.ctas { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 36px; }
.ctas.center { justify-content: center; }

.hero-vis, .talk-vis { position: relative; padding: 14px; }

/* A wooden picture frame (game .wood, in pixels) with brass nails in the corners. */
.woodbox {
  position: relative; z-index: 1; padding: 11px;
  background:
    linear-gradient(var(--gold), var(--gold)) 3px 3px / 4px 4px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right 3px top 3px / 4px 4px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 3px calc(100% - 3px) / 4px 4px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right 3px bottom 3px / 4px 4px no-repeat,
    #d9924a;
  box-shadow: var(--o3), inset 0 3px 0 #f0b373, inset 0 -3px 0 #9c5520, inset 3px 0 0 #e8a564, inset -3px 0 0 #a95f26, 10px 12px 0 #3b24121c;
}
.woodbox > * { box-shadow: 0 0 0 3px var(--wood-dk); }

/* Hero: a live corner of the town (landing.js townMap) */
.town { position: relative; aspect-ratio: 34 / 22; overflow: hidden; background: var(--grass); }
.town canvas { display: block; width: 100%; height: 100%; }
.plate { /* nameplate hanging on the frame, like the game's dialog nameplate */
  position: absolute; z-index: 2; left: 50%; top: -14px; transform: translateX(-50%); padding: 5px 12px 6px; white-space: nowrap;
  font: 12px/1 var(--label); color: #fff4d6; background: var(--wood); text-shadow: 1px 1px 0 var(--wood-dk);
  box-shadow: var(--o2), inset 0 -2px 0 var(--wood-lo), inset 0 2px 0 var(--wood-hi);
}

/* Conversations: a game-style chat window that plays scripted exchanges */
.screen { background: var(--paper); overflow: hidden; }
.screen-bar { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; background: var(--wood-dk); font: 11px/1 var(--label); color: #f0d9ad; }
.screen-bar i { width: 8px; height: 8px; box-shadow: 1px 1px 0 #00000059; }
.screen-bar i:first-child { background: #f06292; } .screen-bar i:nth-child(2) { background: var(--gold); } .screen-bar i:nth-child(3) { background: #8bc34a; }
.screen-bar span { margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.talk { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.talk h2 { font-size: clamp(30px, 3.5vw, 48px); }
.talk-points { list-style: none; margin: 32px 0 0; padding: 0; border-top: 2px solid var(--line); }
.talk-points li { display: grid; grid-template-columns: 190px 1fr; gap: 16px; padding: 14px 0; border-bottom: 2px solid var(--line); font-size: 15px; }
.talk-points b { position: relative; padding-left: 20px; font: 700 16px/1.4 var(--px); }
.talk-points b::before { content: ""; position: absolute; left: 0; top: .45em; width: 8px; height: 8px; background: var(--wood); box-shadow: 2px 2px 0 var(--wood-dk); }
.talk-points span { color: var(--muted); }
@media (max-width: 560px) { .talk-points li { grid-template-columns: 1fr; gap: 2px; } }

.chat-tabs { display: flex; background: var(--parch); border-bottom: 3px solid var(--wood-dk); }
.chat-tabs button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 6px 10px; border: 0; border-right: 2px solid #dcc08e; background: none;
  font: 700 15px/1 var(--px); color: var(--muted); cursor: pointer; position: relative; }
.chat-tabs button:last-child { border-right: 0; }
.chat-tabs button:hover { color: var(--ink); background: #fbefd0; }
.chat-tabs button[aria-selected="true"] { color: var(--ink); background: var(--paper); }
.chat-tabs button[aria-selected="true"]::after { /* progress bar, filling in pixel steps */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--wood); transform-origin: left; animation: tab var(--dur, 9s) steps(24, end) forwards; }
@keyframes tab { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.chat-tabs canvas { width: 24px; height: 24px; image-rendering: pixelated; background: linear-gradient(#a8d8f0, #d8efc8); box-shadow: var(--o2); }
.chat { display: flex; flex-direction: column; gap: 12px; height: 350px; padding: 18px 18px; overflow: hidden; background: repeating-linear-gradient(0deg, transparent 0 27px, #f1e3c4 27px 29px), var(--paper); }
.line { display: flex; gap: 12px; align-items: flex-end; max-width: 88%; animation: msg .3s steps(3) both; }
@keyframes msg { from { opacity: 0; transform: translateY(9px); } }
.line canvas { flex: none; width: 36px; height: 36px; image-rendering: pixelated; background: linear-gradient(#a8d8f0, #d8efc8); box-shadow: var(--o2); margin: 0 0 2px 2px; }
.bub { position: relative; padding: 8px 12px; background: #fff; font-size: 14px; line-height: 1.45; box-shadow: var(--o2), 4px 5px 0 #3b24121a; }
.bub b { display: table; margin: -2px 0 5px; padding: 3px 6px 4px; font: 10px/1 var(--label); color: #fff4d6; background: var(--wood); text-shadow: 1px 1px 0 var(--wood-dk); }
.line.me { align-self: flex-end; flex-direction: row-reverse; }
.line.me .bub { background: #e4f1ff; color: #1d4f91; box-shadow: 0 -2px 0 var(--sky), 0 2px 0 var(--sky), -2px 0 0 var(--sky), 2px 0 0 var(--sky), 4px 5px 0 #3b24121a; }
.line.fix { align-self: flex-end; max-width: 92%; }
.line.fix .bub { background: #fff1b8; font-size: 13px; box-shadow: 0 -2px 0 #e0a800, 0 2px 0 #e0a800, -2px 0 0 #e0a800, 2px 0 0 #e0a800, inset 4px 0 0 #e0a800; padding-left: 16px; }
.line.fix s { color: #a0522d; } .line.fix i { font-style: normal; font-weight: 700; color: #2b1a0e; } .line.fix small { display: block; color: #8a6a4a; margin-top: 2px; }
.line.sys { align-self: center; font: 11px/1.3 var(--label); color: var(--gold); background: var(--ink); padding: 5px 10px 6px; box-shadow: var(--o2); }
.typing .bub { display: flex; gap: 5px; padding: 13px 14px; }
.typing .bub i { width: 6px; height: 6px; background: #c49a62; animation: dot .9s steps(1) infinite; }
.typing .bub i:nth-child(2) { animation-delay: .3s; } .typing .bub i:nth-child(3) { animation-delay: .6s; }
@keyframes dot { 0%, 66% { transform: none; } 33% { transform: translateY(-3px); } }
.chat-input { display: flex; align-items: center; gap: 12px; margin: 0; padding: 11px 14px; border-top: 3px solid var(--wood-dk); background: var(--parch); font-size: 14px; color: #a68660; }
.chat-input span { flex: 1; padding: 7px 12px; background: var(--paper); box-shadow: var(--o2); margin: 2px; }
.mic { display: grid; place-items: center; width: 36px; height: 34px; background: var(--wood); box-shadow: var(--o2), inset 0 -3px 0 var(--wood-lo), inset 0 2px 0 var(--wood-hi); }
.mic canvas { width: 20px; height: 20px; }

@media (max-width: 960px) { .hero, .talk { grid-template-columns: 1fr; } }

/* ---------- Main Street: a full-width live strip of the town between dark-wood rails ---------- */

/* ---------- Generic block ---------- */
.block { padding-top: clamp(64px, 8vw, 112px); padding-bottom: clamp(64px, 8vw, 112px); }
.block > *:not(.pat):not(.dia) { position: relative; z-index: 1; }
.sec-head { text-align: center; max-width: 700px; margin: 0 auto clamp(40px, 5vw, 64px); }
.sec-head .eyebrow { justify-content: center; }
.sec-head h2, .cta h2 { font-size: clamp(34px, 4.2vw, 54px); }
.sec-head p:not(.eyebrow), .cta p { margin: 16px 0 0; color: var(--muted); font-size: 18px; }

/* Cells share their borders: a grid of lines rather than floating cards. */
.grid { display: grid; border-top: 2px solid var(--line-dk); border-left: 2px solid var(--line-dk); background: #fffaf080; }
.grid > article { position: relative; padding: 28px; border-right: 2px solid var(--line-dk); border-bottom: 2px solid var(--line-dk); transition: background .2s; }
.grid > article:hover { background: var(--paper); }
.grid > article::before, .grid > article::after { /* pixel corner brackets on hover */
  content: ""; position: absolute; width: 14px; height: 14px; opacity: 0; transition: opacity .15s steps(2); }
.grid > article::before { left: -2px; top: -2px; border-left: 4px solid var(--wood); border-top: 4px solid var(--wood); }
.grid > article::after { right: -2px; bottom: -2px; border-right: 4px solid var(--wood); border-bottom: 4px solid var(--wood); }
.grid > article:hover::before, .grid > article:hover::after { opacity: 1; }
.feats { grid-template-columns: repeat(4, 1fr); }
.ico { width: 48px; height: 48px; margin-bottom: 18px; padding: 6px; background: var(--parch); box-shadow: var(--o2); transition: transform .2s steps(2); }
.feats article:hover .ico { transform: translateY(-4px); }
.feats h3 { font-size: 20px; margin-bottom: 8px; }
.feats p { margin: 0; color: var(--muted); font-size: 14.5px; }
@media (max-width: 1080px) { .feats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feats { grid-template-columns: 1fr; } }

.divider { height: clamp(48px, 7vw, 96px); }

/* ---------- Neighbors ---------- */
.npcs { grid-template-columns: repeat(4, 1fr); }
.npcs article { display: flex; flex-direction: column; gap: 12px; cursor: default; }
.stage { /* a little outdoor scene: sky, clouds, a strip of grass */
  position: relative; height: 136px; margin: 2px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; box-shadow: var(--o2);
  background:
    linear-gradient(#72bd4a, #72bd4a) bottom 18px left 0 / 100% 4px no-repeat,
    linear-gradient(#4f9632, #4f9632) bottom 0 left 0 / 100% 18px no-repeat,
    linear-gradient(#a8d8f0, #d8efc8);
}
.stage::before { /* pixel grass tufts along the edge */
  content: ""; position: absolute; left: 0; right: 0; bottom: 22px; height: 4px;
  background: repeating-linear-gradient(90deg, transparent 0 10px, #72bd4a 10px 14px, transparent 14px 26px, #5fa83a 26px 30px); }
.stage::after { content: ""; position: absolute; bottom: 15px; width: 44px; height: 6px; background: #00000026; }
.stage canvas { position: relative; z-index: 1; margin-bottom: 14px; transition: transform .15s steps(2); }
.npcs article:hover .stage canvas { transform: translateY(-4px); }
.who h3 { font-size: 21px; }
.role { margin: 4px 0 0; font: 11px/1.4 var(--label); color: var(--wood); text-transform: uppercase; }
.quote { margin: 0; font-size: 14px; color: var(--muted); font-style: italic; flex: 1; }
.place { display: flex; align-items: center; gap: 8px; margin: 0; padding-top: 10px; border-top: 2px dashed var(--line); font: 11px/1.4 var(--label); color: #8a6a4a; }
.place::before { content: ""; flex: none; width: 6px; height: 6px; background: #f06292; box-shadow: 0 0 0 2px var(--wood-dk); margin-left: 2px; }
@media (max-width: 1080px) { .npcs { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .npcs { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px) { .npcs { grid-template-columns: 1fr; } }

/* ---------- Steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--line-dk); border-left: 2px solid var(--line-dk); background: #fffaf080; }
.steps li { position: relative; padding: 32px 28px; border-right: 2px solid var(--line-dk); border-bottom: 2px solid var(--line-dk); }
.steps li:not(:last-child)::after { /* arrow joint on the shared line */
  content: "→"; position: absolute; right: -15px; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 26px; height: 26px; display: grid; place-items: center; font: 700 15px/1 var(--px); color: #fff4d6;
  background: var(--wood); box-shadow: var(--o2), inset 0 -3px 0 var(--wood-lo);
}
.num { display: inline-block; margin-bottom: 18px; padding: 5px 9px 6px; font: 12px/1 var(--label); color: var(--gold); background: var(--ink); box-shadow: var(--o2); }
.steps h3 { font-size: 22px; margin-bottom: 10px; }
.steps p { margin: 0 0 22px; color: var(--muted); font-size: 15px; }
.kbd-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 2px; }
kbd { font: 11px/1 var(--label); padding: 6px 8px 8px; background: var(--paper); color: var(--ink); box-shadow: var(--o2), inset 0 -3px 0 #e0c99c; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } .steps li:not(:last-child)::after { content: "↓"; right: auto; left: 50%; top: auto; bottom: -15px; transform: translateX(-50%); } }

/* ---------- CTA: a window of sky framed in pixel grass on three sides. Its floor is open: the sky settles onto a grass
   verge where the neighbors stand, and that verge runs straight into the footer lawn below (no seam). ---------- */
.cta { text-align: center; padding-top: clamp(72px, 10vw, 136px); padding-bottom: 0; border-color: transparent;
  background: linear-gradient(#cfe7f3, #e6f0e2 48%, #eef1d8); }
.cta::before { /* the ∩ hedge: 4px of grass on the frame line, tufts sprouting outwards; no bottom edge */
  content: ""; position: absolute; inset: -8px -6px 0; z-index: 2; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, transparent 0 12px, #72bd4a 12px 20px, transparent 20px 36px, #5fa83a 36px 40px, transparent 40px 56px) 0 0 / 100% 4px no-repeat,
    linear-gradient(#5fa83a, #5fa83a) 0 4px / 100% 4px no-repeat,
    repeating-linear-gradient(180deg, transparent 0 20px, #72bd4a 20px 28px, transparent 28px 44px, #5fa83a 44px 48px, transparent 48px 64px) 0 8px / 4px 100% no-repeat,
    linear-gradient(#5fa83a, #5fa83a) 4px 4px / 4px 100% no-repeat,
    repeating-linear-gradient(180deg, transparent 0 20px, #72bd4a 20px 28px, transparent 28px 44px, #5fa83a 44px 48px, transparent 48px 64px) 100% 8px / 4px 100% no-repeat,
    linear-gradient(#5fa83a, #5fa83a) calc(100% - 4px) 4px / 4px 100% no-repeat; }
.cta::after { /* the grass verge at the window's foot, same green as the street's map tiles */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30px; z-index: 0; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, transparent 0 8px, #5fa83a 8px 16px, transparent 16px 28px, #5fa83a 28px 32px, transparent 32px 44px) 0 0 / 100% 4px no-repeat,
    linear-gradient(#72bd4a 0 4px, #5fa83a 4px) 0 4px / 100% calc(100% - 4px) no-repeat; }
.cta > *:not(.pat):not(.clouds) { position: relative; z-index: 1; }
.cta p { max-width: 560px; margin-left: auto; margin-right: auto; }
.cta .ctas { margin-top: 40px; }
.cta-crowd { display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin: clamp(48px, 6vw, 72px) auto 0; padding-bottom: 12px; overflow: hidden; }
.cta-crowd canvas { flex: none; transition: transform .15s steps(2); }
.cta-crowd canvas:hover { transform: translateY(-6px); }

/* ---------- By the numbers: four big ledger figures in the shared line grid ---------- */
.ledger { grid-template-columns: repeat(4, 1fr); }
.ledger article { padding: 36px 28px 30px; }
.ledger .n { display: block; font: 700 clamp(56px, 6vw, 88px)/1 var(--px); color: var(--ink); text-shadow: 4px 4px 0 var(--gold); }
.ledger .n small { font-size: .5em; color: var(--wood); text-shadow: none; }
.ledger h3 { margin: 18px 0 6px; font-size: 19px; }
.ledger p { margin: 0; color: var(--muted); font-size: 14.5px; }
.ledger .n { margin-top: 24px; font-variant-numeric: tabular-nums; }

/* Each figure acted out by a tiny scene above it (landing.js numberScenes). */
.scene { position: relative; height: 84px; overflow: hidden; background: var(--paper); box-shadow: var(--o2); margin: 2px; }
/* 12: the whole street walking by */
.s-people { background: linear-gradient(#cfe7f3 0 54%, #72bd4a 54% 59%, #5fa83a 59% 67%, #e8c99a 67%); }
.parade { position: absolute; left: 0; bottom: 8px; display: flex; gap: 10px; width: max-content; animation: parade 26s linear infinite; }
.parade canvas { width: 32px; height: 36px; flex: none; }
@keyframes parade { to { transform: translateX(-50%); } }
/* 6: you hop up the CEFR staircase */
.s-levels { background: linear-gradient(#cfe7f3, #eaf4ea); }
.s-levels ol { position: absolute; inset: auto 8px 0; display: flex; align-items: flex-end; gap: 4px; height: 100%; margin: 0; padding: 0; list-style: none; }
.s-levels li { flex: 1; display: grid; place-items: start center; padding-top: 3px; font: 9px/1 var(--label); color: var(--wood-dk); background: var(--parch);
  box-shadow: 0 0 0 2px var(--wood-dk), inset 0 3px 0 #fffaf0; transition: background .15s steps(2), color .15s steps(2); }
.s-levels li.on { background: var(--gold); }
.s-levels li.here { background: var(--wood); color: #fffaf0; box-shadow: 0 0 0 2px var(--wood-dk), inset 0 3px 0 var(--wood-hi); }
.s-levels .hopper { position: absolute; width: 16px; height: 18px; z-index: 2; transition: left .32s steps(4), bottom .32s cubic-bezier(.3, 1.8, .6, 1); }
/* ∞: a task list that keeps refilling */
.s-tasks ul { position: absolute; inset: 0; margin: 0; padding: 6px 10px; list-style: none; transition: transform .45s steps(6); }
.s-tasks li { display: flex; align-items: center; gap: 8px; height: 24px; font-size: 12.5px; white-space: nowrap; color: var(--ink); }
.s-tasks li span { overflow: hidden; text-overflow: ellipsis; }
.s-tasks li i { flex: none; position: relative; width: 11px; height: 11px; background: #fff; box-shadow: 0 0 0 2px var(--wood-dk); }
.s-tasks li.done { color: var(--muted); }
.s-tasks li.done span { text-decoration: line-through; text-decoration-thickness: 2px; }
.s-tasks li.done i { background: var(--grass); }
.s-tasks li.done i::after { content: ""; position: absolute; left: 3px; top: 0; width: 3px; height: 6px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(40deg); }
.s-tasks li b { flex: none; margin-left: auto; font: 9px/1 var(--label); color: var(--wood); opacity: 0; }
.s-tasks li.done b { opacity: 1; }
.s-tasks::after { content: ""; position: absolute; inset: auto 0 0; height: 18px; background: linear-gradient(transparent, var(--paper)); }
/* 0: the Chinese word is struck out, the English one typed in */
.s-zh { display: grid; place-items: center; background: linear-gradient(#cfe7f3, #eaf4ea); }
.say { position: relative; display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; padding: 6px 12px 8px; background: #fff; box-shadow: var(--o2), 3px 4px 0 #3b24121a; font: 700 17px/1 var(--px); white-space: nowrap; }
.say::after { content: ""; position: absolute; left: 16px; bottom: -6px; width: 6px; height: 6px; background: #fff; box-shadow: -2px 0 0 var(--wood-dk), 2px 0 0 var(--wood-dk), 0 2px 0 var(--wood-dk); }
.say .zh { position: relative; color: var(--muted); text-decoration: none; font-family: system-ui, sans-serif; font-weight: 600; }
.say .zh::after { content: ""; position: absolute; left: -3px; right: -3px; top: 50%; height: 2px; background: #d6453d; transform: scaleX(0); transform-origin: left; transition: transform .3s steps(4); }
.say.no .zh::after { transform: scaleX(1); }
.say .en { min-width: 1ch; color: var(--wood); }
.say .en::after { content: "_"; animation: blink 1s steps(1) infinite; }

@media (max-width: 960px) { .ledger { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .ledger { grid-template-columns: 1fr; } }

/* ---------- Footer: the CTA window opens onto a grass verge that runs down to the credits bar. ---------- */
.foot { position: relative; background: var(--grass); }
.foot::before, .foot::after { /* the hedge only runs left and right of the CTA window, meeting its sides at the corners */
  content: ""; position: absolute; top: -8px; height: 8px; z-index: 1; pointer-events: none;
  width: calc(max(var(--rail), (100% - 1240px) / 2) + 4px);
  background:
    repeating-linear-gradient(90deg, transparent 0 12px, #72bd4a 12px 20px, transparent 20px 36px, #5fa83a 36px 40px, transparent 40px 56px) 0 0 / 100% 4px no-repeat,
    linear-gradient(#5fa83a, #5fa83a) 0 4px / 100% 4px no-repeat; }
.foot::before { left: 0; }
.foot::after { right: 0; transform: scaleX(-1); }
.foot-lawn { height: clamp(20px, 3vw, 32px); background: linear-gradient(var(--grass), #4f9632); }
.foot-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px;
  padding: 22px max(var(--pad), calc(var(--rail) + var(--pad))); background: var(--ink);
  box-shadow: inset 0 4px 0 #2a180a, inset 0 1px 0 #5a3a1e; font-size: 13px; color: #d9bf91; }
.foot-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.foot-logo { width: 30px; height: 30px; flex: none; image-rendering: pixelated; box-shadow: var(--o2); }
.foot-brand-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.foot-brand-text strong { font: 700 17px/1 var(--px); color: #fff4d6; }
.foot-brand-text span { color: #a8875c; font-size: 12.5px; line-height: 1.5; }
.foot-nav { display: flex; align-items: center; gap: 10px; }
.foot-nav a:not(.btn) { padding: 8px 12px; font: 700 15px/1 var(--px); color: var(--gold); }
.foot-nav a:not(.btn):hover { color: #fff4d6; background: #4a2c16; box-shadow: var(--o2); }
@media (max-width: 640px) { .foot-brand-text span { display: none; } }

/* ---------- "Use a PC" dialog (phones/tablets, opened from any Start link) ---------- */
html, body { overflow-x: hidden; }
.pc-only { width: min(380px, calc(100vw - 40px)); padding: 24px 22px 26px; border: 0; color: var(--ink); background: var(--paper); text-align: center; box-shadow: var(--o3), 0 8px 0 #3b241233; }
.pc-only::backdrop { background: #3b241299; }
.pc-only h2 { font-size: 24px; margin-bottom: 10px; }
.pc-only p { margin: 0 0 20px; }

/* ---------- Phones: keep the page light (the game itself is PC-only) ---------- */
@media (max-width: 720px) {
  .hero .ctas { display: none; }                            /* the hero's Free to play is redundant on a phone */
  .hero, .talk { grid-template-columns: minmax(0, 1fr); }  /* let long text wrap instead of stretching the column */
  .talk-text, .talk h2, .talk .lead, .talk-points li > * { min-width: 0; overflow-wrap: anywhere; }
  .talk-points li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .talk-vis { display: none; }                              /* the scripted chat demo doesn't fit a phone */
  .ledger .n { display: none; }                             /* "By the numbers": drop the big figures on a phone */
  .steps li:not(:last-child)::after { display: none; }      /* "How it works": hide the arrow joining the steps */
  .npcs { grid-template-columns: minmax(0, 1fr); }
  .npcs article:nth-child(n+4) { display: none; }           /* just a few neighbors */
}
@media (max-width: 720px) {
  .feats article:nth-child(n+4) { display: none; }          /* "Why Tututu": first three features only */
}
