/* Kuma landing page — Cozy Cream + Night Den.
 *
 * Tokens are the ones in mobile/src/theme.ts, so the page and the app are the same
 * material. Every rule lives in this file rather than a style attribute: the site
 * ships a strict Content-Security-Policy with no 'unsafe-inline', and an inline style
 * would simply not apply. See public/_headers.
 */

/* --- tokens ---------------------------------------------------------------- */

:root {
  color-scheme: light;
  --bg: #FBF6EC;
  --surface: #FFFDF7;
  --surfaceAlt: #F1ECE1;
  --inputBg: #FFFFFF;
  --border: #EFE6D5;
  --hairline: #F2EADD;
  --ink: #3A2320;
  --inkSoft: #8A7A70;
  --inkFaint: #C1B299;
  --jade: #25C7A5;
  --deepJade: #1F4A41;
  --jadeTint: #EAFAF4;
  --redBean: #884B55;
  --onJade: #06231D;
  --card: 0 2px 5px rgba(72, 7, 5, 0.05);
  --lift: 0 18px 44px rgba(72, 7, 5, 0.10);
}

/* Night Den. Declared twice on purpose: once for an explicit choice, once for the
 * system preference when theme.js has not set an attribute (no JavaScript, or the
 * request for it failed). Keep the two blocks identical. */
:root[data-theme="den"] {
  color-scheme: dark;
  --bg: #1C1412;
  --surface: #271D1A;
  --surfaceAlt: #332622;
  --inputBg: #271D1A;
  --border: #443330;
  --hairline: #2F2320;
  --ink: #F5EDE4;
  --inkSoft: #B7A49B;
  --inkFaint: #7E6C64;
  --jade: #2FD9B4;
  --deepJade: #7BE7CD;
  --jadeTint: #16332D;
  --redBean: #C87F86;
  --onJade: #06231D;
  --card: none;
  --lift: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="cream"]) {
    color-scheme: dark;
    --bg: #1C1412;
    --surface: #271D1A;
    --surfaceAlt: #332622;
    --inputBg: #271D1A;
    --border: #443330;
    --hairline: #2F2320;
    --ink: #F5EDE4;
    --inkSoft: #B7A49B;
    --inkFaint: #7E6C64;
    --jade: #2FD9B4;
    --deepJade: #7BE7CD;
    --jadeTint: #16332D;
    --redBean: #C87F86;
    --onJade: #06231D;
    --card: none;
    --lift: none;
  }
}

/* --- fonts ----------------------------------------------------------------- */

@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/baloo2-latin-var.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: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("assets/fonts/nunito-latin-var.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;
}

/* --- base ------------------------------------------------------------------ */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background 200ms ease, color 200ms ease;
}

a { color: var(--deepJade); text-decoration: none; }
a:hover { color: var(--jade); }

img { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 40;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 800;
}
.skip-link:focus { left: 16px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.shell { max-width: 1120px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 24px); }
.shell-narrow { max-width: 820px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 24px); }

@keyframes kuma-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes kuma-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* --- header ---------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--hairline);
}

.site-header .shell {
  padding-block: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.wordmark { display: flex; align-items: center; gap: 10px; color: inherit; }
.wordmark img { width: 38px; height: 38px; object-fit: contain; }
.wordmark:hover { color: inherit; }
.wordmark-text { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.wordmark-name {
  font-family: "Baloo 2", cursive;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.wordmark-tag { font-size: 13px; font-weight: 700; color: var(--inkFaint); white-space: nowrap; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.site-nav a { font-size: 15px; font-weight: 600; color: var(--inkSoft); }
.site-nav a:hover { color: var(--ink); }

.den-toggle {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--inkSoft);
  border-radius: 19px;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  flex: none;
}
.den-toggle:hover { color: var(--ink); border-color: var(--inkFaint); }

/* --- hero ------------------------------------------------------------------ */

.hero {
  padding-block: clamp(36px, 6vw, 68px) 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(28px, 4vw, 52px);
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--surfaceAlt);
  color: var(--redBean);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 7px 15px 7px 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.hero-badge img { width: 22px; height: 22px; object-fit: contain; }

.hero h1 {
  font-family: "Baloo 2", cursive;
  font-weight: 800;
  font-size: clamp(40px, 7vw, 66px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 20px 0 0;
  text-wrap: balance;
}

.hero-lede {
  font-size: 19px;
  line-height: 1.6;
  color: var(--inkSoft);
  margin: 20px 0 0;
  max-width: 30em;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.hero-note { font-size: 14px; color: var(--inkFaint); font-weight: 600; }

.appstore {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #1A1A1A;
  color: #FFFFFF;
  border-radius: 14px;
  padding: 12px 22px 13px;
  transition: transform 140ms ease;
}
.appstore:hover { color: #FFFFFF; transform: translateY(-1px); }
.appstore svg { width: 26px; height: 30px; fill: currentColor; flex: none; margin-top: -2px; }
.appstore-label { display: flex; flex-direction: column; line-height: 1.05; text-align: left; }
.appstore-label small { font-size: 11px; font-weight: 600; letter-spacing: 0.02em; opacity: 0.8; }
.appstore-label strong {
  font-family: "Baloo 2", cursive;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* --- the demo panel -------------------------------------------------------- */

.demo-frame { position: relative; }
.demo-frame::before {
  content: "";
  position: absolute;
  inset: -14px -10px;
  background: var(--jadeTint);
  border-radius: 34px;
}

.demo {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--lift);
  overflow: hidden;
}

.demo-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--hairline);
}
.demo-head img { width: 34px; height: 34px; object-fit: contain; }
.demo-head-name { display: flex; flex-direction: column; }
.demo-head-name b { font-family: "Baloo 2", cursive; font-weight: 800; font-size: 17px; }
.demo-head-name span { font-size: 13px; font-weight: 700; color: var(--jade); }

.demo-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--redBean);
  color: #FFFDF7;
  border-radius: 22px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.demo-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 4px;
  background: #FFFDF7;
  display: block;
}

.demo-window {
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  height: 352px;
  overflow: hidden;
}

.turn { display: flex; flex-direction: column; gap: 12px; animation: kuma-rise 260ms ease both; }

.bubble-user {
  align-self: flex-end;
  background: var(--jade);
  color: var(--onJade);
  border-radius: 20px;
  padding: 11px 18px;
  font-size: 16px;
  font-weight: 700;
  max-width: 78%;
}

.bubble-kuma {
  align-self: flex-start;
  background: var(--surfaceAlt);
  color: var(--ink);
  border-radius: 20px;
  padding: 12px 18px;
  font-size: 16px;
  line-height: 1.5;
  max-width: 78%;
}

.entry {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--inputBg);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--card);
  max-width: 520px;
}
.entry-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex: none;
}
.entry-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.entry-merchant { font-size: 17px; font-weight: 800; }
.entry-category { font-size: 14px; font-weight: 800; }
.entry-money { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.entry-amount {
  font-family: "Baloo 2", cursive;
  font-size: 22px;
  font-weight: 800;
  color: var(--deepJade);
}
.entry-hint { font-size: 12px; color: var(--inkFaint); font-weight: 700; }

.turn-sticker { width: 86px; height: 86px; align-self: flex-start; object-fit: contain; }

.demo-suggestions {
  padding: 16px 22px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.demo-suggestions h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--redBean);
}
.demo-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--redBean);
  border-radius: 22px;
  padding: 8px 15px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  min-height: 38px;
}
.chip:hover { border-color: var(--redBean); }

.demo-compose { padding: 0 22px 22px; display: flex; gap: 12px; align-items: center; }
.demo-compose input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--inputBg);
  color: var(--ink);
  border-radius: 22px;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  outline: none;
}
.demo-compose input:focus { border-color: var(--jade); }
.demo-send {
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 25px;
  background: var(--jade);
  color: var(--onJade);
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  flex: none;
}

/* --- section furniture ----------------------------------------------------- */

.section-title {
  font-family: "Baloo 2", cursive;
  font-weight: 800;
  font-size: clamp(30px, 4.4vw, 40px);
  letter-spacing: -0.02em;
  margin: 0 0 26px;
}

.how { padding-block: clamp(40px, 6vw, 56px) 24px; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 20px; }
.how-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
}
.how-card h3 { font-family: "Baloo 2", cursive; font-weight: 800; font-size: 20px; margin: 0 0 8px; }
.how-card p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--inkSoft); }

.screens { padding-block: clamp(48px, 7vw, 72px) 24px; }
.screens .section-title { margin-bottom: 8px; }
.screens-lede { margin: 0 0 34px; font-size: 18px; color: var(--inkSoft); max-width: 38em; }
.screens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: clamp(18px, 2.4vw, 26px);
}
.screen { display: flex; flex-direction: column; gap: 14px; }
.screen-shot {
  background: var(--surfaceAlt);
  border-radius: 26px;
  padding: 18px 18px 0;
  overflow: hidden;
  max-width: 300px;
  width: 100%;
}
.screen-shot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
}
.screen h3 { font-family: "Baloo 2", cursive; font-weight: 800; font-size: 20px; margin: 0 0 4px; }
.screen p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--inkSoft); }

/* --- sticker band ---------------------------------------------------------- */

.band { padding-block: clamp(48px, 7vw, 72px) 0; }
.band-inner {
  background: var(--surfaceAlt);
  border-radius: 26px;
  padding: clamp(28px, 4vw, 40px) clamp(18px, 3vw, 40px) 28px;
  text-align: center;
}
.band h2 {
  font-family: "Baloo 2", cursive;
  font-weight: 800;
  font-size: clamp(27px, 4vw, 36px);
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.band p { margin: 0 auto; max-width: 34em; font-size: 17px; line-height: 1.55; color: var(--inkSoft); }

.marquee {
  margin: 22px clamp(-40px, -3vw, -18px) 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.marquee-track {
  display: flex;
  gap: 4px;
  width: max-content;
}
/* app.js adds this once it has cloned the strip. The keyframe travels -50%, so
 * animating a single copy would slide the row into empty space.
 *
 * The images in here are deliberately NOT loading="lazy". A lazy image only loads when
 * it intersects the viewport, and these sit off to the right inside a width:max-content
 * track that a transform slides — the browser never counts that as an intersection, so
 * half the strip stayed permanently blank as it scrolled past. They are fetchpriority
 * low instead: fetched off the critical path, but actually fetched. */
.marquee-track.is-looping { animation: kuma-marquee 90s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee img {
  width: 116px;
  height: 116px;
  flex: none;
  object-fit: contain;
  object-position: center bottom;
}

/* --- faq ------------------------------------------------------------------- */

.faq { padding-block: clamp(48px, 7vw, 76px) 0; }
.faq .section-title { margin-bottom: 24px; }
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  background: none;
  border: none;
  padding: 18px 22px;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  font-family: "Baloo 2", cursive;
  font-size: 19px;
  font-weight: 800;
}
.faq-q > span:first-child { flex: 1; }
.faq-mark { color: var(--jade); font-size: 22px; line-height: 1; }
.faq-a {
  margin: 0;
  padding: 0 22px 20px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--inkSoft);
  max-width: 56em;
}
.faq-a[hidden] { display: none; }

/* --- closing --------------------------------------------------------------- */

.closing { padding-block: clamp(48px, 7vw, 80px) 0; }
.closing-inner {
  background: var(--jadeTint);
  border-radius: 26px;
  padding: clamp(34px, 5vw, 52px) clamp(20px, 3vw, 40px);
  display: flex;
  align-items: center;
  gap: 36px;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}
.closing-inner > img { width: 150px; height: 150px; object-fit: contain; }
.closing-copy { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.closing-copy h2 {
  font-family: "Baloo 2", cursive;
  font-weight: 800;
  font-size: clamp(28px, 4.2vw, 38px);
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}

/* --- footer ---------------------------------------------------------------- */

.site-footer {
  padding-block: clamp(40px, 6vw, 56px) 64px;
  margin-top: 40px;
  border-top: 1px solid var(--hairline);
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
}
.site-footer-mark { display: flex; align-items: center; gap: 10px; }
.site-footer-mark img { width: 30px; height: 30px; object-fit: contain; }
.site-footer-mark span { font-size: 14px; color: var(--inkSoft); font-weight: 600; }
.site-footer-links { margin-left: auto; display: flex; gap: 22px; font-size: 14px; font-weight: 700; flex-wrap: wrap; }

/* --- motion ---------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
  .turn { animation: none; }
  .appstore { transition: none; }
  body { transition: none; }
}
