/* ============ Шрифты (свои, работают офлайн) ============ */

/* Наборы урезаны до знаков, которые сайту действительно нужны: 119 -> 70 КБ.
   Латиница оставлена целиком, потому что заголовочным шрифтом рисуется имя
   пользователя и почта (.profile-head strong). Кириллица — русский, украинский
   и белорусский; сербские и македонские буквы убраны за ненадобностью.
   Имена файлов с пометкой -v2, чтобы у вернувшихся посетителей не остался
   старый тяжёлый набор из кэша. */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("assets/fonts/manrope-var-cyrillic-v2.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("assets/fonts/manrope-var-latin-v2.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("assets/fonts/unbounded-var-cyrillic-v2.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("assets/fonts/unbounded-var-latin-v2.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}

/* ============ Темы ============ */
/* Система радиусов: карточки 18px, кнопки и поля 12px, чипы pill. */

:root {
  /* ---- Типографика: 6 ступеней интерфейса + display-ярус ----
     Раньше тут жило 23 разных размера, из них десять — в полосе 10.5-15px,
     где разницу в полпикселя не видит никто. Шаги выбраны так, чтобы самые
     ходовые размеры не сдвинулись вовсе, а сдвиги остальных были <=1.5px. */
  --fs-1: 12px;   /* микро: бейджи, мелкие подписи */
  --fs-2: 13px;   /* подписи, вторичный текст */
  --fs-3: 14px;   /* основной текст интерфейса */
  --fs-4: 16px;   /* подзаголовки, акценты */
  --fs-5: 19px;   /* заголовки блоков, крупные глифы */
  --fs-6: 26px;   /* верх шкалы */
  /* display-ярус: осознанно отдельный, каждый размер под свой уровень */
  --fs-display: 32px;
  --fs-lead: clamp(15px, 1.7vw, 18px);
  --fs-h3: clamp(17px, 2vw, 22px);
  --fs-h2: clamp(26px, 3.4vw, 44px);
  --fs-h1: clamp(42px, 5.6vw, 60px);
  --fs-hero: clamp(44px, 7.4vw, 104px);

  --r-card: 18px;
  --r-ctrl: 12px;
  --r-chip: 999px;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.44, 1);
  --content: 1180px;
  --cta-grad: linear-gradient(135deg, #f6d982, #b67a24);
  --cta-ink: #120d05;
  --topbar-h: 68px;

  /* Полночь (тёмное золото) */
  --bg: #050505;
  --text: #f3ead7;
  --muted: #b9ad94;
  /* Подписи в карточке статистики давали 4,33 на тёмном — чуть светлее до нормы */
  --faint: #968b6e;
  --gold: #d8a84e;
  --gold-soft: #f4d27a;
  --gold-dim: #9b8b6b;
  --line: rgba(244, 210, 122, 0.2);
  --line-strong: rgba(244, 210, 122, 0.5);
  --input-bg: rgba(255, 255, 255, 0.045);
  --chip-active-bg: rgba(216, 168, 78, 0.16);
  --panel-solid: #12100b;
  --glass-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015) 38%, rgba(16, 13, 9, 0.5));
  --glass-border: rgba(244, 210, 122, 0.18);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --glass-sheen: rgba(255, 255, 255, 0.1);
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.38);
  --cta-shadow: rgba(216, 168, 78, 0.26);
  --wave-a: 232, 196, 118;
  --wave-b: 96, 156, 176;
  --grain-line: rgba(255, 255, 255, 0.05);
  --stage-bg:
    radial-gradient(circle at 72% 24%, rgba(216, 168, 78, 0.16), transparent 36%),
    radial-gradient(circle at 10% 85%, rgba(82, 143, 168, 0.12), transparent 30%),
    linear-gradient(180deg, #050505 0%, #0b0907 60%, #050505 100%);
  --emblem-glow: drop-shadow(0 0 34px rgba(244, 210, 122, 0.3));
  --emblem-glow-strong: drop-shadow(0 0 52px rgba(244, 210, 122, 0.45));
  --dialog-bg: #0d0b08;
  --toast-bg: rgba(13, 11, 8, 0.94);
  --toast-text: #f3ead7;
  --track-a: rgba(216, 168, 78, 0.55);
  --track-b: rgba(216, 168, 78, 0.18);
  --tabbar-bg: rgba(10, 9, 6, 0.82);
  --petal-a: #f4d27a;
  --petal-b: #b67a24;
  --danger: #e08a80;
}

/* «Свет» — чистая белая тема. Держим бумагу белой, а глубину даём
   границами и мягкими тенями, иначе на белом всё выглядит плоским. */
html[data-theme="light"] {
  /* Было чистое #ffffff — белые карточки сливались с белым фоном и держались
     только на волосяной рамке. Тёплый почти-белый фон даёт карточкам отделиться,
     оставаясь заметно светлее и холоднее кремовой «Бумаги». */
  --bg: #f5f2ec;
  --text: #1c1810;
  --muted: #575040;
  --faint: #6b6252;
  --gold: #8a6410;
  --gold-soft: #7c5a14;
  --gold-dim: #6e6248;
  --line: rgba(28, 24, 16, 0.14);
  --line-strong: rgba(122, 90, 20, 0.5);
  --input-bg: rgba(28, 24, 16, 0.04);
  --chip-active-bg: rgba(138, 100, 16, 0.12);
  --panel-solid: #ffffff;
  --glass-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.92), rgba(252, 251, 248, 0.72));
  --glass-border: rgba(122, 90, 20, 0.16);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 1);
  --glass-sheen: rgba(255, 255, 255, 0.8);
  --shadow-soft: 0 14px 38px rgba(40, 34, 20, 0.1);
  --cta-shadow: rgba(150, 108, 30, 0.24);
  --wave-a: 150, 116, 40;
  --wave-b: 90, 130, 150;
  --grain-line: rgba(28, 24, 16, 0.035);
  --stage-bg:
    radial-gradient(circle at 72% 24%, rgba(216, 168, 78, 0.13), transparent 42%),
    radial-gradient(circle at 10% 85%, rgba(120, 160, 180, 0.1), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbfaf7 62%, #ffffff 100%);
  --emblem-glow: drop-shadow(0 16px 32px rgba(60, 48, 22, 0.24));
  --emblem-glow-strong: drop-shadow(0 18px 44px rgba(90, 70, 26, 0.36));
  --dialog-bg: #ffffff;
  --toast-bg: rgba(38, 32, 20, 0.95);
  --toast-text: #f6f0e2;
  --track-a: rgba(122, 90, 20, 0.6);
  --track-b: rgba(28, 24, 16, 0.14);
  --tabbar-bg: rgba(255, 255, 255, 0.9);
  --petal-a: #c99a3a;
  --petal-b: #8a6410;
  --danger: #b0483c;
}

html[data-theme="paper"] {
  --bg: #efe6d0;
  --text: #2b2214;
  --muted: #63563e;
  /* Третий уровень текста. Был #665738 — от --muted он отличался на 1,018,
     то есть глазом никак: сноски звучали так же громко, как основной текст.
     #6f6042 даёт контраст к фону 4,93 (норма 4,5) и заметный шаг вниз. */
  --faint: #6f6042;
  --gold: #8a5a20;
  --gold-soft: #7c4f16;
  /* Частота на карточке пресета давала 4,45 — на волос ниже нормы 4,5 */
  --gold-dim: #6b5a39;
  --line: rgba(110, 78, 30, 0.28);
  --line-strong: rgba(110, 78, 30, 0.58);
  --input-bg: rgba(110, 78, 30, 0.07);
  /* Подложка выбранной фишки была плотнее, и надпись на ней давала 4,38.
     Фишка и без того отличается рамкой, поэтому заливку ослабляем. */
  --chip-active-bg: rgba(138, 90, 32, 0.1);
  --panel-solid: #f7efdc;
  --glass-bg: linear-gradient(160deg, rgba(255, 250, 238, 0.8), rgba(250, 240, 218, 0.5));
  --glass-border: rgba(90, 64, 24, 0.2);
  --glass-inset: inset 0 1px 0 rgba(255, 252, 242, 0.9);
  --glass-sheen: rgba(255, 252, 240, 0.6);
  --shadow-soft: 0 14px 36px rgba(96, 72, 32, 0.16);
  --cta-shadow: rgba(140, 96, 34, 0.3);
  --wave-a: 140, 100, 40;
  --wave-b: 110, 120, 90;
  --grain-line: rgba(110, 78, 30, 0.07);
  --stage-bg:
    radial-gradient(circle at 72% 24%, rgba(180, 130, 50, 0.18), transparent 40%),
    linear-gradient(180deg, #f2e9d4 0%, #eadfc4 60%, #efe6d0 100%);
  --emblem-glow: drop-shadow(0 16px 30px rgba(96, 70, 30, 0.35));
  --emblem-glow-strong: drop-shadow(0 18px 42px rgba(120, 86, 34, 0.5));
  --dialog-bg: #f7efdc;
  --toast-bg: rgba(62, 48, 26, 0.95);
  --toast-text: #f7f0de;
  --track-a: rgba(110, 78, 30, 0.6);
  --track-b: rgba(110, 78, 30, 0.22);
  --tabbar-bg: rgba(247, 239, 220, 0.88);
  --petal-a: #c08a34;
  --petal-b: #8a5a20;
  --danger: #a8473a;
}

/* ============ База ============ */

* { box-sizing: border-box; }

/* Атрибут hidden сильнее любых display-правил компонентов */
[hidden] { display: none !important; }

/* Скрытая ссылка «сразу к звуку» для клавиатуры */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-ctrl);
  background: var(--cta-grad);
  color: var(--cta-ink);
  font-weight: 800;
  transform: translateY(-64px);
  opacity: 0;
  pointer-events: none;
}
.skip-link:focus-visible {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

html[data-theme="paper"] body {
  background-image:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(110, 78, 30, 0.016) 3px 4px),
    repeating-linear-gradient(90deg, transparent 0 3px, rgba(110, 78, 30, 0.014) 3px 4px);
}

button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.05;
}
p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

::selection { background: rgba(216, 168, 78, 0.35); }

.section,
.stage { scroll-margin-top: 84px; }

/* Жидкое стекло: слоистая подсветка + блюр. Web-аппроксимация, не системный материал. */
.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-card);
  box-shadow: var(--glass-inset), var(--shadow-soft);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, var(--glass-sheen), transparent 34%);
  opacity: 0.5;
  pointer-events: none;
}

/* Раньше баннер был 720px по центру низа и перекрывал ползунки и кнопки,
   пока человек не ответит. Теперь это скромная карточка в левом нижнем углу —
   привычное место, важное не закрывает. */
.privacy-consent {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 120;
  width: min(400px, calc(100% - 32px));
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 16px 18px;
}
.privacy-consent[hidden] { display: none; }
.privacy-consent strong { display: block; margin-bottom: 4px; }
.consent-more { color: var(--gold-soft); text-decoration: underline; text-underline-offset: 2px; }
.privacy-consent p { color: var(--muted); font-size: var(--fs-2); line-height: 1.4; }
.privacy-consent-actions { display: grid; grid-template-columns: repeat(2, minmax(132px, 1fr)); gap: 10px; }
.privacy-consent-actions > * { min-height: 44px; }
.glass > * { position: relative; }

@media (prefers-reduced-transparency: reduce) {
  .glass {
    background: var(--panel-solid);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .glass::before { display: none; }
}

/* Иконки-штрихи внутри кнопок и навигации */
.layer-toggle svg,
.icon-toggle svg,
.tabbar a svg,
.to-top svg,
.avatar svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

/* ============ Прогресс скролла ============ */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  width: 100%;
  height: 3px;
  background: var(--cta-grad);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

/* ============ Шапка ============ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  height: var(--topbar-h);
  padding: 0 clamp(16px, 4vw, 56px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: height 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.topbar.is-scrolled {
  height: 58px;
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
}
.topbar.is-hidden { transform: translateY(-100%); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: 0 0 22px var(--cta-shadow);
}
.brand span { display: grid; line-height: 1.05; }
.brand strong { font-family: var(--display); font-size: var(--fs-4); }
.brand em {
  color: var(--gold-soft);
  font-style: normal;
  font-size: var(--fs-1);
  letter-spacing: 0.04em;
}

.topnav {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  padding: 9px 12px;
  color: var(--muted);
  font-size: var(--fs-3);
  white-space: nowrap;
  border-radius: var(--r-chip);
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.topnav a:hover { color: var(--text); background: var(--input-bg); }
.topnav a.is-current {
  color: var(--gold-soft);
  background: var(--chip-active-bg);
}

.topbar-side {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 0 auto;
}

.theme-toggle,
.icon-toggle,
.profile-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  background: var(--input-bg);
  color: var(--muted);
  font-size: var(--fs-2);
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.theme-toggle:hover,
.icon-toggle:hover,
.profile-btn:hover { color: var(--text); border-color: var(--line-strong); }

/* Значок темы: солнце на светлых, месяц на тёмной. Обе иконки лежат
   друг на друге и меняются местами — так переход читается как смена дня и ночи. */
.theme-ico {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--gold);
}
.theme-ico svg {
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.28s var(--ease), transform 0.42s var(--ease);
}
.ico-sun { opacity: 1; transform: none; }
.ico-moon { opacity: 0; transform: rotate(90deg) scale(0.5); }
html[data-theme="gold"] .ico-sun { opacity: 0; transform: rotate(-90deg) scale(0.5); }
html[data-theme="gold"] .ico-moon { opacity: 1; transform: none; }
.theme-toggle:hover .theme-ico { color: var(--gold-soft); }

/* Значок установки: стрелка, уходящая в устройство. Сама кнопка оформлена
   как остальные в шапке, отличается только рисунком. */
.ico-install {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--gold);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.install-btn:hover .ico-install { color: var(--gold-soft); }

/* Кнопка «поделиться миксом» под полем сохранения */
.share-mix {
  width: 100%;
  margin-top: 10px;
}

/* Живые цифры под заголовком: сколько человек здесь прямо сейчас */
.live-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 26px;
  font-size: var(--fs-3);
  color: var(--muted);
}
.live-line b {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.live-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #46a97a;
  animation: livePulse 2.6s var(--ease) infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(70, 169, 122, 0.5); }
  70%  { box-shadow: 0 0 0 9px rgba(70, 169, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(70, 169, 122, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}

/* Быстрый подбор: что включить под конкретную задачу */
.quick-pick {
  display: grid;
  /* Было 3 колонки с зазором 26px — список притворялся сеткой карточек под ним,
     но не попадал в неё. Две широкие колонки читаются как советы, а не как плитки. */
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 10px 12px;
  margin: 14px 0 40px;
  padding: 0;
  list-style: none;
}
.quick-pick li {
  position: relative;
  padding-left: 16px;
  font-size: var(--fs-3);
  line-height: 1.5;
  color: var(--muted);
}
.quick-pick li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}
.quick-pick b { color: var(--text); font-weight: 700; }

/* Переключение «вход ↔ регистрация» внизу диалога */
.auth-switch {
  margin: 15px 0 0;
  text-align: center;
  font-size: var(--fs-3);
  color: var(--muted);
}

.profile-btn .avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--chip-active-bg);
  font-size: var(--fs-2);
  line-height: 1;
}
.profile-btn.is-authed { color: var(--gold-soft); border-color: var(--line-strong); }

/* ============ Герой ============ */

.stage {
  position: relative;
  min-height: calc(100dvh - var(--topbar-h));
  display: flex;
  align-items: center;
  padding: clamp(28px, 5vh, 64px) clamp(18px, 4vw, 64px);
  isolation: isolate;
  overflow: hidden;
  background: var(--stage-bg);
}

#waveCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.85;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grain-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grain-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, #000 0%, transparent 76%);
  -webkit-mask-image: radial-gradient(circle at center, #000 0%, transparent 76%);
}

.hero-grid {
  width: min(var(--content), 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.78fr);
  align-items: center;
  /* Было clamp(32,6vw,90) — между заголовком и эмблемой зияло до 340px пустоты.
     Сузили зазор, чтобы правая колонка подошла ближе к тексту. */
  gap: clamp(24px, 3.4vw, 56px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold-soft);
  font-size: var(--fs-1);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  font-size: var(--fs-hero);
  line-height: 0.92;
  letter-spacing: -0.01em;
}

.lead {
  max-width: 620px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: var(--fs-h3);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.primary-action,
.ghost-action {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctrl);
  padding: 0 22px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s var(--spring), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.primary-action {
  background: var(--cta-grad);
  color: var(--cta-ink);
  border-color: transparent;
  font-weight: 800;
  box-shadow: 0 16px 50px var(--cta-shadow);
}
.primary-action:hover { box-shadow: 0 18px 60px var(--cta-shadow); transform: translateY(-1px); }
.primary-action:active { transform: scale(0.98); }

.ghost-action {
  background: var(--input-bg);
}
.ghost-action:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.ghost-action:active { transform: scale(0.98); }

.play-icon {
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid currentColor;
}
.is-playing .play-icon {
  width: 14px;
  height: 16px;
  border: 0;
  background: linear-gradient(90deg, currentColor 0 35%, transparent 35% 65%, currentColor 65%);
}

/* Орб с эмблемой */

.orb-panel {
  display: grid;
  justify-items: center;
  gap: 22px;
}

.emblem-orb {
  position: relative;
  width: min(430px, 74vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.emblem-orb img {
  width: 88%;
  height: 88%;
  filter: var(--emblem-glow);
  animation: orb-breathe 7s var(--ease) infinite;
}
.is-playing .emblem-orb img { filter: var(--emblem-glow-strong); }

.ring-line {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: inset 0 0 34px var(--cta-shadow), 0 0 34px var(--cta-shadow);
  opacity: 0.55;
}
.ring-line-a { animation: ring-breathe 7s ease-in-out infinite; }
.ring-line-b {
  inset: 7%;
  border-style: dashed;
  animation: ring-spin 34s linear infinite;
}
.ring-line-c {
  inset: 16%;
  opacity: 0.4;
  animation: ring-breathe 5.5s ease-in-out infinite reverse;
}

.now-playing {
  width: min(400px, 100%);
  display: grid;
  gap: 8px;
  padding: 18px 20px;
}
.np-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.np-head > span:first-child { color: var(--gold-soft); font-weight: 800; }
.now-playing strong {
  font-family: var(--display);
  font-size: var(--fs-display);
  font-weight: 700;
}
.now-playing strong small {
  font-family: var(--body);
  font-size: var(--fs-3);
  font-weight: 600;
  color: var(--muted);
  margin-left: 6px;
}
.now-playing small { color: var(--muted); line-height: 1.45; }
.now-playing .hp-hint { color: var(--faint); font-size: var(--fs-1); }

/* Эквалайзер: живой отклик, когда звук играет */
.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
  height: 16px;
  flex: 0 0 auto;
}
.eq i {
  width: 3px;
  height: 30%;
  border-radius: 2px;
  background: var(--gold);
  opacity: 0.3;
  transition: opacity 0.4s var(--ease);
}
body.is-playing .eq i {
  opacity: 1;
  animation: eq-bounce 1.1s ease-in-out infinite;
}
body.is-playing .eq i:nth-child(2) { animation-delay: 0.18s; }
body.is-playing .eq i:nth-child(3) { animation-delay: 0.36s; }
body.is-playing .eq i:nth-child(4) { animation-delay: 0.52s; }

/* ============ Секции ============ */

.section {
  width: min(var(--content), calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(72px, 10vw, 120px) 0 0;
}

.section-heading { max-width: 640px; }
.section-heading h2,
.breath-copy h2,
.support-card h2 {
  font-size: var(--fs-h2);
}
.sub {
  margin-top: 14px;
  color: var(--muted);
  font-size: var(--fs-lead);
  line-height: 1.6;
  max-width: 60ch;
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ============ Пресеты ============ */

.cat-row { margin-top: 26px; }

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.preset-card {
  min-height: 190px;
  display: grid;
  align-content: space-between;
  gap: 22px;
  padding: 20px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-card);
  background: var(--glass-bg);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--glass-inset);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.25s var(--spring);
}
.preset-card.featured {
  grid-column: span 2;
  background:
    radial-gradient(circle at 85% 15%, var(--chip-active-bg), transparent 46%),
    var(--glass-bg);
}
.preset-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
  box-shadow: var(--glass-inset), var(--shadow-soft);
}
.preset-card:active { transform: scale(0.99); }
.preset-card.is-active {
  border-color: var(--line-strong);
  box-shadow: var(--glass-inset), var(--shadow-soft), inset 0 0 48px var(--chip-active-bg);
}

.preset-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.preset-badges {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.preset-card .card-eq { display: none; }
body.is-playing .preset-card.is-active .card-eq { display: inline-flex; }

.preset-band {
  padding: 4px 12px;
  font-size: var(--fs-1);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  color: var(--gold-soft);
}
.band-delta { color: #9db8d8; border-color: rgba(157, 184, 216, 0.35); }
.band-theta { color: #a8c8b8; border-color: rgba(168, 200, 184, 0.35); }
.band-alpha { color: var(--gold-soft); }
.band-beta { color: #e8b98a; border-color: rgba(232, 185, 138, 0.4); }
.band-gamma { color: #d8a2a2; border-color: rgba(216, 162, 162, 0.4); }

html[data-theme="light"] .band-delta, html[data-theme="paper"] .band-delta { color: #3c5a7c; border-color: rgba(60, 90, 124, 0.45); }
html[data-theme="light"] .band-theta, html[data-theme="paper"] .band-theta { color: #3e6e56; border-color: rgba(62, 110, 86, 0.45); }
html[data-theme="light"] .band-beta, html[data-theme="paper"] .band-beta { color: #8a5a20; border-color: rgba(138, 90, 32, 0.45); }
html[data-theme="light"] .band-gamma, html[data-theme="paper"] .band-gamma { color: #96443c; border-color: rgba(150, 68, 60, 0.45); }

.preset-hz { color: var(--gold-dim); font-weight: 700; font-size: var(--fs-3); }
.preset-body strong {
  display: block;
  margin-bottom: 8px;
  font-size: var(--fs-5);
  font-family: var(--display);
  font-weight: 600;
}
.preset-body p { color: var(--muted); line-height: 1.5; font-size: var(--fs-3); }

/* ============ Студия ============ */

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 12px;
  margin-top: 30px;
  align-items: start;
}

.channel-rack { display: grid; gap: 12px; }

.channel { padding: 24px; }

.channel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.channel h3 { font-size: var(--fs-5); font-weight: 600; }
.channel-note { color: var(--faint); font-size: var(--fs-2); max-width: 34ch; }
.field-hint { display: block; margin-top: 4px; color: var(--faint); font-size: var(--fs-1); }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button,
.chip-row button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  background: var(--input-bg);
  color: var(--muted);
  cursor: pointer;
  font-size: var(--fs-3);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.seg button:hover,
.chip-row button:hover { color: var(--text); }
.seg button.is-active,
.chip-row button.is-active {
  background: var(--chip-active-bg);
  color: var(--gold-soft);
  border-color: var(--line-strong);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.slider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.slider-grid.one { grid-template-columns: minmax(0, 1fr); max-width: 420px; }

.slider-grid label,
.master-vol {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: var(--fs-3);
}
.slider-grid output,
.master-vol output {
  color: var(--gold-soft);
  font-weight: 700;
}
.slider-grid label > span,
.master-vol > span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

/* Слайдеры */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 34px;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--track-a), var(--track-b));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg);
  box-shadow: 0 0 12px var(--cta-shadow);
}
input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--track-a), var(--track-b));
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg);
  box-shadow: 0 0 12px var(--cta-shadow);
}

/* Слои атмосферы */
.layer-list { display: grid; gap: 10px; }
.layer {
  display: grid;
  grid-template-columns: 40px 118px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.layer-preview {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--input-bg);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.2s var(--spring);
}
.layer-preview svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  margin-left: 2px;
}
.layer-preview:hover { color: var(--gold-soft); border-color: var(--line-strong); transform: scale(1.06); }
.layer-preview.is-previewing {
  color: var(--gold-soft);
  border-color: var(--line-strong);
  background: var(--chip-active-bg);
  animation: preview-pulse 1.2s ease-in-out infinite;
}
.layer-toggle {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  background: var(--input-bg);
  color: var(--muted);
  cursor: pointer;
  font-size: var(--fs-3);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.layer.is-on .layer-toggle {
  background: var(--chip-active-bg);
  color: var(--gold-soft);
  border-color: var(--line-strong);
}
.layer input { opacity: 0.55; transition: opacity 0.25s var(--ease); }
.layer.is-on input { opacity: 1; }

/* Правая колонка */
.side-rack { display: grid; gap: 12px; }

.master-card,
.mixes-card { padding: 24px; }
.master-card h3,
.mixes-card h3 { font-size: var(--fs-5); font-weight: 600; margin-bottom: 16px; }

.transport { margin-bottom: 18px; }
.transport-btn {
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--cta-grad);
  color: var(--cta-ink);
  border: 0;
  border-radius: var(--r-ctrl);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 40px var(--cta-shadow);
  transition: transform 0.2s var(--spring), box-shadow 0.3s var(--ease);
}
.transport-btn:hover { box-shadow: 0 16px 50px var(--cta-shadow); }
.transport-btn:active { transform: scale(0.98); }

.sleep-block { margin-top: 22px; }
.sleep-block h4 {
  font-size: var(--fs-2);
  font-weight: 600;
  color: var(--muted);
  font-family: var(--body);
  margin-bottom: 10px;
}
.sleep-readout {
  margin-top: 12px;
  color: var(--faint);
  font-size: var(--fs-2);
}

.mix-save {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.mix-save input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctrl);
  background: var(--input-bg);
  color: var(--text);
}
.mix-save input::placeholder { color: var(--faint); }
.mix-save button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctrl);
  background: var(--chip-active-bg);
  color: var(--gold-soft);
  font-weight: 700;
  cursor: pointer;
}
.mix-save button:active { transform: scale(0.98); }

.mix-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.mix-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.mix-apply {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctrl);
  background: var(--input-bg);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color 0.25s var(--ease);
}
.mix-apply:hover { border-color: var(--line-strong); }
.mix-del {
  width: 40px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctrl);
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  font-size: var(--fs-5);
}
.mix-del:hover { color: var(--text); border-color: var(--line-strong); }
.mixes-empty { margin-top: 14px; color: var(--faint); font-size: var(--fs-2); }

/* ============ Фокус / помодоро ============ */

.focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
  margin-top: 30px;
  align-items: start;
}

.pomo-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(28px, 3.4vw, 48px);
}

.pomo-ring-wrap {
  position: relative;
  width: min(320px, 72vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.pomo-ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.pomo-track,
.pomo-fg {
  fill: none;
  stroke-width: 6;
}
.pomo-track { stroke: var(--line); }
.pomo-fg {
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-dasharray: 779.11;
  stroke-dashoffset: 779.11;
  transition: stroke-dashoffset 0.3s linear, stroke 0.4s var(--ease);
}
.pomo-card.is-break .pomo-fg { stroke: #7fae96; }

.pomo-readout {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}
.pomo-readout strong {
  font-family: var(--display);
  font-size: var(--fs-h1);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pomo-readout span { color: var(--gold-soft); font-weight: 700; font-size: var(--fs-3); }
.pomo-readout small { color: var(--faint); font-size: var(--fs-2); }

.pomo-dots {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.pomo-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.pomo-dots i.is-done { background: var(--gold); border-color: var(--gold); }
.pomo-dots i.is-now {
  border-color: var(--gold);
  animation: dot-pulse 1.6s ease-in-out infinite;
}

.pomo-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.pomo-main {
  min-height: 50px;
  padding: 0 28px;
  background: var(--cta-grad);
  color: var(--cta-ink);
  border: 0;
  border-radius: var(--r-ctrl);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s var(--spring), box-shadow 0.3s var(--ease);
  box-shadow: 0 12px 36px var(--cta-shadow);
}
.pomo-main:active { transform: scale(0.98); }
.pomo-secondary {
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctrl);
  background: var(--input-bg);
  color: var(--muted);
  cursor: pointer;
}
.pomo-secondary:hover { color: var(--text); border-color: var(--line-strong); }

.pomo-plan {
  margin: 0 0 16px;
  color: var(--faint);
  font-size: var(--fs-2);
}

.pomo-tip {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: var(--r-ctrl);
  background: var(--chip-active-bg);
  color: var(--gold-soft);
  font-size: var(--fs-3);
  max-width: 46ch;
}

.pomo-settings { display: grid; gap: 16px; }
.pomo-setting {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: var(--fs-2);
  font-weight: 600;
}
.setting-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
input[type="number"] {
  width: 84px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctrl);
  background: var(--input-bg);
  color: var(--text);
}
input[type="number"]::placeholder { color: var(--faint); }

.pomo-auto {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: var(--fs-3);
  cursor: pointer;
}
.pomo-auto input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}

/* Статистика */

.stats-card { padding: 24px; }
.stats-card h3 { font-size: var(--fs-5); font-weight: 600; margin-bottom: 18px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.stat {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctrl);
  background: var(--input-bg);
}
.stat span {
  color: var(--faint);
  font-size: var(--fs-1);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.stat strong {
  font-family: var(--display);
  font-size: var(--fs-3);
  font-weight: 600;
  line-height: 1.25;
  color: var(--gold-soft);
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
}

.week-wrap { margin-top: 18px; }
.week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.week-head h4 {
  font-family: var(--body);
  font-size: var(--fs-2);
  font-weight: 600;
  color: var(--muted);
  margin: 0;
}
.range-chips button {
  min-height: 34px;
  padding: 0 12px;
  font-size: var(--fs-1);
}
.week-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 56px;
}
.week-bar {
  flex: 1;
  min-height: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  opacity: 0.9;
}
.week-bar.is-empty {
  background: var(--input-bg);
  border: 1px dashed var(--line);
}
.week-days {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.week-days span {
  flex: 1;
  text-align: center;
  color: var(--faint);
  font-size: var(--fs-1);
  overflow: hidden;
  white-space: nowrap;
}

.data-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.data-actions button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctrl);
  background: var(--input-bg);
  color: var(--muted);
  cursor: pointer;
  font-size: var(--fs-2);
}
.data-actions button:hover { color: var(--text); border-color: var(--line-strong); }

.stats-note { margin-top: 16px; color: var(--faint); font-size: var(--fs-2); }

/* ============ Дыхание ============ */

#breath .breath-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

.breath-copy .chip-row { margin-top: 22px; }
.breath-desc {
  margin: 16px 0 24px;
  color: var(--muted);
  max-width: 52ch;
  font-size: var(--fs-3);
  line-height: 1.6;
}

.breath-stagearea {
  display: grid;
  place-items: center;
  min-height: 380px;
}

.breath-scene {
  position: relative;
  width: min(340px, 82vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  --phase-dur: 4s;
}

.breath-halo {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--chip-active-bg) 0%, transparent 68%);
  box-shadow: 0 0 70px var(--cta-shadow);
  filter: blur(2px);
  transform: scale(0.7);
  transition: transform var(--phase-dur) linear, opacity 0.8s var(--ease);
  opacity: 0.7;
}

.breath-petals {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: scale(0.68) rotate(-6deg);
  transition: transform var(--phase-dur) linear;
}
.breath-scene.is-in .breath-petals,
.breath-scene.is-hold-in .breath-petals { transform: scale(1.1) rotate(9deg); }
.breath-scene.is-out .breath-petals,
.breath-scene.is-hold-out .breath-petals { transform: scale(0.68) rotate(-6deg); }
.breath-scene.is-in .breath-halo,
.breath-scene.is-hold-in .breath-halo { transform: scale(1.05); }
.breath-scene.is-out .breath-halo,
.breath-scene.is-hold-out .breath-halo { transform: scale(0.7); }
.breath-scene.is-hold-in .breath-petals,
.breath-scene.is-hold-out .breath-petals { transition-timing-function: ease-in-out; }
.breath-scene.is-out { --petal-a: #7fb6a6; --petal-b: #4f7f8e; }
html[data-theme="light"] .breath-scene.is-out,
html[data-theme="paper"] .breath-scene.is-out { --petal-a: #4f8f7c; --petal-b: #35635c; }

.breath-particles { position: absolute; inset: 0; pointer-events: none; }
.breath-particles i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-soft);
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}
.breath-scene.is-running .breath-particles i {
  opacity: 0.55;
  animation: particle-float 7s ease-in-out infinite;
}
.breath-particles i:nth-child(1) { left: 18%; top: 62%; animation-delay: 0s; }
.breath-particles i:nth-child(2) { left: 78%; top: 56%; animation-delay: 1.1s; }
.breath-particles i:nth-child(3) { left: 30%; top: 24%; animation-delay: 2.3s; width: 4px; height: 4px; }
.breath-particles i:nth-child(4) { left: 66%; top: 20%; animation-delay: 3.4s; }
.breath-particles i:nth-child(5) { left: 10%; top: 38%; animation-delay: 4.2s; width: 4px; height: 4px; }
.breath-particles i:nth-child(6) { left: 86%; top: 34%; animation-delay: 5.3s; }

.breath-core {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
}
.breath-core span {
  font-family: var(--display);
  font-size: var(--fs-5);
  font-weight: 600;
  color: var(--text);
}
/* В «Полночи» в состоянии покоя лепестки сходятся под надписью, и светлый текст
   ложится на золото: контраст падает до 3,15 при норме 4,5. Во время цикла
   лепестки расходятся, под текстом уже тёмный фон и контраст 13,8 и выше —
   поэтому красить текст тёмным нельзя, он пропадёт на всё упражнение.
   Кладём под надпись мягкое тёмное пятно: на золоте оно работает, на тёмном
   фоне его не видно. */
html[data-theme="gold"] .breath-core::before {
  content: "";
  position: absolute;
  inset: -14px -30px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(6, 5, 3, 0.78), rgba(6, 5, 3, 0));
  pointer-events: none;
}
html[data-theme="gold"] .breath-core span,
html[data-theme="gold"] .breath-core small {
  position: relative;
}
.breath-core small {
  font-family: var(--display);
  font-size: var(--fs-3);
  color: var(--gold-soft);
  min-height: 20px;
  font-variant-numeric: tabular-nums;
}

/* ============ Наука ============ */

.science-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
}
.sketch-art {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 40px var(--cta-shadow));
}

.science-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 60px);
  margin-top: 30px;
  align-items: start;
}

.bands h3,
.science-notes h3 {
  font-size: var(--fs-5);
  font-weight: 600;
  margin-bottom: 18px;
}

.band-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
}
.band-item strong {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--fs-4);
  color: var(--gold-soft);
}
.band-item span {
  display: block;
  color: var(--gold-dim);
  font-size: var(--fs-2);
  font-weight: 700;
  margin: 2px 0 6px;
}
.band-item p { color: var(--muted); font-size: var(--fs-3); line-height: 1.55; }

.science-notes p {
  color: var(--muted);
  line-height: 1.65;
  font-size: var(--fs-3);
}
.science-notes p + p { margin-top: 14px; }

.howto-title { margin-top: 26px; }
.howto-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: var(--fs-3);
  line-height: 1.55;
  display: grid;
  gap: 8px;
}

/* Исследования */
.research-block { margin-top: clamp(40px, 6vw, 64px); }
.research-block h3 { font-size: var(--fs-5); font-weight: 600; }
.research-sub {
  margin-top: 10px;
  color: var(--muted);
  font-size: var(--fs-3);
  max-width: 62ch;
}
.research-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.research-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-card);
  background: var(--glass-bg);
  box-shadow: var(--glass-inset);
  transition: border-color 0.3s var(--ease), transform 0.25s var(--spring), box-shadow 0.3s var(--ease);
}
.research-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
  box-shadow: var(--glass-inset), var(--shadow-soft);
}
.research-tag {
  justify-self: start;
  padding: 3px 10px;
  font-size: var(--fs-1);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold-dim);
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
}
.research-card strong {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--fs-3);
  line-height: 1.3;
}
.research-card p { color: var(--muted); font-size: var(--fs-2); line-height: 1.55; }
.research-card em {
  font-style: normal;
  color: var(--gold-soft);
  font-size: var(--fs-2);
  font-weight: 700;
}
.research-card em::after { content: " ↗"; }

.psych-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(32px, 5vw, 72px);
  margin-top: clamp(36px, 5vw, 56px);
  max-width: 980px;
}
.psych-item {
  padding: 20px 0 22px;
  border-top: 1px solid var(--line);
}
.psych-item strong {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--fs-4);
  color: var(--gold-soft);
  margin-bottom: 10px;
}
.psych-item p { color: var(--muted); font-size: var(--fs-3); line-height: 1.6; max-width: 52ch; }

.disclaimer {
  margin-top: 24px;
  max-width: 860px;
  padding: 16px 18px;
  border: 1px solid rgba(200, 120, 110, 0.38);
  border-radius: var(--r-card);
  background: rgba(200, 120, 110, 0.07);
}
.disclaimer p { color: var(--muted); font-size: var(--fs-3); line-height: 1.6; }

/* ============ FAQ ============ */

.faq-list {
  margin-top: 26px;
  max-width: 780px;
  border-top: 1px solid var(--line);
}
.faq-list details {
  border-bottom: 1px solid var(--line);
}
.faq-list summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 4px;
  cursor: pointer;
  font-weight: 700;
  font-size: var(--fs-lead);
  transition: color 0.25s var(--ease);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  flex: 0 0 auto;
  font-family: var(--display);
  font-size: var(--fs-5);
  color: var(--gold-dim);
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}
.faq-list details[open] summary { color: var(--gold-soft); }
.faq-list details[open] summary::after {
  transform: rotate(45deg);
  color: var(--gold-soft);
}
.faq-list summary:hover { color: var(--gold-soft); }
.faq-list details p {
  padding: 0 4px 22px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 68ch;
}

/* ============ Поддержка ============ */

#support { padding-bottom: clamp(72px, 10vw, 120px); }

.support-card {
  padding: clamp(32px, 5vw, 64px);
  text-align: center;
}
.support-card .sub {
  margin-left: auto;
  margin-right: auto;
}
.support-art {
  width: min(320px, 70vw);
  height: auto;
  margin: -20px auto 0;
  display: block;
  filter: drop-shadow(0 10px 36px var(--cta-shadow));
}
.support-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}
.support-note {
  margin-top: 20px;
  color: var(--faint);
  font-size: var(--fs-2);
  max-width: 72ch;
  margin-left: auto;
  margin-right: auto;
}
.link-btn {
  border: 0;
  padding: 0;
  background: none;
  color: var(--gold-dim);
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--gold-soft); }

/* ============ Футер ============ */

.footer {
  border-top: 1px solid var(--line);
  padding: 40px clamp(18px, 4vw, 56px) 48px;
}
.footer-inner {
  width: min(var(--content), 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
  justify-items: start;
}
.footer .brand img { width: 36px; height: 36px; }
.footer-disclaimer {
  max-width: 640px;
  color: var(--faint);
  font-size: var(--fs-2);
  line-height: 1.6;
}
.footer-privacy {
  max-width: 640px;
  color: var(--faint);
  font-size: var(--fs-2);
  line-height: 1.6;
}
.footer-meta { color: var(--faint); font-size: var(--fs-2); }
.footer-meta a { color: var(--gold-dim); }
.footer-meta a:hover { color: var(--gold-soft); }

/* ============ Нижний таб-бар (телефон) ============ */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: none;
  grid-template-columns: 1fr 1fr auto 1fr 1fr;
  align-items: stretch;
  height: calc(62px + env(safe-area-inset-bottom, 0px));
  padding: 0 8px env(safe-area-inset-bottom, 0px);
  background: var(--tabbar-bg);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}
.tabbar a {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-width: 56px;
  color: var(--faint);
  font-size: var(--fs-1);
  font-weight: 700;
  border-radius: var(--r-ctrl);
  transition: color 0.25s var(--ease);
}
.tabbar a svg { width: 21px; height: 21px; }
.tabbar a.is-current { color: var(--gold-soft); }
.tab-play {
  align-self: center;
  width: 56px;
  height: 56px;
  margin: 0 6px;
  transform: translateY(-14px);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--cta-grad);
  color: var(--cta-ink);
  cursor: pointer;
  box-shadow: 0 10px 30px var(--cta-shadow);
  transition: transform 0.2s var(--spring), box-shadow 0.3s var(--ease);
}
.tab-play:active { transform: translateY(-14px) scale(0.94); }
.tab-play .play-icon {
  border-top-width: 9px;
  border-bottom-width: 9px;
  border-left-width: 15px;
  margin-left: 4px;
}
.tab-play.is-playing .play-icon { margin-left: 0; width: 15px; height: 17px; }

/* ============ Кнопка «наверх» ============ */

.to-top {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 45;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--toast-bg);
  color: var(--toast-text);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

/* ============ Диалоги и тост ============ */

dialog {
  margin: auto;
  width: min(460px, calc(100vw - 40px));
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  background: var(--dialog-bg);
  color: var(--text);
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}
dialog h3 { font-size: var(--fs-5); font-weight: 600; margin-bottom: 12px; }
dialog p { color: var(--muted); line-height: 1.6; }
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.dialog-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--input-bg);
  color: var(--muted);
  font-size: var(--fs-5);
  line-height: 1;
  cursor: pointer;
}
.dialog-x:hover { color: var(--text); border-color: var(--line-strong); }

/* Вход и регистрация */
#authDialog { padding-top: 24px; }
.auth-tabs { margin: 0 0 18px; }
#authForm { display: grid; gap: 14px; }
.auth-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: var(--fs-2);
  font-weight: 600;
}
.auth-field input {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctrl);
  background: var(--input-bg);
  color: var(--text);
}
.auth-field input::placeholder { color: var(--faint); font-weight: 400; }
.auth-avatars {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.auth-avatars button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: var(--fs-5);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--input-bg);
  cursor: pointer;
  transition: border-color 0.25s var(--ease), transform 0.2s var(--spring);
}
.auth-avatars button:hover { transform: scale(1.08); }
.auth-avatars button.is-active {
  border-color: var(--gold);
  background: var(--chip-active-bg);
  box-shadow: 0 0 14px var(--cta-shadow);
}
.auth-error {
  color: var(--danger);
  font-size: var(--fs-2);
  margin: 0;
}
.auth-submit { width: 100%; }
.auth-forgot {
  justify-self: center;
  border: 0;
  background: none;
  color: var(--gold-dim);
  font-size: var(--fs-2);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-forgot:hover { color: var(--gold-soft); }
.auth-note {
  margin-top: 16px;
  color: var(--faint);
  font-size: var(--fs-1);
  line-height: 1.55;
}

/* Профиль */
.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-right: 40px;
}
.avatar-big {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: var(--fs-6);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--chip-active-bg);
}
.profile-head strong {
  display: block;
  font-family: var(--display);
  font-size: var(--fs-5);
  font-weight: 600;
}
.profile-head small { color: var(--muted); font-size: var(--fs-2); overflow-wrap: anywhere; }
.profile-stats {
  display: grid;
  gap: 10px;
}
.profile-stats > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.profile-stats span { color: var(--muted); font-size: var(--fs-3); }
.profile-stats strong {
  font-family: var(--display);
  font-size: var(--fs-4);
  font-weight: 600;
  color: var(--gold-soft);
}
.danger-link {
  margin-top: 18px;
  border: 0;
  background: none;
  color: var(--danger);
  font-size: var(--fs-2);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  z-index: 60;
  padding: 12px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctrl);
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: var(--fs-3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  max-width: calc(100vw - 40px);
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============ Анимации ============ */

@keyframes orb-breathe {
  0%, 100% { transform: scale(0.985); }
  50% { transform: scale(1.02); }
}
@keyframes ring-breathe {
  0%, 100% { transform: scale(0.97); opacity: 0.4; }
  50% { transform: scale(1.04); opacity: 0.9; }
}
@keyframes ring-spin {
  to { transform: rotate(360deg); }
}
@keyframes eq-bounce {
  0%, 100% { height: 30%; }
  50% { height: 100%; }
}
@keyframes dot-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.35); }
}
@keyframes preview-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--cta-shadow); }
  50% { box-shadow: 0 0 0 7px rgba(0, 0, 0, 0); }
}
@keyframes particle-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-26px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .emblem-orb img,
  .ring-line-a,
  .ring-line-b,
  .ring-line-c,
  .eq i,
  .pomo-dots i.is-now,
  .layer-preview.is-previewing,
  .breath-particles i { animation: none; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .breath-petals,
  .breath-halo { transition-duration: 0.2s !important; }
  .primary-action,
  .ghost-action,
  .transport-btn,
  .pomo-main,
  .preset-card,
  .research-card,
  .topbar { transition: none; }
  body { transition: none; }
  body.is-playing .eq i { height: 70%; }
}

/* ============ Адаптив ============ */

@media (max-width: 1020px) {
  .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preset-card.featured { grid-column: span 2; }
  .studio-grid,
  .focus-grid { grid-template-columns: 1fr; }
  .side-rack { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .psych-grid,
  .research-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-toggle span:last-child,
  .icon-toggle span:last-child,
  .profile-btn span:last-child { display: none; }
  .topnav {
    mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
  }
}

@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .stage { min-height: auto; padding-top: 34px; padding-bottom: 56px; }
  .science-layout { grid-template-columns: 1fr; }
  .science-heading { grid-template-columns: 1fr; }
  .sketch-art { max-width: 300px; justify-self: center; }
  #breath .breath-grid { grid-template-columns: 1fr; }
  .breath-stagearea { min-height: 340px; }
  .pomo-card { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .pomo-controls { justify-content: center; }
  .pomo-settings { justify-items: center; }
  .pomo-setting { justify-items: center; }
  .setting-row { justify-content: center; }
  .pomo-tip { margin-left: auto; margin-right: auto; }
}

@media (max-width: 680px) {
  body { padding-bottom: 78px; }
  .topbar { height: 62px; }
  .topbar.is-scrolled { height: 56px; }
  .brand strong { font-size: var(--fs-3); }
  .topnav { display: none; }
  .tabbar { display: grid; }
  .to-top { bottom: 94px; right: 16px; }
  .side-rack { grid-template-columns: 1fr; }
  .preset-grid { grid-template-columns: 1fr; }
  .preset-card.featured { grid-column: auto; }
  .preset-card { min-height: 0; }
  .slider-grid { grid-template-columns: 1fr; }
  .hero-actions > * { flex: 1 1 100%; }
  .emblem-orb { width: min(320px, 82vw); }
  .band-grid { grid-template-columns: 1fr; }
  .psych-grid,
  .research-grid { grid-template-columns: 1fr; }
  .support-actions > * { flex: 1 1 100%; }
  .layer { grid-template-columns: 38px 100px minmax(0, 1fr); gap: 8px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid .stat:last-child { grid-column: span 2; }
  .privacy-consent {
    left: 12px;
    bottom: 86px;
    width: calc(100% - 24px);
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }
  .privacy-consent-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============ Принудительный «телефонный» вид (кнопка в шапке) ============ */

html[data-view="phone"] body { padding-bottom: 78px; }
html[data-view="phone"] main,
html[data-view="phone"] .footer-inner { max-width: 540px; margin-left: auto; margin-right: auto; }
html[data-view="phone"] .topnav { display: none; }
html[data-view="phone"] .tabbar { display: grid; }
html[data-view="phone"] .to-top { bottom: 94px; }
html[data-view="phone"] .hero-grid,
html[data-view="phone"] .studio-grid,
html[data-view="phone"] .focus-grid,
html[data-view="phone"] .science-layout,
html[data-view="phone"] .science-heading,
html[data-view="phone"] #breath .breath-grid,
html[data-view="phone"] .preset-grid,
html[data-view="phone"] .band-grid,
html[data-view="phone"] .psych-grid,
html[data-view="phone"] .research-grid,
html[data-view="phone"] .side-rack,
html[data-view="phone"] .slider-grid { grid-template-columns: 1fr; }
html[data-view="phone"] .preset-card.featured { grid-column: auto; }
html[data-view="phone"] .stage { min-height: auto; padding-top: 30px; padding-bottom: 52px; }
html[data-view="phone"] .pomo-card { grid-template-columns: 1fr; justify-items: center; text-align: center; }
html[data-view="phone"] .pomo-controls,
html[data-view="phone"] .setting-row { justify-content: center; }
html[data-view="phone"] .pomo-settings,
html[data-view="phone"] .pomo-setting { justify-items: center; }
html[data-view="phone"] .hero-actions > *,
html[data-view="phone"] .support-actions > * { flex: 1 1 100%; }
html[data-view="phone"] .sketch-art { max-width: 300px; justify-self: center; }

/* Пальцем в мелкую кнопку не попадёшь. На сенсорных экранах поднимаем органы
   управления до 44 пикселей — общий ориентир и Apple, и Google. Условие именно
   про способ ввода, а не про ширину экрана: сенсорный ноутбук тоже считается.
   Мышке лишняя высота не нужна, там всё остаётся как было. */
@media (pointer: coarse) {
  button:not([hidden]) {
    min-width: 44px;
    min-height: 44px;
  }
  /* Ползунку добавляем высоту только как область захвата: сама дорожка
     и бегунок рисуются по центру и внешне не меняются. */
  input[type="range"] {
    height: 44px;
  }
}

/* ============ Физика звука ============ */

.physics-block {
  margin-top: 40px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}
.physics-head { max-width: 62ch; margin-bottom: 22px; }
.physics-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
  margin-bottom: 26px;
}
.wave-figure {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: var(--glass-bg);
  box-shadow: var(--glass-inset);
}
.wave-row { display: grid; gap: 4px; }
.wave-cap { color: var(--faint); font-size: var(--fs-1); font-weight: 600; }
.wave-svg { display: block; width: 100%; height: auto; overflow: visible; }
.wave-svg path { stroke-linejoin: round; stroke-linecap: round; }
.w-l, .w-r, .w-sum { fill: none; }
.w-l, .w-r { stroke: var(--gold-dim); stroke-width: 1.6; opacity: 0.6; }
.w-sum { stroke: var(--gold); stroke-width: 2.4; }
.w-env { fill: var(--gold); opacity: 0.16; }
.wave-scan {
  position: absolute;
  top: 10%;
  bottom: 10%;
  left: 3%;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, transparent, var(--gold-soft), transparent);
  opacity: 0.5;
  animation: waveScan 6.5s ease-in-out infinite;
}
@keyframes waveScan {
  0% { left: 3%; }
  50% { left: 96%; }
  100% { left: 3%; }
}
.physics-lead h4 { margin: 0 0 8px; font-size: var(--fs-5); }
.physics-lead p { margin: 0; color: var(--text); }
.physics-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.physics-card {
  padding: 18px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: var(--glass-bg);
  box-shadow: var(--glass-inset);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.physics-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--glass-inset), var(--shadow-soft);
}
.physics-card h4 { margin: 12px 0 6px; font-size: var(--fs-4); }
.physics-card p { margin: 0; color: var(--text); font-size: var(--fs-3); }
.mini-figure { border-radius: 10px; overflow: hidden; }
.mini-figure svg { display: block; width: 100%; height: auto; }
.sp-bars rect { fill: var(--gold); opacity: 0.7; }
.sp-bars rect:nth-child(odd) { opacity: 0.82; }
.mask-floor { fill: var(--gold); opacity: 0.16; }
.mask-base { stroke: var(--line-strong); stroke-width: 1.4; }
.mask-spike { fill: none; stroke: var(--gold-soft); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.physics-foot { margin: 20px 0 0; color: var(--faint); font-size: var(--fs-2); font-style: italic; }

/* ============ Иконка сон-таймера ============ */

#sleepTitle { display: flex; align-items: center; gap: 8px; }
.sleep-icon {
  width: 17px;
  height: 17px;
  flex: none;
  fill: var(--gold-soft);
  animation: sleepFloat 4.5s ease-in-out infinite;
}
@keyframes sleepFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-1.5px) rotate(-7deg); }
}

/* ============ Живость интерфейса ============ */

.transport-btn[aria-pressed="true"] {
  box-shadow: 0 0 0 1px var(--line-strong), 0 0 22px -4px var(--gold);
}

@media (prefers-reduced-motion: reduce) {
  .sleep-icon { animation: none; }
  .wave-scan { display: none; }
}

@media (max-width: 760px) {
  .physics-hero { grid-template-columns: 1fr; }
  .physics-cards { grid-template-columns: 1fr; }
}
