/* ============ LinguaKata — sibling of the Spaikz house style ============ */
/* Same bones as spaikz.com and vocabkuizu.spaikz.com: Space Grotesk + Inter,
   grid/glow background, kicker pills, cards, reveal-on-scroll, dark by default
   with a light toggle. Different palette — the app's own sky blue, the amber it
   marks a contact point with, and the green it lights the larynx with. Those
   three are not decoration here: they mean the same things on this page that
   they mean in the cross-section, so somebody who reads the page and then opens
   the app is not learning a second colour code. */
:root {
  --bg: #0b0f1a;
  --bg-soft: #0f1424;
  --panel: rgba(255, 255, 255, 0.03);
  --panel-brd: rgba(255, 255, 255, 0.08);
  --text: #e8ecf6;
  --muted: #97a2bd;
  --brand: #57b8ff;          /* the app's accent, and the adaptive icon's ground */
  --brand-2: #7dd3fc;        /* airflow blue, straight from the cross-section */
  --accent: #fbbf24;         /* the contact-point highlight */
  --voiced: #4ade80;         /* the larynx, when it is voicing */
  --on-brand: #041423;
  --grad-text: linear-gradient(115deg, #57b8ff 0%, #7dd3fc 45%, #fbbf24 100%);
  --glow-opacity: 1;
  --radius: 16px;
  --maxw: 1120px;
  --ease: cubic-bezier(.22,.61,.36,1);

  /* ---- Anatomy colours, copied out of the app ----
     Two separate palettes, because the app has two. The FRONT view's come from
     MOUTH_PALETTES.plain in avatar/palettes.ts and are per-skin, not per-theme,
     so they do not change with the toggle. The CROSS-SECTION's come from
     ui/palette.ts and ARE per-theme — its head is dark slate on the dark theme
     and pale bone on the light one, and using the dark set on a light page put a
     navy skull in the middle of the hero.

     These values are measured in the app (palette.test.ts and palettes.test.ts
     check every pair, including that the tongue clears its own lips at 3:1 by
     fill, because the protruding tongue of /θ/ is drawn ON TOP of them). Copying
     rather than importing costs only this page if they drift; the SHAPES are
     imported, and those are the ones that carry the teaching. */
  --m-lip: #a02f3d;
  --m-lip-line: #c9908c;
  --m-inner: #1d0d0f;
  --m-teeth: #f7f4ee;
  --m-tongue: #ff9fab;
  --m-tongue-line: #8c3945;
  --skin: #e0b89c;
  --skin-line: #c39c80;

  --s-flesh: #2b3342;
  --s-flesh-line: #8ba0bd;
  --s-cavity: #0a0d13;
  --s-tongue: #e0687e;
  --s-tongue-line: #f5a3b2;
  --s-teeth: #eef2f7;
  --s-highlight: #fbbf24;
  --s-voiced: #4ade80;
  --s-air: #7dd3fc;
}

:root[data-theme="light"] {
  --bg: #f7f9fc;
  --bg-soft: #eef2f8;
  --panel: rgba(16, 27, 51, 0.035);
  --panel-brd: rgba(16, 27, 51, 0.12);
  --text: #0f1626;
  --muted: #4f5a72;
  --brand: #1263a8;
  --brand-2: #0d5f86;
  --accent: #8a6100;
  --voiced: #0f7a3d;
  --on-brand: #ffffff;
  --grad-text: linear-gradient(115deg, #1263a8 0%, #0d5f86 45%, #8a6100 100%);
  --glow-opacity: 0.45;

  /* The cross-section's light theme, from ui/palette.ts. */
  --s-flesh: #e6dfd4;
  --s-flesh-line: #6f6a60;
  --s-cavity: #3b3630;
  --s-tongue: #c54459;
  --s-tongue-line: #ffd7de;
  --s-teeth: #ffffff;
  --s-highlight: #8a5300;
  --s-voiced: #177245;
  --s-air: #38bdf8;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, .brand-name { font-family: "Space Grotesk", "Inter", sans-serif; letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }
.grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: var(--on-brand); padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- background ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background-image:
    linear-gradient(rgba(87,184,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(87,184,255,.05) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}
.bg-glow {
  position: fixed; z-index: -1; top: -22%; left: 50%;
  width: 900px; height: 900px; transform: translateX(-50%);
  background: radial-gradient(circle at 32% 30%, rgba(87,184,255,.22), transparent 60%),
              radial-gradient(circle at 70% 42%, rgba(251,191,36,.12), transparent 55%),
              radial-gradient(circle at 50% 52%, rgba(125,211,252,.18), transparent 60%);
  filter: blur(30px);
  opacity: var(--glow-opacity);
  animation: float 16s var(--ease) infinite alternate;
}
@keyframes float {
  from { transform: translateX(-50%) translateY(0) scale(1); }
  to   { transform: translateX(-45%) translateY(40px) scale(1.08); }
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 14px;
  max-width: var(--maxw); margin: 0 auto; padding: 16px 24px;
  transition: padding .3s var(--ease), background .3s;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--panel-brd);
  padding: 10px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; display: block; }
.brand-mark-sm { width: 24px; height: 24px; border-radius: 6px; }
.brand-name { font-weight: 700; font-size: 1.05rem; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--muted); font-size: .94rem; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  padding: 8px 16px; border-radius: 999px; color: var(--text) !important;
  border: 1px solid var(--panel-brd); background: var(--panel);
}
.nav-cta:hover { border-color: var(--brand); }
.theme-toggle, .nav-toggle {
  display: grid; place-items: center; width: 34px; height: 34px; cursor: pointer;
  border: 1px solid var(--panel-brd); border-radius: 9px;
  background: var(--panel); color: var(--text);
}
.theme-toggle svg { width: 18px; height: 18px; }
:root[data-theme="light"] .icon-moon { display: none; }
:root:not([data-theme="light"]) .icon-sun { display: none; }
.nav-toggle { display: none; flex-direction: column; gap: 4px; }
.nav-toggle span { width: 16px; height: 2px; background: currentColor; border-radius: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 1rem;
  padding: 13px 24px; border-radius: 12px; border: 1px solid transparent;
  transition: transform .2s var(--ease), border-color .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-ghost { border: 1px solid var(--panel-brd); background: var(--panel); color: var(--text); }
.btn-ghost:hover { border-color: var(--brand); }

/* ---------- hero ---------- */
.hero {
  max-width: var(--maxw); margin: 0 auto; padding: 64px 24px 40px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
}
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--brand); margin-bottom: 18px;
}
h1 { font-size: clamp(2.3rem, 5.6vw, 3.9rem); line-height: 1.04; margin: 0 0 18px; }
.lead { color: var(--muted); font-size: 1.13rem; max-width: 31rem; margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { color: var(--muted); font-size: .88rem; margin: 18px 0 0; }

/* ---------- the demo stage ---------- */
.stage {
  border: 1px solid var(--panel-brd); border-radius: 20px;
  background: var(--panel); padding: 18px;
}
.stage-views { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.view { position: relative; }
.view svg { width: 100%; height: auto; display: block; border-radius: 12px; background: var(--bg-soft); }
.view-label {
  position: absolute; bottom: 8px; left: 10px;
  font-size: .66rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
.stage-caption {
  min-height: 3em; margin: 14px 2px 12px;
  color: var(--muted); font-size: .92rem;
}
.stage-caption b { color: var(--text); font-weight: 600; }
.stage-ipa {
  font-family: "Space Grotesk", sans-serif; font-size: 1.1rem;
  color: var(--brand-2); margin: 0 2px 10px;
}
.stage-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stage-row + .stage-row { margin-top: 10px; }
.pill {
  font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--panel-brd); background: transparent; color: var(--muted);
  transition: border-color .2s, color .2s, background .2s;
}
.pill:hover { color: var(--text); border-color: var(--brand); }
.pill[aria-pressed="true"] { color: var(--on-brand); background: var(--brand); border-color: var(--brand); }
.pill-play { color: var(--text); border-color: var(--brand); }
.stage-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 2px 0; }
.stage-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-air { background: var(--s-air); }
.dot-contact { background: var(--s-highlight); }
.dot-voice { background: var(--s-voiced); }

/* the sound track under the stage */
.track { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 2px 0; }
.track b {
  font-weight: 600; font-size: .82rem; padding: 3px 8px; border-radius: 7px;
  color: var(--muted); background: var(--panel); border: 1px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.track b.on { color: var(--on-brand); background: var(--brand); }
.track b.puff { border-color: var(--brand-2); }

/* ---------- strip ---------- */
.strip {
  max-width: var(--maxw); margin: 0 auto; padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px;
  border-top: 1px solid var(--panel-brd); border-bottom: 1px solid var(--panel-brd);
}
.strip p { color: var(--muted); font-size: .9rem; margin: 0; }
.strip-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.strip-tags span {
  font-size: .82rem; color: var(--muted); padding: 5px 13px;
  border: 1px solid var(--panel-brd); border-radius: 999px; background: var(--panel);
}

/* ---------- sections ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 88px 24px; }
.section-alt { background: var(--bg-soft); }
.section-inner { max-width: var(--maxw); margin: 0 auto; padding: 88px 24px; }
.section-head { max-width: 680px; margin-bottom: 44px; }
.kicker {
  display: inline-block; font-size: .74rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brand);
  padding: 5px 12px; border: 1px solid var(--panel-brd); border-radius: 999px;
  background: var(--panel); margin-bottom: 16px;
}
h2 { font-size: clamp(1.7rem, 3.8vw, 2.5rem); margin: 0 0 12px; line-height: 1.12; }
.section-head p { color: var(--muted); font-size: 1.06rem; margin: 0; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  padding: 26px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--panel-brd);
  transition: transform .3s var(--ease), border-color .3s;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.card-icon {
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px;
  border: 1px solid var(--panel-brd); border-radius: 11px; color: var(--brand); font-size: 1.15rem;
}
.card-icon-air { color: var(--brand-2); border-color: color-mix(in srgb, var(--brand-2) 45%, transparent); }
.card-icon-amber { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.card h3 { font-size: 1.12rem; margin: 0 0 8px; }
.card p { color: var(--muted); font-size: .96rem; margin: 0; }

/* ---------- the p/m pair figure ---------- */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.pair-item {
  padding: 18px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--panel-brd);
}
.pair-item h3 { margin: 0 0 4px; font-size: 1.5rem; font-family: "Space Grotesk", sans-serif; }
.pair-item .pair-sub { color: var(--muted); font-size: .9rem; margin: 0 0 14px; }
.pair-views { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair-fact {
  display: flex; gap: 8px; align-items: baseline;
  margin: 14px 0 0; font-size: .9rem; color: var(--muted);
}
.pair-fact strong { color: var(--text); font-weight: 600; }
.pair-note {
  grid-column: 1 / -1; margin: 4px 0 0; padding: 18px 20px;
  border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  color: var(--muted); font-size: .96rem;
}
.pair-note strong { color: var(--text); }

/* ---------- notation table ---------- */
.notation { display: grid; gap: 12px; }
.notation-row {
  display: grid; grid-template-columns: 130px 1fr; gap: 18px; align-items: center;
  padding: 16px 20px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--panel-brd);
}
.notation-row dt {
  font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--brand);
}
.notation-row dd {
  margin: 0; font-family: "Space Grotesk", sans-serif; font-size: 1.15rem;
  word-break: break-word;
}
.notation-caveat { color: var(--muted); font-size: .92rem; margin: 18px 0 0; }

/* ---------- honest / limitations ---------- */
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.ticks li { position: relative; padding-left: 28px; color: var(--muted); }
.ticks li strong { color: var(--text); font-weight: 600; }
.ticks li::before {
  content: ""; position: absolute; left: 6px; top: .62em;
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
}
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }

/* ---------- contact ---------- */
.contact { display: flex; justify-content: center; }
.contact-card {
  width: 100%; max-width: 720px; text-align: center;
  padding: 48px 36px; border-radius: 24px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 10%, transparent), color-mix(in srgb, var(--accent) 6%, transparent));
  border: 1px solid var(--panel-brd);
}
.contact-card p { color: var(--muted); max-width: 34rem; margin: 0 auto 26px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.contact-alt { font-size: .9rem; margin: 22px auto 0 !important; }
.contact-alt a { color: var(--brand); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--panel-brd); margin-top: 40px; padding: 36px 24px 26px; }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center;
  flex-wrap: wrap; gap: 16px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.footer-tag { color: var(--muted); font-size: .92rem; margin: 0; margin-right: auto; }
.footer-tag a { color: var(--brand); }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { color: var(--muted); font-size: .9rem; }
.footer-links a:hover { color: var(--text); }
.copyright { max-width: var(--maxw); margin: 24px auto 0; color: var(--muted); font-size: .84rem; text-align: center; }

/* ---------- legal pages ---------- */
.prose { max-width: 760px; margin: 0 auto; padding: 56px 24px 72px; }
.prose h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); }
.prose h2 { font-size: 1.3rem; margin-top: 40px; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--text); }
.prose a { color: var(--brand); }
.prose .updated { font-size: .9rem; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .bg-glow { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .cards, .cards-2, .split, .pair { grid-template-columns: 1fr; }
  .nav-toggle { display: flex; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--panel-brd); padding: 8px 24px 18px;
  }
  .nav.open .nav-links { display: flex; }
  .nav-links a { padding: 12px 0; }
  .nav-cta { text-align: center; margin-top: 8px; }
  .notation-row { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 480px) {
  .stage-views { grid-template-columns: 1fr; }
  .pair-views { grid-template-columns: 1fr 1fr; }
}
