:root {
  --bg: #fbf8f3;
  --ink: #1c1613;
  --muted: #776d63;
  --line: #ece2d5;
  --red: #ff3d34;
  --red-deep: #ff5a3c;
  --amber: #ffaf3a;
  --amber-ink: #d98e2f;
  --card: rgba(255, 255, 255, 0.74);
  --radius: 24px;
  --shadow: 0 32px 64px -34px rgba(124, 68, 24, 0.34), 0 2px 8px rgba(124, 68, 24, 0.06);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 28px 20px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background:
    radial-gradient(120% 70% at 50% -18%, #fff1de 0%, rgba(255, 241, 222, 0) 62%),
    radial-gradient(90% 60% at 100% 102%, #ffefe9 0%, rgba(255, 239, 233, 0) 58%),
    var(--bg);
  font-family: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(255, 175, 58, 0.35);
}

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

.stage {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* ---------- brand ---------- */

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.mark {
  width: 184px;
  max-width: 54vw;
}

.mark svg {
  display: block;
  width: 100%;
  height: auto;
}

.wordmark {
  margin: 16px 0 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
  color: var(--amber-ink);
}

.tagline {
  margin: 14px 0 0;
  font-size: clamp(25px, 5.4vw, 31px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

/* ---------- radio card ---------- */

.player {
  width: 100%;
  padding: 22px 24px 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(228, 214, 198, 0.6);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), var(--card));
  box-shadow: var(--shadow), inset 0 1px 0 #fff;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .player {
    background: rgba(255, 255, 255, 0.94);
  }
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
}

.dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c6bbaf;
  transition: background 0.3s;
}

.is-playing .dot {
  background: var(--red);
  animation: dot-pulse 2.4s ease-out infinite;
}

.is-loading .dot {
  background: var(--amber);
  animation: dot-pulse 1.3s ease-out infinite;
}

.is-error .dot {
  background: #b9aea3;
}

@keyframes dot-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 61, 52, 0.4);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(255, 61, 52, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 61, 52, 0);
  }
}

.status__text {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  transition: color 0.2s;
}

.is-paused .status__text,
.is-error .status__text {
  color: var(--muted);
}

.status__note {
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #a99d90;
}

.is-error .status__note,
.is-silent .status__note {
  display: none;
}

.unmute {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(217, 142, 47, 0.42);
  background: rgba(255, 175, 58, 0.13);
  color: #a9631b;
  font-family: inherit;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.unmute[hidden] {
  display: none;
}

.unmute svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
}

.unmute:hover {
  background: rgba(255, 175, 58, 0.24);
  border-color: rgba(217, 142, 47, 0.6);
}

/* waveform */

.wave {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  margin: 16px 0 20px;
}

.wave span {
  flex: 0 0 auto;
  width: 3px;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--amber) 0%, var(--red) 100%);
  transform: scaleY(0.2);
  transform-origin: center;
  transition: opacity 0.3s;
  will-change: transform;
}

.is-paused .wave span {
  opacity: 0.6;
}

.is-error .wave span {
  opacity: 0.25;
}

/* controls */

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.play {
  position: relative;
  width: 60px;
  height: 60px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(150deg, #ff6a3d 0%, var(--red) 58%, #ff2f4e 100%);
  box-shadow: 0 14px 26px -14px rgba(255, 70, 50, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, opacity 0.2s;
}

.play:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 18px 32px -14px rgba(255, 70, 50, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.play:active:not(:disabled) {
  transform: scale(0.97);
}

.play:disabled {
  opacity: 0.4;
  cursor: default;
}

.play .icon {
  grid-area: 1 / 1;
  width: 25px;
  height: 25px;
  fill: currentColor;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s, transform 0.2s var(--ease);
}

.play .icon--play {
  opacity: 1;
  transform: none;
  margin-left: 2px;
}

.is-playing .play .icon--play {
  opacity: 0;
  transform: scale(0.6);
}

.is-playing .play .icon--pause {
  opacity: 1;
  transform: none;
}

.is-silent .play .icon--play,
.is-silent .play .icon--pause {
  opacity: 0;
  transform: scale(0.6);
}

.is-silent .play .icon--sound {
  opacity: 1;
  transform: none;
}

.play::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(255, 61, 52, 0.4);
  opacity: 0;
  transform: scale(0.9);
}

.is-silent .play::before {
  opacity: 1;
  animation: ring-pulse 2.4s ease-out infinite;
}

@keyframes ring-pulse {
  0% {
    transform: scale(0.92);
    opacity: 0.7;
  }
  70% {
    transform: scale(1.16);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.play::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: rgba(255, 61, 52, 0.55);
  opacity: 0;
  transition: opacity 0.2s;
}

.is-buffering .play::after {
  opacity: 1;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.volume {
  display: flex;
  align-items: center;
  gap: 4px;
}

.volume .icon--muted {
  display: none;
}

.is-muted .volume .icon--muted {
  display: block;
}

.is-muted .volume .icon--vol {
  display: none;
}

.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s var(--ease), opacity 0.2s;
}

.icon-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.icon-btn:hover {
  background: rgba(255, 175, 58, 0.14);
  color: var(--ink);
}

.icon-btn:active {
  transform: scale(0.93);
}

/* volume slider */

.range {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 96px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 99px;
  background:
    linear-gradient(90deg, var(--amber), #ff7a3d) 0 0 / var(--p, 0%) 100% no-repeat,
    var(--line);
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border-radius: 50%;
  border: 2px solid var(--amber-ink);
  background: #fff;
  box-shadow: 0 2px 6px rgba(70, 35, 15, 0.2);
  transition: transform 0.15s var(--ease);
}

.range:hover::-webkit-slider-thumb,
.range:focus-visible::-webkit-slider-thumb {
  transform: scale(1.18);
}

.range::-moz-range-track {
  height: 4px;
  border-radius: 99px;
  background: var(--line);
}

.range::-moz-range-progress {
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--amber), #ff7a3d);
}

.range::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--amber-ink);
  background: #fff;
  box-shadow: 0 2px 6px rgba(70, 35, 15, 0.2);
}

/* ссылка на «Планету Железяка» */

.sister {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--amber-ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.sister:hover,
.sister:focus-visible {
  color: var(--red);
  border-color: rgba(255, 61, 52, 0.35);
  background: rgba(255, 255, 255, 0.85);
}

.sister:focus-visible {
  outline: 2px solid rgba(255, 175, 58, 0.6);
  outline-offset: 3px;
}

.sister__arrow {
  width: 16px;
  height: 16px;
  flex: none;
}

@media (prefers-reduced-motion: no-preference) {
  .sister {
    animation: rise 0.75s var(--ease) 0.1s both;
  }

  .sister__arrow {
    animation: sister-nudge 1.8s ease-in-out infinite;
  }

  .sister:hover .sister__arrow {
    animation-duration: 0.9s;
  }
}

@keyframes sister-nudge {
  0%, 55%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(4px);
  }
}

/* footer */

.footer {
  font-size: 12px;
  color: #7d7369;
  letter-spacing: 0.01em;
}

.noscript {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* focus */

:focus-visible {
  outline: 2px solid rgba(255, 90, 60, 0.65);
  outline-offset: 3px;
}

.range:focus-visible {
  outline-offset: 6px;
  border-radius: 99px;
}

/* entrance */

@media (prefers-reduced-motion: no-preference) {
  .brand,
  .player,
  .footer {
    animation: rise 0.75s var(--ease) both;
  }

  .player {
    animation-delay: 0.06s;
  }

  .footer {
    animation-delay: 0.12s;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* small screens */

@media (max-width: 420px) {
  body {
    padding: 22px 16px;
  }

  .stage {
    gap: 20px;
  }

  .mark {
    width: 152px;
  }

  .player {
    padding: 20px 18px 16px;
  }

  .wave {
    height: 46px;
    margin: 14px 0 18px;
  }

  .play {
    width: 54px;
    height: 54px;
  }

  .play .icon {
    width: 23px;
    height: 23px;
  }

  .range {
    width: 72px;
  }

  .status__note {
    font-size: 8.5px;
  }
}

@media (max-height: 640px) and (min-width: 421px) {
  .mark {
    width: 128px;
  }

  .tagline {
    font-size: 23px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
