/* Bungee ships one weight; declaring it for 400-900 lets CJK fallback fonts use a heavy
   weight in headings without the browser faux-bolding the Latin glyphs. */
@font-face { font-family: "Bungee"; src: url("/fonts/Bungee-Regular.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Rubik"; src: url("/fonts/Rubik-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Rubik"; src: url("/fonts/Rubik-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #1c1a1f;
  --ink: #1b1a22;
  --paper: #f3ecdf;
  --surface: #ffffff;
  --on-bg: #ffffff;
  --muted-bg: rgba(255,255,255,0.72);
  --muted: #6f6a62;
  --amber: #f5a524;
  --coral: #f2594b;
  --teal: #17a398;
  --indigo: #4c55d9;
  --plum: #9b5de5;
  --stroke: 2.5px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--on-bg);
  font: 500 18px/1.55 "Rubik", system-ui, sans-serif;
}
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
main { overflow-x: clip; } /* rotated stickers must not cause sideways scroll */

/* A sticker: ink outline and a hard print shadow. */
.sticker {
  background: var(--surface);
  color: var(--ink);
  border: var(--stroke) solid var(--ink);
  border-radius: 22px;
  box-shadow: 3px 5px 0 var(--ink);
}
.tag {
  display: inline-block;
  font: 700 13px/1 "Rubik", sans-serif;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 6px 10px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  box-shadow: 2px 3px 0 var(--ink);
  background: var(--amber);
  color: var(--ink);
  transform: rotate(-3deg);
}

header.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding-top: 18px; padding-bottom: 18px;
}
header.top nav { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 64px; transform: rotate(-6deg); }
.brand span { font-family: "Bungee", sans-serif; font-size: 24px; }
nav a { text-decoration: none; margin-left: 18px; color: var(--muted-bg); font-weight: 700; }
nav a:hover { color: var(--on-bg); }

h1, h2, h3 { font-family: "Bungee", sans-serif; font-weight: 400; line-height: 1.05; margin: 0 0 14px; overflow-wrap: break-word; hyphens: auto; }
h1 { font-size: clamp(40px, 7vw, 76px); }
h2 { font-size: clamp(28px, 4vw, 40px); }
h3 { font-size: 22px; }
.lead { font-size: clamp(18px, 2.2vw, 22px); color: var(--muted-bg); max-width: 34em; }

.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 30px; align-items: center; padding: 40px 0 70px; }
.hero .art { position: relative; min-height: 480px; }
.hero .art img { position: absolute; }
.hero .art .a1 { left: 0; top: 0; width: 64%; transform: rotate(-8deg); }
.hero .art .a2 { right: 0; bottom: 0; width: 56%; transform: rotate(7deg); }
.hero .art .a3 { display: none; }

.cta { display: inline-flex; align-items: center; gap: 12px; margin-top: 18px; text-decoration: none;
  font: 400 20px "Bungee", sans-serif; padding: 16px 26px; background: var(--amber); color: var(--ink);
  border: var(--stroke) solid var(--ink); border-radius: 16px; box-shadow: 3px 5px 0 var(--ink); }
.cta:active { transform: translate(2px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.small { font-size: 14px; color: var(--muted-bg); }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; padding: 30px 0 80px; }
.feature { position: relative; padding: 26px 22px 24px; margin-top: 60px; }
.feature img { position: absolute; width: 140px; right: -10px; top: -76px; }
.feature h3 { padding-right: 110px; }
.feature p { margin: 0; color: var(--muted); }

.band { padding: 60px 0; }
.band .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; align-items: center; }

footer { padding: 40px 0 60px; color: var(--muted-bg); font-size: 15px; }
footer a { margin-right: 16px; }
footer p a { margin-right: 0; }
footer .links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
footer .links a { margin: 0; }

/* Language switcher */
.langs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 22px 0 6px; font-size: 14px; font-weight: 700; }
.langs a { margin: 0; text-decoration: none; color: var(--muted-bg); }
.langs a:hover { color: var(--on-bg); text-decoration: underline; }
.langs a[aria-current] { color: var(--amber); }
.langs span { opacity: .45; }
nav a.lang-jump { font-size: 14px; border: 2px solid currentColor; border-radius: 8px; padding: 1px 7px; }
.page .langs a { color: var(--muted); }
.page .langs a:hover { color: var(--ink); }
.page .langs a[aria-current] { color: var(--coral); }

/* Japanese and Chinese: Bungee and Rubik have no CJK glyphs, so name system CJK fonts
   after them. Latin letters still render in Bungee/Rubik. */
:lang(ja) body, body:lang(ja) { font-family: "Rubik", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Meiryo", "Noto Sans JP", "Noto Sans CJK JP", system-ui, sans-serif; }
:lang(zh-Hans) body, body:lang(zh-Hans) { font-family: "Rubik", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, sans-serif; }
:lang(ja) :is(h1, h2, h3, .cta, .brand span) { font-family: "Bungee", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Meiryo", "Noto Sans JP", "Noto Sans CJK JP", sans-serif; font-weight: 800; line-height: 1.25; }
:lang(zh-Hans) :is(h1, h2, h3, .cta, .brand span) { font-family: "Bungee", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif; font-weight: 800; line-height: 1.25; }
:lang(ja) .lead, :lang(zh-Hans) .lead { line-height: 1.75; }
:lang(ja) h1, :lang(zh-Hans) h1 { font-size: clamp(34px, 5vw, 56px); line-break: strict; }
/* Break Japanese headings between phrases, not mid-word (Chromium 119+; others ignore it). */
:lang(ja) :is(h1, h2, h3) { word-break: auto-phrase; }
:lang(ja) h2, :lang(zh-Hans) h2 { font-size: clamp(26px, 3.4vw, 36px); line-break: strict; }
:lang(ja) h3, :lang(zh-Hans) h3 { font-size: 20px; line-break: strict; }

/* Text pages */
.page { background: var(--paper); color: var(--ink); }
.page header.top .brand span { color: var(--ink); }
.page nav a { color: var(--muted); }
.page nav a:hover { color: var(--ink); }
.doc { max-width: 760px; margin: 0 auto; padding: 10px 20px 60px; }
.doc h1 { font-size: clamp(32px, 5vw, 48px); }
.doc h2 { font-size: 22px; margin-top: 34px; }
.doc p, .doc li { color: #2d2b33; }
.doc .card { padding: 20px 22px; margin: 18px 0; }
.page footer { color: var(--muted); }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 10px; }
  .hero .art { min-height: 300px; }
  .features, .band .row { grid-template-columns: minmax(0, 1fr); }
  nav a { margin-left: 12px; font-size: 15px; }
}
@media (max-width: 520px) {
  .brand { gap: 8px; }
  .brand img { width: 44px; }
  .brand span { font-size: 17px; line-height: 1.1; }
  nav a { margin-left: 10px; font-size: 14px; }
  nav a.lang-jump { display: none; } /* the footer switcher covers phones */
}
