* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; background: #000; overflow: hidden; font-family: 'IBM Plex Mono', monospace; }
#stage { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
.canvas-wrap {
  position: relative; aspect-ratio: 16/9;
  max-width: 100vw; max-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
#c { width: 100%; height: 100%; display: block; background: #000; }

#subtitle {
  position: absolute; left: 8%; right: 8%; bottom: 9%;
  text-align: center; pointer-events: none;
  font-family: 'Anton', sans-serif;
  font-size: clamp(22px, 2.8vw, 52px);
  letter-spacing: 2px; line-height: 1.15; text-transform: uppercase;
  color: #f8f5f0; opacity: 0; transition: opacity .18s ease-out;
  text-shadow:
    0 0 14px rgba(0,0,0,.85),
    0 2px 6px rgba(0,0,0,.9),
    0 0 2px rgba(13,31,45,.9);
}
#subtitle.visible { opacity: 1; }
#subtitle::before {
  content: ''; display: block; width: 40px; height: 3px;
  background: #c84b31; margin: 0 auto 14px;
}

#ui {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 10px; align-items: center; z-index: 10;
  flex-wrap: wrap; justify-content: center;
}
button {
  background: #c84b31; color: #f8f5f0; border: none; padding: 12px 22px;
  font-family: 'Bebas Neue', sans-serif; font-size: 14px; letter-spacing: 3px;
  cursor: pointer; text-transform: uppercase; transition: background .12s;
}
button:hover { background: #a33a23; }
button:disabled { opacity: 0.35; cursor: not-allowed; }
.ccbtn { background: #0d1f2d; color: #a8bac8; border: 1px solid #1e3448; }
.ccbtn:hover { background: #1e3448; color: #f8f5f0; }
.ccbtn.active { background: #c84b31; color: #f8f5f0; border-color: #c84b31; }
.ui-sep { display: inline-block; width: 1px; height: 20px; background: #1e3448; margin: 0 4px; }

#timer {
  background: #0d1f2d; color: #f8f5f0; padding: 12px 18px; font-size: 12px;
  letter-spacing: 2px; min-width: 130px; text-align: center; font-weight: 600;
}
#timer.rec { background: #c84b31; }
#timer.rec::before { content: '●'; color: #fff; margin-right: 6px; animation: pulse .8s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

#hint {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  color: #6b7f8e; font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: 2px; text-transform: uppercase; z-index: 10;
  pointer-events: none;
}
#loader {
  position: fixed; inset: 0; background: #000; color: #f8f5f0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', sans-serif; z-index: 100; gap: 10px;
}
#loader .big { font-size: 42px; letter-spacing: 8px; }
#loader .small { font-size: 13px; letter-spacing: 4px; color: #6b7f8e; font-family: 'IBM Plex Mono', monospace; }
#loader.hidden { display: none; }

/* ─── Home mode (index.html) ─────────────────────────────────────────────── */
/* Stage starts hidden; revealed when user clicks hero-play. */
#stage.stage-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#stage { transition: opacity 0.5s ease 0.1s, visibility 0.5s ease 0.1s; }

#hero {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #0d1f2d;
  z-index: 50;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#hero.hero-fade { opacity: 0; visibility: hidden; pointer-events: none; }

.hero-content {
  text-align: center; color: #f8f5f0;
  display: flex; flex-direction: column; align-items: center; gap: 28px;
  padding: 20px;
}

.hero-logo {
  font-family: 'Anton', sans-serif;
  font-size: clamp(54px, 8vw, 130px);
  letter-spacing: 4px; line-height: 1;
}
.hero-logo .logo-tip { color: #c84b31; }
.hero-logo .logo-platforma { color: #f8f5f0; }

/* Red horizontal bar between logo and tagline — mirrors the canvas logo
   in mkLogoTexture (text → bar → tagline stack). */
.hero-rule {
  width: clamp(220px, 32vw, 480px);
  height: 4px;
  background: #c84b31;
  margin: 18px 0 22px;
}

.hero-tagline {
  font-family: 'Anton', sans-serif;
  font-size: clamp(18px, 2.2vw, 34px);
  letter-spacing: 6px;
  color: #a8bac8; text-transform: uppercase;
}

.hero-play {
  background: #c84b31; color: #f8f5f0; border: none;
  padding: 22px 70px;
  font-family: 'Anton', sans-serif;
  font-size: clamp(24px, 2.5vw, 38px);
  letter-spacing: 8px;
  cursor: pointer; text-transform: uppercase;
  transition: background 0.15s, transform 0.15s, opacity 0.3s;
  margin-top: 16px;
}
.hero-play:hover:not(:disabled) { background: #a33a23; transform: translateY(-2px); }
.hero-play:disabled { opacity: 0.35; cursor: not-allowed; }
.hero-play .triangle { display: inline-block; margin-right: 10px; transform: translateY(-2px); }

.hero-progress {
  width: clamp(280px, 30vw, 460px);
  display: flex; flex-direction: column; gap: 10px;
  transition: opacity 0.4s ease;
  margin-top: 8px;
}
.hero-progress.done { opacity: 0; pointer-events: none; }

.progress-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; letter-spacing: 2px;
  color: #6b7f8e; text-transform: uppercase;
  min-height: 16px;
}

.progress-bar {
  height: 3px; background: #1e3448; overflow: hidden; position: relative;
}
.progress-fill {
  position: absolute; top: 0; left: 0; height: 100%; width: 0%;
  background: #c84b31; transition: width 0.35s ease-out;
}

/* Countdown to service launch (home mode only) */
.countdown {
  font-family: 'IBM Plex Mono', monospace;
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  margin: 6px 0 4px;
}
.countdown-label {
  font-size: 11px; letter-spacing: 4px;
  color: #6b7f8e; text-transform: uppercase;
  text-align: center;
}
.countdown-units {
  display: flex; gap: clamp(8px, 1.2vw, 16px);
}
.countdown-unit {
  display: flex; flex-direction: column; align-items: center;
  background: #0d1f2d;
  border: 1px solid #1e3448;
  padding: 10px clamp(10px, 1.4vw, 18px);
  min-width: 64px;
}
.countdown-num {
  font-family: 'Anton', sans-serif;
  font-size: clamp(28px, 3.2vw, 46px);
  color: #f8f5f0; line-height: 1;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}
.countdown-unit-label {
  font-size: 10px; letter-spacing: 2px;
  color: #6b7f8e; text-transform: uppercase;
  margin-top: 6px;
}
.countdown.launched .countdown-units { display: none; }
.countdown.launched .countdown-label {
  color: #c84b31;
  font-size: 14px;
  font-family: 'Anton', sans-serif;
  letter-spacing: 6px;
}

/* Timeline bar — non-clickable playback progress (home mode only) */
.timeline-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: rgba(13, 31, 45, 0.55);
  pointer-events: none;
  z-index: 5;
}
.timeline-fill {
  height: 100%;
  width: 0%;
  background: #c84b31;
  /* No transition — driven by rAF each frame for true playback-accurate width. */
}

/* Stop button — visible only during playback, top-right corner */
.stage-stop-btn {
  position: fixed; top: 18px; right: 18px;
  width: 44px; height: 44px;
  background: rgba(13, 31, 45, 0.7);
  color: #a8bac8;
  border: 1px solid #1e3448;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 18px; line-height: 1;
  cursor: pointer;
  z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.3s;
}
.stage-stop-btn:hover { background: #c84b31; color: #f8f5f0; border-color: #c84b31; }
.stage-stop-btn.hidden { opacity: 0; pointer-events: none; }

