/* VHL VSL — simple above-the-fold shell */

:root {
  --bg: #0e1116;
  --bg-elev: #161b22;
  --surface: #1c222c;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eceae4;
  --muted: #9aa3b0;
  --accent: #d2b48c;
  --accent-strong: #e0c9a0;
  --danger: #c45c5c;
  --ok: #6faf8a;
  --radius: 10px;
  --font-display: "Lora", Georgia, serif;
  --font-headline: "Montserrat", "Manrope", system-ui, sans-serif;
  --font-ui: "Manrope", system-ui, sans-serif;
  --hook: #fff7d8;
  --hook-gold: #d4a843;
  --shell-pad: clamp(14px, 2.4vh, 24px);
}

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

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(210, 180, 140, 0.12), transparent 55%),
    linear-gradient(180deg, #12161d 0%, var(--bg) 40%, #0a0c10 100%);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

/* ===== Single-screen shell ===== */
.shell {
  --slot-h: clamp(150px, 28dvh, 280px);
  height: 100dvh;
  max-height: 100dvh;
  display: grid;
  /* fixed slot row = video never jumps when questions appear */
  grid-template-rows: auto minmax(0, 1fr) var(--slot-h);
  gap: clamp(8px, 1.4vh, 14px);
  padding: var(--shell-pad) clamp(12px, 3vw, 28px) calc(var(--shell-pad) + env(safe-area-inset-bottom));
  max-width: 920px;
  margin: 0 auto;
}

/* ===== Hook — like classic VSL (cream + bold) ===== */
.hook {
  text-align: center;
  padding: 10px 4px 4px;
}

.brand {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hook-gold);
  margin-bottom: 8px;
}

.brand[hidden] {
  display: none;
}

.hook-title {
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: clamp(1.35rem, 3.2vw + 0.55rem, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--hook);
  max-width: 22em;
  margin: 0 auto;
  text-wrap: balance;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

.hook-title::after {
  content: "";
  display: block;
  width: min(220px, 55%);
  height: 3px;
  margin: 12px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--hook-gold), transparent);
  opacity: 0.95;
}

.hook-sub {
  margin-top: 10px;
  color: rgba(255, 247, 216, 0.72);
  font-size: clamp(0.85rem, 1.2vw + 0.55rem, 1.05rem);
  line-height: 1.35;
  font-weight: 500;
}

/* ===== Video ===== */
.stage {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
}

.player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 100%;
  margin: 0 auto;
  background: #000;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.player video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  cursor: pointer;
}

.player-loader {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.82rem;
  font-weight: 600;
  pointer-events: none;
}

.player.is-loading .player-loader {
  display: flex;
}

.player-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

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

.player-error {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  text-align: center;
  padding: 16px;
}

.player.is-error .player-error {
  display: flex;
}

.player-error[hidden] {
  display: none !important;
}

.player-error p {
  font-size: 0.95rem;
  font-weight: 600;
}

.buffer-dot {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 4;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2f6fed;
  box-shadow: 0 0 0 0 rgba(47, 111, 237, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.buffer-dot.is-on {
  opacity: 1;
  animation: buffer-pulse 1s ease-in-out infinite;
}

.buffer-dot[hidden] {
  display: none;
}

@keyframes buffer-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(47, 111, 237, 0.45);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(47, 111, 237, 0);
  }
}

.progress-rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  z-index: 3;
  pointer-events: none;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.15s linear;
}

/* Centered plate over video (like VSL unmute label) */
.video-plate {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  transform: translate(-50%, -50%) scale(0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: min(72%, 280px);
  padding: 18px 22px 16px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  background: #2f6fed;
  color: #fff;
  font-family: var(--font-ui);
  cursor: pointer;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.video-plate.is-on {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
  animation: plate-pulse 1.8s ease-in-out infinite;
}

.video-plate[hidden] {
  display: none;
}

.video-plate-title {
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-align: center;
}

.video-plate-icon {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1;
  margin: 2px 0;
}

.video-plate-sub {
  font-size: clamp(0.8rem, 1.8vw, 0.95rem);
  font-weight: 700;
  opacity: 0.95;
  text-align: center;
}

@keyframes plate-pulse {
  0%,
  100% {
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
  }
  50% {
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4), 0 0 0 6px rgba(47, 111, 237, 0.28);
  }
}

.player.is-paused-for-quiz video {
  filter: brightness(0.55);
}

/* User-paused: big blue play like VSL players */
.pause-play {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  border: 0;
  background: rgba(0, 0, 0, 0.28);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.pause-play.is-on {
  opacity: 1;
  pointer-events: auto;
}

.pause-play[hidden] {
  display: none;
}

.pause-play-btn {
  width: clamp(72px, 14vw, 96px);
  height: clamp(72px, 14vw, 96px);
  border-radius: 50%;
  background: #2f6fed;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease;
}

.pause-play:hover .pause-play-btn,
.pause-play:focus-visible .pause-play-btn {
  transform: scale(1.05);
}

.pause-play-btn::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin-left: 5px;
  border-style: solid;
  border-width: 16px 0 16px 26px;
  border-color: transparent transparent transparent #fff;
}

/* ===== Bottom functional slot ===== */
.slot {
  height: 100%;
  min-height: 0;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  overflow: hidden;
  position: relative;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, background 0.2s ease;
}

/* Keep layout space, hide chrome until questions */
.slot.is-idle {
  visibility: hidden;
  pointer-events: none;
}

.slot.is-active {
  visibility: visible;
  pointer-events: auto;
  border-color: var(--line);
  background: rgba(22, 27, 34, 0.88);
  backdrop-filter: blur(8px);
}

.slot.is-attention {
  border-color: rgba(47, 111, 237, 0.65);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.25);
}

.slot-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* display:grid above beats bare [hidden] — force hide */
.slot-placeholder[hidden] {
  display: none !important;
}

.slot-placeholder strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}

.panel {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: clamp(12px, 2vh, 18px) clamp(14px, 2.5vw, 22px);
  display: none;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(22, 27, 34, 0.98);
  animation: rise 0.35s ease;
}

.panel.is-open {
  display: flex;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-kicker {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.panel-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.5vw + 0.55rem, 1.25rem);
  line-height: 1.25;
}

.quiz-options {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.quiz-option {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.quiz-option:hover,
.quiz-option:focus-visible {
  border-color: rgba(210, 180, 140, 0.55);
  outline: none;
}

.quiz-option.is-selected {
  border-color: var(--accent);
  background: rgba(210, 180, 140, 0.12);
}

.quiz-option.is-dimmed {
  opacity: 0.35;
}

.quiz-option:disabled {
  cursor: default;
}

/* Spoken reaction after tap — paced lines */
.reaction {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  min-height: 100%;
  padding: 4px 2px 8px;
}

.reaction-line {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.8vw + 0.55rem, 1.35rem);
  line-height: 1.35;
  color: var(--text);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reaction-line.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reaction-line.is-soft {
  font-size: clamp(0.98rem, 1.5vw + 0.5rem, 1.2rem);
  color: rgba(236, 234, 228, 0.72);
  font-weight: 500;
}

.reaction-line.is-firm {
  color: var(--accent-strong);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.quiz-text {
  width: 100%;
  min-height: 64px;
  resize: none;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
}

.quiz-text:focus {
  outline: none;
  border-color: rgba(210, 180, 140, 0.55);
}

.panel-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  align-items: center;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #1a140c;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.quiz-meta {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--muted);
}

/* Offer */
.offer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 4px;
}

.offer-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.offer-was {
  color: var(--muted);
  text-decoration: line-through;
  font-size: 0.95rem;
}

.offer-now {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--accent-strong);
}

.offer-cta {
  margin-left: auto;
  min-width: 140px;
  text-align: center;
  text-decoration: none;
}

/* Mobile: reserved slot (no jump), comfortable top spacing */
@media (max-width: 768px) {
  .shell {
    --slot-h: min(32dvh, 260px);
    --shell-pad: 12px;
    gap: 12px;
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .hook {
    padding: 6px 2px 2px;
  }

  .hook-title {
    font-size: clamp(1.28rem, 5.2vw, 1.65rem);
    max-width: none;
    line-height: 1.18;
  }

  .hook-title::after {
    margin-top: 10px;
    width: min(160px, 48%);
  }

  .hook-sub {
    margin-top: 8px;
    font-size: 0.88rem;
  }

  .stage {
    justify-content: center;
  }

  .player {
    width: 100%;
    max-height: none;
    border-radius: 8px;
  }

  .quiz-option {
    padding: 8px 10px;
    font-size: 0.9rem;
  }

  .offer-cta {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-height: 700px) and (max-width: 768px) {
  .shell {
    --slot-h: min(30dvh, 220px);
    gap: 10px;
  }

  .hook-title {
    font-size: clamp(1.15rem, 4.6vw, 1.4rem);
  }

  .hook-sub {
    display: none;
  }
}
