/* Home page. Tokens follow the Stack & Spin landing (light), with its charcoal set under
   [data-theme="dark"] on <html>. Block colours come from Blocks & Taps. */

@font-face {
  font-family: "M PLUS Rounded 1c";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/m-plus-rounded-1c-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "M PLUS Rounded 1c";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/m-plus-rounded-1c-latin-ext-500.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "M PLUS Rounded 1c";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/m-plus-rounded-1c-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "M PLUS Rounded 1c";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/m-plus-rounded-1c-latin-ext-700.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "M PLUS Rounded 1c";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("fonts/m-plus-rounded-1c-latin-800.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "M PLUS Rounded 1c";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("fonts/m-plus-rounded-1c-latin-ext-800.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --bg: #F4FAF8;
  --band: #DCEFEA;
  --wave1: #CBE7E0;
  --wave2: #BFE1D9;
  --text: #2F3533;
  --text2: #45524E;
  --panel: #FFFFFF;
  --stitch: #A9DCCF;
  --link: #2F6E62;
  --link-hover: #3F7C96;
  --fact: #E2685A;
  --cta: #5FBDCE;
  --cta-text: #2F3533;
  --cta-halo: rgba(95, 189, 206, .25);
  --tint-butter: #FFF1D6;
  --tint-sky: #E3F1F6;
  --salmon: #FA897B;
  --butter: #FFDD94;
  --pistachio: #DDE6A5;
  --sky: #86C9E3;
  --lilac: #CCA8D8;
  --shadow: rgba(40, 90, 80, .10);
  --shadow-icon: rgba(40, 90, 80, .18);
  --shadow-shot: rgba(40, 90, 80, .22);
  --shadow-nav: rgba(0, 0, 0, .10);
  --badge-line: transparent;
  --font: "M PLUS Rounded 1c", ui-rounded, "Hiragino Maru Gothic ProN", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1B1C1F;
  --band: #202226;
  --wave1: #25272C;
  --wave2: #2B2D32;
  --text: #EDEDED;
  --text2: #B9C2BF;
  --panel: #2B2D32;
  --stitch: #4B6E66;
  --link: #8FD1C2;
  --link-hover: #8CC3DA;
  --fact: #F08C7F;
  --cta: #57A4B3;
  --cta-text: #1B1C1F;
  --cta-halo: rgba(87, 164, 179, .28);
  --tint-butter: #2E2B25;
  --tint-sky: #26343A;
  --salmon: #CE746A;
  --butter: #D1B67F;
  --pistachio: #B7BD8C;
  --sky: #72A6BC;
  --lilac: #A98CB4;
  --shadow: rgba(0, 0, 0, .35);
  --shadow-icon: rgba(0, 0, 0, .40);
  --shadow-shot: rgba(0, 0, 0, .45);
  --shadow-nav: rgba(0, 0, 0, .35);
  --badge-line: #5A5D63;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}
h1, h2, h3, p, dl, dd, ul { margin: 0; }
ul { list-style: none; padding: 0; }
img, svg { display: block; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--link-hover); outline-offset: 3px; border-radius: 10px; }

.skip {
  position: absolute; left: 12px; top: -80px; z-index: 10;
  padding: 12px 16px; border-radius: 12px;
  background: var(--panel); color: var(--text); font-weight: 800;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Theme-dependent images: the light one shows unless the dark theme is on */
.on-dark { display: none; }
:root[data-theme="dark"] .on-dark { display: block; }
:root[data-theme="dark"] .on-light { display: none; }

/* ---------- Hero band ---------- */
.hero { position: relative; overflow: hidden; background: var(--band); padding: 40px 0 140px; }
.waves { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 200px; }
.waves .w1 { fill: var(--wave1); }
.waves .w2 { fill: var(--wave2); }
.hero .wrap { position: relative; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 104px; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 18px; }
.brand:hover { color: var(--text); }
.face { width: 38px; height: 38px; transform: rotate(-6deg); filter: drop-shadow(0 3px 6px var(--shadow-icon)); }
.face .tile { fill: var(--sky); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.themebtn {
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); color: var(--text); box-shadow: 0 3px 8px var(--shadow);
}
.themebtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.themebtn .sun { display: none; }
:root[data-theme="dark"] .themebtn .sun { display: block; }
:root[data-theme="dark"] .themebtn .moon { display: none; }

.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 22px;
  background: var(--cta); color: var(--cta-text); font-weight: 800; font-size: 15px; text-decoration: none;
  box-shadow: 0 3px 10px var(--shadow-nav);
}
.pill:hover { color: var(--cta-text); filter: brightness(1.05); }
.pill svg { width: 18px; height: 18px; flex: none; fill: currentColor; }
.pill-lg { min-height: 52px; padding: 0 28px; border-radius: 26px; font-size: 17px; gap: 10px; box-shadow: 0 0 0 6px var(--cta-halo); }
.pill-lg svg { width: 20px; height: 20px; }

.hero-in { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; }
.hero-copy { flex: 1 1 420px; min-width: 0; }
h1 { font-size: 64px; line-height: 1.05; font-weight: 800; margin-bottom: 12px; }
.tagline { font-size: 22px; line-height: 1.35; font-weight: 700; color: var(--link); margin-bottom: 14px; }
.lede { font-size: 18px; line-height: 1.55; color: var(--text2); max-width: 30em; margin-bottom: 24px; }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; max-width: 460px; margin-bottom: 32px; }
.facts .wide { grid-column: 1 / -1; }
.facts dt { font-size: 14px; color: var(--text2); }
.facts dd { margin-top: 2px; font-size: 16px; font-weight: 700; }

.hero-shots { flex: 1 1 380px; min-width: 0; display: flex; justify-content: center; align-items: flex-start; gap: 24px; }
.shot {
  flex: none; width: 230px; aspect-ratio: 230 / 498; border-radius: 34px; overflow: hidden;
  background: var(--panel); box-shadow: 0 18px 40px var(--shadow-shot);
}
.shot img { width: 100%; height: 100%; object-fit: cover; }
.hero-shots .shot:nth-child(2) { margin-top: 56px; }

/* ---------- Sections ---------- */
main { flex: 1 0 auto; }
.sec { padding-top: 80px; }
.sec + .sec { padding-top: 88px; }
h2 { font-size: 36px; line-height: 1.2; font-weight: 800; margin-bottom: 28px; }
.sec-intro { font-size: 18px; line-height: 1.5; color: var(--text2); margin: -20px 0 28px; }

.build { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card { background: var(--panel); border-radius: 24px; box-shadow: 0 6px 18px var(--shadow); }
.build .card { padding: 28px; outline: 2px dashed var(--stitch); outline-offset: -8px; }
.card-head { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 18px; margin-bottom: 8px; }
h3 { font-size: 20px; line-height: 1.3; font-weight: 800; }
.fact { font-size: 34px; line-height: 1.1; font-weight: 800; color: var(--fact); margin-bottom: 10px; }
.card p:last-child { font-size: 16px; line-height: 1.55; color: var(--text2); }

/* Small block drawings above each "What I build" card */
.art { --b: 18px; display: flex; align-items: flex-end; gap: calc(var(--b) / 3); height: calc(var(--b) * 2.25); flex: none; }
.art span { width: var(--b); border-radius: calc(var(--b) / 3.6); }
.art-grid { display: grid; grid-template-columns: repeat(4, var(--b)); gap: calc(var(--b) / 4.5); align-content: end; }
.art-grid span { height: var(--b); }
.bar-sm { height: 60%; } .bar-md { height: 80%; } .bar-lg { height: 100%; } .bar-xs { height: 35%; }
.c-salmon { background: var(--salmon); } .c-butter { background: var(--butter); } .c-pistachio { background: var(--pistachio); }
.c-sky { background: var(--sky); } .c-lilac { background: var(--lilac); } .c-ink { background: var(--link); }

/* ---------- Apps ---------- */
.apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.app { overflow: hidden; }
.app-art { height: 260px; padding-top: 28px; display: flex; justify-content: center; align-items: flex-start; overflow: hidden; background: var(--band); }
.app-art.t-butter { background: var(--tint-butter); }
.app-art.t-sky { background: var(--tint-sky); align-items: center; padding-top: 0; }
.app-art .shot { width: 200px; border-radius: 28px; box-shadow: 0 12px 28px var(--shadow-shot); }
.app-art .big-icon { width: 132px; height: 132px; border-radius: 30px; box-shadow: 0 12px 28px var(--shadow-shot); }
.app-body { padding: 24px; }
.app-title { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.app-icon { width: 56px; height: 56px; border-radius: 14px; flex: none; }
.app h3 { font-size: 22px; }
.app h3 a { color: var(--text); }
.app h3 a:hover { color: var(--link-hover); }
.amp { color: var(--fact); }
.app-body p { font-size: 16px; line-height: 1.55; color: var(--text2); }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.badges a { display: block; border-radius: 8px; }
.badge-apple img { height: 40px; width: auto; border-radius: 8px; outline: 1.5px solid var(--badge-line); }
/* The official Google Play artwork carries its own transparent margin; crop it to the badge height */
.badge-play img { height: 58px; width: auto; margin: -9px -6px; }
.compact-icon { display: none; }

/* ---------- Footer ---------- */
.foot { margin-top: 96px; padding: 48px 0 36px; background: var(--band); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; }
.foot-copy { flex: 1 1 420px; min-width: 0; }
.foot h2 { font-size: 28px; line-height: 1.25; margin: 0; }
.foot-copy p { margin-top: 8px; max-width: 32em; font-size: 17px; line-height: 1.55; color: var(--text2); }
.elsewhere { flex-basis: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); gap: 12px; margin-top: 8px; }
.elsewhere a {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 48px; padding: 0 16px; border-radius: 24px; white-space: nowrap;
  background: var(--panel); color: var(--text); font-weight: 800; text-decoration: none;
  box-shadow: 0 4px 12px var(--shadow);
}
.elsewhere a:hover { color: var(--link-hover); }
.elsewhere svg { width: 18px; height: 18px; flex: none; fill: currentColor; }
.foot-meta { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 20px; font-size: 15px; color: var(--text2); }
.foot-meta a { font-weight: 800; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  .hero { padding: 20px 0 96px; }
  .hero .wrap { padding: 0 24px; }
  .waves { height: 110px; }
  .topbar { margin-bottom: 40px; }
  .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .topbar-actions { gap: 10px; }
  .topbar .pill { width: 44px; padding: 0; }
  .topbar .pill svg { width: 20px; height: 20px; }
  .topbar .pill .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  .hero-in { gap: 40px; }
  .hero-copy { flex-basis: 100%; }
  h1 { font-size: 44px; margin-bottom: 10px; }
  .tagline { font-size: 19px; margin-bottom: 12px; }
  .lede { font-size: 16px; margin-bottom: 22px; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 26px; }
  .facts dt { font-size: 13px; }
  .facts dd { font-size: 15px; }
  .hero .pill-lg { display: flex; width: 100%; }
  .hero-shots { flex-basis: 100%; gap: 16px; }
  .hero-shots .shot { width: 150px; border-radius: 24px; box-shadow: 0 14px 30px var(--shadow-shot); }
  .hero-shots .shot:nth-child(2) { margin-top: 36px; }

  .sec, .sec + .sec { padding-top: 56px; }
  h2 { font-size: 28px; margin-bottom: 20px; }
  .sec-intro { font-size: 16px; margin: -14px 0 20px; }
  .build, .apps { gap: 16px; }
  .card { border-radius: 22px; }
  .build .card { padding: 24px; outline-offset: -7px; }
  .card-head { flex-direction: row; justify-content: space-between; align-items: flex-end; gap: 12px; }
  h3 { font-size: 18px; }
  .art { --b: 12px; }
  .art-grid { grid-template-columns: repeat(3, var(--b)); }
  .art-grid span:nth-child(n+7) { display: none; }
  .fact { font-size: 30px; margin-bottom: 8px; }
  .card p:last-child { font-size: 15px; }

  .app-art { height: 200px; padding-top: 24px; }
  .app-art .shot { width: 160px; border-radius: 24px; }
  .app-body { padding: 20px; }
  .app-title { gap: 12px; margin-bottom: 8px; }
  .app-icon { width: 48px; height: 48px; border-radius: 12px; }
  .app h3 { font-size: 20px; }
  .app-body p { font-size: 15px; }
  .badges { margin-top: 16px; }

  /* Stack & Spin becomes a compact row: icon left, text right */
  .app-compact { display: flex; align-items: center; gap: 16px; padding: 20px; }
  .app-compact .app-art { display: none; }
  .app-compact .app-body { padding: 0; min-width: 0; }
  .app-compact .compact-icon { display: block; flex: none; }
  .app-compact .app-icon { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 8px 18px var(--shadow-icon); }

  .foot { margin-top: 64px; padding: 36px 0 32px; }
  .foot-in { display: block; }
  .foot h2 { font-size: 26px; }
  .foot-copy p { font-size: 16px; margin-bottom: 20px; }
  .foot .pill-lg { display: flex; width: 100%; }
  .elsewhere { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
  .elsewhere a { padding: 0 8px; font-size: 15px; }
  .elsewhere svg { width: 16px; height: 16px; }
  .foot-meta { margin-top: 22px; gap: 16px; font-size: 14px; }
}

@media (prefers-reduced-motion: no-preference) {
  .pill, .themebtn, .elsewhere a { transition: filter .2s ease, color .2s ease; }
}
