/* Language Trail — site styles
   Layout concept: Apple-style product page. Quiet cool-white canvas, one teal accent, large display type,
   four language tiles as the only colour. Single page with section anchors plus a #signup view. */
:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --band: #f1f4f4;
  --ink: #1a1d1f;
  --muted: #566065;
  --line: #dde3e5;
  --field-line: #7d878c;
  --accent: #0e6b5b;
  --accent-soft: #e2f0ed;
  --on-accent: #ffffff;
  --focus: #0b57d0;
  --danger: #b3261e;
  --zh: #f9e4e0; --zh-ink: #a93426;
  --ja: #e5e8f8; --ja-ink: #3140a8;
  --de: #f7ecd5; --de-ink: #835509;
  --fr: #e0ecf8; --fr-ink: #1f559a;
  --font-display: "Bricolage Grotesque", "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 20px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1112; --surface: #161a1c; --band: #121617; --ink: #f1f4f4; --muted: #9ba6ab; --line: #2a3033;
    --field-line: #6f7b80; --accent: #5cd0b6; --accent-soft: #12302a; --on-accent: #06211b; --focus: #8ab4f8; --danger: #f2b8b5;
    --zh: #3a1f1b; --zh-ink: #ff9d8f; --ja: #1f2547; --ja-ink: #a5b0ff; --de: #38290f; --de-ink: #f0c46b; --fr: #15293f; --fr-ink: #8dbdf2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1112; --surface: #161a1c; --band: #121617; --ink: #f1f4f4; --muted: #9ba6ab; --line: #2a3033;
  --field-line: #6f7b80; --accent: #5cd0b6; --accent-soft: #12302a; --on-accent: #06211b; --focus: #8ab4f8; --danger: #f2b8b5;
  --zh: #3a1f1b; --zh-ink: #ff9d8f; --ja: #1f2547; --ja-ink: #a5b0ff; --de: #38290f; --de-ink: #f0c46b; --fr: #15293f; --fr-ink: #8dbdf2;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
:lang(zh) { font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", var(--font-body); }
:lang(ja) { font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans CJK JP", var(--font-body); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 5.6vw, 4.3rem); line-height: 1.04; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1.1; letter-spacing: -0.028em; }
h3 { font-size: 1.15rem; line-height: 1.3; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
[tabindex="-1"]:focus { outline: none; }
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.eyebrow { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent); }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.5; color: var(--muted); max-width: 40rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 40; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 8px); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 26px; border-radius: 999px; font: 600 1rem var(--font-body); text-decoration: none; border: 1.5px solid transparent; cursor: pointer; transition: transform .15s ease, background-color .15s ease; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-quiet { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-quiet:hover { background: var(--accent-soft); }
.btn-small { min-height: 38px; padding: 0 18px; font-size: 0.9375rem; }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; position: relative; }
.brand { font-family: var(--font-display); font-weight: 650; font-size: 1.35rem; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
.brand b { color: var(--accent); font-weight: 650; }
.nav-links { display: none; list-style: none; margin: 0; padding: 0; gap: 28px; align-items: center; }
.nav-links a:not(.btn) { color: var(--ink); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.nav-links a:not(.btn):hover { color: var(--accent); }
.nav-links a[aria-current="page"]:not(.btn) { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.menu-btn { min-height: 38px; padding: 0 16px; border-radius: 999px; background: transparent; border: 1.5px solid var(--line); color: var(--ink); font: 600 0.9375rem var(--font-body); cursor: pointer; }
.nav-links.open { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin-top: 6px; }
.nav-links.open a:not(.btn) { display: block; padding: 10px 12px; width: 100%; font-size: 1.05rem; }
.nav-links.open li { width: 100%; }
@media (min-width: 900px) {
  .nav-links { display: flex; }
  .menu-btn { display: none; }
}

/* Hero */
.hero { padding-block: clamp(40px, 7vw, 96px) clamp(48px, 7vw, 96px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 22px; min-width: 0; align-items: flex-start; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.875rem; font-weight: 600; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: 28px; min-height: 170px; padding: 20px; border-radius: var(--radius); min-width: 0; transition: transform .2s ease; }
.tile:hover { transform: translateY(-3px); }
.tile .hello { font-family: var(--font-display); font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; overflow-wrap: anywhere; }
.tile:lang(zh) .hello, .tile:lang(ja) .hello { font-weight: 700; }
.tile .tag { font-size: 0.875rem; font-weight: 600; }
.t-zh { background: var(--zh); color: var(--zh-ink); }
.t-ja { background: var(--ja); color: var(--ja-ink); }
.t-de { background: var(--de); color: var(--de-ink); }
.t-fr { background: var(--fr); color: var(--fr-ink); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

/* Sections */
.section { padding-block: clamp(56px, 8vw, 112px); scroll-margin-top: 72px; }
.section.alt { background: var(--band); }
.section-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: clamp(32px, 5vw, 56px); align-items: flex-start; }

/* Languages */
.lang-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.lang-card { display: flex; flex-direction: column; gap: 16px; padding: 28px 24px; border-radius: var(--radius); min-width: 0; }
.lang-card .native { font-family: var(--font-display); font-size: 2.6rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }
.lang-card h3 { font-size: 1.05rem; font-weight: 600; opacity: 0.9; }
.lang-card p { color: var(--ink); font-size: 1rem; line-height: 1.55; }
.lang-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 0.95rem; color: var(--ink); }
.lang-card li::before { content: "\2713\00a0\00a0"; font-weight: 700; }
.status { margin-top: auto; align-self: flex-start; padding: 5px 12px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; background: var(--surface); color: var(--ink); }
.skills-row { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px 28px; color: var(--muted); font-weight: 500; }
.skills-row strong { color: var(--ink); }

/* Immersion */
.imm-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.imm-points { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }
.imm-points li { padding: 22px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.imm-points li:last-child { border-bottom: 1px solid var(--line); }
.imm-points p { color: var(--muted); }
.callout { margin-top: 28px; padding: 22px 24px; border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); max-width: 36rem; }
.callout strong { color: var(--accent); }
@media (max-width: 860px) { .imm-grid { grid-template-columns: 1fr; } }

/* Research */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 28px 26px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.stat .num { font-family: var(--font-display); font-size: clamp(2.6rem, 5vw, 3.8rem); font-weight: 600; letter-spacing: -0.04em; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat .num small { font-size: 0.45em; letter-spacing: -0.01em; font-weight: 600; margin-left: 4px; color: var(--muted); }
.stat h3 { font-size: 1.1rem; }
.stat p { color: var(--muted); font-size: 0.975rem; }
.stat .src { font-size: 0.8125rem; color: var(--muted); margin-top: auto; padding-top: 6px; }
.terms { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.term { background: var(--surface); border-radius: var(--radius); padding: 22px 24px; min-width: 0; }
.term dt { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; margin-bottom: 4px; }
.term dd { margin: 0; color: var(--muted); font-size: 0.95rem; }
.terms-label { margin-top: 40px; font-weight: 600; }
.balance { margin-top: 32px; max-width: 46rem; padding-left: 20px; border-left: 3px solid var(--accent); }
.balance h3 { margin-bottom: 6px; }
.balance p { color: var(--muted); }
.sources { margin-top: 40px; font-size: 0.875rem; color: var(--muted); max-width: 52rem; }
.sources h3 { font-size: 0.9375rem; color: var(--ink); margin-bottom: 8px; }
.sources ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* Skill Trail */
.st-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; min-width: 0; }
.feature { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.feature p { color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.soon { display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: 600 0.75rem var(--font-body); vertical-align: middle; letter-spacing: 0.02em; }
.report { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 18px 50px -28px rgba(0,0,0,.35); min-width: 0; }
.report-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.report-top h3 { font-size: 1.05rem; }
.report-top .sample { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; }
.report-sub { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.kpi { background: var(--band); border-radius: 14px; padding: 12px 14px; }
.kpi dt { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.kpi dd { margin: 2px 0 0; font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi dd small { font-size: 0.55em; color: var(--muted); font-family: var(--font-body); font-weight: 500; margin-left: 3px; }
.bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-items: end; height: 120px; padding-top: 8px; }
.bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.bar i { display: block; width: 100%; max-width: 40px; border-radius: 8px 8px 4px 4px; background: var(--accent); }
.bar span { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.report-note { font-size: 0.9rem; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); }
@media (max-width: 960px) { .st-grid { grid-template-columns: 1fr; } .report { position: static; } }

/* FAQ */
.faq { max-width: 46rem; display: flex; flex-direction: column; }
.faq details { border-top: 1px solid var(--line); padding: 18px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; line-height: 1; color: var(--accent); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin-top: 10px; color: var(--muted); max-width: 40rem; }

/* CTA + footer */
.cta { background: var(--accent); color: var(--on-accent); }
.cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding-block: clamp(48px, 6vw, 80px); }
.cta h2 { max-width: 28rem; }
.cta .btn { background: var(--on-accent); color: var(--accent); }
.site-footer { padding-block: 40px; color: var(--muted); font-size: 0.9rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--muted); }

/* Sign-up */
.su { padding-block: clamp(36px, 6vw, 80px) clamp(56px, 8vw, 112px); }
.su-inner { max-width: 760px; margin-inline: auto; display: flex; flex-direction: column; gap: 32px; }
.su-head { display: flex; flex-direction: column; gap: 14px; }
.su-head h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(20px, 4vw, 36px); display: flex; flex-direction: column; gap: 22px; min-width: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.form-card legend, .kid-legend { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; padding: 0; margin-bottom: 14px; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .group-label { font-weight: 600; font-size: 0.95rem; }
.opt { font-weight: 400; color: var(--muted); }
.hint { font-size: 0.85rem; color: var(--muted); }
.field input[type="text"], .field input[type="email"], .field select, .field textarea {
  font: 400 16px var(--font-body); color: var(--ink); background: var(--bg); border: 1.5px solid var(--field-line); border-radius: 12px; padding: 12px 14px; min-height: 48px; width: 100%;
}
.field textarea { min-height: 96px; resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--danger); }
.err { color: var(--danger); font-size: 0.875rem; font-weight: 600; }
.kid { border: 1px solid var(--line); border-radius: 18px; padding: 22px 20px 24px; display: flex; flex-direction: column; gap: 18px; background: var(--bg); min-width: 0; }
.kid-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.linkbtn { background: none; border: 0; padding: 6px 8px; color: var(--accent); font: 600 0.9375rem var(--font-body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.choice { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 14px; min-height: 52px; border: 1.5px solid var(--field-line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice b { font-family: var(--font-display); font-weight: 650; font-size: 1.2rem; }
.choice span { font-size: 0.9rem; color: var(--muted); line-height: 1.2; }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); background: var(--accent-soft); }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.check { display: flex; gap: 12px; align-items: flex-start; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check label { font-size: 0.975rem; }
.form-errors { color: var(--danger); font-weight: 600; padding: 12px 16px; border: 1.5px solid var(--danger); border-radius: 12px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.privacy { font-size: 0.85rem; color: var(--muted); }
.done { display: flex; flex-direction: column; gap: 18px; }
.done ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.draft-note { padding: 12px 16px; border-radius: 12px; background: var(--band); color: var(--muted); font-size: 0.9rem; }
