/*
 * LittleStep — littlestep.app
 *
 * Tokens are the corporate identity, verbatim. Do not invent a colour here:
 * if a shade is missing, it is missing from the brand, and the brand is the
 * one in `apps/mobile/src/theme/tokens.ts`. Keep the two in step.
 *
 * Two rules from the identity that are easy to break by accident:
 *   1. No black anywhere. The darkest tone is cocoa (#3F2617).
 *   2. The mark's three steps never reorder or resize relative to each other.
 */

:root {
  /* Paper */
  --cream: #faf7f1;
  --paper: #fffdfa;
  --sand: #f7efe6;
  --beige: #f0e3d3;

  /* Steps */
  --tangerine: #ff6a2b;
  --clay: #c6431a;
  --sun: #eda01a;
  --teal: #1ea896;

  /* Ink — cocoa, never black */
  --ink: #3f2617;
  --bark: #7a6355;
  --faint: #7c6a5a;

  --line: rgba(63, 38, 23, 0.11);
  --line-soft: rgba(63, 38, 23, 0.07);
  --tangerine-soft: rgba(255, 106, 43, 0.14);

  --bg: var(--cream);
  --card: var(--paper);
  --shadow: 0 1px 2px rgba(63, 38, 23, 0.04), 0 12px 32px -18px rgba(63, 38, 23, 0.28);
  --shadow-lift: 0 2px 4px rgba(63, 38, 23, 0.05), 0 28px 60px -28px rgba(63, 38, 23, 0.34);

  --radius: 22px;
  --radius-lg: 30px;
  --radius-sm: 14px;

  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 40px);

  color-scheme: light;
}

/*
 * Evening. The identity ships a cocoa-ground lockup, so the site honours the
 * reader's own setting rather than forcing daylight. Only tokens change.
 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #2e1b10;
    --card: #3a2315;
    --sand: #40291a;
    --beige: #4a3020;
    --ink: #fbf3e9;
    --bark: #cbb4a2;
    --faint: #b79f8d;
    --line: rgba(251, 243, 233, 0.14);
    --line-soft: rgba(251, 243, 233, 0.09);
    --tangerine-soft: rgba(255, 106, 43, 0.2);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -18px rgba(0, 0, 0, 0.6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.34), 0 28px 60px -28px rgba(0, 0, 0, 0.66);
    color-scheme: dark;
  }
}

/* Figtree is Latin-only and self-hosted: no third-party request on any page,
 * which is a promise the privacy policy makes out loud. Non-Latin scripts drop
 * the family and take the platform face — the same rule the app follows in
 * `src/theme/script-font.ts`. */
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/fonts/figtree-var-latin.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
    U+FFFD;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.62;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Thai (and any other non-Latin) takes the platform face and more leading —
 * Figtree has no Thai glyphs, and Thai stacks vowel + tone above the line. */
:lang(th) body,
body:lang(th),
.th {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, 'Noto Sans Thai',
    'Sarabun', sans-serif;
  line-height: 1.86;
  letter-spacing: 0;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.022em;
  line-height: 1.08;
}

:lang(th) h1,
:lang(th) h2,
:lang(th) h3,
:lang(th) h4 {
  letter-spacing: 0;
  line-height: 1.42;
}

p {
  margin: 0;
}

/* ── Layout ─────────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(64px, 10vw, 120px);
}

.section--tight {
  padding-block: clamp(48px, 7vw, 84px);
}

.section--sand {
  background: var(--sand);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--cream);
  padding: 12px 18px;
  border-radius: 0 0 12px 0;
  z-index: 100;
}
.skip:focus {
  left: 0;
}

:where(a, button, summary, input, textarea):focus-visible {
  outline: 3px solid var(--tangerine);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ── The mark ───────────────────────────────────────────────────────── */

.mark {
  display: block;
  height: 26px;
  width: auto;
  flex: none;
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: inherit;
}

.wordmark {
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.022em;
  line-height: 1;
}

/* ── Nav ────────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.nav[data-scrolled='true'] {
  border-bottom-color: var(--line-soft);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 68px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 28px);
}

.nav__links a {
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--bark);
  white-space: nowrap;
}

.nav__links a:hover {
  color: var(--ink);
}

@media (max-width: 720px) {
  .nav__links .nav__hide-sm {
    display: none;
  }
}

/* ── Buttons ────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.14s ease,
    background-color 0.14s ease,
    box-shadow 0.14s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--tangerine);
  color: #fffdfa;
  box-shadow: 0 10px 24px -12px rgba(255, 106, 43, 0.9);
}

.btn--primary:hover {
  background: var(--clay);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn--ghost:hover {
  background: var(--sand);
}

.btn--sm {
  padding: 10px 18px;
  font-size: 15px;
}

/* ── Store buttons ──────────────────────────────────────────────────────
 * Default state is "coming soon" and NOT a link, because on the day this
 * ships the app is not in either store yet. `assets/site.js` promotes them
 * to real links the moment STORE_LINKS carries a URL — so the honest state
 * is what you get with JavaScript off, and nobody has to remember to edit
 * six HTML files.
 */

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  max-width: 460px;
}

.close .stores {
  margin-inline: auto;
}

@media (max-width: 460px) {
  .stores {
    flex-direction: column;
    align-items: stretch;
  }
}

.store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px 11px 17px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  /* Grows to fill a row, never wider than one. `min-width: 0` is what lets a
   * flex item shrink below its content — without it the pair of buttons runs
   * off a 390px phone instead of stacking. */
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.store[data-state='soon'] {
  opacity: 0.62;
  cursor: default;
}

.store:not([data-state='soon']):hover {
  border-color: var(--tangerine);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.store svg {
  flex: none;
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.store__text {
  display: flex;
  flex-direction: column;
  line-height: 1.18;
  min-width: 0;
}

.store__kicker {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.store__name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store__kicker {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Type helpers ───────────────────────────────────────────────────── */

.kicker {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 18px;
}

.h1 {
  font-size: clamp(40px, 7.2vw, 74px);
  line-height: 1.02;
}

.h2 {
  font-size: clamp(28px, 4.4vw, 44px);
  line-height: 1.1;
}

.h3 {
  font-size: clamp(19px, 2.2vw, 23px);
  line-height: 1.24;
}

.lede {
  font-size: clamp(17px, 1.9vw, 20px);
  color: var(--bark);
  max-width: 60ch;
}

.muted {
  color: var(--bark);
}

.small {
  font-size: 14.5px;
  color: var(--faint);
}

.center {
  text-align: center;
}

.center .lede {
  margin-inline: auto;
}

/* ── Hero ───────────────────────────────────────────────────────────── */

.hero {
  padding-top: clamp(44px, 7vw, 88px);
  padding-bottom: clamp(56px, 8vw, 100px);
  overflow: clip;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  background: var(--tangerine-soft);
  color: var(--clay);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 24px;
}

@media (prefers-color-scheme: dark) {
  .hero__badge {
    color: #ffb08a;
  }
}

.hero__badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.hero h1 {
  margin-bottom: 22px;
}

.hero .lede {
  margin-bottom: 30px;
}

.hero__cta {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.hero__note {
  font-size: 14.5px;
  color: var(--faint);
}

.hero__note a,
.close .small a {
  color: var(--clay);
  font-weight: 600;
  text-underline-offset: 3px;
}

/* ── Phone ──────────────────────────────────────────────────────────── */

.phone {
  --phone-w: 316px;
  width: var(--phone-w);
  margin-inline: auto;
  border-radius: 46px;
  padding: 11px;
  background: linear-gradient(160deg, var(--beige), var(--sand));
  box-shadow: var(--shadow-lift);
  border: 1px solid var(--line);
}

.phone__screen {
  border-radius: 36px;
  background: var(--card);
  overflow: hidden;
  padding: 14px 16px 18px;
  min-height: 528px;
  display: flex;
  flex-direction: column;
}

.phone__notch {
  width: 92px;
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  margin: 2px auto 16px;
}

.screen__kicker {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 10px;
}

.screen__hello {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.022em;
  line-height: 1.12;
  margin-bottom: 6px;
}

.screen__sub {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--bark);
  margin-bottom: 16px;
}

.screen__cards {
  display: grid;
  gap: 12px;
}

.tile {
  border-radius: 20px;
  padding: 15px 16px 16px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.tile__kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.tile__kicker::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.tile--story .tile__kicker {
  color: #a06a06;
}
.tile--moment .tile__kicker {
  color: #0f7b6d;
}

@media (prefers-color-scheme: dark) {
  .tile--story .tile__kicker {
    color: var(--sun);
  }
  .tile--moment .tile__kicker {
    color: #4fd6c3;
  }
}

.tile__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.2;
  margin-bottom: 7px;
}

.tile__meta {
  font-size: 12.5px;
  color: var(--faint);
}

.screen__foot {
  margin-top: auto;
  padding-top: 18px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--bark);
}

/* ── Cards & grids ──────────────────────────────────────────────────── */

.grid {
  display: grid;
  gap: clamp(16px, 2.2vw, 24px);
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 860px) {
  .grid--3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .grid--2 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 34px);
  box-shadow: var(--shadow);
}

.card__dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-bottom: 20px;
}

.card h3 {
  margin-bottom: 10px;
}

.card p {
  color: var(--bark);
}

.dot--sun {
  background: var(--sun);
}
.dot--teal {
  background: var(--teal);
}
.dot--tangerine {
  background: var(--tangerine);
}

/* Numbered steps */
.steps {
  counter-reset: step;
}

.step {
  position: relative;
  padding-left: 62px;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--tangerine-soft);
  color: var(--clay);
  font-weight: 800;
  font-size: 17px;
}

@media (prefers-color-scheme: dark) {
  .step::before {
    color: #ffb08a;
  }
}

@media (max-width: 860px) {
  .step {
    padding-left: 56px;
  }
}

/* ── Parent panel ───────────────────────────────────────────────────── */

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3.4vw, 40px);
  box-shadow: var(--shadow);
}

.panel__rows {
  display: grid;
  gap: 20px;
}

/* Always stacked: this panel lives in a half-width column, and a 200px label
 * gutter left the value column too narrow to read — three words per line. */
.panel__row {
  display: grid;
  gap: 5px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

.panel__row:first-child {
  padding-top: 0;
  border-top: 0;
}

.panel__label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ── Promise list (the anti-features) ───────────────────────────────── */

.promises {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.promise {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.promise__tick {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tangerine-soft);
  display: grid;
  place-items: center;
  margin-top: 2px;
}

.promise__tick svg {
  width: 13px;
  height: 13px;
  stroke: var(--clay);
  stroke-width: 2.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-color-scheme: dark) {
  .promise__tick svg {
    stroke: #ffb08a;
  }
}

.promise b {
  font-weight: 700;
}

/* ── Beta band ──────────────────────────────────────────────────────── */

.beta {
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--radius-lg);
  padding: clamp(30px, 4.4vw, 56px);
}

.beta h2 {
  margin-bottom: 16px;
}

.beta p {
  color: rgba(250, 247, 241, 0.76);
}

.beta .grid {
  margin-top: 32px;
}

.beta__item h4 {
  font-size: 17px;
  margin-bottom: 6px;
}

.beta__item p {
  font-size: 15px;
}

/* ── Closing CTA ────────────────────────────────────────────────────── */

.close {
  text-align: center;
}

.close .mark {
  height: 40px;
  margin: 0 auto 26px;
}

.close .stores {
  justify-content: center;
  margin-top: 28px;
}

/* ── Footer ─────────────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--line);
  padding-block: 44px 56px;
  font-size: 14.5px;
  color: var(--bark);
}

.footer__top {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  justify-content: space-between;
  align-items: flex-start;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
}

.footer__links a {
  text-decoration: none;
  color: var(--bark);
}

.footer__links a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer__bottom {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  align-items: center;
  color: var(--faint);
  font-size: 13.5px;
}

.lang {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.lang a {
  padding: 4px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--bark);
}

.lang a[aria-current='page'] {
  background: var(--sand);
  color: var(--ink);
}

@media (prefers-color-scheme: dark) {
  .lang a[aria-current='page'] {
    background: var(--beige);
  }
}

/* ── Document pages (privacy, terms, support, deletion) ─────────────── */

.doc {
  max-width: 760px;
  margin-inline: auto;
  padding-block: clamp(48px, 7vw, 84px);
}

.doc h1 {
  font-size: clamp(32px, 5vw, 48px);
  margin-bottom: 14px;
}

.doc__meta {
  color: var(--faint);
  font-size: 14.5px;
  margin-bottom: 40px;
}

.doc h2 {
  font-size: clamp(21px, 2.6vw, 26px);
  margin-top: 44px;
  margin-bottom: 12px;
}

.doc h3 {
  font-size: 18px;
  margin-top: 28px;
  margin-bottom: 8px;
}

.doc p,
.doc li {
  color: var(--bark);
}

.doc p + p {
  margin-top: 14px;
}

.doc ul,
.doc ol {
  margin: 14px 0 0;
  padding-left: 22px;
  display: grid;
  gap: 8px;
}

.doc a {
  color: var(--clay);
  text-underline-offset: 3px;
}

@media (prefers-color-scheme: dark) {
  .doc a {
    color: #ffb08a;
  }
}

.doc strong {
  color: var(--ink);
}

.callout {
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-top: 24px;
}

.callout p {
  color: var(--ink);
}

.toc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 8px;
}

.toc ol {
  margin-top: 10px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 15.5px;
  display: block;
  overflow-x: auto;
}

.table th,
.table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--bark);
}

.table th {
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

/* ── Thai ───────────────────────────────────────────────────────────────
 * Every uppercase + wide-tracking label in this sheet is a Latin device.
 * Thai has no case, so `text-transform` does nothing, while the tracking
 * pulls the tone marks away from the consonants they belong to and makes a
 * 11px label genuinely hard to read. Thai keeps the label's ROLE — small,
 * quiet, above the thing it names — and drops the mechanics.
 */

:lang(th) .kicker,
:lang(th) .store__kicker,
:lang(th) .screen__kicker,
:lang(th) .tile__kicker,
:lang(th) .panel__label {
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.7;
}

:lang(th) .kicker,
:lang(th) .panel__label {
  font-size: 13px;
}

:lang(th) .store__kicker,
:lang(th) .screen__kicker,
:lang(th) .tile__kicker {
  font-size: 12px;
}

/* Thai needs the extra leading here too, and these three have fixed-ish rows. */
:lang(th) .screen__hello {
  line-height: 1.35;
}

:lang(th) .tile__title,
:lang(th) .store__name {
  line-height: 1.45;
}

/* The store name is clamped to one line for Latin; Thai sits taller inside
 * the same box, so give the button room rather than shearing a tone mark. */
:lang(th) .store {
  padding-block: 9px;
}

/* ── 404 ────────────────────────────────────────────────────────────── */

.notfound {
  min-height: 68vh;
  display: grid;
  place-items: center;
  text-align: center;
}
