:root {
  color-scheme: light;
  --background: #fff;
  --ink: #161625;
  --muted: #555565;
  --panel: #f7f7f9;
  --border: #e5e5ec;
  --selection: #e8e8f0;
  --spectrum: linear-gradient(135deg, #00dce4, #253cff 42%, #c000e9 68%, #ffbc00);
  font-family: Inter, system-ui, sans-serif;
}

:root[data-variant="barvni-temni"],
:root[data-variant="beli"] {
  color-scheme: dark;
  --background: #000;
  --ink: #f5f5fa;
  --muted: #bcbcca;
  --panel: #14141f;
  --border: #2b2b39;
  --selection: #323244;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--background);
  color: var(--ink);
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  overflow: hidden;
  overflow: clip;
  min-height: 0;
  padding: 12px 0;
}

.logo-frame {
  position: relative;
  width: min(148vw, 1040px, max(220px, calc(190vh - 320px)));
  width: min(148vw, 1040px, max(220px, calc(190svh - 320px)));
}

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

.logo--mono,
[data-logo="barvni-temni"] { filter: contrast(1.14); }

.footer {
  display: flex;
  justify-content: center;
  padding: 0 10px max(20px, env(safe-area-inset-bottom));
}

.contact {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
  text-decoration-color: var(--muted);
  text-underline-offset: 0.24em;
}

.contact:hover, .contact:focus-visible { text-decoration-color: currentColor; }

.header {
  display: flex;
  justify-content: flex-end;
  padding-inline: clamp(12px, 3vw, 32px);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: max(16px, env(safe-area-inset-top));
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--panel);
}

.variants { display: flex; }

button {
  border: 0;
  border-radius: 999px;
  min-height: 44px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }

.variant {
  width: 44px;
  display: grid;
  place-items: center;
}

.variant[aria-pressed="true"] .swatch {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

.swatch {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #868696;
  border-radius: 50%;
  background: #fff;
  color: #11111e;
}

.swatch::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

[data-choice^="barvni"] .swatch::after { background: var(--spectrum); }
[data-choice="barvni-temni"] .swatch { background: #000; }
[data-choice="beli"] .swatch { background: #000; color: #fff; }

.autoplay {
  display: grid;
  place-items: center;
  width: 44px;
  padding: 0;
  color: var(--muted);
}

.autoplay[aria-pressed="true"] { background: var(--selection); color: var(--ink); }

.playback-icon {
  display: block;
  width: 8px;
  height: 10px;
  border-left: 8px solid currentColor;
  border-block: 5px solid transparent;
}

.autoplay[aria-pressed="true"] .playback-icon {
  border-block: 0;
  border-inline: 2px solid currentColor;
}

@media (hover: hover) {
  button:hover { background: var(--selection); }
}

@media (max-width: 480px) {
  .header { justify-content: center; }
}

@media (prefers-reduced-motion: no-preference) {
  .intro-playing .logo-frame::before,
  .intro-playing .logo-frame::after {
    content: "";
    position: absolute;
    top: 50%;
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
  }

  .intro-playing .logo-frame::before {
    left: 50%;
    width: clamp(54px, 14vw, 120px);
    aspect-ratio: 1;
    background: radial-gradient(circle, #4c66ff45, #be46ff28 32%, transparent 68%);
    animation: intro-pulse 1250ms ease-out;
  }

  .intro-playing .logo-frame::after {
    inset-inline: 20%;
    height: 3px;
    background: var(--spectrum);
    box-shadow: 0 0 16px #7b45f565;
    animation: intro-light 1480ms cubic-bezier(0.25, 0.7, 0.3, 1) 240ms;
  }

  .intro-playing .logo-reveal {
    animation: intro-logo 2500ms ease-out;
  }

  .intro-playing .header,
  .intro-playing .footer {
    animation: intro-controls 380ms ease-out 2120ms backwards;
  }

  .intro-playing .header:focus-within,
  .intro-playing .footer:focus-within { opacity: 1 !important; }
}

@keyframes intro-pulse {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.08); }
  24% { opacity: 1; transform: translate(-50%, -50%) scale(0.45); }
  60% { opacity: 0.75; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.15); }
}

@keyframes intro-light {
  0% { opacity: 0; transform: scaleX(0.018) scaleY(2.1); }
  15% { opacity: 1; }
  57% { opacity: 1; transform: scaleX(1) scaleY(1); }
  100% { opacity: 0; transform: scaleX(1.1) scaleY(0.35); }
}

@keyframes intro-logo {
  0%, 34% { opacity: 0; clip-path: inset(49% 14%); transform: scale(0.92); }
  58% { opacity: 1; clip-path: inset(29% 10%); }
  85% { opacity: 1; clip-path: inset(0); transform: scale(1.014); }
  100% { opacity: 1; clip-path: inset(0); transform: scale(1); }
}

@keyframes intro-controls {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
