/* Shared styles for Vocal Tuner's guide, tool, legal and error pages (the home page has its own inline CSS). */
:root {
  --bg: #09090E; --panel: #111118; --surface: #16161F; --surface-2: #1D1D28;
  --ink: #F4F4F7; --ink-soft: #A6A6B5; --ink-faint: #6F6F80;
  --trace: #FFCC47; --guide: #FF5278; --green: #4DE68C; --amber: #FFC740; --red: #FF614D; --blue: #5CB8FF;
  --line: rgba(255,255,255,.08);
  --rounded: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--rounded); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--blue); }
img, svg { max-width: 100%; }
button { font: inherit; color: inherit; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.wide { max-width: 1100px; }

/* Nav */
nav.top { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
nav.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 62px; max-width: 1100px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 19px; flex-shrink: 0; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav-links { display: flex; gap: 22px; align-items: center; font-weight: 650; font-size: 15px; }
.nav-links a:not(.btn) { text-decoration: none; color: var(--ink-soft); }
.nav-links a:not(.btn):hover, .nav-links a[aria-current="page"] { color: var(--ink); }
@media (max-width: 760px) { .nav-links .hide-sm { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: rgba(255,255,255,.09); color: var(--ink); text-decoration: none; border: 0; cursor: pointer;
  font-weight: 750; font-size: 14px; padding: 9px 16px; border-radius: 999px; transition: transform .15s ease, background .15s ease, opacity .15s; }
.btn:hover { background: rgba(255,255,255,.14); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.btn-primary { background: var(--trace); color: #17130A; font-size: 17px; padding: 13px 24px; box-shadow: 0 10px 40px -12px rgba(255,204,71,.55); }
.btn-primary:hover { background: #FFD666; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Article */
main { padding: 40px 0 40px; }
.crumbs { font-size: 14px; color: var(--ink-faint); margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--ink-faint); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.eyebrow { font-weight: 800; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--trace); margin: 0 0 10px; }
h1 { font-size: clamp(34px, 6vw, 50px); line-height: 1.08; letter-spacing: -.02em; font-weight: 800; margin: 0 0 14px; }
h2 { font-size: clamp(24px, 3.4vw, 30px); line-height: 1.15; letter-spacing: -.015em; margin: 46px 0 10px; }
h3 { font-size: 19px; line-height: 1.25; letter-spacing: -.01em; margin: 28px 0 6px; }
p, li { color: var(--ink-soft); }
p { margin: 0 0 14px; }
.lede { font-size: clamp(18px, 2.2vw, 20px); color: var(--ink-soft); margin-bottom: 22px; }
ul, ol { padding-left: 22px; margin: 0 0 14px; }
li { margin-bottom: 6px; }
strong { color: var(--ink); }
.meta { color: var(--ink-faint); font-size: 14px; margin-bottom: 28px; }
.summary, .callout { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; color: var(--ink); margin: 0 0 18px; }
.callout p:last-child { margin-bottom: 0; }
.callout.tip { border-color: rgba(255,204,71,.28); }
.answer { background: var(--surface); border-left: 3px solid var(--trace); border-radius: 0 14px 14px 0; padding: 14px 18px; color: var(--ink); margin: 0 0 22px; }
.toc { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 20px; margin: 0 0 8px; font-size: 15px; }
.toc b { display: block; color: var(--ink); margin-bottom: 4px; }
.toc ol { margin: 0; }
.toc li { margin: 2px 0; }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--ink); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--ink); font-weight: 750; background: var(--panel); }
td { color: var(--ink-soft); }
tr:last-child td { border-bottom: 0; }
td a { color: var(--ink); }

/* Steps (exercises, plans) */
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 12px; margin: 0 0 18px; }
.steps > li { counter-increment: step; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px 16px 58px; margin: 0; }
.steps > li::before { content: counter(step); position: absolute; left: 16px; top: 15px; width: 28px; height: 28px; border-radius: 50%; background: rgba(255,204,71,.14); color: var(--trace); font-weight: 800; font-size: 15px; display: grid; place-items: center; }
.steps h3 { margin: 0 0 4px; }
.steps p { margin: 0 0 8px; }
.steps p:last-child { margin-bottom: 0; }
.steps .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.steps .time { font-size: 13px; font-weight: 750; color: var(--ink-faint); }

/* Card grid for related links */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin: 0 0 18px; }
.cards a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; text-decoration: none; transition: border-color .15s, transform .15s; }
.cards a:hover { border-color: rgba(255,255,255,.2); transform: translateY(-1px); }
.cards b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 2px; }
.cards span { color: var(--ink-faint); font-size: 14px; line-height: 1.45; display: block; }

/* Range chart (inline SVG) */
.chart { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 14px; margin: 6px 0 18px; overflow-x: auto; }
.chart svg { display: block; width: 100%; min-width: 560px; height: auto; }
.chart svg text { font-family: var(--rounded); }
.chart figcaption { font-size: 13px; color: var(--ink-faint); padding: 8px 4px 0; }

/* Tool card */
.tool { background: var(--panel); border: 1px solid var(--line); border-radius: 26px; padding: 22px; margin: 8px 0 26px; box-shadow: 0 40px 120px -50px rgba(0,0,0,.9); }
.tool-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tool-top .label { font-weight: 800; color: var(--ink); }
.seg { display: inline-flex; background: rgba(255,255,255,.06); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--ink-soft); font-weight: 700; font-size: 14px; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.level { position: relative; height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); margin-bottom: 14px; }
.level span { position: absolute; inset: 0; border-radius: 4px; background: rgba(255,255,255,.3); transform-origin: left; transform: scaleX(0); }
.level span.on { background: var(--green); }
.big-note { text-align: center; padding: 6px 0 2px; }
.big-note .n { font-size: clamp(56px, 12vw, 84px); font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.big-note .sub { color: var(--ink-faint); font-size: 15px; min-height: 1.6em; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.stats div { background: var(--surface); border-radius: 16px; padding: 12px; text-align: center; }
.stats b { display: block; font-size: 24px; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.stats span { font-size: 13px; color: var(--ink-faint); }
.keys { display: block; width: 100%; height: 74px; border-radius: 12px; margin: 4px 0 14px; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.tool .hint { text-align: center; color: var(--ink-soft); font-size: 15px; margin: 12px 0 0; min-height: 1.6em; }
.tool .err { text-align: center; color: var(--red); font-size: 15px; margin: 12px 0 0; }
.result { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; margin-top: 16px; }
.result h3 { margin: 0 0 6px; }
.result p:last-child { margin-bottom: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.pills li { margin: 0; font-size: 14px; font-weight: 700; padding: 4px 11px; border-radius: 999px; background: rgba(255,255,255,.07); color: var(--ink); font-variant-numeric: tabular-nums; }
.pills li.good { background: rgba(77,230,140,.14); color: var(--green); }
.pills li.ok { background: rgba(255,199,64,.14); color: var(--amber); }
.pills li.bad { background: rgba(255,97,77,.14); color: var(--red); }
.pills li.now { outline: 2px solid var(--trace); }
.meter { position: relative; height: 22px; border-radius: 7px; background: rgba(255,255,255,.06); margin: 6px 0 4px; }
.meter .zone { position: absolute; left: 40%; width: 20%; top: 0; bottom: 0; background: rgba(77,230,140,.15); border-radius: 4px; }
.meter b { position: absolute; top: 5px; bottom: 5px; width: 1px; background: rgba(255,255,255,.18); }
.meter span { position: absolute; top: 2px; bottom: 2px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--ink-faint); left: 50%; transition: left .06s linear; }
.progress { height: 6px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; margin: 10px 0 0; }
.progress span { display: block; height: 100%; width: 0; background: var(--green); border-radius: 6px; }

/* App promo */
.promo { display: flex; gap: 18px; align-items: center; background: linear-gradient(135deg, rgba(255,82,120,.12), rgba(255,204,71,.08)); border: 1px solid var(--line); border-radius: 22px; padding: 20px; margin: 40px 0 10px; }
.promo img { width: 64px; height: 64px; border-radius: 15px; flex-shrink: 0; }
.promo b { display: block; color: var(--ink); font-size: 18px; }
.promo p { margin: 2px 0 10px; font-size: 15px; }
@media (max-width: 520px) { .promo { flex-direction: column; align-items: flex-start; } }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 750; color: var(--ink); padding: 12px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--ink-faint); font-weight: 600; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 14px; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 34px 0 40px; color: var(--ink-faint); font-size: 14px; margin-top: 30px; }
footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 24px; max-width: 1100px; margin-bottom: 28px; }
footer .cols b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 8px; }
footer .cols a { display: block; padding: 3px 0; }
footer .base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: 1100px; }
footer .base nav { display: flex; gap: 20px; }
footer a { color: inherit; text-decoration: none; }
footer a:hover { color: var(--ink); }
:focus-visible { outline: 2.5px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  :root { --bg: #fff; --ink: #000; --ink-soft: #222; --ink-faint: #555; --surface: #fff; --panel: #fff; --line: #ccc; }
  body { background: #fff; color: #000; font-size: 12pt; }
  nav.top, footer, .promo, .tool, .cards, .crumbs, .toc, .btn, .steps .row, .faq, #faq { display: none !important; }
  .steps > li { break-inside: avoid; border-color: #ccc; }
  a { color: #000; text-decoration: none; }
}
