/* Tiger Lingo site. Colours mirror apps/mobile/theme (light only — the app has no dark theme).
   Order: tokens → base → atoms → molecules → organisms → page layouts. */

/* ── Tokens ─────────────────────────────────────────────────────────────── */

:root {
  --teal-500: #71b776;
  --teal-600: #50a557;
  --teal-800: #2f6b34;
  --orange-500: #ff691f;
  --neutral-0: #fff;
  --neutral-100: #f3f4f6;
  --neutral-600: #4b5563;
  --neutral-800: #1f2937;
  --neutral-900: #111827;
  --jungle-mint: #e4faf0; /* flat fill of the illustrated background art */

  --page: var(--jungle-mint);
  --surface: var(--neutral-0);
  --surface-banner: var(--neutral-100);
  --surface-frost: rgb(255 255 255 / 72%);
  --device: var(--neutral-900);
  --sticker-edge: var(--neutral-800);
  --border-base: var(--neutral-800);
  --border-hairline: rgb(31 41 55 / 12%);
  --border-dashed: rgb(31 41 55 / 35%);
  --text-primary: var(--neutral-800);
  --text-strong: var(--neutral-900);
  --text-secondary: var(--neutral-600);
  --brand: var(--teal-500);
  --brand-pressed: var(--teal-600);
  --brand-strong: var(--teal-800);
  --brand-on: var(--neutral-900);
  --focus-ring: var(--orange-500);

  --outline: 2px solid var(--border-base);
  --sticker: 0 2px 0 var(--sticker-edge);
  --sticker-lg: 0 4px 0 var(--sticker-edge);
  --shadow-card: 0 10px 30px -6px rgb(26 64 40 / 18%);
  --shadow-float: 0 32px 64px -24px rgb(20 70 45 / 45%);
  --shadow-art: drop-shadow(0 10px 16px rgb(20 70 45 / 28%));

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-xxl: 24px;
  --space-xxxl: 32px;
  --space-huge: 40px;
  --space-giant: 64px;
  --space-section: clamp(72px, 11vw, 128px);

  --radius-btn: 16px;
  --radius-card: 24px;
  --radius-sheet: 32px;
  --radius-pill: 999px;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-thai: "Noto Sans Thai", Thonburi, system-ui, sans-serif;
  --font-zh: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --duration-press: 120ms;
  --duration-hover: 220ms;

  --wrap: 68rem;
  --measure: 40rem;
  --leaf-top: clamp(120px, 24vw, 340px);
  --leaf-bottom: clamp(150px, 26vw, 380px);

  color-scheme: light;
}

/* ── Base ───────────────────────────────────────────────────────────────── */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  background:
    url("/assets/leaves-tl.webp") left top / var(--leaf-top) auto no-repeat,
    url("/assets/leaves-tr.webp") right top / calc(var(--leaf-top) * 0.8) auto no-repeat,
    var(--page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 26px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizelegibility;
}

main {
  flex: 1;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--text-strong);
  text-wrap: balance;
}

h1 {
  font-size: clamp(32px, 7vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0 0 var(--space-lg);
}

h2 {
  font-size: clamp(24px, 3.4vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-weight: 750;
  margin: var(--space-huge) 0 var(--space-md);
}

h3 {
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  margin: var(--space-xxl) 0 var(--space-xs);
}

p {
  margin: 0 0 var(--space-lg);
  text-wrap: pretty;
}

ul {
  padding-left: var(--space-xl);
}

li {
  margin: 0 0 var(--space-sm);
}

a {
  color: var(--brand-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

strong {
  font-weight: 600;
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.thai {
  font-family: var(--font-thai);
}

.zh {
  font-family: var(--font-zh);
}

/* ── Atoms ──────────────────────────────────────────────────────────────── */

.lede {
  font-size: 19px;
  line-height: 29px;
  color: var(--text-secondary);
  margin-bottom: var(--space-xxl);
}

.muted {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 23px;
}

.button {
  display: inline-block;
  background: var(--brand);
  color: var(--brand-on);
  border: var(--outline);
  border-radius: var(--radius-btn);
  box-shadow: var(--sticker);
  padding: var(--space-md) var(--space-xl);
  font-weight: 650;
  line-height: 22px;
  text-decoration: none;
  transition:
    translate var(--duration-press) var(--ease-out),
    scale var(--duration-press) var(--ease-out),
    box-shadow var(--duration-press) var(--ease-out),
    background-color var(--duration-hover) var(--ease-out);
}

.button.secondary {
  background: var(--surface);
  color: var(--text-primary);
}

.button:active {
  translate: 0 2px;
  scale: 0.97;
  box-shadow: 0 0 0 var(--sticker-edge);
}

@media (hover: hover) and (pointer: fine) {
  .button:hover {
    translate: 0 1px;
    box-shadow: 0 1px 0 var(--sticker-edge);
  }

  .button:not(.secondary):hover {
    background: var(--brand-pressed);
  }
}

/* Round action button, drawn like the app's toolbar buttons. Decorative here. */
.tool {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: var(--brand-on);
  border: var(--outline);
  box-shadow: var(--sticker);
}

.tool svg {
  width: 24px;
  height: 24px;
}

/* ── Molecules ──────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: var(--outline);
  border-radius: var(--radius-card);
  box-shadow: var(--sticker), var(--shadow-card);
  padding: var(--space-xxl);
  margin: var(--space-xxl) 0;
}

.card > :first-child {
  margin-top: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

/* A real app screenshot inside a device outline. */
.phone {
  width: min(320px, 66vw);
  margin: 0;
  padding: 7px;
  background: var(--device);
  border: var(--outline);
  border-radius: 16% / 7.4%;
  box-shadow: var(--sticker-lg), var(--shadow-float);
}

.phone img {
  width: 100%;
  height: auto;
  border-radius: 13.6% / 6.3%;
}

.perks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-xxl) 0 0;
  padding: 0;
  list-style: none;
}

.perks li {
  margin: 0;
  padding: var(--space-xs) var(--space-md);
  background: var(--surface-frost);
  border: 1.5px solid var(--border-base);
  border-radius: var(--radius-pill);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.tools {
  display: flex;
  gap: var(--space-xxl);
  margin: var(--space-xxl) 0 0;
  padding: 0;
  list-style: none;
}

.tools li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md) var(--space-lg);
  margin: var(--space-xxl) 0;
}

/* Apple's official badge, unmodified. Apple asks for clear space of a quarter of its height. */
.store-badge {
  display: inline-block;
  border-radius: 12px;
  transition: scale var(--duration-press) var(--ease-out);
}

.store-badge img {
  width: auto;
  height: 56px;
}

.store-badge:active {
  scale: 0.97;
}

/* ── Organisms ──────────────────────────────────────────────────────────── */

.site-header {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: var(--space-xl) var(--space-xl) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.brand-tiger {
  width: clamp(38px, 10vw, 48px);
  height: auto;
  filter: var(--shadow-art);
}

.brand-wordmark {
  width: clamp(108px, 30vw, 148px);
  height: auto;
}

.site-nav {
  display: flex;
  gap: var(--space-sm);
}

.site-nav a {
  padding: 6px 14px;
  background: var(--surface);
  color: var(--text-primary);
  border: var(--outline);
  border-radius: var(--radius-pill);
  box-shadow: var(--sticker);
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  text-decoration: none;
  transition:
    translate var(--duration-press) var(--ease-out),
    scale var(--duration-press) var(--ease-out),
    box-shadow var(--duration-press) var(--ease-out);
}

.site-nav a:active {
  translate: 0 2px;
  scale: 0.97;
  box-shadow: 0 0 0 var(--sticker-edge);
}

@media (hover: hover) and (pointer: fine) {
  .site-nav a:hover {
    translate: 0 1px;
    box-shadow: 0 1px 0 var(--sticker-edge);
  }
}

.site-footer {
  margin-top: var(--space-section);
  padding-bottom: calc(var(--leaf-bottom) * 0.8);
  background:
    url("/assets/leaves-bl.webp") left bottom / var(--leaf-bottom) auto no-repeat,
    url("/assets/leaves-br.webp") right bottom / var(--leaf-bottom) auto no-repeat;
}

.site-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  width: fit-content;
  max-width: calc(100% - 2 * var(--space-xl));
  margin: 0 auto;
  padding: var(--space-lg) var(--space-xxl);
  background: var(--surface-frost);
  border: 1.5px solid var(--border-hairline);
  border-radius: var(--radius-card);
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs) var(--space-xl);
}

.site-footer a {
  color: var(--text-primary);
  font-weight: 600;
}

.site-footer p {
  margin: 0;
}

/* Home */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.hero {
  display: grid;
  justify-items: center;
  gap: var(--space-giant);
  padding-top: clamp(48px, 9vw, 96px);
  text-align: center;
}

.hero-copy {
  max-width: 40rem;
}

.hero h1 {
  font-size: clamp(42px, 7vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-xl);
}

.hero .lede {
  max-width: 34rem;
  margin: 0 auto;
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.5;
}

.hero .actions,
.hero .perks {
  justify-content: center;
}

/* One phone on small screens; a fanned pair from 640px. */
.hero-visual {
  position: relative;
  width: min(340px, 74vw);
}

.hero-visual .phone {
  width: 100%;
}

.phone-back {
  display: none;
}

.hero-tiger {
  position: absolute;
  z-index: 3;
  left: -12%;
  bottom: 8%;
  width: 34%;
  height: auto;
  rotate: -10deg;
  filter: var(--shadow-art);
}

.section-head {
  max-width: 40rem;
  margin: 0 auto var(--space-xxxl);
  text-align: center;
}

.section-head h2 {
  margin-top: 0;
}

.section-head .lede {
  margin-bottom: 0;
}

.features {
  padding-top: var(--space-section);
}

.feature-grid {
  display: grid;
  gap: var(--space-xl);
  max-width: 30rem;
  margin: 0 auto;
}

.feature {
  margin: 0;
  padding: var(--space-md);
}

.feature-shot {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  background: var(--surface);
  border: 1.5px solid var(--border-hairline);
  border-radius: var(--radius-btn);
}

.feature h3 {
  margin: var(--space-lg) var(--space-sm) var(--space-xs);
}

.feature p {
  margin: 0 var(--space-sm) var(--space-sm);
  font-size: 16px;
  line-height: 24px;
  color: var(--text-secondary);
}

.feature-tools {
  display: grid;
  place-items: center;
  background:
    url("/assets/leaves-tl.webp") left top / 32% auto no-repeat,
    url("/assets/leaves-br.webp") right bottom / 34% auto no-repeat,
    var(--page);
}

.feature-tools .tools {
  margin: 0;
}

.feature-tools .tool {
  width: 68px;
  height: 68px;
}

.feature-tools .tool svg {
  width: 28px;
  height: 28px;
}

.languages {
  display: grid;
  gap: var(--space-xxxl);
  align-items: center;
  padding-top: var(--space-section);
  text-align: center;
}

.languages-copy h2 {
  margin-top: 0;
}

.languages .lede {
  max-width: 34rem;
  margin-inline: auto;
}

.pair-grid {
  display: grid;
  gap: var(--space-lg);
}

.pair {
  margin: 0;
  text-align: center;
}

.pair-script {
  margin: 0;
  font-size: 64px;
  line-height: 1.25;
  color: var(--text-strong);
}

.pair h3 {
  margin-top: var(--space-sm);
}

.pair p:last-child {
  color: var(--text-secondary);
}

.offline {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin: 0;
  padding: var(--space-lg) var(--space-xl);
  background: var(--surface-frost);
  border: 1.5px solid var(--border-hairline);
  border-radius: var(--radius-card);
  text-align: left;
  color: var(--text-secondary);
}

.offline svg {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  color: var(--text-strong);
}

.next-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin: var(--space-md) 0 0;
  padding: 0;
  list-style: none;
}

.next {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: var(--space-lg) var(--space-xs);
  background: var(--surface-frost);
  border: 2px dashed var(--border-dashed);
  border-radius: var(--radius-card);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.next-script {
  margin-bottom: var(--space-xs);
  font-size: clamp(18px, 4.8vw, 30px);
  line-height: 1.3;
  font-weight: 500;
  color: var(--text-strong);
  white-space: nowrap;
}

.next-status {
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  color: var(--text-secondary);
}

.cta {
  display: grid;
  justify-items: center;
  gap: var(--space-xl);
  max-width: 60rem;
  margin: var(--space-section) auto 0;
  padding: clamp(28px, 5vw, 48px);
  text-align: center;
}

.cta-tiger {
  width: 112px;
  height: auto;
  filter: var(--shadow-art);
}

.cta h2 {
  margin: 0 0 var(--space-sm);
}

.cta p {
  margin: 0;
  color: var(--text-secondary);
}

@media (min-width: 640px) {
  .hero-visual {
    width: min(560px, 100%);
    aspect-ratio: 560 / 740;
  }

  .hero-visual .phone {
    position: absolute;
    width: 56%;
  }

  .phone-front {
    z-index: 2;
    top: 0;
    right: 4%;
  }

  .phone-back {
    display: block;
    z-index: 1;
    top: 7%;
    left: 4%;
    rotate: -7deg;
  }

  .hero-tiger {
    left: -2%;
    bottom: 1%;
    width: 22%;
  }

  .pair-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: none;
  }

  .cta {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    justify-items: start;
    gap: var(--space-xxxl);
    text-align: left;
  }
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    align-items: center;
    justify-items: stretch;
    gap: var(--space-huge);
    text-align: left;
  }

  .hero .lede {
    margin: 0;
  }

  .hero .actions,
  .hero .perks {
    justify-content: flex-start;
  }

  .hero-visual {
    justify-self: end;
  }

  .languages {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: var(--space-giant);
    text-align: left;
  }

  .languages .lede {
    margin-inline: 0;
  }
}

/* Text pages: a white sheet over the jungle, like the app's main card. */

.page {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--space-xl));
  margin: 0 auto;
  padding: var(--space-huge) clamp(var(--space-md), 3vw, var(--space-xl)) 0;
}

.sheet {
  background: var(--surface);
  border: var(--outline);
  border-radius: var(--radius-sheet);
  box-shadow: var(--sticker-lg), var(--shadow-card);
  padding: clamp(20px, 6vw, 48px);
}

.sheet > :last-child {
  margin-bottom: 0;
}

.sheet .card {
  background: var(--surface-banner);
  box-shadow: var(--sticker);
  padding: var(--space-xl);
}

.faq h3:first-of-type {
  margin-top: 0;
}

.faq p {
  color: var(--text-secondary);
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .site-nav a {
    transition: background-color var(--duration-hover) var(--ease-out);
  }

  .button:active,
  .site-nav a:active,
  .store-badge:active {
    translate: none;
    scale: none;
  }

  @media (hover: hover) and (pointer: fine) {
    .button:hover,
    .site-nav a:hover {
      translate: none;
    }
  }
}
