/* Utter — quiet, typographic, paper-like. */

@font-face { font-family: "Gentium"; src: url("../fonts/gentium-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Gentium"; src: url("../fonts/gentium-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Gentium"; src: url("../fonts/gentium-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("../fonts/hanken-grotesk.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --paper: #f6f3ec;
  --panel: #fbf9f4;
  --ink: #1d1c19;
  --muted: #69665e;
  --faint: #99958a;
  --line: #ddd8cb;
  --soft: #ece7da;
  --accent: #a8391f;
  --accent-ink: #7e2812;
  --accent-soft: #f1d8cd;
  --good: #2c6a3d;
  --good-soft: #dcebd9;
  --bad: #a8391f;
  --bad-soft: #f4dcd3;
  --serif: "Gentium", "Charis SIL", "Noto Serif", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151412; --panel: #1b1a17; --ink: #ece8de; --muted: #a39f93; --faint: #77736a; --line: #2e2c26; --soft: #24221e;
    --accent: #e57a5c; --accent-ink: #f2a28b; --accent-soft: #3b2118; --good: #7cc48f; --good-soft: #1f3324; --bad: #e57a5c; --bad-soft: #3b2118;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #151412; --panel: #1b1a17; --ink: #ece8de; --muted: #a39f93; --faint: #77736a; --line: #2e2c26; --soft: #24221e;
  --accent: #e57a5c; --accent-ink: #f2a28b; --accent-soft: #3b2118; --good: #7cc48f; --good-soft: #1f3324; --bad: #e57a5c; --bad-soft: #3b2118;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.62 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--accent-soft); }
[hidden] { display: none !important; }

/* ---------- layout */
.wrap { max-width: 720px; margin: 0 auto; padding: 0 22px; }
.wrap.wide { max-width: 1040px; }
main { padding: 44px 0 96px; min-height: 70vh; }

.site-head { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 30; }
.site-head .wrap { max-width: 1040px; display: flex; align-items: baseline; gap: 28px; padding-top: 14px; padding-bottom: 12px; }
.brand { font: 600 21px/1 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: -.005em; white-space: nowrap; }
.brand span { color: var(--accent); }
nav.main { display: flex; gap: 4px 22px; flex-wrap: wrap; font-size: 14.5px; }
nav.main a { color: var(--muted); text-decoration: none; padding: 2px 0; border-bottom: 1px solid transparent; }
nav.main a:hover { color: var(--ink); }
nav.main a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.head-tools { margin-left: auto; display: flex; gap: 10px; }
@media (max-width: 760px) {
  .site-head .wrap { flex-wrap: wrap; gap: 8px 18px; }
  .head-tools { margin-left: 0; }
  .site-head { position: static; }
  main { padding-top: 30px; }
}

/* ---------- type */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: -.012em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(34px, 5.4vw, 50px); margin-bottom: 14px; }
h2 { font-size: 28px; margin: 54px 0 12px; }
h3 { font-size: 21px; margin: 32px 0 8px; }
h4 { font-size: 17px; font-family: var(--sans); font-weight: 600; letter-spacing: 0; margin: 22px 0 6px; }
p { margin: 0 0 1em; }
.lede { font: 400 21px/1.5 var(--serif); color: var(--muted); max-width: 34em; margin-bottom: 1.4em; }
.eyebrow { font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.ipa, .ipa-text { font-family: var(--serif); font-feature-settings: "kern"; letter-spacing: .01em; }
.ipa { font-size: 1.05em; }
.serif { font-family: var(--serif); }
code, kbd { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .88em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }

ul.plain, ol.plain { padding: 0; margin: 0; list-style: none; }
ul.bullets { padding-left: 1.2em; } ul.bullets li { margin: .35em 0; }

/* ---------- controls */
.btn {
  appearance: none; font: 500 15px/1 var(--sans); color: var(--ink); background: transparent;
  border: 1px solid var(--ink); border-radius: var(--radius); padding: 10px 16px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px; transition: background .12s, color .12s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.quiet { border-color: var(--line); color: var(--muted); }
.btn.quiet:hover { background: var(--soft); color: var(--ink); border-color: var(--line); }
.btn.small { padding: 7px 11px; font-size: 13.5px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.rec { border-color: var(--accent); color: var(--accent-ink); }
.btn.rec.on { background: var(--accent); color: #fff; }

.icon-btn {
  appearance: none; border: 1px solid var(--line); background: var(--panel); color: var(--ink); width: 34px; height: 34px; border-radius: 50%;
  display: inline-grid; place-items: center; cursor: pointer; flex: none; padding: 0;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 15px; height: 15px; fill: currentColor; }
.icon-btn.playing { background: var(--accent); border-color: var(--accent); color: #fff; }
.icon-btn.lg { width: 44px; height: 44px; } .icon-btn.lg svg { width: 18px; height: 18px; }

select, input[type=text], textarea {
  font: 400 15.5px/1.4 var(--sans); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 11px; max-width: 100%;
}
select { padding-right: 30px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2399958a' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
select:hover, input:hover, textarea:hover { border-color: var(--faint); }
textarea { width: 100%; min-height: 120px; resize: vertical; font-size: 16px; line-height: 1.6; }
label.field { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); padding: 2px; background: var(--panel); }
.seg button { appearance: none; border: 0; background: transparent; color: var(--muted); font: 500 14px/1 var(--sans); padding: 8px 13px; border-radius: 4px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.row.center { align-items: center; }
.grow { flex: 1; }
.gap-s { margin-top: 10px; } .gap-m { margin-top: 24px; } .gap-l { margin-top: 44px; }

/* ---------- lists and rows */
.ruled > * { border-top: 1px solid var(--line); }
.ruled > *:last-child { border-bottom: 1px solid var(--line); }
.item { display: flex; gap: 16px; align-items: baseline; padding: 14px 0; color: inherit; text-decoration: none; }
a.item:hover .item-title { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.item-title { font: 600 19px/1.25 var(--serif); }
.item-sub { color: var(--muted); font-size: 15px; }
.item .grow { min-width: 0; }
.item .tail { color: var(--faint); font-size: 14px; white-space: nowrap; }
.item .lead-ipa { font: 400 26px/1 var(--serif); width: 62px; flex: none; color: var(--accent-ink); }

.note {
  border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; margin: 22px 0; color: var(--ink);
}
.note .label { font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 4px; display: block; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 22px; }
.tag { display: inline-block; font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; margin: 0 6px 6px 0; }
.tag.on { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }

table.data { border-collapse: collapse; width: 100%; font-size: 15.5px; }
table.data th, table.data td { text-align: left; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
table.data th { font-weight: 500; color: var(--muted); font-size: 13px; }

/* ---------- words and highlights */
.words { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.word-btn {
  appearance: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 11px;
  font: 400 19px/1.3 var(--serif); color: var(--ink); cursor: pointer; display: inline-flex; flex-direction: column; align-items: flex-start; text-align: left;
}
.word-btn small { font: 400 13px/1.2 var(--serif); color: var(--muted); }
.word-btn:hover { border-color: var(--ink); }
.word-btn.playing { border-color: var(--accent); background: var(--accent-soft); }

mark.snd { background: var(--accent-soft); color: var(--accent-ink); border-radius: 3px; padding: 0 .04em; box-shadow: inset 0 -2px 0 var(--accent); }
.reading { font: 400 27px/1.7 var(--serif); padding: 26px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.reading .w { cursor: pointer; border-radius: 3px; }
.reading .w:hover { background: var(--soft); }
.reading .w.sel { background: var(--soft); }
.reading.small { font-size: 22px; }
@media (max-width: 600px) { .reading { font-size: 22px; } }

.stats { display: flex; gap: 30px; flex-wrap: wrap; align-items: baseline; }
.stat b { font: 600 34px/1 var(--serif); display: block; } .stat span { font-size: 13px; color: var(--muted); }

/* ---------- breakdown */
.units { display: flex; flex-wrap: wrap; gap: 6px; }
.unit { display: flex; flex-direction: column; align-items: center; min-width: 46px; padding: 9px 10px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.unit .g { font: 400 26px/1 var(--serif); }
.unit .p { font: 400 17px/1 var(--serif); margin-top: 8px; color: var(--muted); white-space: nowrap; }
.unit.v { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.unit.v .p { color: var(--accent-ink); }
.unit.silent .g { opacity: .4; } .unit.silent .p { opacity: .5; }
.unit.hit { outline: 2px solid var(--accent); outline-offset: 1px; }
.syl { display: inline-flex; gap: 0; align-items: baseline; font: 400 34px/1.2 var(--serif); }
.syl .sep { color: var(--faint); margin: 0 3px; }
.syl .st { color: var(--accent-ink); font-weight: 600; }

/* ---------- charts */
.chart svg { width: 100%; height: auto; display: block; }
.vchart text { font-family: var(--serif); }
.vchart .dot { cursor: pointer; }
.vchart .dot circle { fill: var(--panel); stroke: var(--ink); stroke-width: 1.2; }
.vchart .dot:hover circle, .vchart .dot.active circle { fill: var(--accent); stroke: var(--accent); }
.vchart .dot:hover text, .vchart .dot.active text { fill: #fff; }
.vchart .dot text { font-size: 21px; text-anchor: middle; dominant-baseline: central; fill: var(--ink); pointer-events: none; }
.vchart .frame { fill: none; stroke: var(--line); stroke-width: 1.2; }
.vchart .guide { stroke: var(--line); stroke-dasharray: 2 4; }
.vchart .axis { font-size: 12px; fill: var(--faint); font-family: var(--sans); letter-spacing: .06em; text-transform: uppercase; }
.vchart .arrow path { stroke: var(--accent); stroke-width: 1.6; fill: none; }
.vchart .arrow text { font-size: 20px; fill: var(--accent-ink); }
.vchart .arrow { cursor: pointer; } .vchart .arrow:hover path { stroke-width: 2.6; }

table.cgrid { border-collapse: collapse; width: 100%; font-size: 14px; }
.cgrid th { font: 500 12px/1.2 var(--sans); color: var(--muted); text-align: center; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.cgrid th.rowh { text-align: left; border-bottom: 1px solid var(--line); padding-right: 12px; white-space: nowrap; }
.cgrid td { border-bottom: 1px solid var(--line); padding: 8px 3px; text-align: center; height: 56px; }
.cgrid .pair { display: inline-flex; gap: 2px; }
.cbtn { appearance: none; border: 1px solid var(--line); background: var(--panel); border-radius: 5px; font: 400 20px/1 var(--serif); width: 32px; height: 36px; cursor: pointer; color: var(--ink); }
.cbtn.v { background: var(--soft); }
.cbtn:hover { border-color: var(--accent); color: var(--accent-ink); }
.cgrid-wrap { overflow-x: auto; }
.cgrid-wrap table { min-width: 600px; }

.mouth svg { width: 100%; max-width: 340px; height: auto; }
.mouth .skin { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.mouth .tongue { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; }
.mouth .touch { fill: var(--accent); }
.mouth .air { stroke: var(--accent); stroke-width: 1.4; fill: none; stroke-dasharray: 3 3; }
.mouth text { font: 400 11px var(--sans); fill: var(--faint); }
.mouth .cords { stroke: var(--accent); stroke-width: 1.6; fill: none; }

/* ---------- drills */
.drill-word { font: 600 44px/1.1 var(--serif); }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice button {
  appearance: none; font: 400 30px/1.2 var(--serif); padding: 22px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--ink);
}
.choice button small { display: block; font: 400 16px/1.3 var(--serif); color: var(--muted); margin-top: 6px; }
.choice button:hover { border-color: var(--ink); }
.choice button.right { background: var(--good-soft); border-color: var(--good); }
.choice button.wrong { background: var(--bad-soft); border-color: var(--bad); }
.progress { height: 3px; background: var(--soft); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ink); transition: width .3s; }
.meter { height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--good); }
.meter.warn i { background: var(--accent); }

/* ---------- rhythm */
.beats { display: flex; flex-wrap: wrap; gap: 2px 0; align-items: flex-end; margin: 14px 0; }
.beat { display: flex; flex-direction: column; align-items: center; padding: 0 9px; cursor: pointer; }
.beat .bar { width: 100%; background: var(--ink); border-radius: 2px; margin-bottom: 6px; }
.beat.strong .bar { height: 16px; } .beat.weak .bar { height: 5px; background: var(--faint); }
.beat .t { font: 400 24px/1.2 var(--serif); } .beat.weak .t { color: var(--muted); font-size: 20px; }
.beat .i { font: 400 15px/1.2 var(--serif); color: var(--muted); margin-top: 3px; }
.beat.weak .i { color: var(--accent-ink); }
.link { color: var(--accent); font: 400 20px/1 var(--serif); margin: 0 -8px; align-self: center; }

/* ---------- speak lab */
canvas.wave { width: 100%; height: 110px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; display: block; }
.verdict { display: inline-block; font: 400 26px/1 var(--serif); padding: 6px 9px; border-radius: 5px; margin: 0 4px 4px 0; }
.verdict.ok { background: var(--good-soft); color: var(--good); }
.verdict.bad { background: var(--bad-soft); color: var(--bad); }
.verdict.near { background: var(--soft); color: var(--muted); }
.verdict small { display: block; font: 400 12px/1.2 var(--sans); margin-top: 5px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } * { transition: none !important; } }

footer.site { border-top: 1px solid var(--line); padding: 30px 0 60px; color: var(--muted); font-size: 14px; }
footer.site a { color: var(--muted); }
footer.site .wrap { max-width: 1040px; display: flex; gap: 12px 26px; flex-wrap: wrap; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 820px) { .two { grid-template-columns: 1fr; gap: 20px; } }
.split { display: grid; grid-template-columns: 340px 1fr; gap: 44px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 24px; } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 22px; }
.kv dt { color: var(--muted); font-size: 14px; padding-top: 2px; } .kv dd { margin: 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 6px; font-size: 14px; z-index: 50; }
.big-ipa { font: 400 clamp(64px, 12vw, 104px)/1 var(--serif); color: var(--accent-ink); letter-spacing: 0; }
