/* ============================================================================
   CatLitter — landing styles
   Built on the app's own design system (lib/theme/tokens.dart):
   Daylight palette · tuxedo charcoal ink · cat-eye gold · Fredoka + DM Sans.
   The freshness ring is the signature; litter grain is the texture.
   No red exists in the palette. Calm, warm, never a scold.
   ============================================================================ */

:root {
  /* Daylight (light) — verbatim from the app token table */
  --bg: #FAF6EF;
  --surface: #FFFDF8;
  --surface-2: #FAF1DC;
  --ink: #2C2A2B;
  --ink-soft: #4A443C;
  --muted: #6B6157;
  --faint: #A89B8C;
  --hairline: #EADFCE;
  --border: #F0E6D6;
  --accent: #E0A43A;
  --accent-press: #C98F2E;
  --accent-soft: #8C6A27;
  --fresh: #EDB84A;
  --amber: #D98A34;
  --ring-track: #F0E6D5;
  --positive: #569672;

  /* Quiet Evening (charcoal band) */
  --evening-bg: #1F1D1E;
  --evening-surface: #2C2A2B;
  --evening-ink: #FAF6EF;
  --evening-muted: #A89B8C;

  --radius-pill: 999px;
  --radius-card: 22px;
  --radius-lg: 30px;
  --radius-field: 16px;

  --shadow-card: 0 10px 24px -6px rgba(44, 42, 43, .12), 0 2px 6px -2px rgba(44, 42, 43, .08);
  --shadow-float: 0 30px 60px -24px rgba(44, 42, 43, .45);
  --gold-glow: 0 0 44px 2px rgba(224, 164, 58, .28);

  --maxw: 1120px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  /* Litter grain: a warm cream field with a faint speckle, echoing the disc surface */
  background-image:
    radial-gradient(1200px 720px at 18% -8%, #FDEECB 0%, rgba(253, 238, 203, 0) 55%),
    radial-gradient(1000px 680px at 100% 0%, #FBE4C0 0%, rgba(251, 228, 192, 0) 48%),
    radial-gradient(circle at 50% 50%, rgba(168, 155, 140, .05) 0.6px, transparent 0.7px);
  background-size: auto, auto, 7px 7px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, .display { font-family: 'Fredoka', 'DM Sans', sans-serif; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; }

/* ── i18n (behavior.js keys off <html lang>) ─────────────────────────────── */
/* Localized nodes are hidden by default and only the active language is revealed. Lang wrappers are
   always PLAIN elements (no competing display class), so this hide is never overridden. */
.lang-en, .lang-es, .lang-pt, .lang-de, .lang-fr, .lang-ja { display: none; }
html[lang="en"] .lang-en,
html[lang="es"] .lang-es,
html[lang="pt"] .lang-pt,
html[lang="de"] .lang-de,
html[lang="fr"] .lang-fr,
html[lang="ja"] .lang-ja { display: revert; }

/* Japanese: Fredoka + DM Sans carry no CJK glyphs, so swap to Noto Sans JP for that locale. */
html[lang="ja"] body,
html[lang="ja"] h1, html[lang="ja"] h2, html[lang="ja"] h3, html[lang="ja"] .display {
  font-family: 'Noto Sans JP', 'DM Sans', system-ui, sans-serif;
}
html[lang="ja"] h1, html[lang="ja"] h2, html[lang="ja"] h3, html[lang="ja"] .glance__inner { font-weight: 700; }

/* ── layout ──────────────────────────────────────────────────────────────── */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
section { position: relative; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent-soft); background: var(--surface-2);
  padding: 7px 14px; border-radius: var(--radius-pill);
}

/* ── nav ─────────────────────────────────────────────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px;
  transition: background .3s var(--ease), box-shadow .3s var(--ease), backdrop-filter .3s var(--ease);
}
.nav.scrolled {
  background: rgba(250, 246, 239, .82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--hairline), 0 8px 24px -18px rgba(44, 42, 43, .5);
}
.nav__brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.nav__word { font-family: 'Fredoka'; font-weight: 600; font-size: 21px; color: var(--ink); }
.nav__right { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.nav__link { display: none; text-decoration: none; color: var(--ink-soft); font-weight: 500; font-size: 15px; padding: 8px 10px; border-radius: 10px; }
.nav__link:hover { color: var(--ink); background: var(--surface-2); }

/* the ring-gauge emblem — the app's mark, built from tokens */
.emblem { position: relative; width: 46px; height: 46px; flex-shrink: 0; }
.emblem__tile {
  position: absolute; inset: 0; border-radius: 12px; background: var(--ink);
  display: grid; place-items: center; box-shadow: 0 10px 22px -10px rgba(44, 42, 43, .55);
  overflow: hidden;
}
.emblem__tile img { width: 60%; height: 60%; }

/* language selector (6 locales) — a segmented pill on desktop, a compact dropdown on mobile */
.lang { position: relative; display: inline-flex; }
.lang__trigger {
  display: none; align-items: center; gap: 7px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill);
  color: var(--ink-soft); font: 600 13px/1 'DM Sans', sans-serif;
  padding: 0 12px; min-height: 42px;
  transition: background .2s, color .2s, box-shadow .2s;
}
.lang__trigger:hover { color: var(--ink); }
.lang__trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lang__globe { width: 17px; height: 17px; color: var(--accent-soft); }
.lang__code { letter-spacing: .04em; }
.lang__chev { width: 15px; height: 15px; color: var(--faint); transition: transform .2s var(--ease); }
.lang.open .lang__chev { transform: rotate(180deg); }

.lang-toggle { display: inline-flex; gap: 1px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 3px; }
.lang-toggle__btn {
  border: 0; background: transparent; cursor: pointer;
  font: 600 12px/1 'DM Sans', sans-serif; color: var(--muted);
  padding: 7px 10px; border-radius: var(--radius-pill); min-height: 32px;
  transition: color .2s, background .2s;
}
.lang-toggle__btn.active { color: var(--ink); background: var(--surface); box-shadow: 0 2px 6px -2px rgba(44, 42, 43, .25); }
.lang-toggle__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lang-toggle__name { display: none; }

/* ── buttons / badges ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1 'DM Sans', sans-serif; text-decoration: none; cursor: pointer;
  padding: 13px 22px; min-height: 46px; border-radius: var(--radius-pill); border: 0;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s;
}
.btn--dark { background: var(--ink); color: #fff; box-shadow: 0 12px 26px -12px rgba(44, 42, 43, .6); }
.btn--dark:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -14px rgba(44, 42, 43, .7); }
.btn--ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }
.btn--ghost:hover { background: var(--surface-2); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.badges { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.store-badge { display: inline-flex; transition: transform .15s var(--ease), filter .2s; border-radius: 12px; }
.store-badge img { height: 52px; width: auto; display: block; }
.store-badge:hover { transform: translateY(-2px); filter: drop-shadow(0 10px 18px rgba(44, 42, 43, .28)); }
.store-badge:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 12px; }
.store-badge--soon { position: relative; opacity: .55; pointer-events: none; filter: grayscale(.3); }
.store-badge--soon::after {
  content: 'Coming soon'; position: absolute; top: -9px; right: -6px;
  font: 600 10px/1 'DM Sans'; color: var(--ink); background: var(--fresh);
  padding: 4px 7px; border-radius: var(--radius-pill);
}
.cta-badges .store-badge img { height: 58px; }

/* ── hero ────────────────────────────────────────────────────────────────── */
.hero { padding: 128px 0 72px; }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero__copy { max-width: 560px; }
.hero h1 {
  font-size: clamp(38px, 5.2vw, 62px); line-height: 1.04; margin: 20px 0 0;
  font-weight: 600; color: var(--ink);
}
.hero h1 .accent { color: var(--accent-soft); }
.hero__sub { font-size: clamp(17px, 1.5vw, 20px); color: var(--ink-soft); margin-top: 22px; max-width: 30em; }
.hero__actions { margin-top: 30px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 26px; }
.trust li { list-style: none; display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; color: var(--muted); }
.trust svg { width: 17px; height: 17px; color: var(--positive); flex-shrink: 0; }
.hero__actions .badges { margin-top: 0; }

/* hero stage: the bespoke breathing freshness ring behind a bezeled phone */
.stage { position: relative; display: grid; place-items: center; min-height: 620px; }
.halo { position: absolute; width: min(560px, 96%); aspect-ratio: 1; pointer-events: none; z-index: 0; }
.halo svg { width: 100%; height: 100%; overflow: visible; }
.halo__arc { transform-origin: center; animation: haloBreathe 7s var(--ease) infinite; }
.halo__spark { transform-origin: center; animation: haloSpin 26s linear infinite; }
@keyframes haloBreathe {
  0%, 100% { opacity: .85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.028); }
}
@keyframes haloSpin { to { transform: rotate(360deg); } }

/* phone bezel — composed by the page around the raw screenshot (screenshots-as-is), the way the
   unworried landing does it: the IMAGE drives the height (no object-fit, no aspect-ratio to fight),
   so the screen can never stretch or crop. Thin charcoal rim, and a real dynamic-island + status
   time drawn in the app's empty top safe-area via pseudo-elements (zero markup per phone, blends
   with the cream app background). */
.phone {
  position: relative; z-index: 2;
  width: clamp(226px, 25vw, 288px);
  background: #2C2A2B;
  border-radius: 13% / 6.1%;
  padding: 1.55%;
  box-shadow: var(--shadow-float);
}
.phone__screen {
  position: relative; width: 100%;
  border-radius: 11% / 5.1%; overflow: hidden; background: var(--bg);
  line-height: 0;
}
.phone__screen img { width: 100%; height: auto; display: block; }
/* dynamic island */
.phone__screen::before {
  content: ''; position: absolute; z-index: 4;
  top: 1.7%; left: 50%; transform: translateX(-50%);
  width: 28%; height: 22px; max-height: 3.4%;
  background: #0b0b0c; border-radius: var(--radius-pill);
}
/* status time */
.phone__screen::after {
  content: '9:41'; position: absolute; z-index: 4;
  top: 1.9%; left: 9%;
  font: 700 12px/1 'DM Sans', sans-serif; color: var(--ink); letter-spacing: .01em;
}
.phone--float { animation: floaty 8s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ── glance band ─────────────────────────────────────────────────────────── */
.glance { padding: 40px 0; }
.glance__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 26px;
  text-align: center; font-family: 'Fredoka'; font-weight: 500;
  font-size: clamp(22px, 3vw, 34px); color: var(--ink);
}
.glance__inner b { color: var(--accent-soft); font-weight: 600; }
.glance__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ── features ────────────────────────────────────────────────────────────── */
.features { padding: 40px 0 24px; display: flex; flex-direction: column; gap: 96px; }
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.feature:nth-child(even) .feature__media { order: -1; }
.feature__title { font-size: clamp(27px, 3.4vw, 40px); line-height: 1.1; margin: 16px 0 0; }
.feature__body { font-size: 17px; color: var(--ink-soft); margin-top: 16px; max-width: 34em; }
.feature__list { margin: 22px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.feature__list li { list-style: none; display: flex; gap: 12px; align-items: flex-start; font-size: 15.5px; color: var(--ink-soft); }
.feature__list .ic { flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; }
.feature__list .ic svg { width: 17px; height: 17px; color: var(--accent-soft); }

.feature__media { position: relative; display: grid; place-items: center; }
.media-card {
  position: relative; width: 100%; padding: 40px 24px;
  border-radius: var(--radius-lg); overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, #FDEECB 0%, #FDF7EF 46%, #F8F0E3 100%);
  border: 1px solid var(--border); box-shadow: var(--shadow-card);
  display: grid; place-items: center;
}
.media-card--warm { background: radial-gradient(120% 90% at 50% -10%, #FBE4C0 0%, #FDF7EF 48%, #F8F0E3 100%); }
.media-card .phone { width: clamp(190px, 22vw, 244px); box-shadow: var(--shadow-float); }
.media-card .phone::before, .stage .phone::before { }
.media-pair { display: flex; gap: 18px; justify-content: center; align-items: flex-start; }
.media-pair .phone { width: clamp(150px, 16.5vw, 186px); }
.media-pair .phone:last-child { margin-top: 40px; }

/* freshness states row (brand detail — gold to amber, never red) */
.states { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 24px; }
.state {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 8px 15px 8px 8px; box-shadow: var(--shadow-card); font-size: 14px; font-weight: 600; color: var(--ink);
}
.ringlet { width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(var(--_c) var(--_p), var(--ring-track) 0); position: relative; }
.ringlet::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.state--fresh { --_c: var(--fresh); --_p: 92%; }
.state--soon { --_c: var(--amber); --_p: 55%; }
.state--full { --_c: var(--accent); --_p: 18%; }

/* ── CTA band (Quiet Evening) ────────────────────────────────────────────── */
.cta {
  margin-top: 80px; padding: 84px 0;
  background: linear-gradient(180deg, var(--evening-surface) 0%, var(--evening-bg) 100%);
  color: var(--evening-ink); text-align: center; position: relative; overflow: hidden;
}
.cta::before {
  content: ''; position: absolute; top: -40%; left: 50%; transform: translateX(-50%);
  width: 640px; height: 640px; border-radius: 50%;
  background: radial-gradient(circle, rgba(237, 184, 74, .18) 0%, rgba(237, 184, 74, 0) 62%);
  pointer-events: none;
}
.cta h2 { position: relative; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; color: var(--evening-ink); }
.cta p { position: relative; color: var(--evening-muted); font-size: 18px; margin: 18px auto 0; max-width: 30em; }
.cta__actions { position: relative; margin-top: 34px; display: flex; justify-content: center; }
.cta .badges { justify-content: center; }

/* ── contact ─────────────────────────────────────────────────────────────── */
.contact { padding: 72px 0; text-align: center; }
.contact h2 { font-size: clamp(24px, 3vw, 34px); }
.contact p { color: var(--ink-soft); margin: 12px auto 26px; max-width: 34em; font-size: 17px; }
.contact__btn {
  font: 600 16px/1 'DM Sans'; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 26px; min-height: 50px; border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink); border: 1px solid var(--border);
  box-shadow: var(--shadow-card); transition: transform .15s var(--ease), background .2s;
}
.contact__btn:hover { transform: translateY(-2px); background: var(--surface-2); }
.contact__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.contact__btn svg { width: 19px; height: 19px; color: var(--accent-soft); }

/* ── footer ──────────────────────────────────────────────────────────────── */
.footer { padding: 48px 0 60px; border-top: 1px solid var(--hairline); }
.footer__grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.footer__brand { display: inline-flex; align-items: center; gap: 12px; }
.footer__made { font-size: 14px; color: var(--muted); margin-top: 4px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.footer__links a { text-decoration: none; color: var(--ink-soft); font-size: 14.5px; font-weight: 500; }
.footer__links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.footer__copy { margin-top: 26px; font-size: 13px; color: var(--faint); }

/* ── snackbar ────────────────────────────────────────────────────────────── */
.snackbar {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 24px);
  z-index: 80; background: var(--ink); color: #fff;
  font: 500 14.5px/1.3 'DM Sans'; padding: 14px 20px; border-radius: var(--radius-field);
  box-shadow: 0 18px 40px -14px rgba(44, 42, 43, .6);
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease), transform .3s var(--ease);
  max-width: calc(100vw - 40px);
}
.snackbar--show { opacity: 1; transform: translate(-50%, 0); }

/* ── responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { padding: 108px 0 48px; }
  .hero__grid { grid-template-columns: 1fr; gap: 12px; }
  .hero__copy { max-width: none; text-align: center; margin: 0 auto; }
  .hero .eyebrow { }
  .hero__sub { margin-left: auto; margin-right: auto; }
  .hero__actions .badges, .trust { justify-content: center; }
  .stage { min-height: 520px; order: -1; }
  .feature { grid-template-columns: 1fr; gap: 28px; text-align: center; }
  .feature:nth-child(even) .feature__media { order: 0; }
  .feature__body { margin-left: auto; margin-right: auto; }
  .feature__list { max-width: 32em; margin-left: auto; margin-right: auto; text-align: left; }
  .states { justify-content: center; }
  .nav__link { display: none; }

  /* mobile header: tighten the trio (brand · language · CTA) onto one calm row */
  .nav { padding: 12px 18px; gap: 10px; }
  .nav__right { flex-wrap: nowrap; gap: 8px; }
  .nav .btn--dark { padding: 0 15px; min-height: 42px; font-size: 14px; }

  /* language: collapse the 6-pill row into a compact globe dropdown */
  .lang__trigger { display: inline-flex; }
  .lang-toggle {
    position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
    display: none; flex-direction: column; gap: 2px; min-width: 188px; padding: 8px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
    box-shadow: 0 22px 46px -18px rgba(44, 42, 43, .5), 0 2px 6px -2px rgba(44, 42, 43, .12);
  }
  .lang.open .lang-toggle { display: flex; }
  .lang-toggle__btn {
    width: 100%; justify-content: flex-start; gap: 12px; display: flex; align-items: center;
    padding: 11px 12px; min-height: 44px; border-radius: 11px; font-size: 15px; color: var(--ink-soft);
  }
  .lang-toggle__btn.active { color: var(--ink); background: var(--surface-2); box-shadow: none; }
  .lang-toggle__code { font-size: 11px; font-weight: 700; color: var(--faint); width: 20px; letter-spacing: .04em; }
  .lang-toggle__name { display: inline; }
}
@media (min-width: 901px) { .nav__link { display: inline-flex; } }
@media (max-width: 460px) {
  .wrap { padding: 0 18px; }
  .store-badge img { height: 46px; }
  .cta-badges .store-badge img { height: 50px; }
  .media-pair { flex-direction: column; align-items: center; }
  .media-pair .phone:last-child { margin-top: 0; }
}

/* ── reduced motion: keep the end-state, drop the movement ───────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .halo__arc, .halo__spark, .phone--float { animation: none; }
  .halo__arc { opacity: 1; }
  * { transition-duration: .01ms !important; }
}
