/* Self-hosted font declarations */
@font-face {
  font-family: 'Figtree';
  src: url('Assets/Fonts/Figtree/Figtree-VariableFont_wght.ttf') format('truetype');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --terminal-purple: #af92e1;
  --terminal-white: #e1e1e1;
  --terminal-pink: #eb7ad4;
  --terminal-blue: #85b5f9;
  --terminal-green: #76d675;
  --terminal-yellow: #ffb300;
  --terminal-red: #f87171;
  --surface-card: rgba(33, 33, 33, 0.5);
  --surface-bar: rgba(42, 42, 42, 0.5);
  --surface-terminal: rgba(11, 11, 18, 0.0);
  --surface-dark: #0a0a12;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --font-terminal: 'JetBrains Mono', monospace;
  --font-display: 'Figtree', -apple-system, BlinkMacSystemFont, 'Proxima Nova', 'Segoe UI', sans-serif;
  --smooth-corner-shape: superellipse(1.5);
  --next-step-glow-duration: 2.8s;
  --next-step-glow-drift-duration: 2.8s;
  --next-step-glow-fade-duration: 0.9s;
  --next-step-glow-fade-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --card-crt-raster-display: none;
  --page-width: 960px;
  --page-gutter: 20px;
  --page-shell-top-gap: clamp(24px, 4vh, 40px);
  --page-shell-bottom-gap: clamp(24px, 4vh, 36px);
  --control-max-width: 300px;
  --stage-light-max-width: 280px;
  --warning-banner-height: 50px;
}

body {
  font-family: var(--font-display);
  background: var(--surface-dark);
  color: #e0e0e0;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 100vh;
  min-height: 100svh;
  width: 100%;
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--warning-banner-height));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

body.reduce-motion {
  --next-step-glow-duration: 0.01ms;
  --next-step-glow-drift-duration: 0.01ms;
  --next-step-glow-fade-duration: 0.01ms;
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-delay: 0s !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}

/* ==========================================
   STARFIELD BACKGROUND
   ========================================== */
#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #04060a;
}

/* ==========================================
   MAIN LAYOUT
   ========================================== */
.main-container {
  position: relative;
  z-index: 2;
  width: min(100%, var(--page-width));
  max-width: var(--page-width);
  margin: 0 auto;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vh, 30px);
  padding:
    var(--page-shell-top-gap)
    max(var(--page-gutter), env(safe-area-inset-right, 0px))
    var(--page-shell-bottom-gap)
    max(var(--page-gutter), env(safe-area-inset-left, 0px));
}

/* ==========================================
   CARD
   ========================================== */
.card {
  --card-radius: clamp(32px, 5vw, 64px);
  --card-padding: clamp(12px, 1.8vw, 16px);
  --card-inner-radius: calc(var(--card-radius) - var(--card-padding));
  position: relative;
  width: min(800px, 100%);
  height: clamp(420px, calc(100svh - var(--warning-banner-height) - clamp(176px, 22svh, 238px)), 600px);
  min-height: 420px;
  max-height: 600px;
  background: rgba(28, 28, 28, 0.3);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  display: flex;
  flex-direction: column;
  padding: var(--card-padding);
  gap: clamp(8px, 1.2vw, 10px);
  isolation: isolate;
  overflow: hidden;
}

.card-content {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2vw, 10px);
}

/* ==========================================
   TERMINAL AREA
   ========================================== */
.terminal-wrapper {
  flex: 1;
  position: relative;
  border-radius: var(--card-inner-radius);
  overflow: hidden;
  isolation: isolate;
}

.terminal {
  font-family: var(--font-terminal);
  font-size: clamp(12px, 1.45vw, 13px);
  line-height: 1.55;
  color: var(--terminal-purple);
  overflow-y: scroll;
  overflow-x: hidden;
  padding: clamp(12px, 2vw, 16px) clamp(16px, 3vw, 28px);
  padding-right: clamp(30px, 4vw, 40px);
  position: absolute;
  inset: 0;
  z-index: 1;
  /* Hide native scrollbar */
  scrollbar-width: none; /* Firefox */
}

.terminal::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Edge */
}

/* Custom scrollbar track and thumb */
.custom-scrollbar {
  position: absolute;
  top: clamp(10px, 1.4vw, 12px);
  bottom: clamp(10px, 1.4vw, 12px);
  right: clamp(6px, 1vw, 8px);
  width: 7px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 11.5px;
  z-index: 4;
  opacity: 1;
}

.custom-scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 1px;
  width: 5px;
  min-height: 37px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 11.5px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.custom-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.65);
}

.custom-scrollbar-thumb:active {
  background: rgba(255, 255, 255, 0.75);
}

/* Hide scrollbar when content doesn't overflow */
.custom-scrollbar.hidden {
  display: none;
}

.terminal-header {
  text-align: center;
  font-size: clamp(12px, 1.45vw, 13px);
  margin-bottom: clamp(12px, 2vw, 16px);
  white-space: nowrap;
}

/* CRT power-on animation scoped to the terminal display only */
.terminal-wrapper.crt-boot {
  animation: card-boot-fade 920ms ease-out both;
}

.terminal-wrapper.crt-boot .terminal {
  transform-origin: 50% 50%;
  will-change: transform, opacity, filter;
  animation: crt-screen-on 920ms cubic-bezier(0.22, 0.88, 0.2, 1) both;
}

.terminal-wrapper.crt-boot::before,
.terminal-wrapper.crt-boot::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.terminal-wrapper.crt-boot::before {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.08) 43%,
      rgba(255, 255, 255, 0.92) 49%,
      rgba(255, 255, 255, 1) 50%,
      rgba(255, 255, 255, 0.92) 51%,
      rgba(255, 255, 255, 0.08) 57%,
      rgba(255, 255, 255, 0) 100%
    );
  mix-blend-mode: screen;
  animation: crt-beam-flash 920ms cubic-bezier(0.22, 0.88, 0.2, 1) both;
}

.terminal-wrapper.crt-boot::after {
  display: var(--card-crt-raster-display, block);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0.08) 24%, rgba(255, 255, 255, 0) 62%),
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.075) 0 1px,
      rgba(255, 255, 255, 0) 1px 4px
    );
  opacity: 0;
  animation: crt-raster-glow 920ms ease-out both;
}

.terminal-wrapper.crt-boot .terminal-header,
.terminal-wrapper.crt-boot .terminal-body {
  will-change: opacity, filter;
  animation: crt-phosphor-settle 920ms cubic-bezier(0.22, 0.88, 0.2, 1) both;
}

.terminal-wrapper.crt-boot .border-line,
.terminal-wrapper.crt-boot .title {
  text-shadow:
    0 0 12px rgba(175, 146, 225, 0.88),
    0 0 28px rgba(175, 146, 225, 0.32);
  animation: crt-halation 920ms cubic-bezier(0.22, 0.88, 0.2, 1) both;
}

@keyframes card-boot-fade {
  0% {
    opacity: 0;
  }
  12% {
    opacity: 0.35;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}

@keyframes crt-screen-on {
  0% {
    opacity: 0;
    filter: brightness(0.28) saturate(1.45) blur(6px);
    transform: scaleY(0.015) scaleX(0.16);
  }
  16% {
    opacity: 1;
    filter: brightness(3.1) saturate(1.5) blur(3px);
    transform: scaleY(0.028) scaleX(0.42);
  }
  30% {
    filter: brightness(2.6) saturate(1.35) blur(2px);
    transform: scaleY(0.055) scaleX(1);
  }
  58% {
    filter: brightness(1.26) saturate(1.08) blur(0);
    transform: scaleY(1.03) scaleX(1);
  }
  76% {
    filter: brightness(0.93) saturate(1.02) blur(0);
    transform: scaleY(0.992) scaleX(1);
  }
  100% {
    opacity: 1;
    filter: brightness(1) saturate(1) blur(0);
    transform: scaleY(1) scaleX(1);
  }
}

@keyframes crt-beam-flash {
  0% {
    opacity: 0;
    transform: scaleY(0.05) scaleX(0.06);
  }
  10% {
    opacity: 1;
    transform: scaleY(0.07) scaleX(0.22);
  }
  20% {
    opacity: 1;
    transform: scaleY(0.085) scaleX(0.62);
  }
  34% {
    opacity: 0.92;
    transform: scaleY(0.11) scaleX(1);
  }
  58% {
    opacity: 0.16;
    transform: scaleY(1.45) scaleX(1.02);
  }
  100% {
    opacity: 0;
    transform: scaleY(1.75) scaleX(1.02);
  }
}

@keyframes crt-raster-glow {
  0% {
    opacity: 0;
    filter: blur(8px);
    transform: scaleY(0.03);
  }
  22% {
    opacity: 0.82;
    filter: blur(5px);
    transform: scaleY(0.08);
  }
  48% {
    opacity: 0.26;
    filter: blur(1px);
    transform: scaleY(1);
  }
  100% {
    opacity: 0;
    filter: blur(0);
    transform: scaleY(1);
  }
}

@keyframes crt-phosphor-settle {
  0% {
    opacity: 0;
    filter: contrast(1.55) brightness(2.35);
  }
  28% {
    opacity: 0.78;
    filter: contrast(1.4) brightness(1.75);
  }
  60% {
    opacity: 1;
    filter: contrast(1.12) brightness(1.08);
  }
  100% {
    opacity: 1;
    filter: contrast(1) brightness(1);
  }
}

@keyframes crt-halation {
  0% {
    text-shadow:
      0 0 0 rgba(175, 146, 225, 0),
      0 0 0 rgba(175, 146, 225, 0);
  }
  18% {
    text-shadow:
      0 0 16px rgba(175, 146, 225, 0.95),
      0 0 32px rgba(175, 146, 225, 0.42);
  }
  42% {
    text-shadow:
      0 0 8px rgba(175, 146, 225, 0.46),
      0 0 18px rgba(175, 146, 225, 0.18);
  }
  100% {
    text-shadow: none;
  }
}

.terminal-header .border-line {
  color: var(--terminal-purple);
}

.terminal-header .title {
  color: var(--terminal-white);
}

.terminal-body {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.terminal-body :is(
  .fa,
  .fas,
  .far,
  .fal,
  .fab,
  .fa-solid,
  .fa-regular,
  .fa-light,
  .fa-thin,
  .fa-brands,
  .svg-inline--fa
) {
  font-size: 1.8em;
  line-height: 1;
  vertical-align: -0.2em;
}

.terminal-body .terminal-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.38em;
  height: 1.15em;
  font-size: 1.68em;
  color: #aaa;
  line-height: 1;
  vertical-align: -0.14em;
  margin-right: 0.5ch;
}

.terminal-bullet {
  display: block;
  padding-left: 2ch;
  text-indent: -2ch;
}

.terminal-section-header {
  display: inline-block;
  padding-bottom: 0.55em;
}

/* Terminal text color helpers */
.t-white { color: var(--terminal-white); }
.t-purple { color: var(--terminal-purple); }
.t-pink { color: var(--terminal-pink); }
.t-blue { color: var(--terminal-blue); }
.t-green { color: var(--terminal-green); }
.t-yellow { color: var(--terminal-yellow); }
.t-red { color: var(--terminal-red); }

.terminal-body a {
  color: var(--terminal-white);
  text-decoration: underline;
  cursor: pointer;
}

.terminal-body a:hover {
  color: var(--terminal-pink);
}

/* Retro terminal cursor */
.terminal-cursor {
  display: inline-block;
  margin-left: 0.12ch;
  text-shadow: 0 0 6px rgba(175, 146, 225, 0.55);
  color: var(--terminal-purple);
  opacity: 0.5;
  animation: terminal-cursor-blink 1.05s steps(1, end) infinite;
  pointer-events: none;
  user-select: none;
}

body.reduce-motion .terminal-cursor {
  animation: none;
  opacity: 0.5;
}

/* ==========================================
   ACTION BAR (bottom of card)
   ========================================== */
.action-bar {
  --action-side-width: clamp(96px, 15vw, 120px);
  --action-content-width: clamp(240px, 34vw, 320px);
  --action-bar-gap: clamp(12px, 1.8vw, 18px);
  --nav-pill-height: clamp(38px, 5vh, 42px);
  height: auto;
  min-height: clamp(104px, 15vh, 117px);
  background: rgba(42, 42, 42, 0.18);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(225, 225, 225, 0.1);
  border-radius: clamp(28px, 4vw, 40px);
  display: grid;
  grid-template-columns: var(--action-side-width) minmax(0, 1fr) var(--action-side-width);
  align-items: center;
  column-gap: var(--action-bar-gap);
  padding: clamp(12px, 1.8vw, 14px) clamp(14px, 2.6vw, 20px);
  overflow: hidden;
}

.action-bar-left,
.action-bar-right {
  width: auto;
  min-width: 0;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
}

.action-bar-left {
  justify-content: flex-start;
}

.action-bar-right {
  justify-content: flex-end;
}

.action-bar-center {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.6vw, 10px);
  padding: clamp(4px, 0.8vw, 6px) 0;
}

#actionContent {
  width: min(var(--action-content-width), 100%);
  display: flex;
  justify-content: center;
  padding: 0;
}

#actionContent.has-stage-lights {
  width: min(360px, 100%);
}

#actionContent:empty {
  display: none;
}

.action-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(18px, 2.8vw, 24px);
  color: white;
  text-align: center;
  line-height: 1.08;
  letter-spacing: -0.01em;
  padding: 0 clamp(4px, 1.2vw, 12px);
  text-wrap: balance;
}

.action-subtitle {
  display: none;
  max-width: min(420px, 100%);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(11px, 1.6vw, 13px);
  color: rgba(255, 255, 255, 0.68);
  text-align: center;
  line-height: 1.35;
  letter-spacing: 0.01em;
  padding: 0 clamp(8px, 1.6vw, 16px);
  text-wrap: balance;
}

.action-subtitle.visible {
  display: block;
}

.action-title-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  color: var(--terminal-green);
  font-size: 0.78em;
  line-height: 1;
  vertical-align: middle;
}

/* Navigation pills */
.nav-arrow {
  position: relative;
  isolation: isolate;
  height: var(--nav-pill-height);
  padding: 0 clamp(14px, 2.4vw, 18px);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #aaa;
  font-family: var(--font-display);
  font-size: clamp(12px, 1.7vw, 14px);
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1vw, 8px);
  transition:
    color 0.18s ease,
    border-color 0.34s ease,
    background-color 0.18s ease,
    box-shadow 0.46s ease,
    opacity 0.18s ease,
    transform 0.18s ease;
}

.nav-arrow::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: linear-gradient(110deg, #56d0ff 0%, #7863ff 38%, #ff4d6d 72%, #56d0ff 100%);
  background-size: 220% 100%;
  filter: blur(9px);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition:
    opacity 0.34s ease,
    filter 0.34s ease,
    transform 0.34s ease;
}

.nav-arrow::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: var(--surface-bar);
  pointer-events: none;
  z-index: 0;
}

.nav-arrow-label,
.nav-arrow-icon {
  position: relative;
  z-index: 1;
}

.nav-arrow-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(13px, 1.8vw, 15px);
  line-height: 1;
}

.nav-arrow:focus-visible {
  outline: none;
}

.nav-arrow:active:not(.disabled) {
  transform: translateY(1px);
}

.nav-arrow.hidden {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

.nav-arrow.disabled {
  color: #767d8e;
  border-color: #4f5664;
  background: transparent;
  box-shadow: inset 0 0 0 1px #2f3440;
  pointer-events: none;
}

.nav-arrow.disabled::before {
  opacity: 0;
  filter: blur(0);
}

#navBack {
  min-width: 92px;
  flex-direction: row-reverse;
  color: #aaa;
  border-color: #aaa;
  background: transparent;
}

#navBack::after {
  background: transparent;
}

#navBack .nav-arrow-label,
#navBack .nav-arrow-icon,
#navBack .nav-arrow-icon i {
  color: inherit;
}

#navBack:hover,
#navBack:focus-visible {
  color: #fff;
  border-color: #fff;
  background: transparent;
}

#navForward {
  min-width: 104px;
  color: rgba(255, 255, 255, 0.36);
  border-color: rgba(255, 255, 255, 0.14);
  background: transparent;
}

#navForward.nav-arrow-update {
  min-width: 116px;
}

#navForward:not(.disabled) {
  color: #f2f2f2;
  border-color: rgba(255, 255, 255, 0.5);
  background: transparent;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(0, 0, 0, 0.14);
}

#navForward:not(.disabled)::after {
  inset: 0;
  background: linear-gradient(180deg, #202020 0%, #181818 100%);
}

#navForward:not(.disabled).next-step-glow,
.pill-dropdown.next-step-glow {
  border-color: rgba(255, 255, 255, 0.44);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

#navForward.disabled {
  color: #555;
  border-color: #555;
  border-width: 0.5px;
  box-shadow: inset 0 0 0 0.5px #555;
}

#navForward.disabled::after {
  background: transparent;
}

#navForward.disabled .nav-arrow-label,
#navForward.disabled .nav-arrow-icon,
#navForward.disabled .nav-arrow-icon i {
  color: inherit;
}

#navForward:not(.disabled):hover,
#navForward:not(.disabled):focus-visible {
  color: #111;
  border-color: #fff;
  background: transparent;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

#navForward:not(.disabled):hover::after,
#navForward:not(.disabled):focus-visible::after {
  background: #fff;
}

#navForward:not(.disabled):hover::before,
#navForward:not(.disabled):focus-visible::before {
  opacity: 0.64;
  filter: blur(13px);
  transform: scale(1);
}

#navForward:not(.disabled).next-step-glow:hover::before,
#navForward:not(.disabled).next-step-glow:focus-visible::before {
  opacity: 0.84;
  filter: blur(7px);
  transform: scale(0.95);
}

@keyframes nav-glow-drift {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@keyframes next-step-halo-enter {
  0% {
    opacity: 0;
    filter: blur(12px);
    transform: scale(1.04);
  }
  55% {
    opacity: 0.5;
    filter: blur(10px);
    transform: scale(1.01);
  }
  100% {
    opacity: 0.84;
    filter: blur(7px);
    transform: scale(0.95);
  }
}

#navForward:not(.disabled).next-step-glow::before,
.pill-dropdown-shell.next-step-glow::before,
.pill-action-shell.next-step-glow::before {
  opacity: 0.84;
  filter: blur(7px);
  transform: scale(0.95);
  animation:
    next-step-halo-enter var(--next-step-glow-fade-duration) var(--next-step-glow-fade-ease) 1,
    nav-glow-drift var(--next-step-glow-drift-duration) linear calc(var(--next-step-glow-fade-duration) * 0.2) infinite;
}

.upload-btn.next-step-glow {
  border-color: rgba(255, 255, 255, 0.74);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 14px rgba(86, 208, 255, 0.2),
    0 0 24px rgba(120, 99, 255, 0.18),
    0 0 34px rgba(255, 77, 109, 0.15);
  animation: next-step-control-glow var(--next-step-glow-duration) ease-in-out infinite;
}

@keyframes next-step-control-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.06),
      0 0 12px rgba(86, 208, 255, 0.18),
      0 0 20px rgba(120, 99, 255, 0.16),
      0 0 26px rgba(255, 77, 109, 0.12);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.12),
      0 0 16px rgba(86, 208, 255, 0.24),
      0 0 28px rgba(120, 99, 255, 0.22),
      0 0 36px rgba(255, 77, 109, 0.17);
  }
}

/* Pill dropdown */
.pill-dropdown-shell,
.pill-action-shell {
  position: relative;
  isolation: isolate;
  width: min(var(--control-max-width), 100%);
  display: flex;
  align-items: center;
}

.action-content-stack {
  width: min(var(--control-max-width), 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.action-helper-link {
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  margin-top: 3px;
  text-decoration: none;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.action-helper-link:hover,
.action-helper-link:focus-visible {
  color: rgba(255, 255, 255, 0.74);
}

.pill-dropdown-shell::before,
.pill-action-shell::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 100px;
  background: linear-gradient(110deg, #56d0ff 0%, #7863ff 38%, #ff4d6d 72%, #56d0ff 100%);
  background-size: 220% 100%;
  filter: blur(9px);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition:
    opacity 0.34s ease,
    filter 0.34s ease,
    transform 0.34s ease;
}

.pill-dropdown {
  position: relative;
  z-index: 1;
  width: 100%;
  height: clamp(30px, 4.6vw, 34px);
  background: #181818;
  border: 0.5px solid white;
  border-radius: 100px;
  color: #aaa;
  font-family: var(--font-display);
  font-size: clamp(14px, 2.1vw, 16px);
  text-align: center;
  padding: 0 36px 0 16px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color 0.34s ease, box-shadow 0.46s ease;
}

.pill-dropdown.has-selection {
  color: #fff;
  border-color: #aaa;
}

.pill-dropdown-icon,
.pill-action-icon {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
  transition: color 0.2s ease, transform 0.2s ease;
}

.pill-dropdown.has-selection + .pill-dropdown-icon {
  color: var(--terminal-green);
}

.pill-action-icon {
  opacity: 0;
  transition: color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.pill-action-icon.visible {
  opacity: 1;
  color: var(--terminal-green);
}

.pill-dropdown optgroup {
  color: #666;
  font-style: normal;
  font-size: 13px;
}

.pill-dropdown option {
  color: #aaa;
}

.pill-dropdown:focus {
  border-color: var(--terminal-pink);
  box-shadow: 0 0 8px rgba(235, 122, 212, 0.3);
}

.pill-dropdown.has-selection:focus {
  border-color: #aaa;
  box-shadow: 0 0 8px rgba(170, 170, 170, 0.3);
}

.pill-dropdown option {
  background: #181818;
  color: #ddd;
  font-family: var(--font-display);
}

/* Connect Device button */
.connect-btn {
  position: relative;
  z-index: 1;
  width: 100%;
  height: clamp(30px, 4.6vw, 34px);
  appearance: none;
  -webkit-appearance: none;
  background: #181818;
  border: 0.5px solid white;
  border-radius: 100px;
  color: #aaa;
  font-family: var(--font-display);
  font-size: clamp(14px, 2.1vw, 16px);
  font-weight: 400;
  text-align: center;
  padding: 0 36px 0 16px;
  cursor: pointer;
  outline: none;
  transition:
    color 0.18s ease,
    border-color 0.34s ease,
    box-shadow 0.46s ease,
    transform 0.18s ease;
}

.connect-btn:hover,
.connect-btn:focus-visible {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.connect-btn.next-step-glow {
  border-color: rgba(255, 255, 255, 0.44);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.connect-btn.is-connected {
  cursor: default;
  color: #fff;
  border-color: #aaa;
}

.connect-btn.is-connected:hover,
.connect-btn.is-connected:focus-visible {
  border-color: #aaa;
  box-shadow: 0 0 8px rgba(170, 170, 170, 0.3);
}

.connect-btn:disabled {
  pointer-events: none;
}

.connect-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.connect-btn:focus-visible {
  outline: none;
}

/* Upload button (solid style) */
.upload-btn {
  width: min(var(--control-max-width), 100%);
  height: clamp(30px, 4.6vw, 34px);
  background: #c240a9;
  border: 0.5px solid #c240a9;
  border-radius: 100px;
  color: white;
  font-family: var(--font-display);
  font-size: clamp(14px, 2.1vw, 16px);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.upload-btn:hover {
  background: #d456bc;
  box-shadow: 0 0 12px rgba(194, 64, 169, 0.4);
}

.upload-btn:active {
  transform: scale(0.98);
}

/* Upload stage lights */
.upload-stage-lights {
  position: relative;
  width: min(var(--stage-light-max-width), 100%);
  display: none;
  justify-items: center;
  gap: clamp(8px, 1.4vw, 10px);
}

.upload-stage-lights.visible {
  display: grid;
}

.upload-stage-light-row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  gap: clamp(8px, 1.6vw, 10px);
}

.upload-stage-light {
  --phase-energy: 0;
  position: relative;
  width: 100%;
  height: 12px;
  overflow: visible;
  border-radius: 999px;
  border: 1px solid rgba(126, 160, 212, 0.2);
  background:
    linear-gradient(180deg, rgba(22, 30, 44, 0.98) 0%, rgba(8, 12, 22, 0.96) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -3px 8px rgba(0, 0, 0, 0.72),
    inset 0 0 0 1px rgba(150, 196, 255, 0.03),
    0 0 0 1px rgba(255, 255, 255, 0.02);
  transition:
    border-color 0.18s linear,
    box-shadow 0.18s linear,
    background-color 0.18s linear;
}

.upload-stage-light::before {
  content: '';
  position: absolute;
  inset: -8px -4px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.92) 0%, rgba(201, 232, 255, 0.78) 26%, rgba(118, 176, 255, 0.44) 58%, rgba(118, 176, 255, 0) 100%);
  filter: blur(12px);
  opacity: calc(0.02 + var(--phase-energy) * 0.82);
  pointer-events: none;
  transition:
    opacity 0.18s linear,
    filter 0.18s linear;
}

.upload-stage-light::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.03) 34%, rgba(255, 255, 255, 0) 52%),
    radial-gradient(circle at 18% 50%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 22%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0) 24%),
    radial-gradient(circle at 82% 50%, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0) 22%),
    linear-gradient(90deg, rgba(210, 238, 255, 0.98) 0%, rgba(158, 213, 255, 0.98) 34%, rgba(104, 165, 255, 0.94) 100%);
  box-shadow:
    inset 0 0 16px rgba(255, 255, 255, 0.58),
    inset 0 -1px 4px rgba(57, 106, 198, 0.36),
    0 0 12px rgba(183, 228, 255, 0.24),
    0 0 24px rgba(94, 156, 255, 0.18);
  opacity: calc(0.05 + var(--phase-energy) * 0.95);
  pointer-events: none;
  transition:
    opacity 0.18s linear,
    box-shadow 0.18s linear,
    filter 0.18s linear;
}

.upload-stage-light.is-started {
  border-color: rgba(190, 226, 255, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -3px 8px rgba(0, 0, 0, 0.64),
    inset 0 0 0 1px rgba(188, 226, 255, 0.08),
    0 0 0 1px rgba(214, 239, 255, 0.04),
    0 0 14px rgba(94, 158, 255, 0.12);
}

.upload-stage-light.is-complete {
  border-color: rgba(222, 240, 255, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -2px 6px rgba(30, 50, 90, 0.22),
    inset 0 0 0 1px rgba(230, 244, 255, 0.12),
    0 0 0 1px rgba(222, 240, 255, 0.08),
    0 0 18px rgba(164, 220, 255, 0.28),
    0 0 36px rgba(76, 138, 255, 0.18);
}

.upload-stage-light.is-complete::before {
  opacity: 0.9;
}

.upload-stage-light.is-complete::after {
  opacity: 1;
  box-shadow:
    inset 0 0 20px rgba(255, 255, 255, 0.72),
    inset 0 -1px 5px rgba(75, 122, 222, 0.34),
    0 0 18px rgba(255, 255, 255, 0.38),
    0 0 34px rgba(174, 226, 255, 0.34),
    0 0 56px rgba(96, 156, 255, 0.26);
}

.upload-stage-light.is-active {
  border-color: rgba(238, 246, 255, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -2px 6px rgba(35, 58, 108, 0.22),
    inset 0 0 0 1px rgba(240, 248, 255, 0.18),
    0 0 0 1px rgba(244, 250, 255, 0.18),
    0 0 22px rgba(204, 234, 255, 0.34),
    0 0 48px rgba(98, 156, 255, 0.28);
  animation: upload-stage-led-shell-pulse 1.3s ease-in-out infinite;
}

.upload-stage-light.is-active::before {
  animation: upload-stage-led-halo-pulse 1.3s ease-in-out infinite;
}

.upload-stage-light.is-active::after {
  animation: upload-stage-led-core-pulse 1.3s ease-in-out infinite;
}

.upload-stage-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.upload-stage-lights.is-complete .upload-stage-status {
  color: inherit;
}

@keyframes upload-stage-led-shell-pulse {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.22),
      inset 0 -2px 6px rgba(35, 58, 108, 0.22),
      inset 0 0 0 1px rgba(240, 248, 255, 0.16),
      0 0 0 1px rgba(244, 250, 255, 0.14),
      0 0 20px rgba(198, 232, 255, 0.28),
      0 0 42px rgba(92, 150, 255, 0.24);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.28),
      inset 0 -2px 6px rgba(50, 76, 126, 0.28),
      inset 0 0 0 1px rgba(248, 252, 255, 0.24),
      0 0 0 1px rgba(248, 252, 255, 0.22),
      0 0 28px rgba(230, 244, 255, 0.42),
      0 0 58px rgba(120, 176, 255, 0.32);
  }
}

@keyframes upload-stage-led-halo-pulse {
  0%,
  100% {
    opacity: calc(0.2 + var(--phase-energy) * 0.78);
  }
  50% {
    opacity: calc(0.34 + var(--phase-energy) * 0.92);
    filter: blur(14px);
  }
}

@keyframes upload-stage-led-core-pulse {
  0%,
  100% {
    opacity: calc(0.08 + var(--phase-energy) * 0.96);
    box-shadow:
      inset 0 0 18px rgba(255, 255, 255, 0.66),
      inset 0 -1px 4px rgba(67, 114, 212, 0.32),
      0 0 16px rgba(255, 255, 255, 0.28),
      0 0 32px rgba(166, 220, 255, 0.28),
      0 0 48px rgba(88, 152, 255, 0.22);
  }
  50% {
    opacity: 1;
    box-shadow:
      inset 0 0 22px rgba(255, 255, 255, 0.82),
      inset 0 -1px 6px rgba(88, 136, 228, 0.4),
      0 0 20px rgba(255, 255, 255, 0.44),
      0 0 40px rgba(194, 232, 255, 0.38),
      0 0 62px rgba(112, 172, 255, 0.3);
  }
}

/* Success check icon */
.success-icon {
  color: var(--terminal-green);
  font-size: clamp(28px, 4vw, 36px);
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
}

.success-icon.visible {
  display: flex;
}

#successIconRight {
  position: absolute;
  inset: 0;
}

/* ==========================================
   LOGO
   ========================================== */
.logo {
  height: clamp(24px, 4vw, 32px);
  max-width: min(280px, 80vw);
  opacity: 0.9;
}

/* ==========================================
   FOOTER
   ========================================== */
.footer {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: min(var(--page-width), 100%);
  margin: 0 auto;
  font-family: var(--font-display);
  font-size: clamp(11px, 1.6vw, 12px);
  color: #777;
  text-align: center;
  line-height: 1.35;
  padding:
    4px
    max(var(--page-gutter), env(safe-area-inset-right, 0px))
    calc(20px + env(safe-area-inset-bottom, 0px))
    max(var(--page-gutter), env(safe-area-inset-left, 0px));
}

.footer p {
  max-width: 760px;
  margin: 0 auto;
}

.footer p + p {
  margin-top: 2px;
}

.footer a {
  color: inherit;
}

.footer a:hover {
  color: #b6b6b6;
}

/* ==========================================
   ALTERNATE METHOD MODAL
   ========================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  padding: 16px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.visible {
  display: flex;
}

.modal {
  background: #111011;
  border-radius: clamp(32px, 9vw, 60px);
  padding: clamp(28px, 7vw, 48px) clamp(22px, 7vw, 55px);
  width: min(466px, calc(100vw - 24px));
  max-width: 466px;
  max-height: calc(100svh - 24px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(18px, 4vw, 28px);
}

.modal-body {
  font-family: var(--font-terminal);
  width: 100%;
  font-size: clamp(11px, 1.8vw, 12px);
  line-height: 1.55;
  color: var(--terminal-purple);
  white-space: pre-wrap;
}

.modal-continue-btn {
  width: min(158px, 100%);
  height: clamp(28px, 8vw, 32px);
  background: #c240a9;
  border: none;
  border-radius: 100px;
  font-family: var(--font-terminal);
  font-size: 12px;
  color: white;
  cursor: pointer;
  transition: opacity 0.2s;
}

.modal-continue-btn:hover {
  opacity: 0.85;
}

/* Corner smoothing for rounded rectangles only; pill controls keep capsule ends */
@supports (corner-shape: superellipse(1.5)) {
  .card,
  .terminal-wrapper,
  .action-bar,
  .modal,
  .upload-stage-lights {
    corner-shape: var(--smooth-corner-shape);
  }
}

/* ==========================================
   VISUAL EFFECTS TOGGLE (in terminal)
   ========================================== */
.vfx-toggle {
  cursor: pointer;
  user-select: none;
}

.vfx-toggle:hover {
  color: var(--terminal-white);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 850px) {
  body {
    min-height: auto;
    --page-shell-top-gap: clamp(18px, 3vh, 28px);
    --page-shell-bottom-gap: clamp(12px, 2vh, 18px);
    --control-max-width: 260px;
    --stage-light-max-width: 260px;
    --warning-banner-height: 64px;
  }

  .main-container {
    flex: 0 0 auto;
    justify-content: flex-start;
    gap: 16px;
  }

  .card {
    width: 100%;
    height: auto;
    min-height: clamp(450px, 68svh, 560px);
    max-height: none;
    --card-radius: 44px;
  }

  .terminal {
    min-height: clamp(250px, 40svh, 330px);
  }

  .action-bar {
    --action-side-width: 96px;
    --action-content-width: 260px;
    --action-bar-gap: 12px;
  }

  #actionContent.has-stage-lights {
    width: min(320px, 100%);
  }

  #navForward.nav-arrow-update {
    min-width: 104px;
  }
}

@media (max-width: 640px) {
  body {
    --page-shell-top-gap: clamp(14px, 2.5vh, 18px);
    --page-shell-bottom-gap: clamp(10px, 2vh, 14px);
    --control-max-width: 100%;
    --stage-light-max-width: 100%;
    --warning-banner-height: 88px;
  }

  .main-container {
    gap: 14px;
  }

  .card {
    min-height: clamp(410px, 63svh, 500px);
  }

  .terminal {
    min-height: clamp(230px, 36svh, 290px);
  }

  .terminal-header {
    white-space: normal;
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 14px;
  }

  .terminal-header .border-line:first-child,
  .terminal-header .border-line:last-of-type,
  .terminal-header br {
    display: none;
  }

  .terminal-header .title {
    display: inline-block;
    text-wrap: balance;
  }

  .action-bar {
    --action-side-width: auto;
    --action-content-width: 100%;
    --action-bar-gap: 12px;
    min-height: 190px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "center center"
      "left right";
    grid-template-rows: minmax(0, 1fr) auto;
    height: auto;
    row-gap: 12px;
    padding: 14px;
    align-content: stretch;
  }

  .action-bar-left,
  .action-bar-right,
  .action-bar-center {
    height: auto;
  }

  .action-bar-left {
    grid-area: left;
    align-self: end;
  }

  .action-bar-center {
    grid-area: center;
    gap: 12px;
    padding: 0;
    align-self: start;
  }

  .action-bar-right {
    grid-area: right;
    align-self: end;
  }

  .action-bar-left .nav-arrow,
  .action-bar-right .nav-arrow {
    width: 100%;
    max-width: none;
  }

  .modal {
    width: min(466px, calc(100vw - 24px));
  }
}

@media (max-width: 500px) {
  body {
    --page-gutter: 14px;
    --page-shell-top-gap: 12px;
    --page-shell-bottom-gap: 10px;
    --warning-banner-height: 104px;
  }

  .main-container {
    gap: 12px;
  }

  .card {
    --card-radius: 28px;
    --card-padding: 12px;
    min-height: clamp(390px, 60svh, 470px);
  }

  .action-bar {
    border-radius: 24px;
    min-height: 176px;
    --action-bar-gap: 10px;
    --nav-pill-height: 36px;
    padding: 10px 12px;
    row-gap: 10px;
  }

  .terminal {
    font-size: 12px;
    min-height: clamp(205px, 32svh, 245px);
    padding: 12px 14px;
    padding-right: 30px;
  }

  .action-title {
    font-size: 17px;
    line-height: 1.08;
    padding: 0 2px;
  }

  .action-subtitle {
    font-size: 11px;
    line-height: 1.3;
    padding: 0 4px;
  }

  .pill-dropdown,
  .connect-btn,
  .upload-btn {
    font-size: 14px;
  }

  .upload-stage-lights {
    width: 100%;
    max-width: 260px;
  }

  .upload-stage-light-row {
    gap: 8px;
  }

  .upload-stage-light {
    height: 10px;
  }

  .nav-arrow {
    padding: 0 12px;
    font-size: 11px;
    gap: 6px;
  }

  #navBack {
    min-width: 64px;
  }

  #navForward {
    min-width: 72px;
  }

  #navForward.nav-arrow-update {
    min-width: 80px;
  }

  .logo {
    height: 24px;
  }

  .footer {
    line-height: 1.4;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-height: 760px) {
  body {
    min-height: auto;
    --page-shell-top-gap: clamp(12px, 2vh, 18px);
    --page-shell-bottom-gap: clamp(12px, 2vh, 18px);
  }

  .main-container {
    flex: 0 0 auto;
    justify-content: flex-start;
    gap: 12px;
  }

  .card {
    height: auto;
    min-height: 380px;
  }

  .terminal {
    min-height: 210px;
  }

  .action-bar {
    min-height: 96px;
  }

  .footer {
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 851px) and (max-height: 760px) {
  .card {
    height: clamp(420px, calc(100svh - var(--warning-banner-height) - 132px), 540px);
    min-height: 420px;
  }

  .terminal {
    min-height: clamp(230px, calc(100svh - var(--warning-banner-height) - 278px), 340px);
  }
}

@media (max-width: 640px) and (max-height: 760px) {
  .card {
    min-height: 340px;
  }

  .terminal {
    min-height: 180px;
  }

  .action-bar {
    min-height: 164px;
  }
}


/* ==========================================
   PHOTOSENSITIVITY WARNING BANNER
   ========================================== */
.photosensitivity-warning {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: transparent;
  border-bottom: none;
  padding: calc(2px + env(safe-area-inset-top, 0px)) 18px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px 14px;
  flex-wrap: wrap;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

.photosensitivity-warning.hidden {
  display: none;
}

.warning-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.warning-icon {
  color: var(--terminal-yellow);
  font-size: 18px;
}

.warning-text {
  font-family: var(--font-terminal);
  font-size: 12px;
  line-height: 1.2;
  color: #aaa;
  letter-spacing: 0.05em;
  text-align: center;
}

.warning-text strong {
  color: var(--terminal-yellow);
}

.motion-toggle-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.motion-toggle-label {
  font-family: var(--font-terminal);
  font-size: 12px;
  color: #888;
  letter-spacing: 0.05em;
  cursor: pointer;
  user-select: none;
}

.motion-toggle {
  position: relative;
  width: 44px;
  height: 22px;
  cursor: pointer;
}

.motion-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(30, 25, 45, 0.8);
  border: 1px solid rgba(175, 146, 225, 0.3);
  border-radius: 11px;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: #888;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.motion-toggle input:checked + .toggle-slider {
  background: rgba(175, 146, 225, 0.3);
  border-color: var(--terminal-purple);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), 0 0 10px rgba(175, 146, 225, 0.2);
}

.motion-toggle input:checked + .toggle-slider::before {
  transform: translateX(22px);
  background: var(--terminal-purple);
  box-shadow: 0 0 8px rgba(175, 146, 225, 0.3);
}

.dismiss-warning {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #888;
  font-family: var(--font-terminal);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.05em;
}

.dismiss-warning:hover {
  border-color: var(--terminal-purple);
  color: white;
  box-shadow: 0 0 10px rgba(175, 146, 225, 0.2);
}

@media (max-width: 500px) {
  .photosensitivity-warning {
    padding-left: 12px;
    padding-right: 12px;
    gap: 4px 10px;
  }

  .warning-content {
    gap: 6px;
  }

  .warning-text,
  .motion-toggle-label,
  .dismiss-warning {
    font-size: 11px;
  }
}

/* ——— Film grain overlay ——— */
#grain-overlay {
  position: fixed;
  top: -100vh;
  left: -100vw;
  width: 300vw;
  height: 300vh;
  z-index: 10;
  pointer-events: none;
  overflow: hidden;
}

#grain-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("https://upload.wikimedia.org/wikipedia/commons/7/76/1k_Dissolve_Noise_Texture.png") repeat;
  background-size: 320px 320px;
  mix-blend-mode: normal;
  opacity: 0.06;
  animation: grainShift 6s steps(6) infinite;
  transform: translateZ(0);
}

body.reduce-motion #grain-overlay::after {
  animation: none !important;
  transform: none;
}

body.reduce-motion .upload-stage-light.is-active,
body.reduce-motion .upload-stage-light.is-active::before,
body.reduce-motion .upload-stage-light.is-active::after {
  animation: none;
}

@keyframes grainShift {
  0%, 100% { transform: translate(0, 0); }
  10%  { transform: translate(-5%, -10%); }
  20%  { transform: translate(-15%, -20%); }
  30%  { transform: translate(-5%, -10%); }
  40%  { transform: translate(-15%, -20%); }
  50%  { transform: translate(-5%, -10%); }
  60%  { transform: translate(-15%, -20%); }
  70%  { transform: translate(-5%, -10%); }
  80%  { transform: translate(-15%, -20%); }
  90%  { transform: translate(-5%, -10%); }
}

@keyframes terminal-cursor-blink {
  0%, 49% {
    opacity: 0.5;
  }

  50%, 100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body {
    --next-step-glow-duration: 0.01ms;
    --next-step-glow-drift-duration: 0.01ms;
    --next-step-glow-fade-duration: 0.01ms;
  }

  body *,
  body *::before,
  body *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }

  #grain-overlay::after {
    animation: none !important;
    transform: none;
  }

  .terminal-cursor {
    animation: none !important;
    opacity: 0.5;
  }

  .nav-arrow,
  .nav-arrow::before,
  .nav-arrow::after,
  .nav-arrow-label,
  .nav-arrow-icon {
    transition: none;
  }

  .upload-stage-light.is-active,
  .upload-stage-light.is-active::before,
  .upload-stage-light.is-active::after {
    animation: none !important;
  }

  #navForward:not(.disabled)::before {
    animation: none !important;
  }
}
