/* testmyheadphones — shared design system (light, warm) */

:root {
  --bg: #faf6f1;
  --surface: #ffffff;
  --card: #ffffff;
  --card-2: #fdf8f5;
  --border: #ecdfe6;
  --border-bright: #dcc8d8;
  --text: #372f3c;
  --muted: #7a6f80;
  --faint: #a99fae;
  --accent: #e5568c;
  --accent-2: #8b6ff0;
  --good: #2fa77c;
  --warn: #c9781f;
  --bad: #d94f6a;
  --grad: linear-gradient(135deg, #f27ba5, #8b6ff0);
  --shadow-soft: 0 4px 20px rgba(90, 60, 90, 0.06);
  --radius: 16px;
  --radius-s: 10px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1100px 520px at 50% -120px, rgba(242, 123, 165, 0.12), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(229, 86, 140, 0.22); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; line-height: 1.15; font-weight: 600; }

.wrap { max-width: 1020px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- header ---------- */

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 32px);
  max-width: 1020px; margin: 0 auto;
}

.logo {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-family: var(--font-display); font-weight: 700;
  font-size: 1.05rem;
}
.logo:hover { text-decoration: none; color: var(--accent); }
.logo svg { flex: none; }

/* ---------- hero (home) ---------- */

.hero { text-align: center; padding: clamp(40px, 8vw, 88px) 0 24px; }

.hero h1 {
  font-size: clamp(2.3rem, 6.5vw, 4.2rem);
  margin-bottom: 18px;
}

.hero .sub {
  color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.2rem);
  max-width: 620px; margin: 0 auto 30px;
}

.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.hero-wave { width: 100%; height: 130px; display: block; margin: 34px auto 8px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px;
  border: 1px solid var(--border-bright);
  background: var(--surface); color: var(--text);
  font: 600 0.95rem/1 var(--font-body);
  cursor: pointer; user-select: none;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { border-color: var(--accent); text-decoration: none; box-shadow: 0 0 0 3px rgba(229, 86, 140, 0.12); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary {
  background: var(--grad); border: none; color: #fff;
  box-shadow: 0 8px 24px rgba(229, 86, 140, 0.28);
}
.btn-primary:hover { box-shadow: 0 10px 30px rgba(229, 86, 140, 0.4); }

.btn-ghost { background: transparent; box-shadow: none; }

.btn-huge { padding: 20px 44px; font-size: 1.15rem; }

.btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: rgba(229, 86, 140, 0.08);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.pulsing { animation: pulseGlow 1.3s ease-in-out infinite; }
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 8px 24px rgba(229, 86, 140, 0.28); transform: scale(1); }
  50% { box-shadow: 0 8px 38px rgba(229, 86, 140, 0.5); transform: scale(1.03); }
}

/* ---------- test cards grid (home) ---------- */

.section-title { font-size: 1.5rem; margin: 48px 0 18px; }

.tests-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px; margin-bottom: 16px;
}

.test-card {
  display: block; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; color: var(--text);
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.test-card:hover {
  text-decoration: none; transform: translateY(-3px);
  border-color: var(--border-bright);
  box-shadow: 0 14px 34px rgba(139, 111, 240, 0.14);
}
.test-card .num {
  font: 600 0.75rem/1 var(--font-body); color: var(--faint);
  letter-spacing: 0.12em;
}
.test-card h3 { font-size: 1.12rem; margin: 10px 0 6px; }
.test-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.chip {
  display: inline-block; margin-top: 12px; padding: 3px 10px;
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 0.72rem; color: var(--faint);
}

/* ---------- feature bullets / faq ---------- */

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-soft); }
.feature h3 { font-size: 1rem; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 0.9rem; }

.faq details {
  border: 1px solid var(--border); border-radius: var(--radius-s);
  padding: 14px 18px; margin-bottom: 10px; background: var(--surface);
}
.faq summary { cursor: pointer; font-weight: 600; font-size: 0.97rem; }
.faq p { color: var(--muted); font-size: 0.93rem; margin-top: 10px; }

/* ---------- test page layout ---------- */

.test-page { max-width: 760px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }

.crumb { font-size: 0.85rem; color: var(--faint); margin: 8px 0 22px; }
.crumb a { color: var(--faint); }
.crumb a:hover { color: var(--accent); }

.test-page h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin-bottom: 12px; }
.lede { color: var(--muted); font-size: 1.05rem; margin-bottom: 26px; max-width: 60ch; }

.stage {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: clamp(20px, 4vw, 34px);
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  text-align: center; margin-bottom: 30px;
  box-shadow: var(--shadow-soft);
}

.viz {
  width: 100%; height: 110px; display: block;
  background: #fdf7fa; border: 1px solid var(--border); border-radius: var(--radius-s);
}

.readout {
  font: 600 clamp(2.4rem, 7vw, 3.6rem)/1.1 var(--font-display);
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  color: transparent; font-variant-numeric: tabular-nums;
}
.readout-label { color: var(--faint); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }

.stage-hint { color: var(--muted); font-size: 0.92rem; max-width: 48ch; }

input[type="range"] { accent-color: var(--accent); width: min(320px, 80%); height: 32px; }

.warn {
  border-left: 3px solid var(--warn);
  background: rgba(201, 120, 31, 0.07);
  padding: 12px 16px; border-radius: 0 var(--radius-s) var(--radius-s) 0;
  font-size: 0.9rem; color: #7c5a2b; margin-bottom: 26px;
}
.warn strong { color: var(--warn); }

.result-card {
  background: linear-gradient(var(--card), var(--card)) padding-box,
              var(--grad) border-box;
  border: 1px solid transparent; border-radius: var(--radius);
  padding: 26px; text-align: center;
  box-shadow: var(--shadow-soft);
}
.result-card .verdict { color: var(--muted); margin-top: 8px; font-size: 0.95rem; }

.status-good { color: var(--good); }
.status-warn { color: var(--warn); }
.status-bad { color: var(--bad); }

/* prose / notes below the stage */

.prose h2 { font-size: 1.25rem; margin: 34px 0 10px; }
.prose p, .prose li { color: #574d5e; font-size: 0.95rem; max-width: 68ch; }
.prose ul { padding-left: 20px; margin: 10px 0; }
.prose li { margin-bottom: 6px; }

table.small {
  border-collapse: collapse; margin: 14px 0; font-size: 0.9rem;
}
table.small th, table.small td {
  border: 1px solid var(--border); padding: 7px 14px; text-align: left; color: #574d5e;
}
table.small th { color: var(--text); background: #f8f0f5; font-family: var(--font-body); font-weight: 600; }

/* pager */

.pager { display: flex; justify-content: space-between; gap: 12px; margin: 44px 0 20px; }
.pager a {
  flex: 1; max-width: 47%; padding: 14px 18px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-s);
  color: var(--text); font-size: 0.9rem;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.15s ease;
}
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager a small { display: block; color: var(--faint); font-size: 0.75rem; margin-bottom: 2px; }
.pager .next { text-align: right; margin-left: auto; }

/* ---------- vertical volume control ---------- */

.volctl {
  position: fixed; right: 14px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 14px 10px; z-index: 60;
  box-shadow: 0 8px 28px rgba(90, 60, 90, 0.14);
  color: var(--muted);
}
.volctl-track {
  position: relative; width: 8px; height: min(34vh, 240px);
  background: #efe2eb; border-radius: 999px; cursor: pointer; touch-action: none;
}
.volctl-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.volctl-fill {
  position: absolute; bottom: 0; left: 0; width: 100%;
  border-radius: 999px; background: var(--grad); height: 25%;
}
.volctl-thumb {
  position: absolute; left: 50%; transform: translateX(-50%);
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent);
  box-shadow: 0 2px 8px rgba(229, 86, 140, 0.35);
  bottom: calc(25% - 10px); pointer-events: none;
}
.volctl-pct { font: 600 0.72rem var(--font-body); color: var(--faint); min-width: 2.6em; text-align: center; }

/* On wide screens, dock the volume control next to the content column
   instead of floating at the far screen edge. */
@media (min-width: 940px) {
  .volctl { right: auto; left: calc(50% - 380px - 40px); }
}

/* ---------- imaging / binaural visuals ---------- */

.soundstage {
  position: relative; width: min(420px, 100%); height: 56px;
  border: 1px solid var(--border); border-radius: 999px;
  background: linear-gradient(90deg, rgba(242, 123, 165, 0.14), rgba(139, 111, 240, 0.08), rgba(242, 123, 165, 0.14));
}
.soundstage .dot {
  position: absolute; top: 50%; left: 50%; width: 18px; height: 18px;
  transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--grad);
  box-shadow: 0 0 14px rgba(229, 86, 140, 0.65);
  transition: left 0.12s linear;
}
.soundstage .lbl {
  position: absolute; top: -22px; font-size: 0.7rem; color: var(--faint);
  letter-spacing: 0.1em;
}

.headviz { width: 220px; height: 220px; }

/* ---------- ear cups (left/right test) ---------- */

.earcups { display: flex; gap: 90px; align-items: center; }
.cup {
  width: 74px; height: 74px; border-radius: 50%;
  border: 2px solid var(--border-bright); background: var(--card-2);
  display: flex; align-items: center; justify-content: center;
  font: 600 1.4rem var(--font-display); color: var(--faint);
  transition: all 0.15s ease; position: relative;
}
.cup.on {
  border-color: var(--accent); color: var(--accent);
  box-shadow: 0 0 26px rgba(229, 86, 140, 0.4), inset 0 0 14px rgba(229, 86, 140, 0.12);
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: 70px; border-top: 1px solid var(--border);
  padding: 34px clamp(16px, 4vw, 32px) 44px;
  background: #f6eef2;
}
.footer-inner { max-width: 1020px; margin: 0 auto; }
.footer-links {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px 18px; margin-bottom: 22px;
}
.footer-links a { color: var(--muted); font-size: 0.87rem; }
.footer-links a:hover { color: var(--accent); }
.fineprint { color: var(--faint); font-size: 0.8rem; max-width: 72ch; }

@media (max-width: 900px) {
  .has-vol .test-page { padding-right: 58px; }
  .volctl { right: 8px; padding: 12px 8px; }
}

@media (max-width: 560px) {
  .earcups { gap: 40px; }
  .pager a { max-width: 100%; }
  .btn-huge { padding: 14px 16px; font-size: 1rem; }
  .btn-row { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulsing { animation: none; }
  .test-card, .btn { transition: none; }
}
