/* ============================================================
   VAPORWAVE ME — 80s Pixel MIDI Controller
   Color tokens, layout, CRT effects, knob styling.
   ============================================================ */

:root {
  --bg-deep:      #0a0420;
  --bg-page-1:    #1d0a4d;
  --bg-page-2:    #4a0e6e;
  --bg-panel:     #1a0f3d;
  --bg-panel-hi:  #2a1a5e;
  --bg-recess:    #0d0628;
  --magenta:      #ff5cf6;
  --magenta-dim:  #b13fa8;
  --cyan:         #5cf6ff;
  --cyan-dim:     #3aa9b1;
  --peach:        #ffb87a;
  --lime:         #b8ff5c;
  --red:          #ff5c7a;
  --yellow:       #fff45c;
  --text-dim:     #9d8fc7;
  --text-bright:  #f4ecff;

  --font-pixel:   'Press Start 2P', monospace;
  --font-term:    'VT323', monospace;
}

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

html, body {
  height: 100%;
}

body {
  background: var(--bg-deep);
  color: var(--text-bright);
  font-family: var(--font-term);
  font-size: 18px;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  font-smooth: never;
  image-rendering: pixelated;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   Page background — sun + grid floor
   ============================================================ */

.page-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 35%, var(--bg-page-2) 0%, var(--bg-page-1) 35%, var(--bg-deep) 75%);
}

.sun {
  position: absolute;
  left: 50%;
  top: 28%;
  transform: translate(-50%, -50%);
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background:
    linear-gradient(180deg,
      #ffea5c 0%,
      #ffb87a 40%,
      #ff5cf6 80%,
      #b13fa8 100%);
  box-shadow:
    0 0 80px rgba(255, 184, 122, 0.35),
    0 0 160px rgba(255, 92, 246, 0.25);
  opacity: 0.55;
  filter: blur(0.4px);
}

.sun::before, .sun::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  background: var(--bg-page-1);
  height: 8px;
}
.sun::before { top: 60%; box-shadow: 0 24px 0 var(--bg-page-1), 0 50px 0 var(--bg-page-1), 0 80px 0 var(--bg-page-1), 0 116px 0 var(--bg-page-1); }
.sun::after { display: none; }

.grid-floor {
  position: absolute;
  left: 50%;
  bottom: -40%;
  transform: translateX(-50%) perspective(400px) rotateX(60deg);
  width: 220%;
  height: 90%;
  background-image:
    linear-gradient(to right, rgba(255, 92, 246, 0.55) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 92, 246, 0.55) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.45;
  mask-image: linear-gradient(to top, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 100%);
}

/* ============================================================
   Chassis — the MIDI controller body
   ============================================================ */

.chassis {
  position: relative;
  z-index: 1;
  width: 1100px;
  max-width: 100%;
  border-radius: 18px;
  padding: 6px;
  background:
    linear-gradient(160deg, #3a1f7a 0%, #1a0f3d 35%, #0a0420 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -2px 0 rgba(0,0,0,0.7),
    0 24px 80px rgba(0,0,0,0.65),
    0 0 0 4px #0a0420,
    0 0 0 6px #ff5cf633,
    0 0 60px rgba(255, 92, 246, 0.25);
}

.chassis-inner {
  position: relative;
  background:
    linear-gradient(180deg, #22134d 0%, #14092e 100%);
  border-radius: 14px;
  padding: 18px 22px 18px;
  overflow: hidden;
}

/* CRT scanlines + vignette on chassis only */
.crt::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 14px;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 2px,
      rgba(0,0,0,0.18) 2px,
      rgba(0,0,0,0.18) 3px);
  mix-blend-mode: multiply;
  z-index: 10;
  animation: flicker 7s infinite steps(1);
}

.crt::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 14px;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
  z-index: 11;
}

@keyframes flicker {
  0%, 96%, 100% { opacity: 1; }
  97% { opacity: 0.94; }
  98% { opacity: 1; }
  99% { opacity: 0.92; }
}

/* ============================================================
   Header bar
   ============================================================ */

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 4px 14px;
  border-bottom: 2px dashed rgba(255, 92, 246, 0.35);
  margin-bottom: 14px;
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-glyph {
  font-family: var(--font-term);
  font-size: 28px;
  color: var(--magenta);
  text-shadow: 0 0 6px var(--magenta);
}

.brand-title {
  font-family: var(--font-pixel);
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--text-bright);
  text-shadow:
    1px 0 var(--magenta),
    -1px 0 var(--cyan),
    0 0 12px rgba(255, 92, 246, 0.5);
  animation: title-glow 4s ease-in-out infinite;
}

@keyframes title-glow {
  50% {
    text-shadow:
      2px 0 var(--magenta),
      -2px 0 var(--cyan),
      0 0 16px rgba(255, 92, 246, 0.7);
  }
}

.status-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 1px;
}

.status-cluster.small { font-size: 8px; }

.status-label { color: var(--text-dim); }

.status-text {
  color: var(--cyan);
  min-width: 80px;
}

/* ============================================================
   LED — the bloom dot
   ============================================================ */

.led {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2a1a5e;
  box-shadow: inset 0 0 2px rgba(0,0,0,0.6);
  flex-shrink: 0;
}

.led[data-state="off"] {
  background: #2a1a5e;
}
.led[data-state="ready"] {
  background: var(--cyan);
  box-shadow:
    0 0 6px var(--cyan),
    0 0 14px rgba(92, 246, 255, 0.6),
    inset 0 0 2px rgba(255,255,255,0.5);
}
.led[data-state="active"] {
  background: var(--peach);
  box-shadow:
    0 0 6px var(--peach),
    0 0 14px rgba(255, 184, 122, 0.6),
    inset 0 0 2px rgba(255,255,255,0.5);
}
.led[data-state="processing"] {
  background: var(--magenta);
  box-shadow:
    0 0 8px var(--magenta),
    0 0 18px rgba(255, 92, 246, 0.7),
    inset 0 0 2px rgba(255,255,255,0.5);
  animation: led-pulse 0.6s ease-in-out infinite alternate;
}
.led[data-state="success"] {
  background: var(--lime);
  box-shadow:
    0 0 6px var(--lime),
    0 0 14px rgba(184, 255, 92, 0.6),
    inset 0 0 2px rgba(255,255,255,0.5);
}
.led[data-state="error"] {
  background: var(--red);
  box-shadow:
    0 0 6px var(--red),
    0 0 14px rgba(255, 92, 122, 0.6),
    inset 0 0 2px rgba(255,255,255,0.5);
}

@keyframes led-pulse {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

/* ============================================================
   Modules (panel boxes)
   ============================================================ */

.top-panel {
  display: grid;
  /* minmax(0, 1fr) so wide content (e.g. stretched waveform canvas)
     can't push the column wider than 1fr's share. */
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.left-column, .right-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.right-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  grid-template-areas:
    "preset master"
    "wave   master";
  gap: 14px;
  align-items: stretch;
}

.preset-module   { grid-area: preset; }
.waveform-module { grid-area: wave; }
.master-module   { grid-area: master; }

.module {
  position: relative;
  background:
    linear-gradient(180deg, #1d1147 0%, #0e0729 100%);
  border-radius: 10px;
  padding: 12px 14px 14px;
  box-shadow:
    inset 2px 2px 0 rgba(255, 92, 246, 0.18),
    inset -2px -2px 0 rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 92, 246, 0.18);
}

.module-label {
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 1.5px;
  color: var(--magenta);
  text-shadow: 0 0 4px rgba(255, 92, 246, 0.4);
  margin-bottom: 10px;
  display: inline-block;
  padding: 2px 6px;
  background: rgba(255, 92, 246, 0.08);
  border: 1px solid rgba(255, 92, 246, 0.3);
  border-radius: 3px;
}

/* ============================================================
   Drop zone (cassette slot)
   ============================================================ */

.drop-zone {
  background: var(--bg-recess);
  border: 2px dashed rgba(92, 246, 255, 0.4);
  border-radius: 8px;
  padding: 18px 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.drop-zone:hover, .drop-zone:focus-visible {
  border-color: var(--cyan);
  background: rgba(92, 246, 255, 0.06);
  outline: none;
}

.drop-zone.dragover {
  border-color: var(--magenta);
  border-style: solid;
  background: rgba(255, 92, 246, 0.1);
  box-shadow: inset 0 0 24px rgba(255, 92, 246, 0.25);
}

.drop-zone.has-file {
  border-color: var(--lime);
  border-style: solid;
}

.drop-icon {
  font-family: var(--font-term);
  font-size: 28px;
  color: var(--cyan);
  margin-bottom: 4px;
  text-shadow: 0 0 8px var(--cyan);
}

.drop-line {
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.drop-sub {
  font-family: var(--font-term);
  font-size: 14px;
  color: var(--text-dim);
}

.file-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 10px;
  font-family: var(--font-term);
  font-size: 16px;
  gap: 8px;
}

.file-name {
  color: var(--peach);
  text-shadow: 0 0 4px rgba(255, 184, 122, 0.3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.file-info {
  color: var(--text-dim);
  flex-shrink: 0;
  font-size: 14px;
}

/* ============================================================
   Transport buttons
   ============================================================ */

.transport-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.transport-btn {
  position: relative;
  background:
    linear-gradient(180deg, #2a1a5e 0%, #1a0f3d 100%);
  color: var(--text-bright);
  border: none;
  border-radius: 6px;
  padding: 12px 4px;
  cursor: pointer;
  font-family: var(--font-pixel);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow:
    inset 2px 2px 0 rgba(255, 92, 246, 0.25),
    inset -2px -2px 0 rgba(0, 0, 0, 0.5),
    0 2px 0 #0a0420;
  transition: transform 0.05s, box-shadow 0.05s;
}

.transport-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #3b2675 0%, #221450 100%);
}

.transport-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow:
    inset 2px 2px 0 rgba(255, 92, 246, 0.35),
    inset -2px -2px 0 rgba(0, 0, 0, 0.6),
    0 0 0 #0a0420;
}

.transport-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.transport-btn.active {
  background: linear-gradient(180deg, #ff5cf6 0%, #b13fa8 100%);
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.3),
    inset -2px -2px 0 rgba(0, 0, 0, 0.4),
    0 0 12px rgba(255, 92, 246, 0.6);
}

.transport-glyph {
  font-family: var(--font-term);
  font-size: 22px;
  color: var(--cyan);
  text-shadow: 0 0 6px var(--cyan);
  line-height: 1;
}

.transport-btn.active .transport-glyph {
  color: var(--text-bright);
  text-shadow: 0 0 8px #fff;
}

.transport-name {
  font-family: var(--font-pixel);
  font-size: 7px;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.transport-btn.active .transport-name {
  color: var(--text-bright);
}

.time-display {
  margin-top: 10px;
  text-align: center;
  font-family: var(--font-term);
  font-size: 22px;
  color: var(--cyan);
  text-shadow: 0 0 6px rgba(92, 246, 255, 0.5);
  letter-spacing: 2px;
  background: var(--bg-recess);
  border-radius: 4px;
  padding: 4px 8px;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.6);
}

.time-sep {
  color: var(--text-dim);
  margin: 0 4px;
}

/* ============================================================
   Preset bank
   ============================================================ */

.preset-bank {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.preset-btn {
  position: relative;
  background: linear-gradient(180deg, #2a1a5e 0%, #1a0f3d 100%);
  color: var(--text-bright);
  border: none;
  border-radius: 6px;
  padding: 10px 4px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow:
    inset 2px 2px 0 rgba(255, 92, 246, 0.22),
    inset -2px -2px 0 rgba(0, 0, 0, 0.5),
    0 2px 0 #0a0420;
  transition: transform 0.05s;
}

.preset-btn:hover {
  background: linear-gradient(180deg, #3b2675 0%, #221450 100%);
}

.preset-btn:active {
  transform: translateY(2px);
}

.preset-btn.active {
  background: linear-gradient(180deg, #ff5cf6 0%, #7a2891 100%);
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.3),
    inset -2px -2px 0 rgba(0, 0, 0, 0.45),
    0 0 14px rgba(255, 92, 246, 0.6);
}

.preset-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a0f3d;
  box-shadow: inset 0 0 2px rgba(0,0,0,0.6);
  margin-bottom: 2px;
}

.preset-btn.active .preset-led {
  background: var(--lime);
  box-shadow:
    0 0 6px var(--lime),
    0 0 12px rgba(184, 255, 92, 0.6),
    inset 0 0 2px rgba(255,255,255,0.4);
}

.preset-btn.active.modified .preset-led {
  background: var(--peach);
  box-shadow:
    0 0 6px var(--peach),
    0 0 10px rgba(255, 184, 122, 0.5);
  animation: led-pulse 0.9s ease-in-out infinite alternate;
}

.preset-name {
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-bright);
}

.preset-sub {
  font-family: var(--font-term);
  font-size: 12px;
  color: var(--text-dim);
}

.preset-btn.active .preset-sub {
  color: var(--text-bright);
  opacity: 0.9;
}

.reset-link {
  display: block;
  margin: 10px auto 0;
  background: none;
  border: none;
  color: var(--peach);
  font-family: var(--font-pixel);
  font-size: 7px;
  letter-spacing: 1px;
  cursor: pointer;
  text-shadow: 0 0 4px rgba(255, 184, 122, 0.4);
}

.reset-link:hover {
  color: var(--cyan);
  text-shadow: 0 0 4px var(--cyan);
}

/* ============================================================
   Waveform
   ============================================================ */

.waveform-module {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0; /* let grid clamp width even with wide canvas inside */
}

.waveform-scroller {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 80px;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--bg-recess);
  border-radius: 4px;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.55);
}

/* Pixel-styled scrollbar */
.waveform-scroller::-webkit-scrollbar {
  height: 6px;
}
.waveform-scroller::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.4);
}
.waveform-scroller::-webkit-scrollbar-thumb {
  background: rgba(255, 92, 246, 0.5);
  border-radius: 3px;
}
.waveform-scroller::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 92, 246, 0.75);
}

#waveform {
  height: 80px;
  display: block;
  /* width is set dynamically based on SPEED */
}

.playhead {
  position: absolute;
  top: 2px;
  left: 0;
  bottom: 2px;
  width: 2px;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan), 0 0 12px var(--cyan);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
}

.playhead.visible { opacity: 1; }

/* ============================================================
   Master speed knob (large)
   ============================================================ */

.master-module {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 20px 14px;
}

/* ============================================================
   Knob component (the <vw-knob>)
   ============================================================ */

vw-knob {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
  cursor: ns-resize;
  font-family: var(--font-pixel);
}

vw-knob:focus-visible .knob-svg {
  filter: drop-shadow(0 0 6px var(--cyan));
}

vw-knob[data-size="large"] .knob-svg {
  width: 110px;
  height: 110px;
}

vw-knob .knob-svg {
  width: 78px;
  height: 78px;
  display: block;
}

vw-knob .knob-label {
  font-size: 8px;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  margin-top: 2px;
}

vw-knob .knob-value {
  font-family: var(--font-term);
  font-size: 16px;
  color: var(--cyan);
  text-shadow: 0 0 4px rgba(92, 246, 255, 0.4);
  background: var(--bg-recess);
  padding: 0 8px;
  border-radius: 3px;
  box-shadow: inset 0 0 4px rgba(0,0,0,0.5);
  min-width: 56px;
  text-align: center;
  letter-spacing: 1px;
}

vw-knob[data-size="large"] .knob-value {
  font-size: 22px;
  min-width: 80px;
}

vw-knob.dragging .knob-value {
  color: var(--magenta);
  text-shadow: 0 0 6px var(--magenta);
}

/* ============================================================
   Bottom panel — knob sections
   ============================================================ */

.bottom-panel {
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 14px;
  margin-bottom: 14px;
  justify-content: space-between;
}

.knob-section {
  background:
    linear-gradient(180deg, #1d1147 0%, #0e0729 100%);
  border-radius: 10px;
  padding: 12px 16px 14px;
  box-shadow:
    inset 2px 2px 0 rgba(255, 92, 246, 0.18),
    inset -2px -2px 0 rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 92, 246, 0.18);
  flex: 1 1 0;
}

.section-label {
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 1.5px;
  color: var(--cyan);
  text-shadow: 0 0 4px rgba(92, 246, 255, 0.4);
  margin-bottom: 12px;
  text-align: center;
  display: block;
  padding: 3px 6px;
  background: rgba(92, 246, 255, 0.08);
  border: 1px solid rgba(92, 246, 255, 0.3);
  border-radius: 3px;
}

.knob-row {
  display: flex;
  gap: 14px;
  justify-content: center;
}

/* ============================================================
   Footer / Export
   ============================================================ */

.footer-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 4px 4px;
  border-top: 2px dashed rgba(255, 92, 246, 0.35);
}

.footer-tip {
  font-family: var(--font-term);
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.export-btn {
  position: relative;
  background:
    linear-gradient(180deg, #ff5cf6 0%, #b13fa8 50%, #6a1c70 100%);
  color: #1a0429;
  border: none;
  border-radius: 8px;
  padding: 14px 24px;
  cursor: pointer;
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.45),
    inset -2px -2px 0 rgba(0, 0, 0, 0.4),
    0 4px 0 #4a0e6e,
    0 0 24px rgba(255, 92, 246, 0.45);
  transition: transform 0.06s, box-shadow 0.06s;
  overflow: hidden;
  min-width: 320px;
  justify-content: center;
  white-space: nowrap;
}

.export-btn .export-text {
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}

.export-btn.processing {
  background: linear-gradient(180deg, #5cf6ff 0%, #3aa9b1 50%, #1a4750 100%);
  color: #06222a;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.45),
    inset -2px -2px 0 rgba(0, 0, 0, 0.4),
    0 4px 0 #06222a,
    0 0 28px rgba(92, 246, 255, 0.7);
  animation: btn-loading-pulse 0.9s ease-in-out infinite alternate;
}

@keyframes btn-loading-pulse {
  from { box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.45),
    inset -2px -2px 0 rgba(0, 0, 0, 0.4),
    0 4px 0 #06222a,
    0 0 18px rgba(92, 246, 255, 0.45); }
  to   { box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.45),
    inset -2px -2px 0 rgba(0, 0, 0, 0.4),
    0 4px 0 #06222a,
    0 0 36px rgba(92, 246, 255, 0.85); }
}

.export-btn:hover:not(:disabled) {
  background:
    linear-gradient(180deg, #ff7cff 0%, #c64dba 50%, #7a2891 100%);
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.55),
    inset -2px -2px 0 rgba(0, 0, 0, 0.4),
    0 4px 0 #4a0e6e,
    0 0 32px rgba(255, 92, 246, 0.65);
}

.export-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.45),
    inset -2px -2px 0 rgba(0, 0, 0, 0.4),
    0 1px 0 #4a0e6e;
}

/* ============================================================
   Error panel — visible when an export fails
   ============================================================ */

.error-panel {
  margin: 12px 4px 0;
  background: linear-gradient(180deg, #4a0a1f 0%, #1a0210 100%);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow:
    inset 2px 2px 0 rgba(255, 92, 122, 0.35),
    inset -2px -2px 0 rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 92, 122, 0.4),
    0 0 24px rgba(255, 92, 122, 0.25);
  font-family: var(--font-term);
  color: #ffc7d3;
}

.error-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.error-panel-icon {
  font-size: 18px;
  color: var(--red);
  text-shadow: 0 0 6px var(--red);
}

.error-panel-title {
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--red);
  text-shadow: 0 0 4px rgba(255, 92, 122, 0.5);
  flex: 1;
}

.error-panel-close {
  background: none;
  border: none;
  color: var(--red);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 6px;
}

.error-panel-close:hover {
  color: var(--text-bright);
}

.error-panel-body {
  background: rgba(0, 0, 0, 0.45);
  padding: 8px 10px;
  border-radius: 4px;
  font-family: var(--font-term);
  font-size: 14px;
  color: #ffd9e0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 120px;
  overflow-y: auto;
  letter-spacing: 0.5px;
}

.error-panel-tip {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255, 199, 211, 0.6);
  letter-spacing: 0.5px;
}

.export-btn:disabled:not(.processing) {
  background: linear-gradient(180deg, #3b2675 0%, #221450 100%);
  color: var(--text-dim);
  cursor: not-allowed;
  box-shadow:
    inset 2px 2px 0 rgba(255, 92, 246, 0.18),
    inset -2px -2px 0 rgba(0, 0, 0, 0.4),
    0 2px 0 #0a0420;
}

.export-btn.processing {
  cursor: progress;
}

.export-arrow {
  font-size: 16px;
  line-height: 1;
}

.export-progress {
  font-family: var(--font-term);
  font-size: 13px;
  color: var(--text-bright);
  margin-left: 4px;
  min-width: 32px;
  text-align: right;
  opacity: 0;
}

.export-btn.processing .export-progress {
  opacity: 1;
}

/* ============================================================
   Scaling for smaller viewports — keep hardware feel, scale down
   ============================================================ */

@media (max-width: 1180px) {
  .chassis {
    transform: scale(0.94);
    transform-origin: top center;
  }
}

@media (max-width: 1040px) {
  .chassis {
    transform: scale(0.84);
    transform-origin: top center;
  }
}

@media (max-width: 920px) {
  .chassis {
    transform: scale(0.74);
    transform-origin: top center;
  }
}

@media (max-width: 800px) {
  .chassis {
    transform: scale(0.62);
    transform-origin: top center;
  }
}

/* ============================================================
   ============================================================
   SITE WRAPPER — Landing + Pricing pages
   ============================================================
   ============================================================ */

/* Site Header — sticky, transparent, blurs on scroll */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: transparent;
  transition: background 0.25s, backdrop-filter 0.25s, border-color 0.25s;
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: rgba(10, 4, 32, 0.65);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom-color: rgba(255, 92, 246, 0.25);
}

.site-header .logo {
  font-family: var(--font-pixel);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--text-bright);
  text-decoration: none;
  text-shadow:
    1px 0 var(--magenta),
    -1px 0 var(--cyan);
  text-transform: lowercase;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-header .nav-link {
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s, text-shadow 0.15s;
}
.site-header .nav-link:hover {
  color: var(--cyan);
  text-shadow: 0 0 6px var(--cyan);
}

.user-state {
  font-family: var(--font-term);
  font-size: 17px;
  color: var(--text-dim);
  letter-spacing: 0.4px;
  background: rgba(255, 92, 246, 0.08);
  border: 1px solid rgba(255, 92, 246, 0.3);
  border-radius: 4px;
  padding: 6px 12px;
}
.user-state .exports-left {
  color: var(--cyan);
  margin-left: 6px;
}
.user-state.unlimited .exports-left {
  color: var(--lime);
}

/* ============================================================
   Hero — wraps the editor with headlines
   ============================================================ */
.hero {
  position: relative;
  z-index: 1;
  padding: 88px 12px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hero-headlines {
  text-align: center;
  max-width: 900px;
  transition: opacity 0.35s ease, transform 0.35s ease, max-height 0.35s ease;
  overflow: hidden;
}

.hero-h1 {
  font-family: var(--font-pixel);
  font-size: 24px;
  letter-spacing: 2px;
  color: var(--text-bright);
  text-shadow:
    1px 0 var(--magenta),
    -1px 0 var(--cyan),
    0 0 14px rgba(255, 92, 246, 0.4);
  margin-bottom: 14px;
  text-transform: lowercase;
  line-height: 1.4;
}

.hero-sub {
  font-family: var(--font-term);
  font-size: 22px;
  color: var(--text-dim);
  letter-spacing: 0.4px;
}

.hero.has-track .hero-headlines {
  opacity: 0;
  transform: translateY(-12px);
  max-height: 0;
  margin-bottom: -20px;
  pointer-events: none;
}

/* ============================================================
   Demo Tracks
   ============================================================ */
.demo-tracks {
  position: relative;
  z-index: 1;
  padding: 56px 24px;
  text-align: center;
}

.section-h2 {
  font-family: var(--font-pixel);
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--text-bright);
  text-shadow:
    1px 0 var(--magenta),
    -1px 0 var(--cyan);
  margin-bottom: 32px;
  text-transform: lowercase;
  line-height: 1.3;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
  gap: 18px;
  justify-content: center;
  max-width: 1000px;
  margin: 0 auto;
}

.demo-card {
  position: relative;
  background:
    linear-gradient(180deg, #1d1147 0%, #0e0729 100%);
  border-radius: 10px;
  padding: 16px 14px;
  border: none;
  cursor: pointer;
  font-family: var(--font-term);
  color: var(--text-bright);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow:
    inset 2px 2px 0 rgba(255, 92, 246, 0.22),
    inset -2px -2px 0 rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 92, 246, 0.18),
    0 4px 0 #0a0420;
  transition: transform 0.06s, box-shadow 0.15s;
}

.demo-card:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 2px 2px 0 rgba(92, 246, 255, 0.32),
    inset -2px -2px 0 rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(92, 246, 255, 0.4),
    0 6px 0 #0a0420,
    0 0 24px rgba(255, 92, 246, 0.35);
}

.demo-card:active {
  transform: translateY(0);
}

.demo-card[data-coming-soon] {
  opacity: 0.55;
}
.demo-card[data-coming-soon]:hover {
  opacity: 0.8;
}

.demo-cover {
  width: 140px;
  height: 140px;
  background: var(--bg-recess);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 14px rgba(0,0,0,0.6);
  position: relative;
  overflow: hidden;
  margin-bottom: 4px;
}
.demo-cover svg {
  width: 100%;
  height: 100%;
  display: block;
}

.demo-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--text-bright);
  letter-spacing: 1px;
  margin-top: 6px;
  text-transform: uppercase;
}

.demo-genre {
  font-family: var(--font-term);
  font-size: 17px;
  color: var(--peach);
  letter-spacing: 0.7px;
}

/* ============================================================
   Social Proof
   ============================================================ */
.social-proof {
  position: relative;
  z-index: 1;
  padding: 64px 24px;
  text-align: center;
}

.counter-block {
  margin-bottom: 24px;
}

.counter-num {
  font-family: var(--font-pixel);
  font-size: 40px;
  letter-spacing: 2px;
  color: var(--magenta);
  text-shadow:
    0 0 16px rgba(255, 92, 246, 0.6),
    1px 0 var(--cyan),
    -1px 0 var(--cyan);
  display: block;
  margin-bottom: 8px;
}

.counter-label {
  font-family: var(--font-term);
  font-size: 22px;
  color: var(--text-dim);
  letter-spacing: 0.8px;
}

.community-headline {
  margin-top: 36px;
  margin-bottom: 18px;
}

.community-grid {
  display: none; /* hidden until real submissions exist */
}

.pricing-hint {
  margin-top: 40px;
  font-family: var(--font-term);
  font-size: 22px;
  color: var(--text-dim);
  letter-spacing: 0.4px;
}

.pricing-hint a {
  color: var(--cyan);
  text-decoration: none;
  margin-left: 10px;
  transition: text-shadow 0.15s;
}
.pricing-hint a:hover {
  text-shadow: 0 0 8px var(--cyan);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 32px;
  border-top: 1px dashed rgba(255, 92, 246, 0.25);
  margin-top: auto;
  font-family: var(--font-term);
  font-size: 17px;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 16px;
  letter-spacing: 0.4px;
}

.footer-copyright {
  letter-spacing: 0.5px;
}

.footer-nav {
  display: flex;
  gap: 22px;
}

.footer-nav a {
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.15s;
}
.footer-nav a:hover {
  color: var(--cyan);
}

.footer-social {
  display: flex;
  gap: 14px;
}

.footer-social a {
  font-size: 22px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s, text-shadow 0.15s;
}
.footer-social a:hover {
  color: var(--magenta);
  text-shadow: 0 0 8px var(--magenta);
}

/* ============================================================
   Pricing Page
   ============================================================ */
.pricing-hero {
  position: relative;
  z-index: 1;
  padding: 120px 24px 36px;
  text-align: center;
}

.pricing-hero h1 {
  font-family: var(--font-pixel);
  font-size: 24px;
  letter-spacing: 2px;
  color: var(--text-bright);
  text-shadow:
    1px 0 var(--magenta),
    -1px 0 var(--cyan),
    0 0 14px rgba(255, 92, 246, 0.4);
  margin-bottom: 16px;
  text-transform: lowercase;
  line-height: 1.3;
}

.pricing-hero p {
  font-family: var(--font-term);
  font-size: 24px;
  color: var(--text-dim);
  letter-spacing: 0.4px;
}

.founder-banner {
  max-width: 720px;
  margin: 24px auto;
  padding: 14px 20px;
  background:
    linear-gradient(90deg,
      rgba(255, 92, 246, 0.15) 0%,
      rgba(92, 246, 255, 0.15) 100%);
  border: 1px solid rgba(255, 184, 122, 0.5);
  border-radius: 8px;
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--peach);
  text-shadow: 0 0 6px rgba(255, 184, 122, 0.4);
  text-transform: uppercase;
  line-height: 1.4;
}

.pricing-tiers {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 24px 48px;
}

.tier {
  position: relative;
  background:
    linear-gradient(180deg, #1d1147 0%, #0e0729 100%);
  border-radius: 12px;
  padding: 24px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow:
    inset 2px 2px 0 rgba(255, 92, 246, 0.18),
    inset -2px -2px 0 rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 92, 246, 0.18);
}

.tier.featured {
  box-shadow:
    inset 2px 2px 0 rgba(255, 92, 246, 0.4),
    inset -2px -2px 0 rgba(0, 0, 0, 0.55),
    0 0 0 1px var(--magenta),
    0 0 32px rgba(255, 92, 246, 0.35);
  transform: translateY(-8px);
}

.tier.tier-lifetime {
  box-shadow:
    inset 2px 2px 0 rgba(92, 246, 255, 0.35),
    inset -2px -2px 0 rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(92, 246, 255, 0.6),
    0 0 28px rgba(92, 246, 255, 0.25);
}

.tier-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  font-family: var(--font-pixel);
  font-size: 7px;
  letter-spacing: 1px;
  padding: 4px 8px;
  background: var(--magenta);
  color: #1a0429;
  border-radius: 4px;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(255, 92, 246, 0.6);
}

.tier-lifetime .tier-badge {
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(92, 246, 255, 0.6);
}

.tier-name {
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--text-bright);
  text-transform: uppercase;
}

.tier-price {
  font-family: var(--font-term);
  font-size: 42px;
  color: var(--magenta);
  text-shadow: 0 0 8px rgba(255, 92, 246, 0.4);
  letter-spacing: 1px;
  line-height: 1.05;
}
.tier-lifetime .tier-price {
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(92, 246, 255, 0.4);
}
.tier-free .tier-price {
  color: var(--text-dim);
  text-shadow: none;
}

.tier-price-strike {
  font-size: 22px;
  color: var(--text-dim);
  text-decoration: line-through;
  margin-right: 8px;
}

.tier-period {
  font-family: var(--font-term);
  font-size: 18px;
  color: var(--text-dim);
  margin-left: 4px;
}

.tier-amount {
  font-family: var(--font-term);
  font-size: 22px;
  color: var(--peach);
  letter-spacing: 0.5px;
}

.tier-per {
  font-family: var(--font-term);
  font-size: 17px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
}

.tier-features {
  list-style: none;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tier-features li {
  font-family: var(--font-term);
  font-size: 19px;
  color: var(--text-bright);
  letter-spacing: 0.3px;
  line-height: 1.35;
}
.tier-features li::before {
  content: '→ ';
  color: var(--cyan);
  margin-right: 4px;
}
.tier-features li.muted {
  color: var(--text-dim);
}
.tier-features li.muted::before {
  content: '× ';
  color: var(--red);
}

.tier-cta {
  margin-top: auto;
  background:
    linear-gradient(180deg, #2a1a5e 0%, #1a0f3d 100%);
  color: var(--text-bright);
  border: none;
  border-radius: 8px;
  padding: 16px 16px;
  cursor: pointer;
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  box-shadow:
    inset 2px 2px 0 rgba(255, 92, 246, 0.25),
    inset -2px -2px 0 rgba(0, 0, 0, 0.5),
    0 4px 0 #0a0420;
  transition: transform 0.06s, box-shadow 0.06s;
}
.tier-cta:hover:not(:disabled) {
  background: linear-gradient(180deg, #3b2675 0%, #221450 100%);
}
.tier-cta:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow:
    inset 2px 2px 0 rgba(255, 92, 246, 0.35),
    inset -2px -2px 0 rgba(0, 0, 0, 0.6),
    0 1px 0 #0a0420;
}
.tier.featured .tier-cta {
  background: linear-gradient(180deg, #ff5cf6 0%, #b13fa8 50%, #6a1c70 100%);
  color: #1a0429;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.4),
    inset -2px -2px 0 rgba(0, 0, 0, 0.4),
    0 4px 0 #4a0e6e,
    0 0 20px rgba(255, 92, 246, 0.45);
}
.tier-lifetime .tier-cta {
  background: linear-gradient(180deg, #5cf6ff 0%, #3aa9b1 50%, #1a4a52 100%);
  color: #06222a;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.4),
    inset -2px -2px 0 rgba(0, 0, 0, 0.4),
    0 4px 0 #1a4a52,
    0 0 20px rgba(92, 246, 255, 0.45);
}

.pricing-disclaimer {
  text-align: center;
  font-family: var(--font-term);
  font-size: 17px;
  color: var(--text-dim);
  padding: 0 24px 32px;
  letter-spacing: 0.4px;
}

/* FAQ */
.pricing-faq {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 24px 96px;
}

.pricing-faq h2 {
  margin-bottom: 20px;
  text-align: center;
}

.pricing-faq details {
  background: rgba(26, 15, 61, 0.6);
  border-radius: 8px;
  border: 1px solid rgba(255, 92, 246, 0.2);
  margin-bottom: 10px;
  overflow: hidden;
}

.pricing-faq summary {
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--text-bright);
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-transform: uppercase;
  line-height: 1.3;
}

.pricing-faq summary::-webkit-details-marker { display: none; }
.pricing-faq summary::after {
  content: '+';
  color: var(--cyan);
  font-family: var(--font-term);
  font-size: 28px;
  line-height: 1;
}
.pricing-faq details[open] summary::after { content: '−'; }

.pricing-faq summary:hover {
  color: var(--cyan);
}

.pricing-faq details p {
  padding: 0 22px 20px;
  font-family: var(--font-term);
  font-size: 20px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
  line-height: 1.5;
}

/* ============================================================
   Modal system
   ============================================================ */
#modal-root:empty { display: none; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 4, 32, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-fade-in 0.2s ease-out;
  padding: 20px;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  position: relative;
  background:
    linear-gradient(160deg, #3a1f7a 0%, #1a0f3d 35%, #0a0420 100%);
  border-radius: 14px;
  padding: 32px 30px 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -2px 0 rgba(0,0,0,0.7),
    0 24px 80px rgba(0,0,0,0.65),
    0 0 0 4px #0a0420,
    0 0 0 6px rgba(255, 92, 246, 0.4),
    0 0 60px rgba(255, 92, 246, 0.35);
  animation: modal-pop-in 0.25s ease-out;
}

@keyframes modal-pop-in {
  from {
    transform: scale(0.92) translateY(8px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.modal-box.wide { max-width: 880px; }

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.15s, text-shadow 0.15s;
}
.modal-close:hover {
  color: var(--magenta);
  text-shadow: 0 0 6px var(--magenta);
}

.modal-h1 {
  font-family: var(--font-pixel);
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--text-bright);
  text-shadow:
    1px 0 var(--magenta),
    -1px 0 var(--cyan);
  margin-bottom: 14px;
  text-transform: lowercase;
  line-height: 1.4;
}

.modal-sub {
  font-family: var(--font-term);
  font-size: 20px;
  color: var(--text-dim);
  margin-bottom: 24px;
  line-height: 1.5;
  letter-spacing: 0.3px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-form label {
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: -4px;
}

.modal-form input[type="email"],
.modal-form input[type="password"],
.modal-form input[type="text"] {
  background: var(--bg-recess);
  border: 1px solid rgba(255, 92, 246, 0.3);
  border-radius: 6px;
  color: var(--text-bright);
  font-family: var(--font-term);
  font-size: 20px;
  padding: 14px 16px;
  letter-spacing: 0.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

/* Checkbox rows in the signup form */
.modal-form .modal-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 6px 0 4px;
  font-family: var(--font-term);
  font-size: 16px;
  color: var(--text-bright);
  letter-spacing: 0.3px;
  line-height: 1.4;
  cursor: pointer;
  text-transform: none;
  user-select: none;
}

.modal-form .modal-check.optional {
  color: var(--text-dim);
}

.modal-form .modal-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  background: var(--bg-recess);
  border: 2px solid rgba(255, 92, 246, 0.5);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}

.modal-form .modal-check input[type="checkbox"]:hover {
  border-color: var(--cyan);
}

.modal-form .modal-check input[type="checkbox"]:checked {
  background: var(--magenta);
  border-color: var(--magenta);
}

.modal-form .modal-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 0px;
  width: 6px;
  height: 11px;
  border-right: 2px solid #1a0429;
  border-bottom: 2px solid #1a0429;
  transform: rotate(45deg);
}

.modal-form .modal-check input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.modal-form .modal-check a {
  color: var(--cyan);
  text-decoration: underline;
}
.modal-form .modal-check a:hover {
  color: var(--magenta);
}

/* ============================================================
   Google OAuth Button — must follow Google brand guidelines:
   white background, dark text, neutral border. Distinct from
   the magenta primary CTA so it's clearly secondary.
   ============================================================ */

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 6px;
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: 6px;
  padding: 13px 16px;
  cursor: pointer;
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 500;
  transition: background 0.12s, box-shadow 0.12s, transform 0.06s;
  box-shadow:
    0 1px 2px rgba(60, 64, 67, 0.3),
    0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.google-btn:hover {
  background: #f8f9fa;
  box-shadow:
    0 1px 3px rgba(60, 64, 67, 0.4),
    0 4px 8px 3px rgba(60, 64, 67, 0.15);
}

.google-btn:active {
  background: #f1f3f4;
  transform: translateY(1px);
}

.google-btn:disabled {
  background: #f1f3f4;
  color: #5f6368;
  cursor: not-allowed;
  box-shadow: none;
}

.google-btn svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

/* Hint shown under the Google button on the Signup modal so the
   user explicitly accepts AGB+Privacy by clicking — DSGVO-clean. */
.google-tos-hint {
  font-family: var(--font-term);
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
  margin: 0 0 14px;
  line-height: 1.4;
  letter-spacing: 0.2px;
}
.google-tos-hint a {
  color: var(--cyan);
  text-decoration: underline;
}
.google-tos-hint a:hover {
  color: var(--magenta);
}

/* Divider with "or with email" text between Google button + email form */
.modal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 16px;
  color: var(--text-dim);
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.modal-divider::before,
.modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 92, 246, 0.25);
}
.modal-divider span {
  white-space: nowrap;
}

.modal-form input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(92, 246, 255, 0.35);
}

.modal-cta {
  background: linear-gradient(180deg, #ff5cf6 0%, #b13fa8 50%, #6a1c70 100%);
  color: #1a0429;
  border: none;
  border-radius: 8px;
  padding: 16px 22px;
  cursor: pointer;
  font-family: var(--font-pixel);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.4),
    inset -2px -2px 0 rgba(0, 0, 0, 0.4),
    0 4px 0 #4a0e6e,
    0 0 24px rgba(255, 92, 246, 0.45);
  transition: transform 0.06s;
}
.modal-cta:hover {
  background: linear-gradient(180deg, #ff7cff 0%, #c64dba 50%, #7a2891 100%);
}
.modal-cta:active {
  transform: translateY(2px);
}

.modal-error {
  color: var(--red);
  font-family: var(--font-term);
  font-size: 17px;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.modal-footer-link {
  font-family: var(--font-term);
  font-size: 17px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 12px;
}
.modal-footer-link a {
  color: var(--cyan);
  text-decoration: none;
  cursor: pointer;
}
.modal-footer-link a:hover {
  text-shadow: 0 0 6px var(--cyan);
}

/* Paywall — inside .modal-box.wide */
.paywall-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
@media (max-width: 720px) {
  .paywall-tiers { grid-template-columns: 1fr; }
}

.paywall-tiers .tier {
  padding: 20px 16px 16px;
}
.paywall-tiers .tier-name { font-size: 11px; }
.paywall-tiers .tier-price { font-size: 34px; }
.paywall-tiers .tier-amount { font-size: 19px; }
.paywall-tiers .tier-per { font-size: 16px; }

.paywall-disclaimer {
  text-align: center;
  font-family: var(--font-term);
  font-size: 16px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
}

/* ============================================================
   Toast notifications
   ============================================================ */
#toast-container {
  position: fixed;
  top: 72px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: calc(100vw - 40px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background:
    linear-gradient(180deg, #1d1147 0%, #0e0729 100%);
  border-radius: 8px;
  padding: 12px 16px 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 420px;
  box-shadow:
    inset 2px 2px 0 rgba(255, 92, 246, 0.22),
    inset -2px -2px 0 rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 92, 246, 0.3),
    0 8px 32px rgba(0, 0, 0, 0.6);
  animation: toast-slide-in 0.25s cubic-bezier(0.4, 1.4, 0.5, 1);
  font-family: var(--font-term);
  color: var(--text-bright);
  letter-spacing: 0.3px;
}

@keyframes toast-slide-in {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.dismissing {
  animation: toast-slide-out 0.2s ease-in forwards;
}
@keyframes toast-slide-out {
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

.toast.success {
  box-shadow:
    inset 2px 2px 0 rgba(184, 255, 92, 0.3),
    inset -2px -2px 0 rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(184, 255, 92, 0.4),
    0 8px 32px rgba(0, 0, 0, 0.6);
}
.toast.error {
  box-shadow:
    inset 2px 2px 0 rgba(255, 92, 122, 0.3),
    inset -2px -2px 0 rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 92, 122, 0.5),
    0 8px 32px rgba(0, 0, 0, 0.6);
}
.toast.info {
  box-shadow:
    inset 2px 2px 0 rgba(255, 184, 122, 0.3),
    inset -2px -2px 0 rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 184, 122, 0.4),
    0 8px 32px rgba(0, 0, 0, 0.6);
}

.toast-icon {
  font-family: var(--font-term);
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}
.toast.success .toast-icon { color: var(--lime); text-shadow: 0 0 6px var(--lime); }
.toast.error .toast-icon { color: var(--red); text-shadow: 0 0 6px var(--red); }
.toast.info .toast-icon { color: var(--peach); text-shadow: 0 0 6px var(--peach); }

.toast-message {
  flex: 1;
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: 0.3px;
}

.toast-action {
  background: none;
  border: none;
  color: var(--cyan);
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 1.2px;
  cursor: pointer;
  text-transform: uppercase;
  padding: 4px 8px;
  flex-shrink: 0;
  transition: text-shadow 0.15s;
}
.toast-action:hover {
  text-shadow: 0 0 6px var(--cyan);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
  flex-shrink: 0;
}
.toast-close:hover { color: var(--text-bright); }

/* ============================================================
   Body adjustments for the new wrapper
   ============================================================ */
.chassis {
  margin: 0 auto;
}

/* If the viewport is short, scale the editor so it fits with header above */
@media (max-height: 820px) and (min-width: 1180px) {
  .hero .chassis {
    transform: scale(0.88);
    transform-origin: top center;
  }
}
@media (max-height: 720px) and (min-width: 1180px) {
  .hero .chassis {
    transform: scale(0.78);
    transform-origin: top center;
  }
}

/* ============================================================
   Pricing tier subtle adjustments
   ============================================================ */
.tier-free {
  opacity: 0.92;
}

/* ============================================================
   Legal pages — Imprint / Privacy / Terms
   Prose-style content, readable but on-brand.
   ============================================================ */

.legal-hero {
  position: relative;
  z-index: 1;
  padding: 110px 24px 24px;
  text-align: center;
}

.legal-hero h1 {
  font-family: var(--font-pixel);
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--text-bright);
  text-shadow:
    1px 0 var(--magenta),
    -1px 0 var(--cyan),
    0 0 14px rgba(255, 92, 246, 0.4);
  margin-bottom: 12px;
  text-transform: lowercase;
  line-height: 1.3;
}

.legal-hero .legal-meta {
  font-family: var(--font-term);
  font-size: 17px;
  color: var(--text-dim);
  letter-spacing: 0.4px;
}

.legal-prose {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 28px 96px;
  font-family: var(--font-term);
  color: var(--text-bright);
  line-height: 1.6;
  letter-spacing: 0.3px;
}

.legal-prose section {
  margin-bottom: 36px;
  background: rgba(26, 15, 61, 0.55);
  border-radius: 10px;
  padding: 20px 24px 18px;
  box-shadow:
    inset 2px 2px 0 rgba(255, 92, 246, 0.18),
    inset -2px -2px 0 rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 92, 246, 0.18);
}

.legal-prose h2 {
  font-family: var(--font-pixel);
  font-size: 13px;
  letter-spacing: 1.5px;
  color: var(--cyan);
  text-shadow: 0 0 6px rgba(92, 246, 255, 0.4);
  margin-bottom: 14px;
  text-transform: uppercase;
  line-height: 1.4;
}

.legal-prose h3 {
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--peach);
  margin: 16px 0 8px;
  text-transform: uppercase;
}

.legal-prose p {
  font-size: 18px;
  margin-bottom: 12px;
}

.legal-prose ul,
.legal-prose ol {
  margin: 8px 0 12px 22px;
}

.legal-prose li {
  font-size: 18px;
  margin-bottom: 6px;
}

.legal-prose strong {
  color: var(--text-bright);
  font-weight: normal;
  background: rgba(255, 92, 246, 0.15);
  padding: 0 4px;
  border-radius: 2px;
}

.legal-prose a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-color: rgba(92, 246, 255, 0.4);
  text-underline-offset: 3px;
}
.legal-prose a:hover {
  color: var(--magenta);
  text-decoration-color: rgba(255, 92, 246, 0.6);
  text-shadow: 0 0 6px rgba(255, 92, 246, 0.5);
}

.legal-prose .legal-table-of-contents {
  background: rgba(13, 6, 40, 0.6);
  border: 1px dashed rgba(255, 92, 246, 0.3);
  padding: 16px 22px;
  margin-bottom: 32px;
  border-radius: 6px;
  font-size: 16px;
}
.legal-prose .legal-table-of-contents h2 {
  font-size: 10px;
  margin-bottom: 10px;
  color: var(--text-dim);
  text-shadow: none;
}
.legal-prose .legal-table-of-contents ol {
  margin: 0;
  padding-left: 22px;
}
.legal-prose .legal-table-of-contents li {
  margin-bottom: 4px;
  font-size: 16px;
}

.legal-prose dl {
  margin-bottom: 12px;
}
.legal-prose dt {
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 10px;
  margin-bottom: 2px;
}
.legal-prose dd {
  font-size: 18px;
  margin-bottom: 8px;
  padding-left: 0;
}

.legal-prose .last-updated {
  font-family: var(--font-term);
  font-size: 15px;
  color: var(--text-dim);
  text-align: center;
  font-style: italic;
  margin-top: 24px;
  letter-spacing: 0.4px;
}

