/* ============================================================
   OwlDuet investor demo — tape-machine reference player
   Brand: black + gold (#C9A961)
   ============================================================ */

:root {
  --bg: #050505;
  --panel-top: #1f1c18;
  --panel-bot: #100e0c;
  --panel-edge: #2a241d;
  --gold: #C9A961;
  --gold-bright: #E5C277;
  --gold-dim: #8a7445;
  --text: #E8E5DD;
  --text-muted: #8a8580;
  --lcd: #FFB347;
  --lcd-dim: #5a3a1a;
  --depth: 0 25px 60px rgba(0,0,0,0.7);
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Studio room ambient */
.room-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201,169,97,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(201,169,97,0.02) 0%, transparent 60%),
    radial-gradient(ellipse at center, #0a0805 0%, #000 80%);
}

/* ====================== Header (removed; logo lives inside the machine) ====================== */
.site-header { display: none; }

/* ====================== Hero (inside the machine) ====================== */
.machine-hero {
  text-align: center;
  padding: 0 24px 22px;
  max-width: 720px;
  margin: 0 auto;
}
.machine-hero .machine-logo-link {
  display: inline-block;
  padding: 0;
  margin-bottom: 12px;
}
.machine-hero .machine-logo {
  height: 56px;
}
.hero-title {
  font-size: clamp(20px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: #fff;
}
.hero-title .accent { color: var(--gold); }
.hero-sub {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.5;
}

/* ====================== Machine chassis ====================== */
.machine-stage {
  padding: 18px 20px 24px;
  max-width: 880px;
  margin: 0 auto;
}
.machine {
  position: relative;
  background:
    /* fine brushed-metal scan lines */
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.012) 0px,
      rgba(255,255,255,0.012) 1px,
      transparent 1px,
      transparent 2px
    ),
    linear-gradient(180deg, var(--panel-top) 0%, var(--panel-bot) 100%);
  border: 1px solid var(--panel-edge);
  border-top-color: rgba(201,169,97,0.35);
  border-radius: 14px;
  padding: 28px 36px 26px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 0 60px rgba(0,0,0,0.4),
    var(--depth);
}
/* Subtle chassis chamfer */
.machine::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 11px;
  border: 1px solid rgba(0,0,0,0.6);
  pointer-events: none;
}

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

.machine-logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0 24px;
}
.machine-logo {
  height: 110px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 14px rgba(201,169,97,0.2));
  transition: filter 0.25s ease;
}
.machine-logo:hover {
  filter: drop-shadow(0 2px 20px rgba(201,169,97,0.35));
}

/* Song selector — two independent pill tabs with a label */
.song-section {
  text-align: center;
  margin-bottom: 20px;
}
.song-section-label {
  font-size: 11px;
  letter-spacing: 0.4em;
  color: #fff;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.5);
}
.song-selector {
  display: inline-flex;
  gap: 8px;
}
.song-tab {
  position: relative;
  font-family: inherit;
  background: linear-gradient(180deg, #18140f 0%, #0d0a08 100%);
  border: 1px solid #2f2820;
  border-radius: 6px;
  padding: 9px 20px;
  cursor: pointer;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.song-tab:hover:not(.active) {
  border-color: var(--gold-dim);
}
.song-tab.active {
  background: linear-gradient(180deg, #2a2520 0%, #18130e 100%);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow:
    inset 0 1px 0 rgba(201,169,97,0.2),
    0 0 12px rgba(201,169,97,0.22);
}
.song-tab-spinner {
  width: 12px;
  height: 12px;
  display: none;
  border-radius: 50%;
  border: 2px solid rgba(201,169,97,0.25);
  border-top-color: var(--gold);
  animation: reel-spin 0.8s linear infinite;
}
.song-tab.loading .song-tab-spinner { display: inline-block; }
.song-tab.loading .song-tab-label { opacity: 0.55; }

/* Centering wrapper helper for the segmented pill */
.machine > .song-selector { display: flex; justify-content: center; }

/* Cartridge label — track name + spoken intent */
.tape-label-plate {
  text-align: center;
  padding: 20px 24px;
  margin-bottom: 20px;
  background: linear-gradient(180deg, #14110d 0%, #060504 100%);
  border: 1px solid #221d16;
  border-top-color: rgba(201,169,97,0.15);
  border-radius: 6px;
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.7),
    inset 0 -1px 0 rgba(255,255,255,0.03);
}
.tape-label-track {
  font-family: 'Inter', sans-serif;
  font-size: clamp(14px, 1.4vw, 17px);
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--gold-dim);
  text-shadow: 0 1px 0 rgba(0,0,0,0.6);
}
.tape-label-prompt {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.prompt-prefix {
  font-size: clamp(9px, 0.85vw, 11px);
  letter-spacing: 0.4em;
  color: var(--gold-dim);
  font-weight: 600;
  text-transform: uppercase;
}
.prompt-quote {
  font-size: clamp(14px, 1.5vw, 18px);
  font-style: italic;
  color: #fff;
  font-weight: 400;
  line-height: 1.35;
  display: block;
  text-align: center;
  transition: opacity 0.25s ease;
  letter-spacing: -0.005em;
}
.prompt-quote.fading { opacity: 0; }

/* ====================== Tape window (waveform) ====================== */
.tape-window {
  position: relative;
  background: #030303;
  border-radius: 6px;
  padding: 8px 16px 12px;
  margin-bottom: 18px;
  box-shadow:
    inset 0 3px 10px rgba(0,0,0,0.9),
    inset 0 -1px 0 rgba(255,255,255,0.03),
    0 1px 0 rgba(255,255,255,0.04);
  border: 1px solid #1a1611;
}
.tape-window-screws {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.screw {
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #4a4540 0%, #1a1611 70%);
  box-shadow: inset 0 0 2px rgba(0,0,0,0.8), 0 1px 1px rgba(255,255,255,0.03);
}
.screw:nth-child(1) { top: 8px; left: 8px; }
.screw:nth-child(2) { top: 8px; right: 8px; }
.screw:nth-child(3) { bottom: 8px; left: 8px; }
.screw:nth-child(4) { bottom: 8px; right: 8px; }

.tape-time {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--lcd);
  text-shadow: 0 0 6px rgba(255,179,71,0.45);
  letter-spacing: 1.5px;
  padding: 0 2px 4px;
}
.tape-time-sep { color: var(--lcd-dim); opacity: 0.6; }
.tape-time-total { color: var(--lcd-dim); text-shadow: 0 0 4px rgba(255,179,71,0.18); }

.waveform {
  position: relative;
  height: 52px;
  margin: 4px 0 0;
  cursor: pointer;
}
.waveform-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%;
  width: 2px;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold), 0 0 4px var(--gold-bright);
  pointer-events: none;
  z-index: 2;
  transform: translateX(-1px);
}
/* ====================== Control row — STOP, PLAY, VOL grouped ====================== */
.control-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 22px;
  margin-bottom: 14px;
}

/* Transport buttons */
.transport {
  display: flex;
  gap: 10px;
}
.tape-btn {
  font-family: inherit;
  width: 86px;
  height: 68px;
  border: 1px solid #0a0805;
  border-top-color: #3a3530;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #2c2823 0%, #1a1714 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -2px 0 rgba(0,0,0,0.4),
    0 3px 0 #050403,
    0 5px 8px rgba(0,0,0,0.5);
  transition: transform 0.06s, box-shadow 0.06s;
  user-select: none;
}
.tape-btn:hover:not(:disabled) {
  border-top-color: #4a4540;
}
.tape-btn:active:not(:disabled),
.tape-btn.pressed {
  transform: translateY(3px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    0 1px 0 #050403,
    0 2px 4px rgba(0,0,0,0.5);
}
.tape-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}
.btn-glyph {
  font-size: 20px;
  line-height: 1;
}
.btn-play .btn-glyph { color: var(--gold); }
.btn-stop .btn-glyph { color: #d8534a; }
.btn-text {
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--text-muted);
  font-weight: 600;
}

/* Listening environment tip — sits below the transport row inside the chassis */
.listen-tip {
  text-align: center;
  font-size: 11px;
  font-style: italic;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin: 4px 0 0;
  opacity: 0.85;
}

/* ====================== Version selector — primary CTA ====================== */
.version-section {
  background: linear-gradient(180deg, #14110d 0%, #0a0807 100%);
  border: 1px solid #2a241d;
  border-top-color: rgba(201,169,97,0.22);
  border-radius: 10px;
  padding: 18px 20px 20px;
  margin-bottom: 22px;
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.5),
    inset 0 -1px 0 rgba(255,255,255,0.03),
    0 0 24px rgba(201,169,97,0.05);
}
.version-section-label {
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 10px;
  padding-left: 4px;
  text-shadow: 0 0 8px rgba(201,169,97,0.25);
}
.version-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.version-btn {
  font-family: inherit;
  background: linear-gradient(180deg, #221e19 0%, #110f0c 100%);
  border: 1px solid #322a22;
  border-top-color: #4a4034;
  border-radius: 8px;
  padding: 15px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 2px 0 #050403,
    0 3px 6px rgba(0,0,0,0.5);
  transition: all 0.12s ease;
}
.version-btn:hover {
  border-color: var(--gold-dim);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 4px 0 #050403,
    0 5px 10px rgba(0,0,0,0.5);
}
.version-btn.active {
  background: linear-gradient(180deg, #2f2820 0%, #1a140e 100%);
  border-color: var(--gold);
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(201,169,97,0.22),
    0 1px 0 #050403,
    0 2px 4px rgba(0,0,0,0.4),
    0 0 18px rgba(201,169,97,0.28);
}
.led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1a1410;
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,0.7),
    inset 0 0 0 1px rgba(0,0,0,0.5);
  flex-shrink: 0;
  transition: all 0.15s;
}
.version-btn.active .led {
  background: var(--gold-bright);
  box-shadow:
    0 0 12px var(--gold),
    0 0 5px var(--gold-bright),
    inset 0 0 2px #fff;
}
.version-name {
  font-size: 13px;
  letter-spacing: 0.2em;
  font-weight: 700;
  color: #c5b896;
}
.version-btn:hover .version-name { color: var(--gold-bright); }
.version-btn.active .version-name { color: var(--gold-bright); }

/* ====================== Footer ====================== */
.site-footer {
  padding: 48px 40px 32px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.site-footer a {
  color: var(--gold-dim);
  text-decoration: none;
}
.site-footer a:hover { color: var(--gold); }

/* ====================== Loading overlay ====================== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}
.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.loading-card {
  text-align: center;
  padding: 40px 56px;
}
.loading-reels {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 28px;
}
.loading-reel {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--gold-dim);
  border-top-color: var(--gold);
  animation: reel-spin 1.4s linear infinite;
}
.loading-text {
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 0.25em;
  margin-bottom: 18px;
  font-weight: 500;
}
.loading-progress {
  width: 240px;
  height: 3px;
  background: #1a1410;
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto 8px;
}
.loading-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold), var(--gold-bright));
  width: 0%;
  transition: width 0.2s ease;
}
.loading-percent {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--gold-dim);
  letter-spacing: 1px;
}

/* ====================== Wavesurfer overrides ====================== */
.waveform ::part(progress) {
  background: rgba(201,169,97,0.15);
}
.waveform ::part(cursor) {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

/* ====================== Responsive ====================== */

/* Tablets and small laptops */
@media (max-width: 880px) {
  .machine-stage { padding: 18px 14px 28px; }
  .machine { padding: 22px 26px 22px; }
  .machine-hero { padding: 0 12px 18px; }
  .machine-hero .machine-logo { height: 52px; }
}

/* Phones — must fit the visible viewport including Safari's bottom
   toolbar (~85px on iPhone 13 mini). Compressed harder than tablet
   so STOP/PLAY clears the URL/tab/share bar. */
@media (max-width: 560px) {
  .machine-stage { padding: 10px 8px 18px; }
  .machine { padding: 12px 14px 14px; border-radius: 12px; }
  .machine::before { inset: 4px; border-radius: 8px; }

  /* Song selector */
  .song-section { margin-bottom: 12px; }
  .song-section-label { font-size: 10px; margin-bottom: 6px; }
  .song-selector { gap: 6px; }
  .song-tab { padding: 7px 14px; font-size: 11px; letter-spacing: 0.04em; }

  /* Hero — keep brand + headline, drop the long subtitle */
  .machine-hero { padding: 0 4px 10px; }
  .machine-hero .machine-logo { height: 34px; }
  .machine-hero .machine-logo-link { margin-bottom: 6px; }
  .hero-title { font-size: 18px; }
  .hero-sub { display: none; }

  /* Cartridge */
  .tape-label-plate { padding: 12px 14px; margin-bottom: 12px; }
  .tape-label-prompt { margin-top: 8px; gap: 4px; }
  /* Reserve 2 lines so the cartridge height stays constant when the
     longer prompts (e.g. "Give it an underwater, aquatic feel.") wrap. */
  .prompt-quote { min-height: calc(1.35em * 2); }

  /* Tape window */
  .tape-window { padding: 4px 10px 8px; margin-bottom: 10px; }
  .waveform { height: 34px; }

  /* Version select 2×2 (touch-friendly hit zones) */
  .version-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .version-section { padding: 10px 10px 12px; margin-bottom: 12px; }
  .version-section-label { font-size: 10px; margin-bottom: 6px; }
  .version-btn { padding: 10px 10px; }
  .version-name { font-size: 12px; }

  /* Transport */
  .control-row { gap: 14px; margin-bottom: 8px; }
  .tape-btn { width: 72px; height: 52px; gap: 2px; }
  .btn-glyph { font-size: 16px; }
  .btn-text { font-size: 9px; letter-spacing: 0.2em; }
  .tape-time { font-size: 9px; padding: 0 2px 2px; }

  .listen-tip { font-size: 10px; margin-top: 2px; }

  /* Honour iOS safe area at the very bottom of the page */
  body { padding-bottom: env(safe-area-inset-bottom); }

  /* Loading overlay */
  .loading-progress { width: 200px; }
  .loading-card { padding: 28px 24px; }
}

/* Tiny phones */
@media (max-width: 360px) {
  .machine-hero .machine-logo { height: 30px; }
  .hero-title { font-size: 17px; }
  .tape-btn { width: 64px; height: 48px; }
  .control-row { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .loading-reel { animation: none; }
  .prompt-quote { transition: none; }
}
