@font-face { font-family: Kanit; src: url(fonts/kanit-700-italic.woff2) format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  /* docs/design.md: ink navy, crimson for fills, soft gold for small accents and accent text, jade for calm. */
  --bg: #0B0E1A; --surface: #121627; --card: #1A1F35; --line: #252A44;
  --text: #F2ECDF; --soft: #C9C5BA; --muted: #9C9EAE; --accent: #B4232C; --accent-dark: #7A161D;
  --gold: #D4AF61; --red: #E5666E; --good: #5DBFA6; --app-bg: #0B0E1A;
  /* mobile/src/theme.ts: restDark, calm and CTA. --raised-dark is the phone frame. */
  --rest-dark: #36638F; --calm: #1D5A4F; --raised-dark: #161a2c; --cta: linear-gradient(135deg, #C42A34, #8F1A22);
  --display: Kanit, "Arial Black", Impact, sans-serif;
  --radius: 16px; --max: 1120px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--gold); }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.muted { color: var(--muted); }
.card { background: var(--card); border-radius: 12px; padding: 16px 20px; margin: 20px 0; }

/* Privacy policy and other plain pages */
body:not(.landing) main { max-width: 720px; margin: 0 auto; padding: 48px 16px 64px; }
body:not(.landing) h1 { font: italic 700 40px/1.1 var(--display); text-transform: uppercase; margin: 24px 0 8px; padding-right: .1em; }
body:not(.landing) h2 { font-size: 22px; margin: 36px 0 8px; }
body:not(.landing) ul { padding-left: 22px; }

/* Landing page */
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 20; background: var(--card); padding: 8px 12px; }
/* Kanit italic leans past its box: the right padding keeps the last letter whole. */
.display { font-family: var(--display); font-weight: 700; font-style: italic; text-transform: uppercase; letter-spacing: -.01em; line-height: 1.02; margin: 0; padding-right: .1em; }
.gold { color: var(--gold); }
.eyebrow { color: var(--gold); font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 12px; }

.btn { display: inline-flex; align-items: center; gap: 10px; background: var(--cta); color: var(--text); font-weight: 700; text-decoration: none; padding: 14px 22px; border-radius: 999px; border: 0; font-size: 16px; cursor: pointer; transition: transform .15s, background .15s; }
.btn:hover { background: var(--accent); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { background: var(--surface); }
.btn-small { padding: 9px 16px; font-size: 14px; min-height: 44px; }
.play { width: 18px; height: 18px; }

.nav { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; padding: 12px max(16px, calc((100% - var(--max)) / 2)); background: rgba(11, 14, 26, .82); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 18px; margin-right: auto; }
.brand img { border-radius: 9px; }
.nav nav { display: none; gap: 24px; }
.nav nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav nav a:hover { color: var(--text); }

.hero { position: relative; isolation: isolate; overflow: hidden; display: grid; gap: 48px; align-items: center; max-width: var(--max); margin: 0 auto; padding: 56px 16px 72px; }
.hero h1 { font-size: clamp(44px, 7.4vw, 80px); line-height: .98; }
.thai { font: italic 700 15px var(--display); letter-spacing: 0; margin-left: 8px; }
.lead { font-size: 19px; color: var(--soft); max-width: 34ch; margin: 22px 0 28px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.ticks { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; padding: 0; margin: 24px 0 0; color: var(--muted); font-size: 15px; }
.ticks li::before { content: "✓"; color: var(--good); font-weight: 800; margin-right: 8px; }

.hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1.5px); background-size: 26px 26px; -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 45%, #000 15%, transparent 75%); mask-image: radial-gradient(ellipse 70% 60% at 70% 45%, #000 15%, transparent 75%); }
.hero-visual { position: relative; justify-self: center; }
/* The rising sun from the app's welcome screen, behind the phone. */
.hero-visual::before { content: ""; position: absolute; z-index: -1; left: 50%; top: 44%; width: min(460px, 94vw); aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); background: linear-gradient(var(--accent), var(--accent-dark)); box-shadow: 0 0 120px rgba(180, 35, 44, .35); }

.chip { position: absolute; z-index: 2; background: rgba(26, 31, 53, .94); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 40px rgba(0, 0, 0, .5); animation: float 6s ease-in-out infinite; }
.chip p { margin: 0; }
.chip-score { left: -96px; top: 17%; width: 196px; padding: 12px 16px 14px; }
.chip-title { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.chip-big { color: var(--muted); font-weight: 700; font-size: 15px; margin: 2px 0 4px !important; }
.chip-big b { font: italic 700 40px/1 var(--display); color: var(--text); margin-right: 4px; }
.chip-line { font-size: 13px; font-weight: 600; line-height: 1.4; }
.chip-bell { right: -72px; bottom: 4%; display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px; font-size: 14px; animation-delay: -3s; }
.chip-bell svg { width: 32px; height: 32px; padding: 6px; border-radius: 50%; background: var(--accent); color: var(--text); flex: none; }
@keyframes float { 50% { transform: translateY(-10px); } }
@media (max-width: 560px) {
  .chip-score { left: -4px; top: 7%; width: 168px; }
  .chip-bell { right: -4px; bottom: -3%; }
}

.phone { justify-self: center; width: min(320px, 86vw); aspect-ratio: 9 / 18.5; border-radius: 46px; padding: 12px; background: var(--raised-dark); box-shadow: 0 0 0 1px var(--line), 0 30px 60px rgba(0, 0, 0, .6); position: relative; }
.phone::before { content: ""; position: absolute; top: 22px; left: 50%; width: 84px; height: 22px; margin-left: -42px; border-radius: 12px; background: #000; z-index: 1; }
.screen { height: 100%; border-radius: 36px; overflow: hidden; background: var(--app-bg); padding: 54px 14px 14px; font-size: 13px; }
.app-bar { font-weight: 600; font-size: 15px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin: 0 -14px; padding-left: 14px; }
.app-bar span { margin-right: 10px; }
.app-text { color: var(--soft); margin: 10px 0; line-height: 1.45; }
.app-card { background: var(--card); border-radius: 12px; padding: 6px; }
.app-timer { display: flex; flex-direction: column; align-items: center; margin-top: 10px; padding: 12px 8px 14px; border-radius: 12px; background: var(--card); transition: background .3s; }
.app-timer .label, .timer-demo .label { font-weight: 800; letter-spacing: .08em; font-size: 12px; }
.app-timer .time { font: italic 700 50px/1.15 var(--display); font-variant-numeric: tabular-nums; }
.app-buttons { display: flex; gap: 8px; margin-top: 4px; }
.app-buttons b { background: rgba(0, 0, 0, .3); padding: 7px 16px; border-radius: 8px; font-size: 12px; }

.skills-section { padding-top: 16px; padding-bottom: 32px; }
.skills-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 16px; }
.skills-head h2.eyebrow { font-size: 13px; margin: 0; }
.skills-head p { margin: 0; font-size: 14px; }
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.skill { display: flex; flex-direction: column; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 10px 10px 16px; color: var(--text); font: inherit; cursor: pointer; transition: transform .2s, border-color .2s; }
.skill:hover { transform: translateY(-3px); border-color: var(--gold); }
.skill svg { width: 100%; height: auto; aspect-ratio: 100 / 95; background: var(--app-bg); border-radius: 12px; }
.skill b { font: italic 700 18px/1.15 var(--display); text-transform: uppercase; margin: 12px 6px 2px; }
.skill:last-child:nth-child(odd) { grid-column: span 2; } /* an odd number of areas: the last tile takes the full row on phones */
.skill:last-child:nth-child(odd) svg { aspect-ratio: 200 / 95; }
.skill span { color: var(--muted); font-size: 14px; margin: 0 6px; }

.band { background: var(--surface); border-block: 1px solid var(--line); }

.section { max-width: var(--max); margin: 0 auto; padding: 88px 16px; }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section h2 { font-size: clamp(32px, 5vw, 52px); }
.section-lead { color: var(--soft); font-size: 18px; margin: 16px 0 0; }

.explorer { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 16px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: none; background: transparent; color: var(--muted); border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 18px; min-height: 44px; font: 700 15px system-ui, sans-serif; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--text); }
.explorer-body { display: grid; gap: 16px; margin-top: 16px; }
.drill-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; align-content: start; }
.drill-list button { width: 100%; text-align: left; background: var(--card); color: var(--text); border: 1.5px solid transparent; border-radius: 12px; padding: 12px 14px; font: 600 15px system-ui, sans-serif; cursor: pointer; }
.drill-list button small { display: block; color: var(--muted); font-weight: 500; font-size: 13px; margin-top: 2px; }
.drill-list button[aria-current="true"] { border-color: var(--gold); }
.drill-view { display: grid; gap: 16px; }
.stage { background: var(--app-bg); border-radius: 16px; padding: 12px; }
.stage svg { width: 100%; height: auto; max-height: 340px; }
.drill-info h3 { font-size: 26px; margin: 0; }
.drill-info h4 { margin: 18px 0 6px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.drill-info ol, .drill-info ul { margin: 0; padding-left: 20px; }
.drill-info li { margin-bottom: 4px; }
.meta { display: inline-block; background: rgba(212, 175, 97, .12); color: var(--gold); font-weight: 700; font-size: 14px; padding: 4px 10px; border-radius: 999px; margin: 8px 0 0; }

.split { display: grid; gap: 40px; align-items: center; }
.points { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.points li { display: flex; align-items: center; gap: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.red { background: linear-gradient(90deg, var(--accent) 33%, var(--rest-dark) 33% 66%, var(--calm) 66%); width: 30px; border-radius: 5px; }
.presets { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.presets li { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--soft); }
.timer-demo { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 20px; border-radius: 24px; background: var(--card); transition: background .3s; text-align: center; }
.timer-demo .label { font-size: 15px; }
.timer-demo .time { font-family: var(--display); font-style: italic; font-weight: 700; font-size: clamp(80px, 16vw, 120px); line-height: 1; font-variant-numeric: tabular-nums; }
.rounds { display: flex; gap: 8px; margin: 8px 0 14px; }
.rounds i { width: 28px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .2); }
.rounds i.done { background: var(--text); }
.td-buttons { display: flex; gap: 10px; }
.td-buttons button { background: rgba(0, 0, 0, .3); color: var(--text); border: 0; border-radius: 10px; padding: 12px 22px; min-height: 44px; font: 700 15px system-ui, sans-serif; cursor: pointer; }
.hint { color: var(--text); font-size: 13px; margin-top: 12px; }

.rating-grid { display: grid; gap: 32px; align-items: start; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.num { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); font: italic 700 22px var(--display); }
.steps h3 { margin: 0 0 4px; font-size: 20px; }
.steps p { margin: 0; color: var(--soft); }
.steps p + p { margin-top: 10px; font-size: 14px; color: var(--muted); }
.score-card { margin: 0; background: var(--app-bg); border: 1px solid var(--line); border-radius: 24px; padding: 24px; }
.score-card figcaption { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.score-top { position: relative; width: 120px; height: 120px; margin: 14px 0 10px; }
.ring { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 98; }
.score { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0; }
.score b { font: italic 700 46px/1 var(--display); }
.score span { color: var(--muted); font-weight: 700; font-size: 13px; margin-top: 2px; }
.score-card h4 { margin: 18px 0 4px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.score-card p { margin: 0; }
.parts { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.parts li { display: grid; grid-template-columns: 1fr 90px 18px; align-items: center; gap: 12px; font-size: 15px; }
.parts small { color: var(--red); font-weight: 700; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; margin-left: 6px; }
.parts i { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--gold) calc(var(--v) * 10%), var(--line) 0); }
.parts .fix i { background: linear-gradient(90deg, var(--red) calc(var(--v) * 10%), var(--line) 0); }
.parts b { text-align: right; }
.good { color: var(--good); } .bad { color: var(--red); }

.cards { display: grid; gap: 16px; }
.cards .card { margin: 0; padding: 24px; border: 1px solid var(--line); }
.cards .icon { width: 42px; height: 42px; padding: 9px; border-radius: 12px; background: rgba(212, 175, 97, .12); color: var(--gold); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 14px; }
.cards h3 { margin: 0 0 6px; }
.cards p { margin: 0; color: var(--soft); }
.cards .eyebrow { margin-bottom: 10px; }
.center { text-align: center; margin-top: 28px; }

.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; max-width: 780px; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 19px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold); font-size: 24px; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--soft); margin: 10px 0 0; }

.final { max-width: var(--max); margin: 0 auto 72px; padding: 64px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; background: radial-gradient(ellipse at 50% 0%, rgba(180, 35, 44, .34), transparent 60%), var(--surface); border: 1px solid var(--line); border-radius: 28px; }
.final img { border-radius: 22px; }
.final h2 { font-size: clamp(38px, 7vw, 64px); }
.final p { color: var(--soft); margin: 0; max-width: 46ch; }
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; max-width: var(--max); margin: 0 auto; padding: 32px 16px 48px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer .brand { color: var(--text); font-size: 16px; margin-right: 0; }
.disclaimer { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--muted); }
body:not(.landing) ol { padding-left: 22px; }

/* Fade in on scroll where the browser supports scroll-driven animations; everything stays visible elsewhere. */
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
@keyframes fill-ring { from { stroke-dashoffset: 326.7; } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
    .ring-fg { animation: fill-ring linear both; animation-timeline: view(); animation-range: entry 40% cover 50%; }
  }
}

@media (min-width: 720px) {
  .nav nav { display: flex; }
  .skills { grid-template-columns: repeat(4, 1fr); }
  .skill:last-child:nth-child(odd) { grid-column: auto; }
  .skill:last-child:nth-child(odd) svg { aspect-ratio: 100 / 95; }
  .skill b { font-size: clamp(15px, 1.9vw, 22px); }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .hero { grid-template-columns: 1.15fr .85fr; padding-top: 80px; }
  .explorer { padding: 24px; }
  .explorer-body { grid-template-columns: 280px 1fr; }
  .drill-view { grid-template-columns: 1.1fr 1fr; align-items: start; }
  .split { grid-template-columns: 1fr 1fr; gap: 64px; }
  .rating-grid { grid-template-columns: 1fr 1fr; gap: 48px; }
  .cards-4 { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chip { animation: none; }
}
