/* styles.css — вид SoundStore. Всё из токенов (tokens.css), литералы — только геометрия проигрывателя и пластинки.
   Порядок: база → сигнатура (пластинка, проигрыватель) → шапка → первый экран → секции → финал → телефон (отдельная композиция). */

/* ---------- база ---------- */
html, body { overscroll-behavior: none; }
html.in-tg { height: 100%; overflow: hidden; }
html.in-tg body { height: 100%; overflow-x: clip; overflow-y: auto; -webkit-overflow-scrolling: touch; }
body { font: 400 var(--step-0)/1.5 var(--font-body); overflow-x: clip; }
::selection { background: var(--ink); color: var(--surface); }
.mono { font-family: var(--font-mono); font-weight: 500; font-size: var(--step--1); letter-spacing: var(--track-mono); text-transform: uppercase; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
h1, h2, h3 { font-weight: 800; letter-spacing: var(--track-display); }
em { font-style: var(--slant); }
.link { font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 8px; text-decoration-color: var(--ink); transition: text-underline-offset var(--dur-micro) var(--ease-soft); }
.link:hover { text-underline-offset: 5px; }

.btn--primary { min-height: var(--btn-h); padding: 0 var(--space-6); border-radius: var(--radius-pill); font: 700 16px/1 var(--font-body); letter-spacing: 0; box-shadow: 0 1px 0 rgb(255 255 255 / .18) inset, 0 10px 24px -12px color-mix(in oklab, var(--accent) 80%, transparent); }
.btn--primary:hover { background: color-mix(in oklab, var(--accent) 88%, var(--ink)); }
.btn .arr { font-weight: 500; transition: transform var(--dur-micro) var(--ease-soft); }
.btn:hover .arr { transform: translate(2px, -2px); }

/* ---------- сигнатура: пластинка (canvas) и проигрыватель (SVG) ---------- */
.vinyl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 20; pointer-events: none; }
.vinyl > * { display: none; }

.tt { --tt-r: 2.2% / 2.75%; position: absolute; aspect-ratio: 1000 / 800; border-radius: var(--tt-r); box-shadow: var(--signature-shadow); background: var(--signature-vinyl); }
.tt svg { display: block; max-width: none; }
.tt__body { width: 100%; height: 100%; border-radius: var(--tt-r); }
.tt__platter { position: absolute; left: 4%; top: 4.375%; width: 70%; height: auto; }
.tt__arm { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 30; pointer-events: none; overflow: visible; }
.tt__txt { font: 500 15px var(--font-mono); letter-spacing: .08em; fill: #8b8a87; }
.tt__txt--mat { font-size: 17px; fill: #3a3a3c; }
.arm, .arm__body { transform-box: view-box; transform-origin: 840px 185px; }
.arm { transform: rotate(var(--arm, 31.5deg)); }
.arm__body { transform: scale(calc(1 + var(--lift, 0) * .018)); }
.arm__shadow { transform: translate(calc(6px + var(--lift, 0) * 16px), calc(9px + var(--lift, 0) * 20px)); opacity: calc(.38 - var(--lift, 0) * .14); }
.cue__lever { transform-box: fill-box; transform-origin: 50% 100%; transform: rotate(calc(var(--lift, 0) * -40deg)); }
.strobe, .tt__mat { transform-box: fill-box; transform-origin: center; }
.strobe--b { animation: spin 46s linear infinite; }
.strobe--c { animation: spin 71s linear infinite reverse; }
.strobe--d { animation: spin 120s linear infinite; }
.tt__mat { animation: spin 1.8s linear infinite; animation-play-state: paused; }
.tt.is-empty .tt__mat { animation-play-state: running; }
.hero:not(.is-live) .strobe, .hero:not(.is-live) .tt__mat { animation-play-state: paused; }
@keyframes spin { to { transform: rotate(360deg); } }

/* окна-круги: пэкшот на чёрном, проявляются маской круга от прокрутки (site.js), фото не масштабируется */
.window { position: relative; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--plate); }
.window img { width: 100%; height: 100%; object-fit: cover; }
html.js .window { clip-path: circle(calc(var(--open, 0) * 50%) at 50% 50%); }

/* ---------- шапка ---------- */
.header__inner { min-height: var(--header-h); border-bottom: 1px solid var(--edge); gap: var(--space-6); }
.logo { display: block; flex: none; padding: 9px 12px 7px; background: var(--ink); border-radius: var(--radius-plate); color: var(--surface); }
.logo svg { width: 82px; height: auto; fill: currentColor; }
.nav { margin-right: auto; margin-left: clamp(24px, 10vw, 170px); }
.nav__list { gap: 0; }
.nav__list a, .lang button, .btn { white-space: nowrap; }
.nav__list a { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; font: 500 var(--step--1)/1 var(--font-mono); letter-spacing: var(--track-mono); text-transform: uppercase; }
.nav__list li + li::before { content: '·'; font: 500 var(--step--1)/44px var(--font-mono); padding-inline: 10px; color: var(--ink-muted); }
.nav__list a:hover .nav__short { text-decoration: underline; text-underline-offset: 6px; }
.nav__no, .nav__long, .nav__extra { display: none; }
.header__actions { gap: var(--space-6); }
.lang { gap: 0; }
.lang button { min-width: 0; padding: 0 6px; font: 500 var(--step--1)/44px var(--font-mono); letter-spacing: var(--track-mono); opacity: 1; color: var(--ink-muted); }
.lang button + button::before { content: '·'; display: inline-block; margin-right: 12px; color: var(--ink-muted); }
.lang button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; }
.header__cta { min-height: 52px; }

/* ---------- первый экран: проигрыватель — главный герой ---------- */
.hero { --tt-w: min(58vw, calc((100svh - var(--header-h) - 72px) * 1.25), 940px);
  position: relative; min-height: max(calc(100svh - var(--header-h)), calc(var(--tt-w) * .8 + 72px));
  display: flex; align-items: flex-end; padding: var(--space-7) var(--gutter) clamp(32px, 7svh, 72px); }
.hero .tt { top: 24px; right: max(16px, calc(var(--gutter) - 24px)); width: var(--tt-w); }
.hero__copy { width: calc(100vw - var(--tt-w) - 2 * var(--gutter) - 8px); display: grid; gap: var(--space-5); }
.eyebrow { color: var(--ink-muted); }
.hero__title { font-size: min(var(--step-4), calc((100vw - var(--tt-w) - 2 * var(--gutter)) / 6.1)); line-height: .93; font-weight: 800; }
.hero__title .l { display: block; }
.hero__title em { font-weight: 900; }
.hero__lead { max-width: 34ch; margin-top: var(--space-3); }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-5) var(--space-6); margin-top: var(--space-3); }

/* ---------- секции-треки ---------- */
.track { --win: min(640px, 44vw); position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap);
  padding: clamp(96px, 11vw, 160px) max(var(--gutter), calc((100% - var(--container)) / 2 + var(--gutter))) var(--space-8); overflow-x: clip; }
.track__no { color: var(--ink-muted); }
.track.is-playing .track__no { color: var(--accent); }
.track__title { font-size: var(--step-3); line-height: .98; margin-top: var(--space-3); }
.track__title .l { display: block; }
.track__title em { font-weight: 900; }
.track__lead { max-width: 46ch; margin-top: var(--space-5); }
.track__tag { margin-top: var(--space-5); color: var(--ink-muted); }
.track__tag + .track__lead { margin-top: var(--space-3); }
.credit { margin-top: var(--space-6); color: var(--ink-muted); }
.track__body { padding-top: var(--space-7); }

.track .window--main { width: var(--win); align-self: start; position: sticky; top: calc(var(--header-h) + 48px); }
.track--win-l .window--main, .track--win-l .window-pair { grid-column: 1 / 7; }
.track--win-l .window--main { margin-left: calc(-1 * var(--gutter) - 24px); }
.track--win-l .track__body { grid-column: 7 / 13; }
.track--win-r .track__body { grid-column: 1 / 7; grid-row: 1; padding-right: var(--space-5); }
.track--win-r .window--main { grid-column: 7 / 13; grid-row: 1; justify-self: end; margin-right: calc(-1 * var(--gutter) - 24px); }
.window-pair { position: sticky; top: calc(var(--header-h) + 48px); align-self: start; width: var(--win); margin-left: calc(-1 * var(--gutter) - 24px); }
.window-pair .window--main { position: relative; top: auto; margin: 0; }
.window--small { position: absolute; width: 44%; right: -6%; bottom: -8%; box-shadow: 0 0 0 10px var(--surface); }

/* строки треклиста */
.rows { margin-top: var(--space-7); border-top: 1px solid var(--line); }
.row { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) 72px; column-gap: var(--space-4); align-items: center;
  padding: var(--space-5) var(--space-3); margin-inline: calc(-1 * var(--space-3)); border-bottom: 1px solid var(--line);
  transition: background-color var(--dur-micro) var(--ease-soft); }
.row:hover { background: var(--edge); }
.row__no { align-self: start; padding-top: .9em; color: var(--ink-muted); }
.row__name { font-size: var(--step-2); line-height: 1.04; font-weight: 800; text-wrap: balance; }
.row__note { margin-top: var(--space-2); font-size: 15px; line-height: 1.4; color: var(--ink-muted); max-width: 52ch; }
.row__act { display: inline-block; margin-top: var(--space-3); color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.row__act::after { content: ''; position: absolute; inset: 0; }
.row__act:focus-visible { outline: none; }
.row:has(.row__act:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.row:hover .row__act { text-decoration-thickness: 2px; }
.row__main { display: flex; flex-direction: column; align-items: flex-start; }
.row__chip { grid-column: 3; width: 72px; height: 72px; border-radius: 50%; background: var(--plate); object-fit: cover; }
.row__chip--pop { display: block; background: radial-gradient(circle, transparent 0 52%, #3a3a3c 53% 58%, transparent 59%), repeating-linear-gradient(45deg, #2a2a2c 0 1px, transparent 1px 5px), repeating-linear-gradient(-45deg, #2a2a2c 0 1px, var(--plate) 1px 5px); }
.rows__sub { margin-top: var(--space-7); color: var(--ink-muted); }
.rows__sub + .rows { margin-top: var(--space-4); }
.rows--more .row__name { font-size: calc(var(--step-2) * .8); }

/* A4 — короткий плотный трек без окна */
.track--a4 .track__head { grid-column: 1 / 5; padding-top: var(--space-2); }
.track__title--s { font-size: calc(var(--step-3) * .72); }
.track--a4 .rows { grid-column: 6 / 13; margin-top: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--space-7); border-top: 0; }
.rows--compact .row { grid-template-columns: 32px minmax(0, 1fr) 56px; border-top: 1px solid var(--line); border-bottom: 0; margin: 0; padding-inline: 0; }
.rows--compact .row:nth-last-child(-n + 2) { border-bottom: 1px solid var(--line); }
.rows--compact .row__name { font-size: 24px; }
.rows--compact .row__note { font-size: 14px; }
.rows--compact .row__chip { width: 56px; height: 56px; }

/* B1 — кто сводит: liner notes */
.track--b1 .track__head { grid-column: 1 / 7; align-self: start; position: sticky; top: calc(var(--header-h) + 48px); }
.track--b1 .track__title em { display: block; padding-left: .2em; }
.notes { grid-column: 8 / 13; display: grid; gap: var(--space-8); padding-top: var(--space-7); }
.note { border-top: 1px solid var(--line); padding-top: var(--space-5); }
.note__role { color: var(--ink-muted); }
.note__name { font-size: clamp(40px, 4.4vw, 64px); line-height: 1; margin-top: var(--space-3); }
.note__name--s { font-size: clamp(28px, 2.6vw, 36px); line-height: 1.1; }
.note__with { margin-top: var(--space-4); }
.note__with .mono { display: block; color: var(--ink-muted); margin-bottom: var(--space-1); }
.note__links { margin-top: var(--space-5); }
.note__links a { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); min-height: 48px; padding: var(--space-3) 0; border-bottom: 1px solid var(--edge); text-decoration: none; }
.note__links li:first-child a { border-top: 1px solid var(--edge); }
.note__track { font-family: var(--font-mono); font-weight: 500; font-size: 17px; }
.note__what { color: var(--ink-muted); white-space: nowrap; }
.note__links a:hover .note__track { text-decoration: underline; text-underline-offset: 5px; }
.notes__all { justify-self: start; }

/* B2 — как купить */
.buy__photo { grid-column: 1 / 5; align-self: start; position: sticky; top: calc(var(--header-h) + 48px); }
.buy__photo img { width: 100%; height: auto; }
.track--b2 .track__body { grid-column: 6 / 13; padding-top: 0; }
.rate { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.rate + .track__no { margin-top: var(--space-7); }
.rows--buy .row { grid-template-columns: 44px minmax(0, 1fr); }
.buy__note { margin-top: var(--space-5); font-size: 15px; color: var(--ink-muted); max-width: 52ch; }
.buy__cta { margin-top: var(--space-6); }

/* ---------- финал: конверт ---------- */
.finale { padding: clamp(120px, 14vw, 200px) var(--gutter) var(--space-7); }
.envelope { position: relative; z-index: 30; width: min(100%, 1200px, calc((100svh - var(--header-h) - 300px) * 1200 / 700)); min-width: min(100%, 760px); margin-inline: auto; aspect-ratio: 1200 / 700; padding: 6% 6.5% 5%;
  display: flex; flex-direction: column; justify-content: space-between; background: var(--surface); border: 2px solid var(--edge); transform: rotate(-2deg);
  box-shadow: 0 1px 2px rgb(40 30 15 / .08), 0 30px 60px -30px rgb(40 30 15 / .35); }
.envelope__logo { width: 82%; }
.envelope__logo svg { width: 100%; height: auto; max-width: none; }
.envelope__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-5) var(--space-7); }
.envelope__tel { font: 800 clamp(40px, 4.6vw, 64px)/1 var(--font-display); letter-spacing: var(--track-display); text-decoration: none; font-variant-numeric: tabular-nums; }
.envelope__tel:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 8px; }
.envelope__cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-5) var(--space-6); }

.footer { padding: var(--space-6) 0 var(--space-7); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4); color: var(--ink-muted); }
.footer__links { display: flex; gap: var(--space-5); }
.footer__links a { display: inline-block; padding-block: 12px; text-decoration: none; color: var(--ink); }
.footer__links a:hover { text-decoration: underline; text-underline-offset: 5px; }

.dock { display: none; }

/* ---------- шапка уже 1200: меню уходит в бургер, языки и кнопка остаются (UZ в одну строку требует ~1155 px) ---------- */
@media (max-width: 1199px) {
  .nav { display: none; }
  .burger { display: block; }
  .burger span { left: 8px; right: 8px; }
  .mobile-menu { position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; overflow-y: auto; display: flex; flex-direction: column; padding: var(--space-6) var(--gutter) calc(var(--space-6) + env(safe-area-inset-bottom)); background: var(--surface); border-top: 0; }
  .mobile-menu[hidden] { display: none; }
  .mobile-menu__eyebrow { color: var(--ink-muted); margin-bottom: var(--space-5); }
  .mobile-menu .nav__list { display: block; border-bottom: 1px solid var(--line); }
  .mobile-menu .nav__list li::before { content: none; }
  .mobile-menu .nav__extra { display: list-item; list-style: none; }
  .mobile-menu .nav__list a { display: flex; align-items: baseline; gap: var(--space-5); width: 100%; min-height: 72px; padding: var(--space-4) 0; border-top: 1px solid var(--line); font: 800 30px/1.1 var(--font-display); letter-spacing: var(--track-display); text-transform: none; }
  .mobile-menu .nav__no { display: inline; width: 28px; flex: none; font: 500 var(--step--1)/1 var(--font-mono); letter-spacing: var(--track-mono); color: var(--ink-muted); }
  .mobile-menu .nav__list a.is-current .nav__no { color: var(--accent); }
  .mobile-menu .nav__short { display: none; }
  .mobile-menu .nav__long { display: inline; }
  .mobile-menu .lang { order: 3; margin-top: var(--space-6); }
  .mobile-menu .lang button { font-size: 15px; padding: 0 8px 0 0; }
  .mobile-menu__tg { order: 4; align-self: flex-start; margin-top: var(--space-5); padding-block: 8px; }

}
@media (min-width: 901px) and (max-width: 1199px) {
  .mobile-menu .lang { display: none; }
  .header__actions { gap: var(--space-5); }
}
@media (min-width: 1200px) {
  .mobile-menu { display: none !important; }
}

/* ---------- планшет и узкий ПК ---------- */
@media (max-width: 1180px) and (min-width: 901px) {
  .track--a4 .rows { grid-template-columns: 1fr; }
  .rows--compact .row:nth-last-child(2) { border-bottom: 0; }
  .track__body, .track--a4 .rows, .notes { grid-column-start: 6 !important; }
  .track--b1 .track__head { grid-column: 1 / 6; }
  .track--win-r .track__body { grid-column: 1 / 8 !important; }
}

/* ---------- телефон: своя композиция (direction §Телефон, кадры 02–15) ---------- */
@media (max-width: 900px) {
  .header__inner { gap: var(--space-3); }
  .logo { padding: 7px 10px 5px; }
  .logo svg { width: 70px; }

  .hero { flex-direction: column; align-items: stretch; min-height: 0; padding: var(--space-4) var(--gutter) var(--space-8); }
  .hero .tt { order: -1; }
  .hero .tt { position: relative; top: auto; right: auto; width: 100%; }
  .hero__copy { width: auto; margin-top: var(--space-6); gap: var(--space-4); }
  .hero__title { font-size: var(--step-4); line-height: .96; }
  .hero__title .l { display: inline; }
  .hero__title .l:nth-child(1), .hero__title .l:nth-child(2) { display: block; }
  .hero__lead { margin-top: 0; font-size: 16px; }
  .hero__cta .btn { display: none; }
  .hero__cta { margin-top: 0; }

  .track { --win: calc(100vw - 2 * var(--gutter)); display: block; padding: var(--space-9) var(--gutter) var(--space-6); }
  .track .window--main, .window-pair { position: relative; top: auto; width: var(--win); margin: 0; }
  .track--win-r .window--main { margin: 0; }
  .window--small { width: 38%; right: -2%; bottom: -4%; box-shadow: 0 0 0 6px var(--surface); }
  .track__body { padding-top: var(--space-6); }
  .track__title { margin-top: var(--space-2); }
  .track__lead { margin-top: var(--space-4); font-size: 16px; }
  .rows { margin-top: var(--space-6); }
  .row { grid-template-columns: 28px minmax(0, 1fr) 56px; column-gap: var(--space-3); padding: var(--space-4) 0; margin: 0; }
  .row__no { padding-top: .55em; }
  .row__note { font-size: 14px; }
  .row__act { margin-top: var(--space-2); }
  .row__chip { width: 56px; height: 56px; }
  .rows--more .row__name { font-size: 22px; }

  .track--a4 .rows { display: block; margin-top: var(--space-6); border-top: 0; }
  .rows--compact .row { grid-template-columns: 28px minmax(0, 1fr) 48px; }
  .rows--compact .row:last-child { border-bottom: 1px solid var(--line); }
  .rows--compact .row__name { font-size: 21px; }
  .rows--compact .row__chip { width: 48px; height: 48px; }
  .track__title--s { font-size: 36px; }

  .track--b1 .track__head { position: static; }
  .notes { padding-top: var(--space-7); gap: var(--space-7); }
  .note__name { font-size: 40px; }
  .note__track { font-size: 15px; }

  .buy__photo { position: static; }
  .rate { margin-top: var(--space-5); }
  .rate + .track__no { margin-top: var(--space-6); }
  .rows--buy .row { grid-template-columns: 28px minmax(0, 1fr); }
  .buy__cta { display: none; }

  .finale { padding: var(--space-10) var(--gutter) var(--space-5); }
  .envelope { width: 100%; min-width: 0; aspect-ratio: auto; padding: var(--space-8) var(--space-5) var(--space-6); gap: var(--space-8); transform: rotate(-2deg); }
  .envelope__logo { width: 100%; }
  .envelope__foot { flex-direction: column; align-items: flex-start; }
  .envelope__tel { font-size: 40px; }
  .envelope__cta .btn { display: none; }

  .footer__inner { flex-direction: column; }
  .dock { display: block; position: fixed; z-index: 40; left: var(--gutter); right: var(--gutter); bottom: max(var(--gutter), env(safe-area-inset-bottom)); }
  .dock .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .strobe, .tt__mat { animation: none; }
  html.js .window { clip-path: none; }
}
