/* ──────────────────────────────────────────────────────────────────
   Stashrun · Terminal Onboarding · Prototype Styles
   ────────────────────────────────────────────────────────────────── */

@import url("../colors_and_type.css");

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--sr-black);
  color: var(--sr-fg);
  font-family: var(--sr-font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  overscroll-behavior: none;
}

/* ── Outer device frame (only on desktop; full-bleed on mobile) ── */

.sr-stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 50%, #0a0a0a 0%, #000 80%);
}

.sr-phone {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  background: var(--sr-black);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 600px) {
  /* Desktop: show simulated iPhone bezel */
  .sr-phone {
    width: 390px;
    height: 844px;
    max-width: 95vw;
    max-height: 95vh;
    border-radius: 56px;
    box-shadow:
      0 0 0 12px #1c1c1e,
      0 0 0 14px #2a2a2c,
      0 40px 80px rgba(0, 0, 0, 0.7),
      0 0 120px rgba(215, 255, 62, 0.04);
  }
}

/* ── Header (static PNG asset — status bar + nav rolled into one) ─ */

.sr-header {
  flex-shrink: 0;
  width: 100%;
  display: block;
  background: var(--sr-black);
  padding-top: calc(10px + env(safe-area-inset-top, 0));
}
.sr-header img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── TV area ───────────────────────────────────────────────────── */

.sr-tv {
  position: relative;
  width: 100%;
  /* Aspect ratio similar to the mockups */
  aspect-ratio: 1.13 / 1;
  flex-shrink: 0;
  overflow: hidden;
  background: #000;
}

.sr-tv__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sr-tv__crossfade {
  transition: opacity var(--xfade, 400ms) ease-in-out;
}

/* ── Transcript area (the bottom black section) ─────────────────── */

.sr-bottom {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Mute button — top right of transcript area */
.sr-mute {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 4;
  width: 34px;
  height: 34px;
  background: transparent;
  border: 1px solid rgba(215, 255, 62, 0.35);
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sr-lime);
  transition: all 150ms ease;
}
.sr-mute:hover {
  border-color: var(--sr-lime);
  box-shadow: 0 0 12px rgba(215, 255, 62, 0.4);
}
.sr-mute:active { transform: scale(0.94); }

.sr-transcript {
  flex: 1;
  min-height: 0;
  padding: 14px 24px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* Text flows top-down: first line tucks top-left; new lines append below */
  justify-content: flex-start;
  scrollbar-width: none;
}
.sr-transcript::-webkit-scrollbar { display: none; }

/* ── Line styles ───────────────────────────────────────────────── */

.sr-line {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity var(--body-fade, 500ms) ease-out,
    transform var(--body-fade, 500ms) ease-out,
    color 600ms ease-out,
    font-size 600ms ease-out,
    text-shadow 600ms ease-out,
    filter 600ms ease-out;
}
.sr-line.is-shown {
  opacity: 1;
  transform: translateY(0);
}

/* Eyebrow ("Loading… >") — Orbitron, grey w/ subtle gradient + white glow */
.sr-line--eyebrow {
  align-self: flex-start;
  font-family: var(--sr-font-display);   /* Orbitron */
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
  margin-left: -2px;
  /* Grey gradient fill via background-clip */
  background: linear-gradient(180deg, #C9C9C9 0%, #8E8E8E 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  /* Subtle white glow (drop-shadow because text-fill is transparent) */
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.18))
          drop-shadow(0 0 1px rgba(255, 255, 255, 0.25));
}

/* Body — neon green Orbitron with glow */
.sr-line--body {
  align-self: flex-start;
  font-family: var(--sr-font-display);   /* Orbitron */
  font-weight: 700;
  font-size: 22px;
  line-height: 1.22;
  letter-spacing: 0.04em;
  color: var(--sr-lime);
  text-shadow:
    0 0 14px rgba(215, 255, 62, 0.55),
    0 0 4px  rgba(215, 255, 62, 0.85),
    0 0 1px  rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  white-space: pre-wrap;
}

/* Faded previous-beat state — smaller, lower opacity, grey */
.sr-line.is-faded {
  opacity: 0.45;
  filter: none;
}
.sr-line.is-faded.sr-line--body {
  font-size: 14px;
  color: rgba(190, 200, 170, 0.55);
  text-shadow: none;
}
.sr-line.is-faded.sr-line--eyebrow {
  font-size: 11px;
  opacity: 0.35;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.08));
}

.sr-line--spacer {
  height: 2px;
  opacity: 1;
  transform: none;
}
.sr-line--spacer.is-faded { height: 0; margin: 0; }

/* ── CTA button — gradient text + gradient fill + gradient border ── */

.sr-btn-area {
  padding: 6px 22px calc(27px + env(safe-area-inset-bottom, 0));
  margin-top: auto;
  flex-shrink: 0;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crt-btn {
  position: relative;
  width: 100%;
  min-height: 62px;
  padding: 14px 24px;
  border: 2px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity var(--btn-fade, 400ms) ease-out,
    transform var(--btn-fade, 400ms) ease-out,
    box-shadow 200ms ease-out,
    filter 200ms ease-out;

  /* layered backgrounds:
     - top: dim colored gradient inside (padding-box)
     - middle: solid dark base inside (padding-box) — keeps the bright border from bleeding through
     - bottom: full-saturation gradient stroke (border-box) — only visible in the border ring */
  background:
    linear-gradient(
      90deg,
      rgba(215, 255, 62, 0.22) 0%,
      rgba(247, 217,   2, 0.22) 38%,
      rgba(126, 205,  37, 0.22) 61%,
      rgba(211, 234, 122, 0.22) 100%
    ) padding-box,
    linear-gradient(rgba(8, 12, 2, 0.95), rgba(8, 12, 2, 0.95)) padding-box,
    linear-gradient(
      90deg,
      #D7FF3E 0%,
      #F7D902 38%,
      #7ECD25 61%,
      #D3EA7A 100%
    ) border-box;

  box-shadow:
    0 0 22px rgba(215, 255, 62, 0.35),
    0 0 5px  rgba(215, 255, 62, 0.55),
    inset 0 0 18px rgba(215, 255, 62, 0.06);
}
.crt-btn.is-shown {
  opacity: 1;
  transform: translateY(0);
}
.crt-btn:hover {
  box-shadow:
    0 0 36px rgba(215, 255, 62, 0.55),
    0 0 10px rgba(215, 255, 62, 0.8),
    inset 0 0 22px rgba(215, 255, 62, 0.12);
}
.crt-btn:active {
  filter: brightness(0.85);
  box-shadow:
    0 0 12px rgba(215, 255, 62, 0.4),
    inset 0 0 0 1px rgba(215, 255, 62, 0.5);
}

.crt-btn__label {
  display: inline-block;
  font-family: var(--sr-font-display);    /* Orbitron */
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 0.06em;
  text-transform: uppercase;

  /* Gradient text */
  background: linear-gradient(
    90deg,
    #D7FF3E 0%,
    #F7D902 38%,
    #7ECD25 61%,
    #D3EA7A 100%
  );
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;

  /* Drop-shadow gives a glow under the gradient fill */
  filter:
    drop-shadow(0 0 6px rgba(215, 255, 62, 0.55))
    drop-shadow(0 0 2px rgba(215, 255, 62, 0.9));
}

/* ── Restart overlay ───────────────────────────────────────────── */

.sr-restart {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 40px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms ease;
}
.sr-restart.is-shown { opacity: 1; pointer-events: auto; }
.sr-restart__msg {
  font-family: var(--sr-font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--sr-lime);
  text-shadow: var(--sr-shadow-glow);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
}

/* ── Audio prompt ──────────────────────────────────────────────── */

.sr-audio-prompt {
  position: absolute;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(215, 255, 62, 0.35);
  color: rgba(215, 255, 62, 0.9);
  font-family: var(--sr-font-ui);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  transition: opacity 400ms ease;
}
.sr-audio-prompt.is-shown { opacity: 1; }

