/* Vokela reading app — same palette and type as vokela.eu. Fonts are self-hosted (Latin Extended carries ā ē ī ū ģ ķ ļ ņ š ž). */
@font-face { font-family: 'Literata'; font-weight: 600; font-display: swap; src: url(fonts/literata-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: 'Literata'; font-weight: 600; font-display: swap; src: url(fonts/literata-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Literata'; font-weight: 800; font-display: swap; src: url(fonts/literata-latin-ext-800-normal.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: 'Literata'; font-weight: 800; font-display: swap; src: url(fonts/literata-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Public Sans'; font-weight: 400; font-display: swap; src: url(fonts/public-sans-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: 'Public Sans'; font-weight: 400; font-display: swap; src: url(fonts/public-sans-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Public Sans'; font-weight: 700; font-display: swap; src: url(fonts/public-sans-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: 'Public Sans'; font-weight: 700; font-display: swap; src: url(fonts/public-sans-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }

:root {
  --paper: #fbf7f0; --paper-2: #f3ece0; --card: #fffdf9; --ink: #26241f; --ink-2: #57514a; --ink-3: #8a8177; --rule: #ddd3c4;
  --accent: #d97426; --accent-deep: #a8531a; --heard: #6fd08c; --heard-ink: #1f6b38; --again: #f2c94c; --again-ink: #6b5100;
  --focus: #3a6fd0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { background: var(--paper); color: var(--ink); font: 400 18px/1.55 'Public Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 10px; }
.app { max-width: 640px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding: 16px 16px 28px; display: flex; flex-direction: column; }
.loading, .noscript { margin: 30vh auto; color: var(--ink-3); text-align: center; }
h1, h2 { font-family: 'Literata', Georgia, serif; font-weight: 800; letter-spacing: -.01em; line-height: 1.12; }
h1 { font-size: clamp(1.9rem, 6vw, 2.5rem); }
h2 { font-size: 1.35rem; }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; color: var(--ink-3); }

/* top bar */
.top { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.brand { display: flex; align-items: center; gap: 8px; font: 800 1.2rem 'Literata', Georgia, serif; }
.mark { width: 32px; height: 32px; border-radius: 10px 10px 10px 3px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: .95rem; box-shadow: 0 3px 0 var(--accent-deep); }
.top .spacer { flex: 1; }
.chip { background: var(--card); border: 1.5px solid var(--rule); border-radius: 999px; padding: 6px 12px; font-size: .9rem; font-weight: 700; color: var(--ink-2); }
.linkbtn { color: var(--accent-deep); text-decoration: underline; font-size: .95rem; padding: 6px 4px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--accent); color: #fff; font-weight: 700; font-size: 1.05rem;
  padding: 14px 26px; border-radius: 999px; box-shadow: 0 5px 0 var(--accent-deep); min-height: 52px; text-decoration: none; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--accent-deep); }
.btn.big { font-size: 1.35rem; padding: 18px 40px; min-height: 68px; }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 2px var(--rule); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.google { display: inline-flex; align-items: center; gap: 12px; background: #fff; color: #1f1f1f; border: 1px solid #747775; border-radius: 999px;
  padding: 12px 24px; font: 500 16px/1.2 system-ui, -apple-system, 'Segoe UI', sans-serif; text-decoration: none; }
.google svg { width: 20px; height: 20px; }

/* welcome + setup */
.center { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; text-align: center; align-items: center; }
.center p { max-width: 34rem; }
.card { background: var(--card); border: 1.5px solid var(--rule); border-radius: 20px; padding: 20px; }
.setup { display: grid; gap: 22px; margin-top: 12px; }
.field > label, .field > legend { display: block; font-weight: 700; margin-bottom: 8px; }
fieldset { border: 0; }
input[type=text] { width: 100%; font: inherit; padding: 12px 16px; border: 2px solid var(--rule); border-radius: 14px; background: #fff; color: var(--ink); }
input[type=text]:focus { border-color: var(--accent); outline: none; }
.choices { display: grid; gap: 10px; }
.choices.row { grid-template-columns: repeat(4, 1fr); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span { display: block; background: #fff; border: 2px solid var(--rule); border-radius: 14px; padding: 12px 14px; text-align: left; }
.choices.row .choice span { text-align: center; font-weight: 700; }
.choice b { display: block; font-size: 1.05rem; }
.choice small { color: var(--ink-2); font-size: .9rem; }
.choice input:checked + span { border-color: var(--accent); background: #fff4e8; box-shadow: 0 0 0 2px var(--accent) inset; }
.choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.error { color: #8a2b1c; font-weight: 700; }

/* home */
.hello { font-size: clamp(2.2rem, 8vw, 3rem); }
.stars { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.stars svg { width: 22px; height: 22px; }

/* reading */
.progress { display: flex; gap: 6px; flex: 1; justify-content: center; }
.progress i { width: 10px; height: 10px; border-radius: 50%; background: var(--rule); }
.progress i.done { background: var(--heard); }
.progress i.now { background: var(--accent); transform: scale(1.3); }
.stage { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.kind { text-align: center; font-size: .9rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.line { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 10px; }
.word { font: 600 clamp(1.7rem, 7vw, 2.4rem)/1.2 'Literata', Georgia, serif; padding: 6px 14px 9px; border-radius: 14px; background: var(--paper-2);
  transition: background .25s, color .25s, transform .2s; }
.word.long { font-size: clamp(1.25rem, 5vw, 1.7rem); }
.word.now { background: #fde2c4; transform: translateY(-4px); }
.word.ok { background: var(--heard); color: var(--heard-ink); }
.word.warn { background: var(--again); color: var(--again-ink); }
.bubble { background: var(--card); border: 1.5px solid var(--rule); border-radius: 18px; padding: 14px 18px; text-align: center; font-weight: 700; min-height: 58px; }
.controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; }
.ctl { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .9rem; font-weight: 700; color: var(--ink-2); }
.round { width: 68px; height: 68px; border-radius: 50%; background: var(--card); border: 2px solid var(--rule); display: grid; place-items: center; }
.round svg { width: 32px; height: 32px; }
.round:disabled { opacity: .4; }
.mic { width: 104px; height: 104px; border-radius: 50%; background: var(--accent); box-shadow: 0 6px 0 var(--accent-deep); display: grid; place-items: center; position: relative; }
.mic svg { width: 46px; height: 46px; }
.mic:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--accent-deep); }
.mic:disabled { opacity: .45; }
.mic.rec::after { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 4px solid rgba(217,116,38,.5); animation: ring 1.2s ease-out infinite; }
.mic.busy svg { animation: spin 1s linear infinite; }
@keyframes ring { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.next { background: var(--heard); border-color: var(--heard); }
.question { background: var(--card); border: 1.5px dashed var(--rule); border-radius: 16px; padding: 14px 16px; text-align: center; }
.question .q { font: 600 1.35rem/1.3 'Literata', Georgia, serif; margin-bottom: 6px; }
.question .answer { margin-top: 8px; color: var(--heard-ink); font-weight: 700; }

/* grown-up area */
.grownup { margin-top: 18px; }
.grownup summary { cursor: pointer; font-weight: 700; color: var(--ink-2); }
.grownup .card { margin-top: 10px; display: grid; gap: 10px; text-align: left; }
.danger { color: #8a2b1c; }

@media (max-width: 420px) {
  .choices.row { grid-template-columns: repeat(2, 1fr); }
  .mic { width: 92px; height: 92px; }
  .round { width: 60px; height: 60px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.choices.row.two { grid-template-columns: repeat(2, 1fr); }

/* welcome-page language switch (EN | LV), same look as vokela.eu */
.langs { display: flex; border: 1.5px solid var(--rule); border-radius: 999px; padding: 3px; gap: 2px; }
.langs button { font: 700 .82rem 'Public Sans', sans-serif; letter-spacing: .06em; color: var(--ink-2); min-width: 40px; height: 32px; border-radius: 999px; }
.langs button[aria-current="true"] { background: var(--ink); color: var(--paper); }
.google span { pointer-events: none; }

/* parent consent for demo recordings */
.consent { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 2px solid var(--rule); border-radius: 14px; padding: 12px 14px; cursor: pointer; }
.consent input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; margin-top: 2px; }
