:root {
  color-scheme: dark;
  --bg: #08090b;
  --surface: #0f1116;
  --surface-hi: #151922;
  --line: #272d38;
  --ink: #f2f4f8;
  --muted: #9aa3b2;
  --accent: #ff2e63;
  --accent-ink: #19040c;
  --blue: #7cc7ff;
  --shadow: #000000;
  --ok: #38e07b;
  --radius: 4px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Pixelify Sans", "Inter", system-ui, sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f2ea;
  --surface: #ffffff;
  --surface-hi: #f7f7ee;
  --line: #1c1e17;
  --ink: #101114;
  --muted: #4f565f;
  --accent: #b5113f;
  --accent-ink: #ffffff;
  --blue: #0a6fc4;
  --shadow: #1c1e17;
  --ok: #127a3f;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--ink) 4%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--ink) 4%, transparent) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ——— фон ——— */

.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.stars i {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--ink);
  opacity: 0.35;
  animation: twinkle 4s steps(2, end) infinite;
}

.stars i:nth-child(1)  { left: 8%;  top: 14%; animation-delay: 0s; }
.stars i:nth-child(2)  { left: 21%; top: 34%; animation-delay: 0.7s; }
.stars i:nth-child(3)  { left: 34%; top: 9%;  animation-delay: 1.4s; }
.stars i:nth-child(4)  { left: 47%; top: 24%; animation-delay: 2.1s; }
.stars i:nth-child(5)  { left: 62%; top: 12%; animation-delay: 0.4s; }
.stars i:nth-child(6)  { left: 74%; top: 31%; animation-delay: 1.1s; }
.stars i:nth-child(7)  { left: 88%; top: 18%; animation-delay: 1.8s; }
.stars i:nth-child(8)  { left: 14%; top: 72%; animation-delay: 2.5s; }
.stars i:nth-child(9)  { left: 29%; top: 86%; animation-delay: 0.9s; }
.stars i:nth-child(10) { left: 55%; top: 78%; animation-delay: 1.6s; }
.stars i:nth-child(11) { left: 71%; top: 90%; animation-delay: 2.3s; }
.stars i:nth-child(12) { left: 92%; top: 68%; animation-delay: 0.2s; }

.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    color-mix(in srgb, var(--ink) 6%, transparent) 0 1px,
    transparent 1px 3px
  );
  opacity: 0.5;
}

/* ——— карточка ——— */

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 30px 22px 26px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 8px 8px 0 var(--shadow);
  overflow: hidden;
}

/* ——— звук ——— */

.sound {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border: 2px solid var(--line);
  border-radius: 3px;
  background: var(--surface-hi);
  color: var(--muted);
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.sound:hover,
.sound[aria-pressed="true"] {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}

.sound:active { transform: translate(1px, 1px); }

.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
}

.eq i {
  width: 3px;
  height: 4px;
  background: currentColor;
  animation: eq 700ms steps(3, end) infinite paused;
}

.eq i:nth-child(2) { animation-delay: 120ms; }
.eq i:nth-child(3) { animation-delay: 240ms; }
.eq i:nth-child(4) { animation-delay: 360ms; }

body.playing .eq i { animation-play-state: running; }

.spk .wave { opacity: 0.45; transition: opacity 200ms ease; }
body.playing .spk .wave { opacity: 1; }

/* ——— шапка ——— */

.head {
  display: grid;
  justify-items: center;
  text-align: center;
}

.avatar-wrap {
  position: relative;
  width: 128px;
  height: 128px;
  margin-top: 8px;
}

.avatar-frame {
  width: 100%;
  height: 100%;
  padding: 3px;
  background: var(--accent);
  clip-path: polygon(
    8px 0,
    calc(100% - 8px) 0,
    calc(100% - 8px) 4px,
    calc(100% - 4px) 4px,
    calc(100% - 4px) 8px,
    100% 8px,
    100% calc(100% - 8px),
    calc(100% - 4px) calc(100% - 8px),
    calc(100% - 4px) calc(100% - 4px),
    calc(100% - 8px) calc(100% - 4px),
    calc(100% - 8px) 100%,
    8px 100%,
    8px calc(100% - 4px),
    4px calc(100% - 4px),
    4px calc(100% - 8px),
    0 calc(100% - 8px),
    0 8px,
    4px 8px,
    4px 4px,
    8px 4px
  );
}

.avatar {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  background: #0b0d10;
  clip-path: polygon(
    6px 0,
    calc(100% - 6px) 0,
    calc(100% - 6px) 2px,
    calc(100% - 2px) 2px,
    calc(100% - 2px) 6px,
    100% 6px,
    100% calc(100% - 6px),
    calc(100% - 2px) calc(100% - 6px),
    calc(100% - 2px) calc(100% - 2px),
    calc(100% - 6px) calc(100% - 2px),
    calc(100% - 6px) 100%,
    6px 100%,
    6px calc(100% - 2px),
    2px calc(100% - 2px),
    2px calc(100% - 6px),
    0 calc(100% - 6px),
    0 6px,
    2px 6px,
    2px 2px,
    6px 2px
  );
}

.status {
  position: absolute;
  right: -3px;
  bottom: 3px;
  z-index: 2;
  width: 13px;
  height: 13px;
  background: var(--ok);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok) 45%, transparent);
  animation: pulse 2.4s steps(2, end) infinite;
}

.name {
  margin: 20px 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(30px, 8.5vw, 40px);
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--blue);
  text-shadow: 3px 3px 0 color-mix(in srgb, var(--blue) 32%, transparent);
  transition: color 160ms ease, text-shadow 160ms ease;
}

.name:hover {
  color: var(--blue);
  text-shadow: 3px 3px 0 color-mix(in srgb, var(--blue) 55%, transparent), -2px -2px 0 color-mix(in srgb, var(--blue) 22%, transparent);
}

.tagline {
  margin: 10px 0 0;
  min-height: 22px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
  white-space: nowrap;
}

.typed {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  vertical-align: bottom;
  animation: typing 1.7s steps(29, end) 400ms forwards;
}

.caret {
  display: inline-block;
  width: 8px;
  height: 15px;
  margin-left: 3px;
  vertical-align: -2px;
  background: var(--accent);
  animation: blink 1s steps(2, end) 400ms infinite;
}

/* ——— ссылки ——— */

.links {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.link {
  display: grid;
  grid-template-columns: 40px 1fr 20px;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 2px solid var(--line);
  border-radius: 3px;
  background: var(--surface-hi);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--shadow);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.link:hover {
  transform: translate(-2px, -2px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 6px 6px 0 color-mix(in srgb, var(--accent) 35%, var(--shadow));
}

.link:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.link .ico {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

.link .txt {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.link .txt strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.link .txt small {
  color: var(--muted);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link .go {
  color: var(--muted);
  transition: color 140ms ease, transform 140ms ease;
}

.link:hover .go { color: var(--accent); transform: translate(2px, -2px); }

/* ——— низ карточки ——— */

.note {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.inline {
  color: var(--muted);
  text-underline-offset: 3px;
  transition: color 150ms ease;
}

.inline:hover { color: var(--ink); }

.rainbow {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background-image: repeating-linear-gradient(
    to right,
    #ff004d 0 14px,
    #ffa300 14px 28px,
    #ffe600 28px 42px,
    #ff8fb1 42px 56px,
    #29adff 56px 70px,
    #a15cff 70px 84px
  );
  background-size: 84px 100%;
  animation: stripe 900ms steps(6, end) infinite;
}

/* ——— a11y ——— */

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

/* ——— toast ——— */

/* ——— вход ——— */

.rise {
  opacity: 0;
  transform: translateY(10px);
  animation: rise 500ms steps(4, end) forwards;
}

.head { animation-delay: 40ms; }
.links .link:nth-child(1) { animation-delay: 110ms; }
.links .link:nth-child(2) { animation-delay: 180ms; }
.note { animation-delay: 250ms; }

/* ——— keyframes ——— */

@keyframes rise {
  to { opacity: 1; transform: none; }
}

@keyframes typing {
  to { max-width: 29ch; }
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes stripe {
  to { background-position: -84px 0; }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.14; }
  50% { opacity: 0.6; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@keyframes eq {
  0%, 100% { height: 4px; }
  50% { height: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; opacity: 1; transform: none; }
  .status, .stars i, .eq i, .rainbow, .caret { animation: none; }
  .typed { animation: none; max-width: none; }
  .name, .link, .go, .inline, .sound { transition: none; }
  .link:hover, .link:active { transform: none; box-shadow: 4px 4px 0 var(--shadow); }
}

@media (max-width: 400px) {
  .card { padding: 26px 16px 24px; }
  .avatar-wrap, .avatar { width: 112px; height: 112px; }
  .link { grid-template-columns: 36px 1fr 18px; gap: 10px; }
  .link .ico { width: 36px; height: 36px; }
}

