/* ก ไก่ มีชีวิต — site styles. Colours are lifted from the app (Palette.swift, Chapter.swift meadow). */
@font-face {
  font-family: "Mali";
  src: url("fonts/mali-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --cream: #FFF4E0;
  --ink: #3B2A20;
  --ink-soft: #5E4A3D;
  --gold: #F5B942;
  --heart: #FF6B81;
  --sky-top: #FFD3A3;
  --sky-bottom: #FFF1B8;
  --ground-top: #A8D672;
  --ground-bottom: #6DBE5A;
  --night-top: #1E2250;
  --night-bottom: #3A3F7A;
  --glow: #FFCF73;
  --coral: #C2553A;
  --card: #FFFFFF;
  --radius: 28px;
  --outline: 3px solid var(--ink);
  --shadow: 0 6px 0 rgba(59, 42, 32, 0.18);
  --thai: -apple-system, BlinkMacSystemFont, "Sukhumvit Set", "Thonburi", "Noto Sans Thai", "Leelawadee UI", sans-serif;
  --display: "Mali", var(--thai);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--thai);
  font-size: 18px;
  line-height: 1.75;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--coral); }
:focus-visible { outline: 4px solid var(--coral); outline-offset: 3px; border-radius: 12px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.35; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 4.4vw, 2.5rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.mark { background: linear-gradient(transparent 58%, rgba(245, 185, 66, 0.55) 58%); padding: 0 0.12em; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 14px; border: var(--outline);
  border-radius: 999px; z-index: 10; }
.skip:focus { left: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Nav ─────────────────────────────────────────────────────────────── */
.nav { position: sticky; top: 0; z-index: 5; background: rgba(255, 244, 224, 0.92); backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(59, 42, 32, 0.08); }
.nav .wrap { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 1.25rem; }
.brand img { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--ink); }
.nav nav { margin-left: auto; }
.nav ul { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav li a { display: inline-block; padding: 8px 12px; border-radius: 999px; text-decoration: none; font-size: 0.98rem; }
.nav li a:hover { background: rgba(245, 185, 66, 0.35); color: var(--ink); }
@media (max-width: 720px) {
  .nav ul .wide { display: none; }
  .brand span { display: none; }
  .nav ul { flex-wrap: nowrap; gap: 2px; }
  .nav li a { padding: 8px 9px; font-size: 0.92rem; white-space: nowrap; }
}

/* ── Buttons, pills, cards ───────────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border-radius: 999px;
  background: var(--gold); color: var(--ink); border: var(--outline); box-shadow: var(--shadow);
  font-family: var(--display); font-size: 1.15rem; text-decoration: none; min-height: 52px; }
.pill.soon { background: var(--card); cursor: default; }
.pill small { font-family: var(--thai); font-size: 0.85rem; font-weight: 400; white-space: nowrap; }
.pill > span, .pill { white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 18px 0 0; }
.chips li { background: rgba(255, 255, 255, 0.75); border: 2px solid rgba(59, 42, 32, 0.2); border-radius: 999px;
  padding: 4px 14px; font-size: 0.98rem; }
.card { background: var(--card); border: var(--outline); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px; position: relative; }
.card img.icon { width: 120px; height: 120px; margin: -8px 0 6px; }

/* ── Hero: the meadow ────────────────────────────────────────────────── */
.hero { background: linear-gradient(var(--sky-top), var(--sky-bottom) 70%); position: relative; overflow: hidden;
  padding: 48px 0 0; }
.hero .copy { position: relative; z-index: 2; max-width: 680px; }
.hero p.lead { font-size: 1.2rem; color: var(--ink-soft); }
.sun { position: absolute; width: 220px; height: 220px; border-radius: 50%; right: 6%; top: 40px;
  background: radial-gradient(circle, #FFE07A 0 55%, rgba(255, 224, 122, 0.35) 56% 70%, transparent 71%);
  animation: glow 5s ease-in-out infinite; }
.cloud { position: absolute; width: 170px; height: 60px; top: 70px; left: -200px; opacity: 0.95;
  animation: drift 80s linear infinite; }
.cloud::before, .cloud::after, .cloud span { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 80px; height: 50px; left: 0; top: 18px; }
.cloud span { width: 80px; height: 64px; left: 42px; top: 0; }
.cloud::after { width: 84px; height: 48px; left: 88px; top: 16px; }
.cloud.c2 { top: 150px; animation-duration: 110s; animation-delay: -50s; transform: scale(0.8); }
.cloud.c3 { top: 30px; animation-duration: 95s; animation-delay: -20s; transform: scale(0.65); }

.meadow { position: relative; margin-top: 18px; height: 340px; }
.hill { position: absolute; left: -10%; right: -10%; bottom: 0; height: 230px; border-radius: 50% 50% 0 0 / 70% 70% 0 0;
  background: linear-gradient(var(--ground-top), var(--ground-bottom)); }
.hill.back { height: 270px; left: 30%; right: -30%; opacity: 0.75; }
.house { position: absolute; bottom: 160px; width: 86px; }
.house.h1 { left: 5%; } .house.h2 { right: 7%; bottom: 178px; }
.nowrap { white-space: nowrap; }
[id] { scroll-margin-top: 84px; }
@media (max-width: 420px) { .nowrap { white-space: normal; } }
.letters { position: absolute; inset: auto 0 34px 0; display: flex; justify-content: center; gap: clamp(4px, 2vw, 26px);
  padding: 0 12px; }
.letter { position: relative; background: none; border: 0; padding: 0; cursor: pointer; width: clamp(64px, 15vw, 150px);
  height: clamp(84px, 19vw, 180px); font: inherit; color: inherit; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; }
.letter .body { position: absolute; inset: 0; display: grid; place-items: end center; transform-origin: 50% 100%;
  animation: breathe 2.2s ease-in-out infinite; }
.letter.asleep .body { animation: breathe 3.4s ease-in-out infinite; transform: rotate(-4deg); }
.letter .glyph, .letter .glyph-outline { grid-area: 1 / 1; font-family: var(--display); font-size: clamp(76px, 18vw, 170px);
  line-height: 1; padding-bottom: 0.12em; }
.letter .glyph-outline { color: var(--ink); -webkit-text-stroke: 0.09em var(--ink); }
.letter .glyph { background: linear-gradient(var(--light), var(--base) 55%, var(--dark)); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
.letter .shadow { position: absolute; left: 12%; right: 12%; bottom: 2px; height: 12px; border-radius: 50%;
  background: rgba(59, 42, 32, 0.18); }
.letter { container-type: inline-size; }
/* Eyes sized from the letter's own width (as in the app), so they read at every screen size. */
.face { position: absolute; left: var(--fx, 50%); top: var(--fy, 56%); transform: translate(-50%, -50%);
  display: flex; gap: 0.1em; font-size: 19cqi; pointer-events: none; }
.eye { width: 0.9em; height: 0.9em; border-radius: 50%; background: #fff; border: 0.1em solid var(--ink); position: relative;
  transition: height 0.2s, border-radius 0.2s; }
.eye::after { content: ""; position: absolute; width: 0.42em; height: 0.42em; border-radius: 50%; background: var(--ink);
  left: 0.16em; top: 0.16em; }
/* Closed eyes: two soft smiling curves, like the app's sleeping face. */
.letter.blink .eye, .letter.asleep .eye { width: 0.8em; height: 0.42em; border-radius: 0 0 100% 100% / 0 0 100% 100%;
  border-width: 0 0 0.17em; background: transparent; margin: 0.25em 0.06em 0; }
.letter.blink .eye::after, .letter.asleep .eye::after { display: none; }
.zzz { position: absolute; right: 2%; top: 4%; font-family: var(--display); color: var(--ink-soft); font-size: clamp(14px, 2.4vw, 22px);
  opacity: 0; pointer-events: none; }
.letter.asleep .zzz { animation: zzz 2.6s ease-in infinite; }
.prop { position: absolute; width: 58%; right: -32%; bottom: 0; opacity: 0; transform: translateY(10px) scale(0.4);
  transition: opacity 0.35s, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); pointer-events: none; }
.letter.awake .prop { opacity: 1; transform: none; }
.letter .label { position: absolute; left: 50%; bottom: -30px; transform: translateX(-50%); white-space: nowrap;
  font-family: var(--display); font-size: clamp(0.85rem, 2.2vw, 1.05rem); background: rgba(255, 255, 255, 0.85);
  border-radius: 999px; padding: 0 10px; opacity: 0; transition: opacity 0.3s; }
.letter.awake .label { opacity: 1; }
.hint-hand { position: absolute; width: 64px; left: 0; top: 0; pointer-events: none; z-index: 3; opacity: 0;
  transition: opacity 0.4s; }
.hint-hand.show { opacity: 1; animation: press 1.1s ease-in-out infinite; }
.sparkle { position: absolute; width: 10px; height: 10px; border-radius: 50%; pointer-events: none; z-index: 4; }

/* ── Ticker ──────────────────────────────────────────────────────────── */
.ticker { background: var(--ink); color: var(--cream); overflow: hidden; padding: 12px 0; border-block: 4px solid var(--gold); }
.ticker .track { display: flex; gap: 28px; width: max-content; animation: march 70s linear infinite;
  font-family: var(--display); font-size: 2rem; line-height: 1.2; }
.ticker:hover .track, .ticker:focus-within .track { animation-play-state: paused; }
.ticker span:nth-child(3n+1) { color: #FFD166; } .ticker span:nth-child(3n+2) { color: #FF9AA8; }
.ticker span:nth-child(3n) { color: #9EE6B0; }

/* ── Sections ────────────────────────────────────────────────────────── */
section { padding: 72px 0; }
.section-head { max-width: 720px; margin-bottom: 30px; }
.section-head p { color: var(--ink-soft); font-size: 1.1rem; }
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step-no { position: absolute; top: -18px; left: 22px; width: 40px; height: 40px; border-radius: 50%; background: var(--gold);
  border: var(--outline); display: grid; place-items: center; font-family: var(--display); }
.blend { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--display); font-size: 2.6rem;
  margin: 6px 0 12px; flex-wrap: wrap; }
.blend .plus { color: var(--ink-soft); font-size: 1.8rem; }
.blend .result { color: var(--coral); }
.learn { background: linear-gradient(#FFF4E0, #FFE7C2); }
.learn .two { display: grid; gap: 30px; grid-template-columns: 1fr 1fr; align-items: center; }
@media (max-width: 820px) { .learn .two { grid-template-columns: 1fr; } }
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { padding-left: 38px; position: relative; margin-bottom: 12px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.35em; width: 24px; height: 24px; border-radius: 50%;
  background: var(--ground-top) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%233B2A20' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat;
  border: 2px solid var(--ink); }
.honest { background: var(--card); border: 2px dashed rgba(59, 42, 32, 0.35); border-radius: 20px; padding: 18px 20px;
  font-size: 1rem; color: var(--ink-soft); }

.night { background: linear-gradient(var(--night-top), var(--night-bottom)); color: #FFF4E0; position: relative; overflow: hidden; }
.night h2 { color: #FFF4E0; }
.night .section-head p { color: #E6DCF5; }
.night .moon { position: absolute; right: 6%; top: 40px; width: 120px; filter: drop-shadow(0 0 30px rgba(255, 207, 115, 0.5)); }
.stars { position: absolute; inset: 0; pointer-events: none; background-image:
  radial-gradient(2px 2px at 12% 20%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 30% 60%, #fff 50%, transparent 51%),
  radial-gradient(1.5px 1.5px at 55% 25%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 72% 70%, #fff 50%, transparent 51%),
  radial-gradient(1.5px 1.5px at 85% 35%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 45% 85%, #fff 50%, transparent 51%);
  opacity: 0.7; animation: twinkle 4s ease-in-out infinite; }
.night .card { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 244, 224, 0.5); box-shadow: none; color: #FFF4E0; }
.night .card h3 { color: var(--glow); }
.night .card img.icon { filter: drop-shadow(0 0 1px #fff); }

.price { background: linear-gradient(var(--sky-bottom), #E9F6D8); }
.plans { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.plans .card h3 { font-size: 1.6rem; }
.plans .tag { display: inline-block; font-size: 0.9rem; background: rgba(168, 214, 114, 0.5); border-radius: 999px; padding: 2px 12px;
  margin-bottom: 8px; }
.plans .gold { background: #FFF8E6; }

.faq details { background: var(--card); border: var(--outline); border-radius: 22px; padding: 4px 22px; margin-bottom: 14px; }
.faq summary { cursor: pointer; font-family: var(--display); font-size: 1.15rem; padding: 14px 0; list-style: none;
  display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.6rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }

.english { background: #F3EAD7; }
.english p, .english li { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

footer { background: var(--ink); color: #F3E6D2; padding: 46px 0 34px; font-size: 0.98rem; }
footer a { color: #FFE2A8; }
footer .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: center; }
footer ul { display: flex; flex-wrap: wrap; gap: 18px; list-style: none; padding: 0; margin: 0; }
footer .note { opacity: 0.85; margin-top: 16px; }

/* ── Legal / support pages ───────────────────────────────────────────── */
.doc-hero { background: linear-gradient(var(--sky-top), var(--cream)); padding: 40px 0 10px; }
.doc-hero .wrap { display: flex; align-items: center; gap: 24px; }
.doc-hero img { width: 120px; flex: none; }
.doc { max-width: 760px; margin-inline: auto; padding: 24px 16px 60px; }
.doc h2 { font-size: 1.6rem; margin-top: 1.6em; }
.doc h3 { margin-top: 1.4em; }
.doc .summary { background: var(--card); border: var(--outline); border-radius: 22px; padding: 18px 22px; box-shadow: var(--shadow); }
.doc .updated { color: var(--ink-soft); font-size: 0.95rem; }
.doc hr { border: 0; border-top: 3px dashed rgba(59, 42, 32, 0.25); margin: 56px 0; }
.lang-switch { font-size: 0.95rem; }
.contact { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.contact img { width: 90px; }

/* ── Motion ──────────────────────────────────────────────────────────── */
@keyframes breathe { 0%, 100% { scale: 1 1; } 50% { scale: 1.015 1.04; } }
@keyframes glow { 0%, 100% { opacity: 0.9; } 50% { opacity: 1; scale: 1.04; } }
@keyframes drift { from { translate: 0 0; } to { translate: calc(100vw + 400px) 0; } }
@keyframes zzz { 0% { opacity: 0; translate: 0 6px; } 30% { opacity: 1; } 100% { opacity: 0; translate: 10px -26px; } }
@keyframes march { from { translate: 0 0; } to { translate: -50% 0; } }
@keyframes press { 0%, 100% { translate: 0 0; scale: 1; } 50% { translate: 0 -8px; scale: 0.92; } }
@keyframes twinkle { 0%, 100% { opacity: 0.55; } 50% { opacity: 0.9; } }
.reveal { transition: opacity 0.6s, transform 0.6s; }
.js .reveal.pending { opacity: 0; transform: translateY(18px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .js .reveal.pending { opacity: 1; transform: none; }
}
.static *, .static *::before, .static *::after { animation: none !important; transition: none !important; }
.static .reveal.pending { opacity: 1; transform: none; }

@media (max-width: 560px) {
  body { font-size: 17px; }
  section { padding: 56px 0; }
  .meadow { height: 260px; }
  .hill { height: 170px; }
  .hill.back { height: 200px; }
  .house { width: 60px; bottom: 128px; }
  .house.h2 { bottom: 136px; }
  .doc-hero .wrap { gap: 14px; }
  .doc-hero img { width: 72px; }
  .doc-hero h1 { font-size: 1.9rem; }
  .pill { flex-direction: column; align-items: flex-start; gap: 0; border-radius: 26px; padding: 12px 22px; }
  .sun { width: 140px; height: 140px; top: 20px; }
  .letters { bottom: 30px; }
  .prop { width: 52%; right: -22%; }
}

/* ── Screenshots (real captures from the app, 2026-10-23) ─────────────── */
.shots-band { background: linear-gradient(#FFF4E0, #FFF9EE); }
.shots { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.shots figure { margin: 0; min-width: 0; }
.shots img { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 1; background: var(--card);
  border: var(--outline); border-radius: var(--radius); box-shadow: var(--shadow); }
.shots figcaption { margin-top: 12px; color: var(--ink-soft); font-size: 0.98rem; }

/* Parent how-to videos (support page): self-hosted MP4, controls, no autoplay, subtitles in Thai and English. */
.faq .howto { display: block; width: 100%; height: auto; aspect-ratio: 1280 / 1000; margin: 4px 0 18px;
  border: var(--outline); border-radius: 18px; background: var(--cream); }
