/* All design tokens now live in tokens.css — loaded before this file.
   HTML reset and component styles follow. */
html {
  color-scheme: dark;
}

/* Light theme and TV mode token overrides now live in tokens.css. */

:focus-visible {
  outline: var(--tv-focus-outline-width) solid var(--accent-color);
  outline-offset: var(--tv-focus-outline-offset);
  transition: outline-offset 0.15s ease;
}

:target {
  scroll-margin-top: clamp(6rem, 12vh, 9rem);
}

img,
video,
canvas {
  content-visibility: auto;
}

/* Light theme and TV mode token overrides now live in tokens.css. */
.sr-only {
  /* biome-ignore lint/complexity/noImportantStyles: a11y utility */
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: max(0.9rem, env(safe-area-inset-left));
  right: auto;
  top: -6rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--card-bg);
  color: var(--text-color);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--surface-border);
  transition:
    top 0.2s ease,
    opacity 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
  z-index: var(--z-dropdown);
  min-height: 46px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.skip-link:focus-visible {
  top: max(4.2rem, calc(env(safe-area-inset-top) + 3.4rem));
  opacity: 1;
  outline: var(--tv-focus-outline-width) solid var(--accent-color);
  outline-offset: var(--tv-focus-outline-offset);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

@media (hover: none) and (pointer: coarse) {
  .skip-link {
    display: none;
  }
}

body,
html {
  padding: 0;
  font-family: var(--font-family-base);
  font-size: calc(16px * var(--tv-scale-multiplier) * var(--ui-scale));
  background:
    radial-gradient(
      circle at 15% 0%,
      rgba(95, 192, 181, 0.14),
      rgba(211, 137, 84, 0.16) 42%,
      transparent 50%
    ),
    linear-gradient(180deg, var(--bg-color) 0%, var(--bg-color-secondary) 100%);
  color: var(--text-color);
  overflow-x: hidden;
  min-height: 100%;
}

html {
  overflow-y: auto;
}

body {
  overflow-y: visible;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  scroll-margin-top: 6rem;
  text-wrap: balance;
}

section,
footer {
  scroll-margin-top: 6rem;
}

.brand-copy .eyebrow {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.75;
}

header {
  margin-bottom: 3rem;
  position: relative;
}

header.hero {
  min-height: 55vh;
  padding: clamp(2.4rem, 2vw + 1.4rem, 3.2rem);
  overflow: hidden;
  border-radius: 24px;
  background:
    linear-gradient(
      165deg,
      color-mix(in srgb, var(--panel-highlight) 80%, transparent),
      transparent 45%
    ),
    var(--aurora-soft), var(--card-bg);
  box-shadow: var(--shadow-surface);
  border: 1px solid var(--surface-border);
}

.intro .section-heading h1 {
  font-size: clamp(2.8rem, 1.6rem + 3.4vw, 4rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
}

.intro .section-heading .section-description {
  font-size: 1.05rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.86rem;
  font-weight: 600;
  opacity: 0.85;
  margin: 0 0 0.5rem;
}

.hero-cta-row .cta-button {
  width: 100%;
  justify-content: center;
}

.hero-cta-row .cta-button.primary {
  grid-column: 1 / -1;
}

.intro h1 {
  margin: 0;
  font-size: clamp(1.45rem, 1.1rem + 1.3vw, 2rem);
  line-height: 1.2;
}

.intro .cta-helper {
  margin: 0;
}

html.light .cta-helper {
  color: color-mix(in srgb, var(--text-color) 85%, var(--accent-color));
}

.cta-button {
  padding: 0.7rem 1.25rem;
  border-radius: 12px;
  background: var(--interactive-bg);
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--interactive-border);
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 0 var(--stims-white-04) inset;
  transition:
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease,
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    filter 0.35s ease;
  background-size: auto;
  animation: none;
  touch-action: manipulation;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
}

.cta-button:active {
  transform: scale(0.97);
  transition-duration: 60ms;
}

.cta-button.primary {
  background: linear-gradient(
    130deg,
    color-mix(in srgb, var(--accent-color) 74%, #4f86d9),
    color-mix(in srgb, var(--accent-purple) 58%, #1d4ed8)
  );
  color: var(--accent-contrast);
  border-color: color-mix(in srgb, #1d4ed8 52%, var(--surface-border));
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}

.cta-button.ghost {
  background: color-mix(in srgb, var(--interactive-bg) 92%, transparent);
  border-color: var(--interactive-border);
  color: var(--text-color);
}

.cta-button:hover {
  filter: none;
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 var(--stims-white-04) inset,
    var(--interactive-shadow);
  color: var(--text-color);
}

.cta-button.primary:hover {
  color: var(--accent-contrast);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.34);
}

@media (prefers-reduced-motion: reduce) {
  header.hero,
  .cta-button {
    backdrop-filter: none;
    transition: none;
    transform: none;
  }

  .cta-button:hover {
    transform: none;
  }
}

.cta-button:focus-visible {
  outline: var(--tv-focus-outline-width) solid var(--accent-color);
  outline-offset: var(--tv-focus-outline-offset);
}

.cta-button::after {
  content: none;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.library {
  margin-top: clamp(1.5rem, 2.8vw, 2.6rem);
  padding-top: clamp(1.1rem, 1.8vw, 1.55rem);
  border-top: 1px solid
    color-mix(in srgb, var(--accent-color) 24%, var(--surface-border));
}

html.light .search-meta {
  background:
    var(--surface-highlight), var(--surface-texture),
    color-mix(in srgb, var(--card-bg) 90%, var(--accent-color));
  border-color: color-mix(
    in srgb,
    var(--accent-color) 18%,
    var(--surface-border)
  );
  color: var(--text-color);
  box-shadow: inset 0 0 0 1px
    color-mix(in srgb, var(--accent-color) 12%, transparent);
}

html.light .search-meta__results,
html.light .search-meta__note {
  color: var(--text-color);
}

html.light .search-meta__tokens li {
  border-color: color-mix(
    in srgb,
    var(--accent-color) 24%,
    var(--surface-border)
  );
  color: var(--text-color);
  background: color-mix(in srgb, var(--card-bg) 92%, var(--accent-color));
}

html.light .active-filters__status {
  color: color-mix(in srgb, var(--text-color) 95%, #0f172a);
}

html.light .library-refine > summary,
html.light .more-filters > summary {
  color: color-mix(in srgb, var(--text-color) 90%, #0f172a);
}

html.light .search-meta__note {
  color: color-mix(in srgb, var(--text-color) 84%, #0f172a);
}

html:not(.light) .webtoy-card {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 0 0 1px var(--stims-white-04),
    var(--shadow-soft),
    var(--surface-emboss);
}

/* Gradient shimmer overlay */

html.light .top-nav,
html.light section.intro,
html.light .library-search,
html.light .webtoy-card {
  border-color: rgba(43, 56, 77, 0.16);
}

html.light .cta-button.ghost,
html.light .filter-chip,
html.light .sort-control,
html.light .filter-toggle {
  border-color: rgba(43, 56, 77, 0.2);
  background: color-mix(in srgb, var(--card-bg) 94%, transparent);
}

html.light .filter-chip {
  color: color-mix(in srgb, var(--text-color) 92%, #0f172a);
}

html.light .filter-chip.is-active {
  background: color-mix(in srgb, var(--accent-color) 38%, #e7eef8);
  border-color: rgba(29, 78, 216, 0.88);
  color: #102544;
  box-shadow:
    0 0 0 2px rgba(37, 99, 235, 0.32),
    0 6px 16px rgba(15, 23, 42, 0.12);
}

html.light .library {
  border-top-color: rgba(63, 74, 90, 0.2);
}

html.light .filter-chip.is-active::before {
  color: #1d4ed8;
}

html.light .cta-button.primary {
  background: linear-gradient(130deg, #3f6ea8, #315f97);
  border-color: rgba(29, 78, 216, 0.54);
}

.webtoy-card-actions .cta-button {
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 0.78rem;
  font-size: 0.79rem;
}

footer {
  text-align: center;
  margin-top: calc(var(--section-gap) * 0.8);
  padding: 1.25rem;
  border-top: 1px solid var(--surface-border);
}

.footer-cta-row .cta-button {
  box-shadow:
    var(--shadow-soft),
    0 0 0 1px var(--stims-white-08);
}

.footer-cta-row .cta-button.ghost {
  background:
    var(--surface-texture), color-mix(in srgb, var(--card-bg) 88%, transparent);
  border-color: color-mix(
    in srgb,
    var(--accent-color) 25%,
    var(--surface-border)
  );
}

@media (max-width: 900px) {
  :root {
    --radius-lg: 18px;
    --radius-md: 12px;
  }

  .hero-utility-row .cta-button,
  .experience-shortcuts .cta-button {
    flex: 1 1 100%;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 0.97rem;
  }

  .webtoy-card-actions .cta-button {
    width: 100%;
    justify-content: center;
  }

  header.hero {
    min-height: auto;
  }
}

@media (max-width: 920px) and (max-height: 520px) and (orientation: landscape) {
  header.hero {
    min-height: auto;
  }
}

@media (max-width: 768px) {
  h2 {
    font-size: clamp(1.4rem, 4vw, 1.8rem);
  }

  h1 {
    font-size: 1.9rem;
  }

  .hero-cta-row .cta-button.primary {
    letter-spacing: 0.04em;
  }
}

@media (max-width: 520px) {
  .skip-link:focus-visible {
    top: max(3.6rem, calc(env(safe-area-inset-top) + 3rem));
  }

  h1 {
    font-size: clamp(1.6rem, 7vw, 1.8rem);
  }

  .library {
    margin-top: 1.35rem;
    padding-top: 0.8rem;
  }

  #site-footer {
    padding-inline: 0.95rem;
  }

  .footer-cta-row .cta-button {
    width: 100%;
  }

  .hero-cta-row .cta-button {
    min-height: 50px;
  }

  .cta-button {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 0.95rem;
    font-size: 0.95rem;
  }
  .hero-cta-row .cta-button.cta-button--muted,
  .hero-cta-row .cta-button.cta-button--accent {
    display: none;
  }

  .hero-cta-row .cta-button.primary,
  .hero-cta-row .cta-button.ghost {
    min-height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-actions .cta-button.primary {
    animation: none;
  }
}

/* Minimal home refresh */

.intro-actions .cta-button {
  min-width: 8.75rem;
  border-radius: 10px;
  border-color: color-mix(
    in srgb,
    var(--accent-color) 30%,
    var(--surface-border)
  );
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  transform: translateZ(0);
}

.intro-actions .cta-button.primary {
  background-size: auto;
  animation: homeHeroButtonPulse 5.4s ease-in-out infinite;
}

@media (max-width: 700px) {
  .intro-actions .cta-button {
    width: 100%;
  }
}

body.tv-mode .top-nav {
  top: max(1.2rem, env(safe-area-inset-top));
  padding: 1rem 1.25rem;
}

body.tv-mode .nav-link,
body.tv-mode .cta-button,
body.tv-mode .filter-chip,
body.tv-mode .webtoy-card__link,
body.tv-mode .theme-toggle {
  min-height: 56px;
  padding-block: 0.8rem;
  padding-inline: 1rem;
  font-size: 1.02rem;
}

body.tv-mode .webtoy-card {
  width: clamp(300px, 34cqi, 420px);
}

body.tv-mode .content {
  max-width: min(1380px, calc(100vw - 2 * var(--tv-safe-padding, 0px)));
}

.library {
  position: relative;
  z-index: var(--z-stage-root);
}

/* UI polish v2: stronger hierarchy, better readability, and less cramped cards */

.intro h1 {
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.intro .cta-helper {
  max-width: 70ch;
  line-height: 1.68;
}

.library {
  margin-top: clamp(2.1rem, 4vw, 3.2rem);
  padding-top: clamp(1.2rem, 2.1vw, 1.8rem);
}

@keyframes homeHeroButtonPulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  }
  50% {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 14px 28px
      color-mix(in srgb, var(--accent-color) 28%, transparent);
  }
}

@keyframes headingBeam {
  0%,
  100% {
    transform: scaleX(0.9);
    filter: saturate(0.95);
  }
  50% {
    transform: scaleX(1.08);
    filter: saturate(1.2);
  }
}

@keyframes milkdropPulse {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.66;
  }

  50% {
    transform: scale(1.04);
    opacity: 0.9;
  }
}

@keyframes milkdropMesh {
  0%,
  100% {
    transform: perspective(720px) rotateX(66deg) rotateZ(-6deg) scale(0.98);
  }

  50% {
    transform: perspective(720px) rotateX(66deg) rotateZ(4deg) scale(1.02);
  }
}

@keyframes milkdropWave {
  0%,
  100% {
    clip-path: polygon(
      0% 55%,
      10% 46%,
      22% 62%,
      35% 44%,
      50% 58%,
      64% 42%,
      78% 60%,
      90% 45%,
      100% 54%,
      100% 70%,
      0% 70%
    );
  }

  50% {
    clip-path: polygon(
      0% 48%,
      12% 61%,
      24% 43%,
      36% 58%,
      50% 40%,
      65% 63%,
      78% 46%,
      90% 57%,
      100% 46%,
      100% 70%,
      0% 70%
    );
  }
}

@keyframes milkdropCore {
  0%,
  100% {
    transform: translate(-50%, -50%) rotate(0deg) scale(0.94);
    border-radius: 24px;
  }

  50% {
    transform: translate(-50%, -50%) rotate(14deg) scale(1.08);
    border-radius: 18px;
  }
}

@keyframes streakScan {
  0%,
  100% {
    transform: scaleX(0.35);
    transform-origin: left center;
    opacity: 0.7;
  }
  50% {
    transform: scaleX(1);
    transform-origin: left center;
    opacity: 1;
  }
}

@keyframes cardRiseIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cardTiltIn {
  0% {
    opacity: 0;
    transform: translate3d(-14px, 18px, 0) rotate(-1.4deg) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0) scale(1);
  }
}

@keyframes cardGlideIn {
  0% {
    opacity: 0;
    transform: translate3d(16px, 10px, 0) scale(0.97);
    filter: saturate(0.85);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: saturate(1);
  }
}

@keyframes cardBloomIn {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.94);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes quickCardBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes quickCardSway {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  35% {
    transform: translateX(2px) rotate(0.35deg);
  }
  70% {
    transform: translateX(-2px) rotate(-0.35deg);
  }
}

@keyframes quickCardLift {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-3px) scale(1.01);
  }
}

@keyframes repoMetricPulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  }
  50% {
    transform: translateY(-3px) scale(1.015);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
  }
}

@keyframes repoMetricFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes repoMetricTilt {
  0%,
  100% {
    transform: perspective(400px) rotateX(0deg);
  }
  50% {
    transform: perspective(400px) rotateX(4deg) translateY(-2px);
  }
}

/* Page-level panel tokens now in tokens.css */

.eyebrow {
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--text-muted) 86%, var(--accent-color));
  margin-bottom: 0.35rem;
}

.cta-button {
  border-radius: 14px;
  padding: 0.78rem 1.2rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 0 var(--stims-white-04) inset;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.cta-button.primary {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent-color) 78%, #4f86d9),
    color-mix(in srgb, var(--accent-magenta) 42%, #315f97)
  );
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 var(--stims-white-05) inset,
    0 14px 24px rgba(0, 0, 0, 0.18);
}

.cta-button.primary:hover {
  box-shadow: 0 16px 28px rgba(37, 99, 235, 0.26);
}

.library {
  margin-top: clamp(2.4rem, 4vw, 3.4rem);
  padding-top: clamp(1.3rem, 2vw, 1.9rem);
}

footer {
  margin-top: calc(var(--section-gap) * 1.05);
  padding: 1.4rem 1.2rem 1.8rem;
}

.shell-header--launch .shell-panel[data-audio-controls] > .control-panel,
.shell-header--launch .shell-panel[data-settings-panel] > .control-panel,
.shell-header--launch .shell-panel > [data-audio-controls] > .control-panel,
.shell-header--launch .shell-panel > [data-settings-panel] > .control-panel {
  max-height: none;
  overflow: visible;
}

.shell-header--launch .shell-panel[data-settings-panel] > .control-panel,
.shell-header--launch .shell-panel > [data-settings-panel] > .control-panel {
  min-height: 100%;
}

body,
html {
  /* No font-family here: --display-font was never defined, which made this
     declaration invalid at computed-value time and silently dropped the whole
     app back to the UA serif. The stack set earlier in this file stands. */
  background:
    radial-gradient(
      circle at 12% 0%,
      color-mix(in srgb, var(--accent-purple) 20%, transparent),
      transparent 26%
    ),
    radial-gradient(
      circle at 88% 14%,
      color-mix(in srgb, var(--accent-magenta) 18%, transparent),
      transparent 28%
    ),
    linear-gradient(
      145deg,
      var(--bg-color) 0%,
      color-mix(in srgb, var(--bg-color-secondary) 88%, #071112) 54%,
      #050a0b 100%
    );
}

header.hero,
.library-search,
.control-panel,
.active-toy-nav,
.active-toy-status__content,
.toy-shell-escape__link {
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--panel-highlight) 88%, transparent),
      transparent 58%
    ),
    var(--surface-texture), var(--panel-gradient);
  border-color: var(--surface-border-strong);
  box-shadow: var(--shadow-panel);
  backdrop-filter: none;
}

.cta-button,
.control-panel__label,
.eyebrow {
  font-family: var(--font-family-mono);
}

.cta-button {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  letter-spacing: 0.15em;
  font-size: 0.72rem;
}

header.hero::before {
  background:
    radial-gradient(
      circle at 16% 18%,
      color-mix(in srgb, var(--accent-purple) 24%, transparent),
      transparent 32%
    ),
    radial-gradient(
      circle at 82% 0%,
      color-mix(in srgb, var(--accent-magenta) 24%, transparent),
      transparent 32%
    ),
    linear-gradient(135deg, var(--stims-white-04), transparent 42%);
  opacity: 0.5;
}

header.hero::after {
  background: linear-gradient(
    120deg,
    transparent 0%,
    var(--stims-white-06) 48%,
    transparent 100%
  );
  opacity: 0.12;
}

.cta-button {
  min-height: 46px;
  border-radius: 10px;
  padding: 0.82rem 1.05rem;
  font-size: 0.78rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--panel-solid) 92%, transparent);
  border-color: color-mix(
    in srgb,
    var(--accent-color) 26%,
    var(--surface-border)
  );
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 var(--stims-white-05);
}

.cta-button.primary {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent-color) 92%, #d6fbe8),
    color-mix(in srgb, var(--accent-magenta) 74%, #ffd19f)
  );
  border-color: color-mix(in srgb, var(--accent-magenta) 42%, #ffffff);
  color: #071315;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.24),
    0 0 0 1px var(--stims-white-12) inset;
}

.cta-button.ghost {
  background: color-mix(in srgb, var(--panel-solid) 94%, transparent);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 28px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 var(--stims-white-06);
}

.cta-button.primary:hover {
  box-shadow:
    0 18px 32px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.16) inset;
}

.control-panel,
.active-toy-nav,
.active-toy-status__content {
  border-radius: 18px;
}

@supports (container-type: inline-size) {
  @container home-hero (max-width: 900px) {
    .hero-cta-row .cta-button.primary {
      grid-column: auto;
    }
  }
}

@media (hover: none), (pointer: coarse) {
  .cta-button:hover {
    transform: none;
    color: inherit;
    box-shadow: 0 1px 0 var(--stims-white-04) inset;
  }

  .cta-button.primary:hover {
    box-shadow:
      0 12px 28px rgba(0, 0, 0, 0.24),
      0 0 0 1px var(--stims-white-12) inset;
  }
}

@media (max-width: 760px) {
  .cta-button {
    letter-spacing: 0.05em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cta-button {
    animation: none;
    transition: none;
  }
}

header.hero,
.library-search,
.control-panel,
.active-toy-nav,
.active-toy-status__content,
.toy-shell-escape__link {
  background:
    linear-gradient(180deg, var(--stims-white-12), var(--stims-white-02) 18%),
    var(--surface-texture), var(--panel-gradient);
  border: 1px solid var(--surface-border-strong);
  box-shadow: var(--shadow-panel);
}

.control-panel {
  position: relative;
}

.control-panel::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, transparent, #f47a54 50%, transparent);
  opacity: 0.82;
  pointer-events: none;
}

.cta-button {
  border-radius: 6px;
}

.cta-button {
  background: #273654;
  border-color: rgba(208, 220, 255, 0.34);
  color: var(--text-color);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 -1px 0 rgba(2, 5, 12, 0.45) inset,
    0 12px 24px rgba(4, 9, 18, 0.22);
}

.cta-button.primary {
  background: #7dd83f;
  border-color: rgba(228, 255, 208, 0.62);
  color: #081108;
  text-shadow: none;
}

.cta-button.ghost {
  background: #2e3a5d;
}

.cta-button:hover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 -1px 0 rgba(2, 5, 12, 0.45) inset,
    0 16px 28px rgba(4, 9, 18, 0.26);
}

.active-toy-container {
  background:
    radial-gradient(circle at 18% 10%, var(--stims-audio-glow), transparent 24%),
    radial-gradient(circle at 82% 16%, var(--highlight-glow), transparent 22%),
    linear-gradient(
      180deg,
      var(--bg-color),
      color-mix(in srgb, var(--bg-color) 92%, #000) 54%,
      color-mix(in srgb, var(--bg-color) 85%, #000)
    );
}

.control-panel,
.active-toy-status__content,
.active-toy-nav,
.toy-shell-escape__link {
  border-radius: 6px;
  box-shadow:
    0 16px 30px rgba(2, 4, 10, 0.36),
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 -1px 0 rgba(14, 19, 33, 0.7) inset,
    1px 0 0 var(--stims-white-08) inset,
    -1px 0 0 rgba(14, 19, 33, 0.4) inset;
}

.control-panel::before {
  left: 8px;
  right: 8px;
  top: 8px;
  height: 2px;
}

.cta-button {
  font-size: 0.72rem;
}

.cta-button {
  border-radius: 4px;
}

.cta-button {
  padding: 0.72rem 0.95rem;
  letter-spacing: 0.11em;
}

.launch-panels .shell-panel[data-audio-controls] > .control-panel,
.launch-panels .shell-panel[data-settings-panel] > .control-panel,
.launch-panels .shell-panel > [data-audio-controls] > .control-panel,
.launch-panels .shell-panel > [data-settings-panel] > .control-panel {
  max-height: none;
  overflow: visible;
}

.launch-panels .shell-panel[data-settings-panel] > .control-panel,
.launch-panels .shell-panel > [data-settings-panel] > .control-panel {
  min-height: 100%;
}

.home-stage__copy .tagline {
  max-width: 33rem;
  margin: 0;
  font-size: clamp(1rem, 1vw + 0.88rem, 1.22rem);
  line-height: 1.58;
  color: color-mix(in srgb, var(--text-color) 92%, transparent);
}

@keyframes home-orb-float {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) scale(1);
  }

  50% {
    transform: translateX(-50%) translateY(-10px) scale(1.04);
  }
}

@keyframes home-waveform-pulse {
  0%,
  100% {
    transform: scaleY(0.88);
    opacity: 0.7;
  }

  50% {
    transform: scaleY(1.12);
    opacity: 1;
  }
}

/* UI hierarchy refresh: keep first-run messaging short and make setup feel secondary. */

.home-stage__copy .tagline {
  max-width: 30rem;
  font-size: clamp(1rem, 0.8vw + 0.92rem, 1.15rem);
  line-height: 1.5;
}

@media (max-width: 640px) {
  .brand-copy .eyebrow {
    font-size: 0.68rem;
  }

  .home-stage__copy .tagline {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .launch-intro__actions .cta-button {
    width: 100%;
    min-width: 0;
  }

  .launch-panels .shell-panel[data-audio-controls] > .control-panel,
  .launch-panels .shell-panel[data-settings-panel] > .control-panel,
  .launch-panels .shell-panel > [data-audio-controls] > .control-panel,
  .launch-panels .shell-panel > [data-settings-panel] > .control-panel {
    border-radius: 20px;
  }
}

/* Mobile-first homepage revamp */

@media (max-height: 520px) and (orientation: landscape) {
  .launch-intro__actions .cta-button {
    min-height: 48px;
  }
}

/* Aggressive screen redesign: reduce repeated chrome and strengthen stage hierarchy. */

:root[data-focused-session="live"] body[data-page="experience"] .content {
  padding-top: max(0.85rem, env(safe-area-inset-top));
}

@keyframes launch-stage-pulse {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
  }

  18% {
    opacity: 0.4;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.02);
  }
}

/* Homepage redesign pass */
