/* EQ Masters – shared styles. No external requests: system fonts only. */
:root {
  --bg: #f5f7ff;
  --surface: #ffffff;
  --ink: #12172b;
  --muted: #566080;
  --line: #e1e6f5;
  --blue: #1a5fe0;
  --blue-dark: #1448b0;
  --hero-a: #1f6fd8;
  --hero-b: #4a35c7;
  --purple: #6a43e6;
  --magenta: #c81ea0;
  --green: #2fcf6e;
  --panel: #14141b;
  --panel-2: #1e1e29;
  --panel-3: #2b2b3a;
  --panel-ink: #f0f0f7;
  --panel-muted: #a8a8bd;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(24, 34, 90, .12);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
img, svg, canvas { max-width: 100%; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-top: 0; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li { margin-bottom: .35em; }
:focus-visible { outline: 3px solid #60cdfc; outline-offset: 2px; }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -999px; top: 8px; background: #fff; color: var(--ink);
  padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); text-decoration: none; font-size: 1.15rem; }
.brand:hover { color: var(--ink); }
.brand svg { width: 30px; height: 30px; flex: none; }
.main-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.main-nav a.nav-link {
  color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: .95rem;
}
.main-nav a.nav-link:hover, .main-nav a.nav-link[aria-current="page"] { background: #eaeffc; color: var(--blue-dark); }
.nav-toggle {
  display: none; margin-left: auto; background: none; border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; text-decoration: none; line-height: 1.2;
  background: var(--blue); color: #fff; transition: background .15s, transform .15s;
}
.btn:hover { background: var(--blue-dark); color: #fff; transform: translateY(-1px); }
.btn-sm { padding: 9px 16px; font-size: .92rem; }
.btn-light { background: #fff; color: var(--blue-dark); }
.btn-light:hover { background: #eef3ff; color: var(--blue-dark); }
.btn-ghost { background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .5); }
.btn-ghost:hover { background: rgba(255, 255, 255, .28); color: #fff; }
.btn-dark { background: var(--panel-3); color: var(--panel-ink); font-weight: 600; padding: 10px 16px; border-radius: 12px; }
.btn-dark:hover { background: #3a3a4e; color: #fff; }
.btn-dark[aria-pressed="true"], .btn-dark.is-active { background: var(--purple); color: #fff; }
.btn-dark:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.cta-hint { font-size: .9rem; margin: 10px 0 0; opacity: .95; }

/* ---------- Hero ---------- */
.hero {
  color: #fff;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(255, 255, 255, .22), transparent 60%),
    linear-gradient(135deg, var(--hero-a), var(--hero-b));
  padding: 56px 0 64px;
}
.hero .lead { font-size: 1.2rem; max-width: 640px; opacity: .97; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-grid { display: grid; gap: 36px; align-items: center; }
.hero-visual img { width: 100%; height: auto; display: block; }
.hero.small { padding: 36px 0 40px; }
.hero.small h1 { margin-bottom: .35em; }
.hero.small .lead { font-size: 1.1rem; margin-bottom: 0; }
.breadcrumb { font-size: .9rem; margin-bottom: 14px; opacity: .95; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; opacity: .8; }
.breadcrumb a { color: #fff; }

/* ---------- Sections & cards ---------- */
section.block { padding: 52px 0; }
section.block.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-lead { color: var(--muted); max-width: 680px; font-size: 1.05rem; }
.grid { display: grid; gap: 18px; }
.cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; text-decoration: none; color: var(--ink); display: block; box-shadow: 0 2px 0 rgba(20, 30, 80, .03);
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
a.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #c8d3f5; color: var(--ink); }
.card h3 { margin-bottom: .3em; }
.card p { color: var(--muted); margin: 0; font-size: .96rem; }
.card .tag { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--purple); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.icon-badge { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--magenta), var(--purple)); color: #fff; font-size: 1.3rem; margin-bottom: 14px; }
.feature-list { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.feature-list li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0; }
.feature-list strong { display: block; }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.steps li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 18px 64px; position: relative; margin: 0; }
.steps li::before {
  content: counter(s); position: absolute; left: 16px; top: 16px; width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--magenta), var(--purple)); color: #fff; font-weight: 800; display: grid; place-items: center;
}
.cta-band {
  background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); color: #fff; border-radius: 20px;
  padding: 32px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between;
}
.cta-band h2 { color: #fff; margin-bottom: .25em; }
.cta-band p { margin: 0; opacity: .95; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f0f3fd; font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

/* ---------- FAQ ---------- */
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 0 18px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 15px 0; list-style-position: outside; }
.faq details[open] summary { color: var(--blue-dark); }
.faq details p { color: var(--muted); }

/* ---------- Tool panel (dark) ---------- */
.panel {
  background: var(--panel); color: var(--panel-ink); border-radius: 20px; padding: 24px;
  box-shadow: 0 18px 50px rgba(18, 24, 70, .3);
}
.panel h2, .panel h3 { color: var(--panel-ink); }
.panel .muted { color: var(--panel-muted); }
.panel-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.panel label.field { display: inline-flex; align-items: center; gap: 8px; color: var(--panel-muted); font-size: .92rem; }
.panel select {
  background: var(--panel-3); color: var(--panel-ink); border: 1px solid #44445a; border-radius: 10px;
  padding: 9px 12px; font: inherit; max-width: 100%;
}
.warn { background: #3a2f12; border: 1px solid #7a6420; color: #ffe9a8; border-radius: 12px; padding: 12px 14px; font-size: .93rem; margin-bottom: 16px; }
.status { min-height: 1.5em; font-size: .93rem; color: var(--panel-muted); }
.status.error { color: #ff9aa8; }
.dropzone {
  border: 2px dashed #4a4a63; border-radius: 14px; padding: 18px; display: flex; flex-wrap: wrap;
  gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; transition: border-color .15s, background .15s;
}
.dropzone.drag { border-color: var(--purple); background: rgba(106, 67, 230, .12); }
.dropzone .file-name { color: var(--panel-muted); word-break: break-all; flex: 1 1 200px; }
audio { width: 100%; margin-bottom: 16px; display: block; }
audio[hidden] { display: none; }

input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: #3d3d52; border-radius: 2px; }
input[type="range"]::-moz-range-track { height: 4px; background: #3d3d52; border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--purple); border: 2px solid #fff; margin-top: -9px; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--purple); border: 2px solid #fff; }
input[type="range"].green::-webkit-slider-thumb { background: var(--green); }
input[type="range"].green::-moz-range-thumb { background: var(--green); }

.sliders-inline { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: 16px; }
.slider-field { display: grid; gap: 6px; font-size: .92rem; color: var(--panel-muted); }
.slider-field .row { display: flex; justify-content: space-between; }
.slider-field output { color: var(--panel-ink); font-weight: 700; }
.slider-field input[type="range"] { width: 100%; height: 28px; }

.eq-canvas-wrap { background: var(--panel-2); border-radius: 14px; padding: 8px; margin-bottom: 14px; }
#eq-canvas { width: 100%; height: 190px; display: block; }
.bands { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 2px; margin-bottom: 18px; }
.band { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.band output { font-size: .75rem; color: var(--panel-muted); font-variant-numeric: tabular-nums; min-height: 1.2em; }
.band label { font-size: .78rem; color: var(--panel-ink); font-weight: 600; }
.vwrap { position: relative; width: 40px; height: 190px; }
.vwrap input[type="range"] { position: absolute; left: 50%; top: 50%; width: 190px; height: 40px; margin: -20px 0 0 -95px; transform: rotate(-90deg); }

/* ---------- Bass / headphone test ---------- */
.tone-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); margin-bottom: 16px; }
.tone-grid .btn-dark { padding: 14px 8px; font-variant-numeric: tabular-nums; }
.readout { font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.readout small { font-size: 1rem; font-weight: 600; color: var(--panel-muted); }
.progress { height: 8px; background: #2b2b3a; border-radius: 4px; overflow: hidden; margin: 10px 0 16px; }
.progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--magenta), var(--purple)); }
.result-box { background: var(--panel-2); border-radius: 12px; padding: 14px 16px; margin-top: 12px; color: var(--panel-ink); }
.result-box[hidden] { display: none; }
.cups { display: flex; justify-content: center; gap: 28px; margin: 6px 0 20px; }
.cup {
  width: 110px; height: 130px; border-radius: 60px 60px 40px 40px / 70px 70px 40px 40px; background: var(--panel-3);
  display: grid; place-items: center; font-size: 2rem; font-weight: 800; color: var(--panel-muted); border: 3px solid #43435a;
  transition: background .12s, color .12s, box-shadow .12s, border-color .12s;
}
.cup.on { background: linear-gradient(135deg, var(--magenta), var(--purple)); color: #fff; border-color: #fff; box-shadow: 0 0 40px rgba(200, 30, 160, .55); }

/* ---------- Preset charts & pages ---------- */
.eq-chart { width: 100%; height: auto; display: block; }
.eq-chart .zero { stroke: #cbd3ee; stroke-width: .5; }
.eq-chart rect.pos { fill: var(--purple); }
.eq-chart rect.neg { fill: var(--magenta); }
.eq-chart.big { background: var(--panel); border-radius: 16px; padding: 14px; }
.eq-chart.big .zero { stroke: #4a4a63; }
.chart-card { margin-top: 14px; }
.preset-layout { display: grid; gap: 24px; }
.copy-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.copy-status { font-size: .9rem; color: var(--muted); }
.note { background: #eef3ff; border: 1px solid #d2defa; border-radius: 12px; padding: 12px 16px; color: #2c3a73; font-size: .95rem; }

/* ---------- Footer ---------- */
.site-footer { background: #0f1430; color: #c4cae6; padding: 40px 0 28px; margin-top: 40px; font-size: .94rem; }
.site-footer a { color: #e7ebff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.site-footer h3 { color: #fff; font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .45em; }
.copyright { border-top: 1px solid #263059; margin-top: 28px; padding-top: 18px; font-size: .88rem; }

/* ---------- Responsive ---------- */
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.05fr 1fr; }
  .preset-layout { grid-template-columns: 1.1fr 1fr; align-items: start; }
}
@media (max-width: 800px) {
  .nav-toggle { display: inline-block; }
  .main-nav {
    display: none; position: absolute; left: 0; right: 0; top: 64px; background: #fff; border-bottom: 1px solid var(--line);
    padding: 12px 20px 18px; flex-direction: column; align-items: stretch; gap: 4px; box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .main-nav a.btn { margin-top: 8px; }
  .hero { padding: 40px 0 44px; }
  .panel { padding: 16px; border-radius: 16px; }
}
@media (max-width: 640px) {
  .bands { gap: 0; }
  .vwrap { width: 28px; height: 160px; }
  .vwrap input[type="range"] { width: 160px; margin: -20px 0 0 -80px; }
  .band label { font-size: .68rem; }
  .band output { font-size: .66rem; }
  #eq-canvas { height: 150px; }
  .cups { gap: 14px; }
  .cup { width: 92px; height: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Extras ---------- */
.mb { margin-bottom: 16px; }
.panel-title { font-size: 1.05rem; margin: 18px 0 10px; }
.chip-links { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-links a { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; text-decoration: none; font-weight: 600; font-size: .92rem; }
.chip-links a:hover { border-color: #b9c8f5; background: #f3f6ff; }
.card .eq-chart { margin-top: 14px; }
.panel .btn { font-size: .95rem; }
