:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f0f3f8;
  --text: #121722;
  --muted: #667085;
  --line: #dfe4ec;
  --accent: #5b5bd6;
  --accent-2: #4444b8;
  --good: #18794e;
  --warn: #9a6700;
  --bad: #b42318;
  --shadow: 0 18px 50px rgba(18, 23, 34, 0.08);
  --radius: 18px;
  --max: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: inherit; }
button, select { font: inherit; }
button { cursor: pointer; }

.container { width: min(calc(100% - 32px), var(--max)); margin: 0 auto; }
.site-header {
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid rgba(223, 228, 236, .85);
  background: rgba(247, 248, 251, .92);
  backdrop-filter: blur(14px);
}
.nav { min-height: 72px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -.03em; font-size: 1.18rem; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent);
  position: relative; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}
.brand-mark::before { content: ""; position: absolute; left: 50%; top: 6px; width: 10px; height: 15px; border: 2px solid white; border-radius: 8px; transform: translateX(-50%); }
.brand-mark::after { content: ""; position: absolute; left: 50%; top: 16px; width: 16px; height: 9px; border: 2px solid white; border-top: 0; border-radius: 0 0 10px 10px; transform: translateX(-50%); }
.nav-links { display: flex; gap: 20px; margin-left: auto; }
.nav-links a { text-decoration: none; color: #3d4654; font-weight: 600; font-size: .95rem; }
.language-select { margin-left: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 10px; color: var(--text); }

.hero { padding: 72px 0 26px; text-align: center; }
.eyebrow { display: inline-flex; padding: 7px 11px; border: 1px solid #d8d8ff; background: #efefff; color: #4141b0; border-radius: 999px; font-size: .82rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
h1 { margin: 18px auto 14px; max-width: 850px; line-height: 1.02; font-size: clamp(2.5rem, 7vw, 5.2rem); letter-spacing: -.06em; }
.hero p { max-width: 760px; margin: 0 auto; color: var(--muted); font-size: clamp(1rem, 2vw, 1.18rem); }
.trust-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.trust-chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; font-size: .85rem; color: #4a5565; }

.tester-shell { padding: 20px 0 50px; }
.tester {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden;
}
.tester-head { padding: 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tester-head h2 { margin: 0; font-size: 1.28rem; letter-spacing: -.02em; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: .83rem; }
.status-dot { width: 8px; height: 8px; border-radius: 999px; background: #98a2b3; }
.status-pill[data-state="active"] { background: #ecfdf3; color: var(--good); }
.status-pill[data-state="active"] .status-dot { background: #12b76a; box-shadow: 0 0 0 4px rgba(18,183,106,.14); }
.status-pill[data-state="error"] { background: #fff1f0; color: var(--bad); }
.status-pill[data-state="error"] .status-dot { background: var(--bad); }
.tester-body { padding: 24px; }
.device-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; margin-bottom: 20px; }
label { font-size: .84rem; font-weight: 800; color: #344054; display: block; margin-bottom: 7px; }
.device-select { width: 100%; border: 1px solid var(--line); padding: 12px 14px; border-radius: 12px; background: white; color: var(--text); }
.btn { border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 800; transition: transform .15s ease, background .15s ease, opacity .15s ease; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--accent-2); }
.btn-secondary { background: #eef0f4; color: #2f3744; }
.btn-danger { background: #fff0ee; color: var(--bad); }
.controls { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.monitor { display: grid; grid-template-columns: 1.4fr .6fr; gap: 18px; margin-top: 18px; }
.panel { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: #fbfcfe; }
.panel h3 { margin: 0 0 12px; font-size: .92rem; }
.meter-track { height: 22px; border-radius: 999px; background: linear-gradient(90deg,#d1fadf 0 65%,#fef0c7 65% 85%,#fee4e2 85% 100%); position: relative; overflow: hidden; }
.meter-fill { position: absolute; inset: 0 auto 0 0; width: 0%; background: rgba(18,23,34,.28); border-right: 2px solid #111827; transition: width .07s linear; }
.meter-labels { display: flex; justify-content: space-between; color: #7b8493; font-size: .72rem; margin-top: 7px; }
.live-value { font-size: 2.1rem; font-weight: 850; letter-spacing: -.05em; line-height: 1; margin: 10px 0 5px; }
.live-sub { color: var(--muted); font-size: .85rem; }
canvas { width: 100%; height: 120px; display: block; border-radius: 12px; background: #f1f3f7; }
.sound-check { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-weight: 800; }
.sound-icon { width: 12px; height: 12px; border-radius: 999px; background: #98a2b3; }
.sound-check[data-heard="true"] .sound-icon { background: #12b76a; box-shadow: 0 0 0 5px rgba(18,183,106,.12); }

.guide { margin-top: 20px; border: 1px solid #dcdcff; background: #f7f7ff; padding: 18px; border-radius: 16px; }
.guide strong { display: block; margin-bottom: 4px; }
.guide p { margin: 0; color: #5f6472; }
.progress { height: 8px; background: #e1e3e9; border-radius: 999px; overflow: hidden; margin-top: 13px; }
.progress > span { display: block; height: 100%; width: 0%; background: var(--accent); transition: width .1s linear; }

.results { margin-top: 26px; display: none; }
.results.visible { display: block; }
.results-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.results-header h2 { margin: 0; letter-spacing: -.03em; }
.readiness { text-align: right; }
.score { font-size: 2rem; font-weight: 900; letter-spacing: -.05em; line-height: 1; }
.score-label { font-size: .76rem; color: var(--muted); margin-top: 5px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; min-height: 122px; }
.stat-card .kicker { color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .value { font-size: 1.45rem; font-weight: 900; letter-spacing: -.03em; margin: 7px 0 3px; }
.stat-card .explain { color: var(--muted); font-size: .82rem; line-height: 1.4; }
.recommendations { margin-top: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcfe; padding: 18px; }
.recommendations h3 { margin: 0 0 10px; }
.recommendations ul { margin: 0; padding-left: 20px; color: #525b69; }
.tech-details { margin-top: 14px; }
.tech-details summary { cursor: pointer; font-weight: 850; }
.tech-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px; margin-top: 12px; color: #525b69; font-size: .9rem; }

.recording { margin-top: 16px; display: none; }
.recording.visible { display: block; }
audio { width: 100%; margin-top: 10px; }

.ad-slot { width: min(calc(100% - 32px), var(--max)); min-height: 110px; margin: 16px auto 54px; border: 1px dashed #b8c0cd; border-radius: 14px; background: #f0f2f5; display: grid; place-items: center; color: #7d8795; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }

.section { padding: 62px 0; }
.section.white { background: var(--surface); border-block: 1px solid var(--line); }
.section h2 { margin: 0 0 12px; font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.045em; line-height: 1.1; }
.section-intro { color: var(--muted); max-width: 760px; margin: 0 0 30px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.white .card { background: #fbfcfe; }
.card h3 { margin: 0 0 8px; font-size: 1rem; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; }
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.step { position: relative; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.step::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #ededff; color: var(--accent-2); font-weight: 900; margin-bottom: 16px; }
.step h3 { margin: 0 0 6px; }
.step p { margin: 0; color: var(--muted); }

.faq { max-width: 880px; }
.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-weight: 850; }
.faq p { color: var(--muted); margin-bottom: 0; }

.footer { padding: 42px 0; background: #111723; color: #d5d9e0; }
.footer-grid { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: start; }
.footer p { color: #9da5b2; max-width: 620px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer a { color: #d5d9e0; text-decoration: none; }

.notice { padding: 12px 14px; border-radius: 12px; background: #fff8e6; border: 1px solid #f7d77b; color: #6e5500; font-size: .88rem; margin-top: 14px; }
.error-box { display:none; margin-top: 16px; padding: 14px; border-radius: 12px; background:#fff1f0; border:1px solid #f5c5c1; color:#8e251d; }
.error-box.visible { display:block; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .language-select { margin-left: auto; }
  .monitor { grid-template-columns: 1fr; }
  .stat-grid, .cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .container { width: min(calc(100% - 20px), var(--max)); }
  .hero { padding-top: 48px; }
  .tester-head, .tester-body { padding: 18px; }
  .device-row { grid-template-columns: 1fr; }
  .stat-grid, .cards { grid-template-columns: 1fr; }
  .results-header { align-items: flex-start; flex-direction: column; }
  .readiness { text-align: left; }
  .tech-list { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .ad-slot { min-height: 90px; margin-bottom: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}


/* V2 motion + search-intent section */
.intent-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.intent-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 21px; }
.intent-card h3 { margin: 0 0 8px; font-size: 1.03rem; letter-spacing: -.015em; }
.intent-card p { margin: 0; color: var(--muted); font-size: .93rem; }
.intent-section { position: relative; overflow: hidden; }
.intent-section::before { content:""; position:absolute; width:360px; height:360px; border-radius:50%; background:radial-gradient(circle, rgba(91,91,214,.075), transparent 68%); right:-140px; top:-140px; pointer-events:none; }

/* Opening animation: calm, fast and non-blocking. */
.hero .eyebrow { animation: mg-rise .55s cubic-bezier(.2,.75,.25,1) both; }
.hero h1 { animation: mg-rise .62s .06s cubic-bezier(.2,.75,.25,1) both; }
.hero > .container > p { animation: mg-rise .62s .12s cubic-bezier(.2,.75,.25,1) both; }
.hero .trust-row { animation: mg-rise .62s .18s cubic-bezier(.2,.75,.25,1) both; }
.tester-shell > .container > .tester { animation: mg-rise .68s .22s cubic-bezier(.2,.75,.25,1) both; }
@keyframes mg-rise { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }

/* Scroll reveals only become hidden when JS is available. */
.js [data-reveal] { opacity:0; transform:translateY(18px); transition:opacity .62s ease, transform .62s cubic-bezier(.2,.75,.25,1); }
.js [data-reveal].is-visible { opacity:1; transform:none; }
.js [data-reveal="cards"] > * { opacity:0; transform:translateY(12px); transition:opacity .48s ease, transform .48s ease; }
.js [data-reveal="cards"].is-visible > * { opacity:1; transform:none; }
.js [data-reveal="cards"].is-visible > *:nth-child(2) { transition-delay:.04s; }
.js [data-reveal="cards"].is-visible > *:nth-child(3) { transition-delay:.08s; }
.js [data-reveal="cards"].is-visible > *:nth-child(4) { transition-delay:.12s; }
.js [data-reveal="cards"].is-visible > *:nth-child(5) { transition-delay:.16s; }
.js [data-reveal="cards"].is-visible > *:nth-child(6) { transition-delay:.20s; }
.js [data-reveal="cards"].is-visible > *:nth-child(7) { transition-delay:.24s; }
.js [data-reveal="cards"].is-visible > *:nth-child(8) { transition-delay:.28s; }

@media (max-width: 900px) { .intent-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .hero .eyebrow, .hero h1, .hero > .container > p, .hero .trust-row, .tester-shell > .container > .tester { animation:none !important; }
  .js [data-reveal], .js [data-reveal] > * { opacity:1 !important; transform:none !important; }
}


/* V3 live monitor + quality gauge */
.monitor-warning { display:none; margin:12px 0 0; padding:10px 12px; border:1px solid #f2c76f; border-radius:12px; background:#fff9e8; color:#75520b; font-size:.9rem; }
.monitor-warning.visible { display:block; }
#monitor-btn[aria-pressed="true"] { box-shadow: inset 0 0 0 2px rgba(91,91,214,.22); background:#ededff; }
.results-header { align-items:flex-start; gap:24px; }
.quality-wrap { display:flex; flex-direction:column; align-items:center; min-width:220px; }
.semi-gauge { width:210px; height:120px; position:relative; overflow:hidden; display:flex; justify-content:center; }
.gauge-arc { --score:0; position:absolute; width:200px; height:200px; border-radius:50%; background:conic-gradient(from 270deg, #5b5bd6 0deg calc(var(--score) * 1.8deg), #e6e8ef calc(var(--score) * 1.8deg) 180deg, transparent 180deg 360deg); }
.gauge-arc::after { content:""; position:absolute; inset:22px; border-radius:50%; background:var(--surface,#fff); }
.gauge-center { position:absolute; top:48px; z-index:2; text-align:center; }
.gauge-number { font-size:2rem; line-height:1; font-weight:800; letter-spacing:-.04em; }
.gauge-number small { font-size:.9rem; color:var(--muted); margin-left:2px; }
.gauge-title { margin-top:7px; font-size:.82rem; font-weight:700; color:var(--muted); }
.gauge-compare { max-width:230px; margin:4px 0 0; color:var(--muted); text-align:center; font-size:.82rem; line-height:1.35; }
.gauge-note { max-width:250px; margin:5px 0 0; color:var(--muted); text-align:center; font-size:.72rem; opacity:.9; }
@media (max-width:760px){ .results-header{flex-direction:column;} .quality-wrap{width:100%;} }
