/* Purrch landing. Colours are the game's Kinari & Hinoki roles (game/src/theme/palettes.json); type is the game's
   kit 2 (Tan Nhang titles, Nunito text); buttons and phone frames are PNGs in the game's crayon line
   (landing/tools/render-ui.mjs, which uses the game's own crayonize()). */
@font-face {
  font-family: "Tan Nhang";
  src: url("/fonts/TanNhang-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #faf6ee;
  --wall: #f1eadf;
  --wood-l: #e3d2b8;
  --wood-m: #c6a889;
  --wood-d: #977158;
  --floor: #dcc8b0;
  --leaf: #b1c6a1;
  --gold: #e8ce94;
  --ink: #3e332c;
  --ink-soft: #6b5d52;

  --title: "Tan Nhang", "Nunito", system-ui, sans-serif;
  --text: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --line: 3px solid var(--ink);
  --wrap: 1080px;
  --wave-h: clamp(32px, 4.5vw, 60px);
  --wall-2: #ece1d1;
  /* one soft hand-drawn wave, used as the top edge of every band */
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'%3E%3Cpath d='M0 46 C 160 18 330 14 520 34 S 880 70 1080 44 S 1340 16 1440 30 V80 H0 Z' fill='black'/%3E%3C/svg%3E");
  --wave-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'%3E%3Cpath d='M0 26 C 220 58 420 62 640 40 S 1010 6 1220 24 S 1400 52 1440 44 V80 H0 Z' fill='black'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--text);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }

/* no lonely last words */
h1, h2, h3, figcaption, summary, .lede, .intro, .stores-note { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
.nw { white-space: nowrap; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--paper); padding: 8px 14px; border: var(--line); border-radius: 12px; z-index: 10; }
.skip:focus { top: 12px; }

h1, h2, h3 { font-family: var(--title); font-weight: 400; line-height: 1.08; margin: 0; }
h2 { font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.1rem); }
h3 { font-size: 1.75rem; }

/* Bands: each section is a soft colour field whose top edge is a gentle wave */
.band { position: relative; padding-block: clamp(56px, 7vw, 96px); }
.band::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); height: var(--wave-h);
  background: inherit;
  -webkit-mask: var(--wave) center / 100% 100% no-repeat;
  mask: var(--wave) center / 100% 100% no-repeat;
  pointer-events: none;
}
.band.flip::before { -webkit-mask-image: var(--wave-b); mask-image: var(--wave-b); }
.paper { background-color: var(--paper); }
.wall { background-color: var(--wall); }
.home { background-color: var(--wall-2); }
.wood { background-color: var(--wood-l); }
.band.faq { padding-top: 8px; }
.band.faq::before { display: none; }

/* A game screenshot inside the game-style phone (the screen sits under the frame's see-through window) */
.phone { position: relative; aspect-ratio: 848 / 1408; filter: drop-shadow(0 8px 14px rgba(60, 40, 25, .14)); }
.phone .screen {
  position: absolute; left: 6.132%; top: 3.693%; width: 87.736%; height: 92.614%;
  object-fit: cover; border-radius: 9.68% / 5.52%; background: var(--wall);
}
.phone .frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Hero: the room by day, standing on a soft wooden floor */
.room {
  position: relative;
  background: linear-gradient(180deg, var(--paper) 0%, var(--wall) 100%);
  overflow-x: clip;
  padding-bottom: calc(var(--wave-h) + 8px);
}
/* the floor the phones stand on: a strip just above the next band's wave */
.room::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--wave-h) + 96px);
  background: linear-gradient(180deg, rgba(220, 200, 176, 0) 0, var(--floor) 52px);
}
.hero-text { padding-bottom: 56px; }
.top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--title); font-size: 1.6rem; text-decoration: none; }
.brand img { border-radius: 9px; }
.top-link { font-weight: 800; text-decoration: none; display: inline-block; padding: 12px 4px; text-align: right; }
.top-link:hover { text-decoration: underline; text-decoration-color: var(--leaf); text-decoration-thickness: 3px; text-underline-offset: 5px; }

.hero {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  padding-top: 28px;
}
.hero h1 { font-size: clamp(2.7rem, 1.5rem + 4.8vw, 5.2rem); }
.hero-text { padding-top: 12px; }
.lede { font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem); line-height: 1.5; max-width: 30ch; margin: 18px 0 24px; }

.stores { display: flex; flex-wrap: wrap; margin: 22px -6px 0; }
.stores img { width: min(46%, 204px); }
.stores-note { margin: 0; font-size: 1rem; color: var(--ink-soft); }

/* Waiting list form: a paper field and the game's gold button */
.wait { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; max-width: 500px; }
.field {
  width: 100%; height: 58px; padding: 0 20px;
  background: #fffdf8; color: var(--ink);
  border: var(--line); border-radius: 22px;
  font: 600 1.08rem/1 var(--text);
  box-shadow: inset 0 3px 0 rgba(62, 51, 44, .06);
}
.field::placeholder { color: #8e7f72; }
.field:focus { outline: none; border-color: var(--wood-d); box-shadow: 0 0 0 4px var(--gold); }
.join { padding: 0; margin: 4px -10px 0 -6px; border: 0; background: none; cursor: pointer; width: 232px; transition: transform .12s ease; }
.join:hover { transform: translateY(-1px); }
.join:active { transform: scale(.94); }
.wait-note { grid-column: 1 / -1; margin: 4px 0 0; font-size: .98rem; color: var(--ink-soft); }
.wait-note:empty { display: none; }
.wait.done .wait-note { color: var(--ink); font-weight: 800; }

/* Three real screens; the cats sit behind the main phone and peek out past its edges */
.stage { position: relative; display: grid; place-items: end center; min-height: 600px; padding-top: 56px; align-self: end; margin-bottom: -6px; }
.stage .main { position: relative; width: min(56%, 288px); z-index: 2; }
.stage .main .phone { z-index: 2; }
.stage .side { position: absolute; bottom: 14px; width: min(40%, 206px); }
.stage .side.left { left: 1%; transform: rotate(-7deg); transform-origin: bottom center; }
.stage .side.right { right: 1%; transform: rotate(7deg); transform-origin: bottom center; }
.peek { position: absolute; width: 88px; height: auto; z-index: 1; }
.peek.p1 { top: -62px; left: 16%; transform: rotate(-8deg); }
.peek.p2 { top: 5%; right: -70px; transform: rotate(14deg); }
.peek.p3 { bottom: 22%; left: -68px; transform: rotate(-14deg); }

/* Meet the cats */
.cats { text-align: center; }
.intro { max-width: 56ch; margin: 16px auto 44px; color: var(--ink-soft); }
.cat-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 32px 20px; }
.cat-list li { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cat-list img { width: 96px; margin-bottom: 6px; transition: transform .25s ease; }
.cat-list li:hover img { transform: rotate(-6deg) translateY(-3px); }
.cat-list strong { font-family: var(--title); font-weight: 400; font-size: 1.5rem; line-height: 1.1; }
.cat-list span { font-size: .98rem; line-height: 1.4; color: var(--ink-soft); max-width: 20ch; text-wrap: balance; }

.home { text-align: center; }
.solo { margin: 0 auto; width: min(68%, 280px); }
.solo figcaption { margin-top: 18px; font-weight: 800; }

.feature {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  max-width: 880px; margin-inline: auto;
}
.feature + .feature { margin-top: clamp(40px, 5vw, 64px); }
.feature:nth-of-type(even) { grid-template-columns: minmax(0, 1fr) 250px; }
.feature:nth-of-type(even) > .phone { order: 2; transform: rotate(2deg); }
.feature:nth-of-type(odd) > .phone { transform: rotate(-2deg); }
.feature > div { max-width: 50ch; }
.feature h3 + ul { margin-top: 12px; }
.feature ul + h3 { margin-top: 30px; }
.feature ul { margin: 0; padding-left: 1.2em; }
.feature li { margin-bottom: 8px; }
.feature li::marker { color: var(--wood-d); }
.calm { margin: 24px 0 0; color: var(--ink-soft); font-style: italic; }

/* Waiting list band */
.waitlist { text-align: center; }
.waitlist .intro { margin-bottom: 26px; }
.waitlist .wait { margin-inline: auto; }
.join-cats { width: 92px; margin: 0 auto 10px; transform: rotate(-6deg); }

/* Facts: a note on paper, like the neighbour's note in the story */
.note {
  max-width: 760px; margin-inline: auto;
  background: #fffdf8;
  border: var(--line); border-radius: 22px;
  padding: 34px clamp(20px, 5vw, 48px) 26px;
  transform: rotate(-.5deg);
  box-shadow: 0 12px 0 -4px var(--wood-l);
}
.note dl { margin: 18px 0 0; }
.note dl > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 16px; padding: 12px 0; border-top: 2px solid var(--wall); }
.note dt { font-weight: 800; }
.note dd { margin: 0; }

.faq .wrap { max-width: 760px; }
.faq h2 { margin-bottom: 14px; }
details { border-bottom: 2px solid var(--wall); }
summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 60px; padding: 12px 0;
  font-weight: 800; font-size: 1.15rem;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; flex: none; font: 400 1.9rem/1 var(--title); color: var(--wood-d); transition: transform .2s ease; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: 0 0 18px; max-width: 62ch; color: var(--ink-soft); }

.foot { padding-block: 36px 40px; font-size: 1rem; }
.foot p { margin: 4px 0; }
.foot a { display: inline-block; margin-right: 20px; padding-block: 12px; font-weight: 800; }

/* Privacy page */
.doc { max-width: 720px; padding-block: 40px 72px; }
.doc h1 { font-size: clamp(2.4rem, 1.8rem + 2.4vw, 3.4rem); }
.doc h2 { font-size: 1.8rem; margin-top: 40px; }
.doc .updated { color: var(--ink-soft); }
.plain-top { background: var(--wall); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 8px; padding-top: 4px; }
  .hero-text { padding-top: 0; padding-bottom: 0; }
  .stage { min-height: 0; padding-top: 64px; }
  .stage .main { width: min(58%, 260px); }
  .stage .side { width: min(39%, 176px); }
  .cat-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .feature, .feature:nth-of-type(even) { grid-template-columns: 1fr; gap: 28px; justify-items: center; }
  .feature > .phone, .feature:nth-of-type(even) > .phone { order: 0; width: min(62%, 240px); }
}
@media (max-width: 520px) {
  body { font-size: 1.0625rem; }
  .top-link .wide { display: none; }
  .hero h1 { font-size: 2.55rem; }
  h2 { font-size: clamp(1.8rem, 7.4vw, 2.3rem); }
  .lede { margin: 12px 0 16px; }
  .field { height: 54px; padding: 0 14px; font-size: 1rem; border-radius: 18px; }
  .join { width: 168px; }
  .peek { width: 62px; }
  .peek.p1 { top: -44px; }
  .peek.p2 { right: -48px; }
  .peek.p3 { left: -46px; }
  .cat-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .cat-list img { width: 72px; }
  .note dl > div { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cat-list img, summary::after, .join { transition: none; }
}
