@font-face {
  font-family: "ClashGrotesk";
  src: url("./fonts/ClashGrotesk-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ClashGrotesk";
  src: url("./fonts/ClashGrotesk-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ClashGrotesk";
  src: url("./fonts/ClashGrotesk-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ClashGrotesk";
  src: url("./fonts/ClashGrotesk-Semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ClashGrotesk";
  src: url("./fonts/ClashGrotesk-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ─── Tokens ──────────────────────────────────────────────── */
:root {
  --bg:      #ffffff;
  --text:    #000000;
  --muted:   #888888;
  --line:    #000000;
  --accent:  #000000;
  --accent-text: #ffffff;
  --max:     1280px;
  --radius:  0px;
  --ease:    cubic-bezier(0.16, 1, 0.3, 1);
  --mono:    "IBM Plex Mono", "Courier New", monospace;
}

[data-theme="dark"] {
  --bg:      #0a0a0a;
  --text:    #f0f0ee;
  --muted:   #666666;
  --line:    #f0f0ee;
  --accent:  #f0f0ee;
  --accent-text: #0a0a0a;
}

/* ─── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; text-transform: uppercase; }
img, svg { display: block; max-width: 100%; }
pre { margin: 0; }
h1, h2, h3 { line-height: 1; margin: 0; }

/* ─── Noise — убран ───────────────────────────────────────── */
.noise { display: none; }

/* ─── Layout ──────────────────────────────────────────────── */
.site-header,
.section,
.ticker-wrap,
.site-footer {
  width: min(calc(100% - 48px), var(--max));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.section {
  padding: clamp(40px, 7vw, 96px) 0;
}

/* ─── Skip link ───────────────────────────────────────────── */
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 16px; top: 16px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  z-index: 200;
}

/* ─── Header ──────────────────────────────────────────────── */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand-logo {
  height: 52px;
  width: auto;
  display: block;
  /* инвертируем в dark mode */
}

[data-theme="dark"] .brand-logo {
  filter: invert(1);
}

.brand-mark {
  width: 120px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: .2em;
  transition: color 0.15s var(--ease);
}

.site-nav a:hover { color: var(--text); }

.theme-toggle {
  background: none;
  border: none;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: .2em;
  color: var(--muted);
  padding: 0;
  transition: color 0.15s var(--ease);
}

.theme-toggle:hover { color: var(--text); }

/* ─── Hero ────────────────────────────────────────────────── */
.hero {
  min-height: 60vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 40px;
  padding-bottom: clamp(40px, 7vw, 96px);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: .2em;
  color: var(--muted);
  margin: 0 0 12px;
}

.hero h1 {
  font-family: var(--mono);
  font-size: clamp(32px, 8vw, 100px);
  font-weight: 300;
  letter-spacing: -.01em;
  text-transform: uppercase;
  margin: 0 0 14px;
  line-height: .95;
}

.lead {
  font-family: var(--mono);
  font-size: clamp(11px, 1.4vw, 14px);
  font-weight: 300;
  letter-spacing: .16em;
  margin: 0 0 10px;
}

.sublead {
  max-width: 50ch;
  color: var(--muted);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: .08em;
  line-height: 1.8;
  margin: 0;
}

/* ─── Buttons ─────────────────────────────────────────────── */
.hero-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 18px;
  border-radius: 0;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
  background: none;
  color: var(--text);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.btn:hover {
  background: var(--text);
  color: var(--bg);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn-primary:hover {
  opacity: .75;
}

.btn-ghost {
  background: none;
}

/* ─── Signal box ──────────────────────────────────────────── */
.signal-box {
  justify-self: end;
  width: 100%;
  border: 1px solid var(--line);
  padding: 18px 20px;
}

.signal-box pre {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 300;
  line-height: 2;
  color: var(--muted);
  white-space: pre-wrap;
  min-height: 88px;
  letter-spacing: .1em;
}

/* ─── Ticker ──────────────────────────────────────────────── */
.ticker-wrap {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.ticker { padding: 10px 0; white-space: nowrap; }

.ticker-track {
  display: inline-flex;
  gap: 48px;
  min-width: max-content;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: .22em;
  color: var(--muted);
  animation: ticker 22s linear infinite;
}

@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.ticker-track:hover { animation-play-state: paused; }

/* ─── Section head ────────────────────────────────────────── */
.section-head { margin-bottom: 24px; }

.section-head h2 {
  font-family: var(--mono);
  font-size: clamp(22px, 5vw, 56px);
  font-weight: 300;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: 6px;
  line-height: 1;
}

/* ─── Track list — как у cry4me ───────────────────────────── */
.track-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.track-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: opacity 0.15s var(--ease);
}

.track-item:hover { opacity: .5; }

.track-item.active .track-name {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.track-index {
  font-size: 10px;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: .12em;
}

.track-name {
  font-size: 11px;
  font-weight: 300;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.track-meta {
  font-size: 10px;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: .1em;
}

/* ─── Player panel ────────────────────────────────────────── */
.player-panel {
  margin-top: 20px;
  border: 1px solid var(--line);
  padding: 24px;
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto auto auto auto auto;
  column-gap: 32px;
  row-gap: 14px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.player-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.player-cover-wrap {
  grid-row: 1 / 5;
  grid-column: 1;
}

.player-cover {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #111;
  border-radius: 0;
  display: block;
}

.player-info {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: flex-end;
}

.player-title {
  font-size: clamp(13px, 2vw, 18px);
  font-weight: 300;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin: 0;
}

.player-sub {
  font-size: 10px;
  font-weight: 300;
  letter-spacing: .14em;
  color: var(--muted);
  margin: 0;
}

.player-controls {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-btn {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .14em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 6px 14px;
  background: none;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.player-btn:hover {
  color: var(--bg);
  background: var(--text);
  border-color: var(--text);
}

.player-btn-play {
  color: var(--text);
  padding: 8px 20px;
  font-size: 11px;
}

.player-btn-play.playing {
  background: var(--text);
  color: var(--bg);
}

.player-progress-wrap {
  grid-column: 2;
  grid-row: 3;
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-time {
  font-size: 10px;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: .08em;
  white-space: nowrap;
}

.player-progress,
.player-volume {
  -webkit-appearance: none;
  appearance: none;
  height: 1px;
  border-radius: 0;
  background: var(--line);
  outline: none;
  cursor: pointer;
  flex: 1;
}

.player-progress::-webkit-slider-thumb,
.player-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 8px;
  height: 8px;
  border-radius: 0;
  background: var(--text);
  cursor: pointer;
}

.player-progress::-moz-range-thumb,
.player-volume::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border-radius: 0;
  background: var(--text);
  border: none;
}

.player-volume-wrap {
  grid-column: 2;
  grid-row: 4;
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-vol-label {
  font-size: 10px;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: .16em;
  white-space: nowrap;
}

.player-download {
  grid-column: 1;
  grid-row: 5;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 4px;
  color: var(--muted);
  align-self: center;
  transition: color 0.15s var(--ease);
}

.player-download:hover { color: var(--text); }

.player-close {
  grid-column: 2;
  grid-row: 5;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: .2em;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  transition: color 0.15s var(--ease);
}

.player-close:hover { color: var(--text); }

/* ─── Old release grid — убран, заменён на track-list ──────── */
.release-grid { display: none; }

/* ─── Manifesto ───────────────────────────────────────────── */
.manifesto { padding-top: 0; }

.manifesto-box {
  border: 1px solid var(--line);
  padding: 22px 24px;
}

.manifesto-text {
  color: var(--muted);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: .12em;
  text-transform: uppercase;
  max-width: 72ch;
  margin: 6px 0 0;
  line-height: 1.9;
}

/* ─── Links grid ──────────────────────────────────────────── */
.links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--line);
}

.link-card {
  border: none;
  border-right: 1px solid var(--line);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
  background: none;
  transition: background 0.15s var(--ease);
}

.link-card:last-child { border-right: none; }

.link-card:hover {
  background: var(--text);
  color: var(--bg);
}

.link-card span {
  font-size: 10px;
  font-weight: 300;
  letter-spacing: .2em;
  color: var(--muted);
  transition: color 0.15s var(--ease);
}

.link-card:hover span { color: var(--bg); }

.link-card strong {
  font-size: clamp(14px, 2vw, 20px);
  font-weight: 300;
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: 1;
}

/* ─── Footer ──────────────────────────────────────────────── */
.site-footer {
  padding: 16px 0 32px;
  border-top: 1px solid var(--line);
}

.site-footer p {
  font-size: 10px;
  font-weight: 300;
  letter-spacing: .2em;
  color: var(--muted);
  margin: 0;
}

/* ─── Scroll reveal ───────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .ticker-track { animation: none; }
}

/* ─── Mobile ──────────────────────────────────────────────── */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 28px;
  }

  .signal-box {
    justify-self: stretch;
    max-width: none;
  }

  .links-grid {
    grid-template-columns: 1fr 1fr;
  }

  .link-card:nth-child(2) { border-right: none; }
  .link-card:nth-child(3) {
    border-right: none;
    border-top: 1px solid var(--line);
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .player-panel {
    grid-template-columns: 1fr;
  }

  .player-cover-wrap {
    grid-row: 1;
    grid-column: 1;
  }

  .player-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

  .player-info,
  .player-controls,
  .player-progress-wrap,
  .player-volume-wrap,
  .player-download,
  .player-close {
    grid-column: 1;
    grid-row: auto;
  }

  .links-grid {
    grid-template-columns: 1fr;
    border: 1px solid var(--line);
  }

  .link-card {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .link-card:last-child { border-bottom: none; }
}
/* ─── Scroll pixelate ─────────────────────────────────────── */
html.scrolling .site-header,
html.scrolling main,
html.scrolling .site-footer {
  filter: blur(0.4px) contrast(1.05);
  image-rendering: pixelated;
  transform: translateZ(0);
  transition: filter 0.05s linear;
}

html:not(.scrolling) .site-header,
html:not(.scrolling) main,
html:not(.scrolling) .site-footer {
  filter: none;
  transition: filter 0.2s ease;
}

/* ─── Snow toggle button — не пикселизируется ─────────────── */
#snow-canvas,
body > button {
  z-index: 100;
  isolation: isolate;
}
/* ─── Pixel-glitch reveal ─────────────────────────────────── */

/* Стартовое состояние — элемент скрыт */
.pixel-hidden {
  opacity: 0;
}

/* Анимация сборки из пикселей */
@keyframes px-assemble {
  0%   {
    opacity: 0.15;
    filter: blur(6px) contrast(6) brightness(2);
    clip-path: inset(0 100% 0 0);
    transform: scaleX(1.04);
  }
  15%  {
    opacity: 0.6;
    filter: blur(3px) contrast(4) brightness(1.5);
    clip-path: inset(0 60% 0 0);
    transform: scaleX(1.02);
  }
  40%  {
    opacity: 0.85;
    filter: blur(1.5px) contrast(2.5);
    clip-path: inset(0 20% 0 0);
    transform: scaleX(1.01);
  }
  60%  {
    opacity: 0.9;
    filter: blur(0.5px) contrast(1.8);
    clip-path: inset(0 5% 0 0);
  }
  /* Глитч-дёргание */
  70%  {
    filter: blur(0) contrast(1);
    clip-path: inset(0 0 0 0);
    transform: translateX(3px) scaleX(1);
  }
  75%  { transform: translateX(-2px); }
  80%  { transform: translateX(1px); }
  85%  { transform: translateX(0); filter: brightness(1.4) contrast(1.5); }
  92%  { filter: none; opacity: 1; }
  100% {
    opacity: 1;
    filter: none;
    clip-path: inset(0 0 0 0);
    transform: none;
  }
}

/* Вертикальный вариант для строк */
@keyframes px-assemble-v {
  0%   {
    opacity: 0.1;
    filter: blur(8px) contrast(8);
    clip-path: inset(0 0 100% 0);
    transform: scaleY(1.06);
  }
  20%  {
    opacity: 0.5;
    filter: blur(4px) contrast(5);
    clip-path: inset(0 0 55% 0);
  }
  50%  {
    opacity: 0.8;
    filter: blur(1px) contrast(2);
    clip-path: inset(0 0 10% 0);
  }
  65%  {
    clip-path: inset(0 0 0 0);
    transform: translateY(-3px) scaleY(1);
  }
  72%  { transform: translateY(2px); filter: brightness(1.6); }
  80%  { transform: translateY(-1px); }
  88%  { transform: translateY(0); filter: none; }
  100% { opacity: 1; filter: none; clip-path: inset(0 0 0 0); transform: none; }
}

/* Глитч-горизонталь для строк трека и ссылок */
@keyframes px-glitch-line {
  0%   { opacity: 0; clip-path: inset(0 100% 0 0); filter: blur(4px) contrast(6); }
  10%  { opacity: 0.7; clip-path: inset(0 70% 0 0); transform: translateX(8px); }
  25%  { clip-path: inset(0 30% 0 0); transform: translateX(-4px); filter: blur(1px); }
  40%  { clip-path: inset(0 8% 0 0); transform: translateX(2px); }
  55%  { clip-path: inset(0 0 0 0); transform: translateX(0); filter: blur(0) brightness(1.5); }
  65%  { transform: translateX(4px); filter: brightness(1.3); }
  75%  { transform: translateX(-2px); }
  85%  { transform: translateX(1px); filter: none; }
  100% { opacity: 1; filter: none; clip-path: inset(0 0 0 0); transform: none; }
}

/* Назначаем анимации конкретным типам */
.px-reveal-h {
  animation: px-assemble 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.px-reveal-v {
  animation: px-assemble-v 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.px-reveal-line {
  animation: px-glitch-line 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Задержки стаггера */
.px-d-0  { animation-delay: 0ms; }
.px-d-1  { animation-delay: 40ms; }
.px-d-2  { animation-delay: 80ms; }
.px-d-3  { animation-delay: 120ms; }
.px-d-4  { animation-delay: 160ms; }
.px-d-5  { animation-delay: 200ms; }
.px-d-6  { animation-delay: 240ms; }
.px-d-7  { animation-delay: 280ms; }
.px-d-8  { animation-delay: 320ms; }
.px-d-9  { animation-delay: 360ms; }
.px-d-10 { animation-delay: 400ms; }

/* Пока не триггернуто — скрыто */
[data-px]:not(.px-fired) {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  [data-px] { animation: none !important; opacity: 1 !important; }
}
/* ─── Loader ──────────────────────────────────────────────── */
#site-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(20px, 5vw, 60px);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#site-loader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-ascii {
  font-family: var(--mono);
  font-size: clamp(5px, 1vw, 10px);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: .05em;
  color: var(--text);
  white-space: pre;
  opacity: 0;
  transition: opacity 0.4s ease;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
}

.loader-ascii.visible {
  opacity: 1;
}

.loader-bottom {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.loader-name {
  font-family: var(--mono);
  font-size: clamp(12px, 2vw, 18px);
  font-weight: 300;
  letter-spacing: .4em;
  text-transform: uppercase;
  color: var(--text);
}

.loader-status {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: .2em;
  color: var(--muted);
  text-transform: lowercase;
}

@media (prefers-reduced-motion: reduce) {
  #site-loader { display: none; }
}
