:root {
  --bg: #fbfbfd;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0a84ff;
  --line: #d2d2d7;
  --shell: #2b2d31; /* цвет наушников, меняется из script.js */
  --nav-h: 68px;
  --maxw: 1080px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- Навигация ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,251,253,.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: rgba(0,0,0,.08); }

.nav__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 22px;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  transition: height .3s var(--ease);
}
.nav.is-scrolled .nav__inner { height: 52px; }

.nav__brand { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }

.nav__links { display: flex; align-items: center; gap: 30px; }
.nav__links a { font-size: 15px; color: var(--muted); transition: color .2s var(--ease); }
.nav__links a:hover { color: var(--ink); }
.nav__buy {
  background: var(--accent); color: #fff !important;
  padding: 7px 16px; border-radius: 980px; font-size: 14px;
}
.nav__buy:hover { filter: brightness(1.05); }

/* Переключатель языка */
.nav__lang {
  border: 1px solid var(--line); background: none; cursor: pointer;
  border-radius: 980px; padding: 5px 12px; font: inherit; font-size: 13px;
  color: var(--muted); display: inline-flex; align-items: center; gap: 4px;
  transition: border-color .2s var(--ease);
}
.nav__lang:hover { border-color: var(--ink); }
.nav__lang [data-lang] { transition: color .2s var(--ease); }
.nav__lang [data-lang].is-active { color: var(--ink); font-weight: 600; }
.nav__lang-sep { color: var(--line); }

.nav__toggle {
  display: none; width: 40px; height: 40px; border: 0; background: none;
  cursor: pointer; padding: 8px; flex-direction: column; justify-content: space-between;
}
.nav__toggle span {
  display: block; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform .3s var(--ease), opacity .2s var(--ease);
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Общие секции ---------- */
section { padding: clamp(72px, 12vw, 140px) 22px; }
.sound, .battery, .colors, .bento, .specs, .cta {
  max-width: var(--maxw); margin: 0 auto;
}

/* Анимация появления — прячем только при активном JS, чтобы без него контент был виден */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Наушники (SVG) ---------- */
.headphones { width: min(360px, 78vw); height: auto; display: block; }
.headphones__band, .headphones__cup rect:first-child { fill: var(--shell); stroke: var(--shell); transition: fill .6s var(--ease), stroke .6s var(--ease); }
.headphones__cup rect:first-child { fill: var(--shell); }
.headphones__pad { fill: rgba(0,0,0,.28); }
.headphones__shadow { fill: rgba(0,0,0,.12); }

/* ---------- Первый экран ---------- */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 20px;
  max-width: var(--maxw); margin: 0 auto;
}
.hero__title { font-size: clamp(44px, 9vw, 88px); }
.hero__sub { font-size: clamp(17px, 2.4vw, 22px); color: var(--muted); max-width: 30ch; margin: 0 auto; }
.hero__price { font-size: 19px; margin-top: 4px; }
.hero__links { display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; }
.hero__links a { color: var(--accent); font-size: 18px; }
.hero__links a:hover { text-decoration: underline; }
.hero__product { margin-top: 24px; }
.hero__product .headphones { animation: float 6s ease-in-out infinite; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

/* ---------- Звук ---------- */
.sound {
  background: #000; color: #f5f5f7; border-radius: 28px;
  max-width: calc(var(--maxw) + 80px);
  text-align: center;
}
.sound__intro { max-width: 24ch; margin: 0 auto clamp(48px, 8vw, 90px); }
.line { font-size: clamp(28px, 5vw, 48px); font-weight: 600; letter-spacing: -0.02em; }
.sound__lede { font-size: clamp(16px, 2.2vw, 20px); font-weight: 400; color: #a1a1a6; margin-top: 24px; max-width: 34ch; }

.stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 40px; justify-content: center; }
.stat { flex: 1 1 200px; }
.stat__num { display: block; font-size: clamp(44px, 8vw, 72px); font-weight: 600; letter-spacing: -0.03em; color: #fff; }
.stat__label { display: block; color: #a1a1a6; margin-top: 8px; font-size: 16px; }

/* ---------- Батарея ---------- */
.battery { display: grid; gap: 40px; align-items: center; }
.battery__text h2 { font-size: clamp(28px, 5vw, 44px); margin-bottom: 16px; }
.battery__text p { color: var(--muted); font-size: 18px; max-width: 46ch; }
.battery__track { height: 26px; background: #e3e3e8; border-radius: 980px; overflow: hidden; }
.battery__fill {
  height: 100%; width: 100%; /* без JS шкала заполнена */
  background: linear-gradient(90deg, #34c759, #30d158);
  border-radius: 980px; transition: width 1.6s var(--ease);
}
.js .battery__fill { width: 0; } /* при JS стартуем с нуля и анимируем */
.battery__scale { display: flex; justify-content: space-between; margin-top: 10px; color: var(--muted); font-size: 15px; }
.battery__value { font-weight: 600; color: var(--ink); }

/* ---------- Цвета ---------- */
.colors { text-align: center; }
.colors h2 { font-size: clamp(28px, 5vw, 44px); margin-bottom: 12px; }
.colors__stage { display: flex; justify-content: center; }
.headphones--mini { width: min(280px, 66vw); }
.colors__name { font-size: 18px; color: var(--muted); margin: 8px 0 24px; }
.colors__swatches { display: flex; gap: 16px; justify-content: center; }
.swatch {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  background: var(--dot); border: 2px solid var(--line);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.swatch:hover { transform: scale(1.08); }
.swatch.is-active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }

/* ---------- Bento ---------- */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.bento__tile {
  grid-column: span 2;
  background: #fff; border: 1px solid var(--line); border-radius: 22px;
  padding: 34px; display: flex; flex-direction: column; gap: 12px;
}
.bento__tile--wide { grid-column: span 4; }
.bento__tile h3 { font-size: 24px; }
.bento__tile p { color: var(--muted); font-size: 16px; }
.ic { width: 44px; height: 44px; stroke: var(--accent); fill: none; }
.ic circle { fill: var(--accent); stroke: none; }

/* ---------- Характеристики ---------- */
.specs h2 { font-size: clamp(28px, 5vw, 44px); text-align: center; margin-bottom: 40px; }
.specs__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.specs__table { width: 100%; border-collapse: collapse; min-width: 520px; }
.specs__table th, .specs__table td { padding: 18px 16px; text-align: left; border-bottom: 1px solid var(--line); font-size: 16px; }
.specs__table thead th { font-size: 18px; }
.specs__table tbody th { font-weight: 500; color: var(--muted); }
.specs__table td { font-variant-numeric: tabular-nums; }

/* ---------- Финальный призыв ---------- */
.cta { text-align: center; }
.cta h2 { font-size: clamp(36px, 7vw, 68px); margin-bottom: 28px; }
.btn {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 13px 30px; border-radius: 980px; font-size: 18px;
  transition: filter .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.cta__fine { color: var(--muted); font-size: 14px; margin-top: 22px; max-width: 40ch; margin-left: auto; margin-right: auto; }

/* ---------- Подвал ---------- */
.footer { border-top: 1px solid var(--line); padding: 56px 22px 40px; }
.footer__cols { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.footer__col h4 { font-size: 14px; margin-bottom: 12px; }
.footer__col a { display: block; color: var(--muted); font-size: 14px; padding: 5px 0; }
.footer__col a:hover { color: var(--ink); }
.footer__copy { max-width: var(--maxw); margin: 40px auto 0; color: var(--muted); font-size: 13px; }

/* ---------- Адаптивность ---------- */
@media (max-width: 720px) {
  .nav__links {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; align-items: flex-start; gap: 4px;
    background: rgba(251,251,253,.96);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    padding: 16px 22px 24px; border-bottom: 1px solid var(--line);
    transform: translateY(-120%); transition: transform .35s var(--ease);
  }
  .nav__links a { font-size: 18px; padding: 10px 0; width: 100%; }
  .nav__links.is-open { transform: translateY(0); }
  .nav__buy { align-self: flex-start; margin-top: 6px; }
  .nav__toggle { display: flex; }

  .bento { grid-template-columns: 1fr; }
  .bento__tile, .bento__tile--wide { grid-column: 1; }
  .footer__cols { grid-template-columns: 1fr 1fr; }

  .config__panel { grid-template-columns: 1fr; }
  .config__preview { border-radius: 24px 24px 0 0; padding: 24px; }
  .config__form { padding: 26px 22px; }
}

@media (min-width: 721px) {
  .battery { grid-template-columns: 1fr 1fr; }
}

/* ---------- Раздел «Внутри» (раскрывающийся корпус) ---------- */
.inside { padding: 0; max-width: none; }
.inside__track { position: relative; height: 240vh; }
.inside__sticky {
  position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(16px, 4vh, 40px); padding: 24px; text-align: center;
}
.inside__head h2 { font-size: clamp(28px, 5vw, 44px); }
.inside__lede { color: var(--muted); font-size: clamp(15px, 2vw, 18px); max-width: 34ch; margin: 12px auto 0; }

.cutaway { width: min(760px, 94vw); height: auto; }
.cutaway__shell path { fill: var(--shell); transition: fill .6s var(--ease); }
.cutaway__shell { transition: transform .15s linear; }
.cutaway__layer { transition: transform .15s linear; }
.cutaway__disc { fill: #e9e9ee; stroke: var(--line); stroke-width: 1.5; }
.cutaway__ring { fill: none; stroke: #b9b9c2; stroke-width: 2; }
.cutaway__center { fill: var(--accent); }
.cutaway__chip-core { fill: #34c759; }
.cutaway__pins { stroke: #8a8a94; }
.cutaway__batt-core { fill: #c9c9d1; }
.cutaway__batt-nub { fill: #b9b9c2; }
.cutaway__callout { transition: opacity .2s linear, transform .2s linear; }
.cutaway__callout line { stroke: var(--muted); stroke-width: 1.5; }
.cutaway__callout circle { fill: var(--accent); }
.cutaway__callout text { fill: var(--ink); font-size: 17px; font-weight: 600; }
.cutaway__callout .cutaway__sub { fill: var(--muted); font-size: 13px; font-weight: 400; }

/* ---------- Конфигуратор (оверлей) ---------- */
body.no-scroll { overflow: hidden; }

.config { max-width: var(--maxw); margin: 0 auto; }
.js .config {
  position: fixed; inset: 0; z-index: 90; margin: 0; max-width: none;
  display: none; align-items: center; justify-content: center;
  background: rgba(20,20,22,.5);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 20px;
}
.js .config.is-open { display: flex; }
.config__panel {
  background: var(--bg); border-radius: 24px; width: min(920px, 100%);
  max-height: 92vh; overflow: auto; position: relative;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  box-shadow: 0 30px 80px rgba(0,0,0,.25);
}
.config__close {
  position: absolute; top: 14px; right: 16px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255,255,255,.7); cursor: pointer; font-size: 22px; line-height: 1;
  color: var(--ink); transition: background .2s var(--ease);
}
.config__close:hover { background: #fff; }
.config__preview {
  display: flex; align-items: center; justify-content: center;
  background: #f0f0f4; border-radius: 24px 0 0 24px; padding: 32px;
}
.headphones--config { width: min(300px, 70vw); }
.headphones__engrave { fill: rgba(255,255,255,.9); font-size: 18px; font-weight: 600; letter-spacing: .02em; }

.config__form { padding: 36px 34px; }
.config__form h2 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 24px; }
.config__group { border: 0; padding: 0; margin: 0 0 26px; }
.config__group legend { font-size: 14px; color: var(--muted); margin-bottom: 12px; padding: 0; }

.opt { display: flex; align-items: center; margin-bottom: 10px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; gap: 12px;
  transition: border-color .2s var(--ease); }
.opt:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.opt input { accent-color: var(--accent); width: 18px; height: 18px; }
.opt__body { display: flex; justify-content: space-between; width: 100%; align-items: baseline; }
.opt__name { font-weight: 600; }
.opt__price { color: var(--muted); font-size: 14px; }

.config__swatches { display: flex; gap: 14px; }
.config__colorname { margin-top: 12px; color: var(--muted); font-size: 15px; }

.config__input {
  width: 100%; font: inherit; font-size: 16px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
}
.config__input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.config__hint { color: var(--muted); font-size: 13px; margin-top: 8px; }

.config__footer { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--line); padding-top: 22px; flex-wrap: wrap; }
.config__total-label { color: var(--muted); font-size: 14px; display: block; }
.config__total-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ---------- Модальное окно заказа ---------- */
.order { display: none; }
.js .order {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(20,20,22,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.js .order.is-open { display: flex; }
.order__box {
  position: relative; background: var(--bg); border-radius: 22px; padding: 36px 34px;
  width: min(440px, 100%); box-shadow: 0 30px 80px rgba(0,0,0,.28); text-align: left;
}
.order__box h2 { font-size: 26px; margin-bottom: 22px; }
.order__list { margin: 0 0 20px; }
.order__list > div { display: flex; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--line); }
.order__list dt { color: var(--muted); font-size: 15px; margin: 0; }
.order__list dd { margin: 0; font-weight: 500; text-align: right; }
.order__total { border-bottom: 0 !important; }
.order__total dt, .order__total dd { font-size: 20px; font-weight: 600; }
.order__total dd { font-variant-numeric: tabular-nums; }
.order__note { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.order__ok { width: 100%; text-align: center; }

/* ---------- Уважаем prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero__product .headphones { animation: none; }
  .js .battery__fill { width: 100%; transition: none; }
  .headphones__band, .headphones__cup rect:first-child { transition: none; }
  /* «Внутри»: без движения корпус сразу раскрыт, выноски видны */
  .inside__track { height: auto; }
  .inside__sticky { position: static; height: auto; }
  .cutaway__shell, .cutaway__layer, .cutaway__callout { transition: none; }
  * { scroll-behavior: auto !important; }
}
