/* Shikaku Kingdom website. Tokens = the app's v3 palette (src/theme/tokens.ts, light + "Folio at
   night" dark), fonts = the app's M PLUS Rounded 1c (display) + Zen Kaku Gothic New (text). */
:root {
  --desk: #E9E1D3; --paper: #FFF8EE; --paper2: #F7EEDD; --card: #FFFDF7;
  --ink: #2B211C; --ink2: #766A62; --ink3: #A89B8E; --line: #EADFCC; --line2: #D6C8B2;
  --accent: #2F7E78; --accentD: #1E5A55; --accentT: #fff;
  --gold: #F2C45A; --goldD: #C08A2C; --brick: #B9553E; --flame: #E0663A;
  --tape: rgba(236,222,186,.82); --sheet: #FFFCF4; --grid: #D8E2E8;
  --link: #1E5A55;
  --shadowC: 60, 40, 20;
  --grainOpacity: .5;
  --grainBlend: multiply;
  --frame: #1F1A17;
  --display: 'M PLUS Rounded 1c', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --text: 'Zen Kaku Gothic New', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-lg: 28px; --r-md: 20px; --r-sm: 14px;
  --wrap: 1120px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --desk: #0E0D16; --paper: #1A1826; --paper2: #221F31; --card: #262236;
    --ink: #F4ECE0; --ink2: #B4AABA; --ink3: #7E7590; --line: #343047; --line2: #4A4460;
    --accent: #3E9C94; --accentD: #23625D;
    --gold: #F0BE54; --goldD: #A8741F; --brick: #C8664C; --flame: #F07A45;
    --tape: rgba(120,110,140,.55); --sheet: #262338; --grid: #34304A;
    --link: #7FCFC7;
    --shadowC: 0, 0, 0;
    --grainOpacity: .22;
    --grainBlend: overlay;
    --frame: #05040A;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--paper); }
body {
  margin: 0; min-height: 100vh; position: relative; display: flow-root;
  font-family: var(--text); font-size: 17px; line-height: 1.6;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
/* The paper grain from the app (assets/textures/grain.png) over the whole page. */
body::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url("../assets/grain.webp") repeat; background-size: 240px;
  opacity: var(--grainOpacity); mix-blend-mode: var(--grainBlend);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, .display { font-family: var(--display); font-weight: 800; line-height: 1.15; margin: 0; letter-spacing: -.005em; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 14px; border-radius: 10px; z-index: 10; }
.skip:focus { left: 12px; }

/* ── header ───────────────────────────────────────────── */
.site-head { padding: 18px 0; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-family: var(--display); font-weight: 900; font-size: 19px; }
.brand img { width: 44px; height: 44px; border-radius: 11px; box-shadow: 0 2px 0 rgba(var(--shadowC), .15), 0 8px 16px -10px rgba(var(--shadowC), .6); }
.nav { display: flex; gap: 22px; font-weight: 500; font-size: 15px; }
.nav a { color: var(--ink2); text-decoration: none; }
.nav a:hover { color: var(--ink); }

/* ── hero ─────────────────────────────────────────────── */
.hero { padding: 28px 0 64px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.kicker { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.kicker::before { content: ""; flex: none; margin-right: 10px; width: 18px; height: 12px; border-radius: 3px; background: var(--gold); box-shadow: 8px 5px 0 -1px var(--accent); }
.hero h1 { font-size: clamp(40px, 6vw, 66px); font-weight: 900; margin: 14px 0 10px; }
.hero h1 span { display: block; color: var(--accent); }
.hero .promise { font-family: var(--display); font-weight: 800; font-size: clamp(20px, 2.4vw, 26px); color: var(--ink2); margin: 0 0 16px; }
.hero .lede { font-size: 18px; color: var(--ink2); max-width: 34em; margin: 0 0 26px; }
.badges { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 22px; }
.badges a { display: inline-block; border-radius: 10px; }
.badges img { height: 52px; width: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.chips li { display: inline-flex; align-items: center; gap: 7px; background: var(--card); border-radius: 999px; padding: 7px 14px 7px 10px; font-size: 14px; font-weight: 500; color: var(--ink2); box-shadow: 0 2px 0 var(--line), 0 6px 14px -10px rgba(var(--shadowC), .5); }
.chips svg { flex: none; color: var(--accent); }

/* Phone mockup with the app's map, on a sheet of taped paper. */
.stage { position: relative; display: flex; justify-content: center; padding: 20px 0; }
.stage .art { position: absolute; width: 78%; top: 6%; left: -2%; transform: rotate(-5deg); border-radius: 10px; background: var(--sheet); padding: 10px 10px 34px; box-shadow: 0 2px 0 rgba(var(--shadowC), .08), 0 24px 40px -18px rgba(var(--shadowC), .55); }
.stage .art img { border-radius: 4px; aspect-ratio: 480 / 853; object-fit: cover; }
.tape { position: absolute; width: 92px; height: 26px; background: var(--tape); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.stage .art .tape { top: -12px; left: 50%; transform: translateX(-50%) rotate(3deg); }
.phone { position: relative; width: min(300px, 70vw); aspect-ratio: 644 / 1400; border-radius: 46px; background: var(--frame); padding: 11px; box-shadow: 0 2px 0 rgba(var(--shadowC), .1), 0 40px 60px -30px rgba(var(--shadowC), .7), inset 0 0 0 2px rgba(255,255,255,.08); transform: rotate(2.5deg); margin-left: 18%; }
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 36px; }

/* ── sections ─────────────────────────────────────────── */
section { padding: 56px 0; }
.section-head { max-width: 40em; margin: 0 0 28px; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 40px); }
.section-head p { color: var(--ink2); margin: 10px 0 0; font-size: 18px; }
.sheet { background: var(--card); border-radius: var(--r-lg); box-shadow: 0 2px 0 var(--line), 0 22px 44px -28px rgba(var(--shadowC), .55); }

/* how it plays */
.how { display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: center; padding: 34px; }
.how svg.board { width: 100%; height: auto; filter: drop-shadow(0 14px 18px rgba(var(--shadowC), .16)); }
.rules { counter-reset: r; list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.rules li::before { content: counter(r); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; font-family: var(--display); font-weight: 900; font-size: 20px; color: var(--accentT); background: var(--accent); box-shadow: 0 4px 0 var(--accentD); }
.rules h3 { font-size: 20px; margin-top: 2px; }
.rules p { margin: 4px 0 0; color: var(--ink2); }

/* gallery */
.gallery { display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 24px 26px; margin: 0 -24px; scrollbar-width: thin; }
.gallery figure { flex: 0 0 220px; margin: 0; scroll-snap-align: center; }
.gallery img { width: 100%; aspect-ratio: 644 / 1400; object-fit: cover; border-radius: 26px; background: var(--paper2); box-shadow: 0 2px 0 rgba(var(--shadowC), .1), 0 20px 30px -20px rgba(var(--shadowC), .7); }
.gallery figcaption { font-family: var(--display); font-weight: 800; font-size: 15px; text-align: center; margin-top: 12px; color: var(--ink); }
.gallery-hint { color: var(--ink2); font-size: 14px; margin: -6px 0 0; }

/* features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { padding: 24px; }
.feature .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--paper2); color: var(--accent); margin-bottom: 14px; box-shadow: inset 0 0 0 1.5px var(--line2); }
.feature h3 { font-size: 19px; }
.feature p { margin: 8px 0 0; color: var(--ink2); font-size: 16px; }

/* story band */
.story { display: grid; grid-template-columns: 1.25fr 1fr; gap: 36px; align-items: stretch; padding: 18px; }
.story .key { border-radius: 20px; overflow: hidden; min-height: 320px; }
.story .key img { width: 100%; height: 100%; object-fit: cover; }
.story .copy { padding: 10px 18px 10px 0; }
.story h2 { font-size: clamp(26px, 3.2vw, 36px); }
.story p { color: var(--ink2); }
.acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.acts figure { margin: 0; }
.acts img { border-radius: 10px; aspect-ratio: 480 / 853; object-fit: cover; }
.acts figcaption { font-size: 13px; color: var(--ink2); margin-top: 6px; text-align: center; font-weight: 500; }

/* honesty note */
.fair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.fair .sheet { padding: 28px; }
.fair h3 { font-size: 22px; margin-bottom: 10px; }
.fair ul { margin: 0; padding-left: 20px; color: var(--ink2); }
.fair li { margin: 6px 0; }
.fair li strong { color: var(--ink); }
.note-line { font-size: 14px; color: var(--ink2); margin: 14px 0 0; }

/* call to action */
.cta { text-align: center; padding: 44px 24px; }
.cta img.icon { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 18px; box-shadow: 0 2px 0 rgba(var(--shadowC), .15), 0 16px 26px -14px rgba(var(--shadowC), .7); }
.cta h2 { font-size: clamp(26px, 3.4vw, 38px); }
.cta p { color: var(--ink2); margin: 10px auto 22px; max-width: 30em; }
.cta .badges { justify-content: center; margin: 0; }

/* ── footer ───────────────────────────────────────────── */
.site-foot { padding: 36px 0 48px; color: var(--ink2); font-size: 15px; }
.site-foot .wrap { display: grid; gap: 14px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot-links a { color: var(--ink); font-weight: 500; }
.langs { font-size: 14px; color: var(--ink2); margin: 0; }
.copyright { font-size: 14px; color: var(--ink2); margin: 0; }

/* ── legal pages ──────────────────────────────────────── */
.doc { max-width: 780px; margin: 8px auto 40px; padding: 44px 52px; }
.doc h1 { font-size: clamp(30px, 4.4vw, 42px); font-weight: 900; margin-bottom: 8px; }
.doc h2 { font-size: 23px; margin: 36px 0 10px; padding-top: 22px; border-top: 1.5px dashed var(--line2); }
.doc .meta { color: var(--ink2); font-size: 15px; margin: 0; font-style: normal; }
.doc p, .doc li { color: var(--ink); }
.doc ul { padding-left: 22px; }
.doc li { margin: 7px 0; }
.doc li::marker { color: var(--accent); }
.doc code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--paper2); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.doc a { overflow-wrap: anywhere; }
.doc .crumbs { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 26px; font-size: 15px; }
.doc .lang-note { font-size: 14px; color: var(--ink2); margin-top: 32px; }

/* ── 404 ──────────────────────────────────────────────── */
.lost { text-align: center; padding: 64px 28px; max-width: 560px; margin: 40px auto; }
.lost h1 { font-size: 40px; margin-bottom: 10px; }
.lost p { color: var(--ink2); }

/* ── responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 28px; }
  .stage { max-width: 440px; margin: 0 auto; width: 100%; }
  .features { grid-template-columns: 1fr 1fr; }
  .how { grid-template-columns: 1fr; padding: 26px; }
  .how svg.board { max-width: 280px; margin: 0 auto; }
  .story { grid-template-columns: 1fr; }
  .story .key { aspect-ratio: 1200 / 676; min-height: 0; }
  .story .copy { padding: 4px 8px 12px; }
  .fair { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  .nav { display: none; }
  .hero { padding-top: 8px; }
  .hero .lede { font-size: 17px; }
  .badges img { height: 46px; }
  .features { grid-template-columns: 1fr; }
  .gallery { margin: 0 -18px; padding: 8px 18px 22px; gap: 16px; }
  .gallery figure { flex-basis: 62vw; }
  .doc { padding: 30px 22px; border-radius: 22px; }
  .doc h2 { font-size: 21px; }
  .phone { margin-left: 22%; }
  .stage .art { width: 64%; left: 3%; }
  section { padding: 40px 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
