/* iamfit.app — iamFit's own look, taken from the app: ios/IamFit/App/FitDesign.swift and FitTheme.swift (canvas
   #F2F4F9, white cards, ink #0E1726, secondary #4B5565, blue #1E4FD8, green ticks #15803D only for "done/included",
   D28/D29/D33) and its fonts (Anuphan for words, Saira Condensed for the wordmark; OFL, self-hosted, D23).
   Light only, like the app (brand brief B1; D74: Khun Poom wants the site white on every device, dark mode too).
   Every text colour passes WCAG AA 4.5:1 on its background (checked with a script, see notes). */
@font-face { font-family: "Anuphan"; src: url("/fonts/Anuphan-Variable.ttf") format("truetype"); font-weight: 100 700; font-display: swap; }
@font-face { font-family: "Saira Condensed"; src: url("/fonts/SairaCondensed-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }

:root {
  --bg: #F2F4F9; --surface: #FFFFFF; --ink: #0E1726; --muted: #4B5565; --line: #E2E6EE; --field: #EEF1F6;
  --accent: #1E4FD8; --accent-text: #1E4FD8; --accent-soft: #E8EEFC; --check: #15803D;
  --hero-a: #2557D9; --hero-b: #1A3FA8; --on-hero-soft: #E6ECFF;
  --draft-bg: #FFF4E5; --draft-ink: #7A4300;
  --shadow: 0 1px 2px rgba(14, 23, 38, .05), 0 10px 28px -20px rgba(14, 23, 38, .35);
  --gutter: 16px;
  color-scheme: light;
}
@media (min-width: 720px) { :root { --gutter: 24px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.7 "Anuphan", system-ui, -apple-system, "Segoe UI", sans-serif; overflow-wrap: break-word; }
a { color: var(--accent-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: 10px; }
.skip:focus { left: var(--gutter); }

/* Top bar */
.bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 16px; max-width: 880px; margin: 0 auto; padding: 10px var(--gutter); }
.mark { font: 800 28px/1 "Saira Condensed", "Anuphan", sans-serif; color: var(--ink); text-decoration: none; letter-spacing: .01em; display: inline-flex; align-items: center; min-height: 44px; }
.mark b { color: var(--accent-text); font-weight: 800; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; }
.bar nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; min-height: 44px; }
.bar nav a[aria-current="page"] { color: var(--ink); }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; padding: 3px; background: var(--surface); }
.bar nav .lang-switch a { min-height: 32px; padding: 0 12px; border-radius: 99px; font-size: 14px; }
.bar nav .lang-switch a[aria-current="true"] { background: var(--accent-soft); color: var(--accent-text); }

main { max-width: 880px; margin: 0 auto; padding: 4px var(--gutter) 56px; }
.draft { margin: 8px 0 16px; padding: 10px 14px; border-radius: 12px; background: var(--draft-bg); color: var(--draft-ink); font-size: 14px; font-weight: 600; }

h1 { font-size: clamp(28px, 6vw, 36px); line-height: 1.3; margin: 16px 0 8px; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: 22px; line-height: 1.4; margin: 40px 0 8px; text-wrap: balance; }
h3 { font-size: 18px; line-height: 1.45; margin: 28px 0 4px; }
p { margin: 10px 0; }
ul, ol { padding-left: 1.4em; margin: 10px 0; }
li + li { margin-top: 6px; }
strong { font-weight: 600; }
code { font-size: .92em; background: var(--field); border-radius: 6px; padding: 1px 6px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }

/* Long pages: privacy, support, delete account, terms */
.doc { max-width: 700px; margin: 0 auto; }
.doc h1 + p { color: var(--muted); }
.doc h2 { padding-top: 4px; }
.doc ol li::marker { color: var(--accent-text); font-weight: 600; }
.table { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.6; }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); min-width: 7.5em; }
th { background: var(--field); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td + td, th + th { border-left: 1px solid var(--line); }
.yes { color: var(--check); font-weight: 700; }
.no { color: var(--muted); }
.note { background: var(--accent-soft); border-radius: 14px; padding: 4px 16px; margin: 16px 0; }
/* Phones: a table reads as a stack of cards, each cell under its column's name (data-label from build.py). */
@media (max-width: 560px) {
  .table { border: 0; border-radius: 0; background: none; overflow: visible; }
  .table table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .table tr { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; }
  .table tr + tr { margin-top: 10px; }
  .table td, .table tr:last-child td { border: 0; padding: 0; min-width: 0; }
  .table td + td { border-left: 0; margin-top: 8px; }
  .table td + td[data-label]::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
  .table td.mark { display: inline-flex; align-items: baseline; gap: 8px; width: auto; margin-right: 24px; }
  .table td.mark[data-label]::before { display: inline; }
}

/* Home */
.hero { margin: 8px 0 0; padding: 36px 20px 32px; border-radius: 28px; text-align: center; color: #FFFFFF;
  background: radial-gradient(120% 95% at 50% 25%, var(--hero-a), var(--hero-b)); }
.app-icon { display: block; margin: 0 auto; width: 96px; height: 96px; border-radius: 22px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .3), 0 14px 34px -14px rgba(5, 12, 40, .6); }
.big { font: 800 clamp(56px, 17vw, 84px)/1 "Saira Condensed", "Anuphan", sans-serif; margin: 18px 0 6px; letter-spacing: .005em; }
.big span { color: var(--on-hero-soft); }
.hero h1 { color: #FFFFFF; font-size: clamp(26px, 6.6vw, 38px); margin: 4px auto 8px; max-width: 18em; }
.lead { color: var(--on-hero-soft); font-size: 18px; max-width: 30em; margin: 0 auto 22px; }
.store-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 14px;
  background: #FFFFFF; color: #1A3FA8; font-weight: 700; text-decoration: none; }
.store-btn.soon { background: rgba(255, 255, 255, .12); color: #FFFFFF; border: 1.5px solid rgba(255, 255, 255, .5); }
.trial { color: var(--on-hero-soft); font-size: 15px; margin: 14px auto 0; max-width: 30em; }

/* The App Store screenshots (D74), sideways like iamDiary's; the page itself never scrolls sideways. */
.shots { display: flex; gap: 14px; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 24px var(--gutter) 8px;
  scroll-snap-type: x mandatory; scroll-padding: var(--gutter); }
.shots img { width: 220px; height: auto; flex: 0 0 auto; border-radius: 22px; scroll-snap-align: start; box-shadow: var(--shadow); }
@media (min-width: 720px) { .shots img { width: 250px; } }

.block { margin-top: 40px; }
.block > h2, .block h2 { margin-top: 0; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
@media (max-width: 600px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { margin: 0 0 4px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); }

.coach { display: grid; gap: 8px 32px; align-items: start; }
@media (min-width: 720px) { .coach { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.coach p { margin: 4px 0 0; }
.steps { list-style: none; padding: 0; margin: 4px 0 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 4px 0 4px 46px; min-height: 34px; }
.steps li + li { margin-top: 10px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 2px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-text); font: 800 18px/32px "Saira Condensed", "Anuphan", sans-serif; text-align: center; }

.plan h3 { font-size: 20px; }
.plan .plan-line { color: var(--ink); font-weight: 500; margin: 2px 0 10px; }
.plan.plus { border: 2px solid var(--accent); padding: 17px 19px; }
.ticks { list-style: none; padding: 0; margin: 8px 0 0; }
.ticks li { position: relative; padding-left: 28px; }
.ticks li::before { content: "✓"; position: absolute; left: 4px; top: 0; color: var(--check); font-weight: 700; }
.card .ticks li { color: var(--muted); }

.band { background: var(--accent-soft); border-radius: 24px; padding: 22px 22px 14px; }
.band .links { font-weight: 600; margin-top: 14px; }

.lost { text-align: center; padding: 56px 0 24px; }
.lost h1 { font: 800 72px/1 "Saira Condensed", "Anuphan", sans-serif; color: var(--accent-text); }

footer { max-width: 880px; margin: 0 auto; padding: 18px var(--gutter) 40px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
footer nav a { color: var(--muted); display: inline-flex; align-items: center; min-height: 40px; }
footer p { margin: 6px 0 0; }
footer p a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
