/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Georgia', 'Times New Roman', serif;
  color: #f0e4d7;
  background: #000;
}

body {
  background:
    radial-gradient(ellipse 70% 55% at 88% 8%,  rgba(180, 150, 110, 0.32) 0%, transparent 65%),
    radial-gradient(ellipse 65% 50% at 12% 92%, rgba(150, 130, 100, 0.18) 0%, transparent 65%),
    radial-gradient(ellipse 100% 80% at 50% 50%, #1a1612 0%, #0a0807 55%, #050403 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.light-ray { display: none; }

/* ── Flash effect ─────────────────────────────────── */
.flash {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 240, 210, 0.85) 0%,
    rgba(255, 220, 190, 0.5) 40%,
    rgba(255, 210, 180, 0) 80%
  );
}

.flash.active {
  animation: flashBurst 500ms ease-out forwards;
}

@keyframes flashBurst {
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  40%  { opacity: 0.6; }
  100% { opacity: 0; }
}

/* ── Video Background ─────────────────────────────── */
.bg-video {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity 3s ease;
}

.bg-video.visible {
  opacity: 1;
}

.bg-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Scene ───────────────────────────────────────── */
#scene {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
}

/* ── Card Dimensions ─────────────────────────────── */
:root {
  --card-width: 280px;
  --card-height: 420px;
  --card-radius: 14px;
  --spread-card-width: 170px;
  --spread-card-height: 255px;
  --revealed-width: 360px;
  --revealed-height: 540px;

  /* Actual revealed card dimensions (capped by viewport).
     Used for both the card sizing and mirror-symmetric form placement. */
  --rh: min(var(--revealed-height), calc(100vh - 200px), calc((100vw - 32px) * 1.5));
  --rw: calc(var(--rh) * 2 / 3);
}

@media (max-width: 700px) {
  :root {
    --card-width: 200px;
    --card-height: 300px;
    --spread-card-width: 110px;
    --spread-card-height: 165px;
    --revealed-width: 240px;
    --revealed-height: 360px;
  }
}

/* ── Deck (idle stacked cards) ───────────────────── */
.deck {
  position: relative;
  width: var(--card-width);
  height: var(--card-height);
  cursor: pointer;
  animation: deckPulse 2.5s ease-in-out infinite;
}

.deck.hidden {
  display: none;
}

.deck-card {
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
  overflow: hidden;
  background: #2a1f30;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.deck-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.deck-card:nth-child(1) { transform: translate(4px, 4px) rotate(2deg); z-index: 1; }
.deck-card:nth-child(2) { transform: translate(2px, 2px) rotate(1deg); z-index: 2; }
.deck-card:nth-child(3) { transform: translate(0, 0) rotate(0deg); z-index: 3; }

@keyframes deckPulse {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(212, 175, 140, 0.3)); }
  50%      { filter: drop-shadow(0 0 28px rgba(212, 175, 140, 0.6)); }
}

/* ── Shuffle Ghost Cards ─────────────────────────── */
.shuffle-cards {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--card-width);
  height: var(--card-height);
  pointer-events: none;
  z-index: 20;
  display: none;
}

.shuffle-cards.active {
  display: block;
}

.shuffle-card {
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
}

.shuffle-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shuffle-cards.active .shuffle-card {
  animation: shuffleFan 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.shuffle-card:nth-child(1) { animation-delay: 0s; }
.shuffle-card:nth-child(2) { animation-delay: 0.06s; }
.shuffle-card:nth-child(3) { animation-delay: 0.12s; }
.shuffle-card:nth-child(4) { animation-delay: 0.18s; }
.shuffle-card:nth-child(5) { animation-delay: 0.24s; }
.shuffle-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes shuffleFan {
  0% {
    opacity: 0.9;
    transform: translateX(0) translateY(0) rotate(0deg) scale(1);
  }
  25% {
    opacity: 1;
    transform:
      translateX(var(--fan-x, 0px))
      translateY(var(--fan-y, 0px))
      rotate(var(--fan-r, 0deg))
      scale(0.92);
  }
  50% {
    opacity: 1;
    transform:
      translateX(calc(var(--fan-x, 0px) * -0.5))
      translateY(calc(var(--fan-y, 0px) * -0.3))
      rotate(calc(var(--fan-r, 0deg) * -0.5))
      scale(0.96);
  }
  75% {
    opacity: 0.8;
    transform: translateX(0) translateY(0) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(0) translateY(0) rotate(0deg) scale(1);
  }
}

/* ── Spread (fan of face-down cards) ─────────────── */
.spread {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
}

.spread.active {
  pointer-events: auto;
}

.spread-card {
  position: absolute;
  width: var(--spread-card-width);
  height: var(--spread-card-height);
  border-radius: 10px;
  overflow: hidden;
  background: #2a1f30;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transform-origin: center bottom;
  opacity: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

.spread-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Fan-in animation for each spread card */
.spread.active .spread-card {
  animation: fanIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes fanIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg) scale(0.5);
  }
  to {
    opacity: 1;
    transform:
      translate(-50%, -50%)
      rotate(var(--rot, 0deg))
      translateY(var(--offset-y, 0px))
      scale(1);
  }
}

/* Hover lift */
.spread-card:hover {
  filter: brightness(1.15);
  box-shadow: 0 8px 30px rgba(212, 175, 140, 0.4);
  z-index: 100 !important;
}

/* Fade out non-selected cards */
.spread-card.fading {
  transition: opacity 0.5s ease, transform 0.5s ease;
  opacity: 0 !important;
  pointer-events: none;
}

/* ── Chosen Card (flip reveal) ───────────────────── */
.chosen-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--card-width);
  height: var(--card-height);
  perspective: 1200px;
  z-index: 30;
  display: none;
}

.chosen-wrapper.active {
  display: block;
  animation: chosenAppear 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes chosenAppear {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Grow to full revealed size after flip — but never overlap the logo
   and never get clipped by either viewport edge. */
.chosen-wrapper.revealed {
  height: var(--rh);
  width:  var(--rw);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              height 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              left 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Slide to left side of screen — keep at least 20px from left edge. */
.chosen-wrapper.shifted-left {
  left: max(25%, calc(var(--rw) / 2 + 20px));
}

.chosen-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--card-radius);
  overflow: hidden;
  background: #2a1f30;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.card-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-back {
  z-index: 2;
}

.card-front {
  transform: rotateY(180deg);
}

/* Flip */
.chosen-wrapper.flipped .chosen-card {
  transform: rotateY(180deg);
}

/* Revealed glow + shimmer */
.chosen-wrapper.revealed .card-front {
  box-shadow:
    0 0 20px rgba(212, 175, 140, 0.4),
    0 0 60px rgba(212, 175, 140, 0.15),
    0 12px 40px rgba(0, 0, 0, 0.4);
}

.chosen-wrapper.revealed .card-front::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 230, 200, 0.12) 45%,
    rgba(255, 220, 180, 0.18) 50%,
    rgba(255, 230, 200, 0.12) 55%,
    transparent 70%
  );
  animation: shimmer 3s ease-in-out infinite;
  border-radius: var(--card-radius);
  pointer-events: none;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Prompt Text ─────────────────────────────────── */
.prompt {
  position: absolute;
  /* Anchor below the card: scene center + half the card's height + small gap. */
  top: calc(50% + var(--card-height) / 2 + 28px);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  text-transform: none;
  color: rgba(220, 200, 180, 0.85);
  text-align: center;
  white-space: nowrap;
  transition: opacity 0.6s ease;
  z-index: 50;
}

.prompt.hidden {
  opacity: 0;
  pointer-events: none;
}

.prompt.fade-in {
  animation: fadeIn 1.2s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Gate form (right side, shown before card text) ───── */
.gate-form-panel {
  position: absolute;
  /* Mirror the card's left-edge gap. Card center is at max(25%, rw/2 + 20px),
     so its left edge is at max(25% - rw/2, 20px). */
  right: max(calc(25% - var(--rw) / 2), 20px);
  top: 50%;
  transform: translateY(-50%) translateX(20px);
  width: 380px;
  max-width: 38vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease, transform 1.2s ease;
  z-index: 40;
  color: rgba(230, 215, 195, 0.92);
}

.gate-form-panel.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.gate-form-panel.dismissed {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-20px);
}

.gate-form-title {
  font-family: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #fff8ec;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  margin-bottom: 10px;
  line-height: 1.2;
}

.gate-form-subtitle {
  font-family: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 0.95rem;
  color: rgba(248, 238, 222, 1);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  margin-bottom: 24px;
  line-height: 1.45;
}

.gate-form { display: flex; flex-direction: column; gap: 14px; }

.gate-field { display: flex; flex-direction: column; gap: 6px; }

.gate-field span {
  font-family: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-style: normal;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: rgba(245, 230, 210, 1);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.gate-field input {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(245, 230, 210, 0.55);
  border-radius: 6px;
  padding: 10px 14px;
  color: #fff8ec;
  font-family: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.gate-field input::placeholder { color: rgba(245, 230, 210, 0.6); }

.gate-field input:focus {
  outline: none;
  border-color: rgba(255, 220, 180, 0.95);
  background: rgba(255, 255, 255, 0.18);
}

.gate-submit {
  margin-top: 8px;
  background: linear-gradient(135deg, rgba(230, 190, 150, 0.95) 0%, rgba(200, 155, 115, 0.95) 100%);
  border: none;
  color: #1a0a2e;
  font-family: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  font-style: normal;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: none;
  padding: 14px 24px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4), 0 0 24px rgba(230, 190, 150, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

.gate-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 40px rgba(230, 190, 150, 0.5);
}

.gate-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.gate-error {
  color: rgba(255, 180, 180, 0.9);
  font-family: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-style: normal;
  font-size: 0.9rem;
  min-height: 1.2em;
  margin-top: 4px;
}

@media (max-width: 900px) {
  .gate-form-panel { width: 280px; }
  .gate-form-title { font-size: 1.25rem; }
}

/* ── Card text panel (right side, shown after gate submitted) ── */
.card-text-panel {
  position: absolute;
  right: max(calc(25% - var(--rw) / 2), 20px);
  top: 50%;
  transform: translateY(-50%) translateX(20px);
  width: 380px;
  max-width: 38vw;
  max-height: 75vh;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease, transform 1.2s ease;
  z-index: 40;
  color: rgba(230, 215, 195, 0.92);
  scrollbar-width: thin;
  scrollbar-color: rgba(230, 215, 195, 0.2) transparent;
}

.card-text-panel.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.card-text-panel::-webkit-scrollbar { width: 6px; }
.card-text-panel::-webkit-scrollbar-thumb { background: rgba(230, 215, 195, 0.2); border-radius: 3px; }

.card-text-title {
  font-family: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: rgba(245, 225, 205, 1);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  margin-bottom: 22px;
  line-height: 1.2;
  /* Keep the title anchored at the top while the body scrolls underneath. */
  position: sticky;
  top: 0;
  padding: 14px 0 12px;
  margin-top: -14px;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.7) 70%,
    rgba(0, 0, 0, 0) 100%
  );
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10;
}

.card-text-body {
  font-family: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(250, 240, 225, 1);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  white-space: pre-wrap;
}

/* "Draw another card" button — appears after typing completes */
.draw-another {
  display: block;
  width: fit-content;
  margin: 32px 0 0 auto;          /* right-aligned within panel */
  background: linear-gradient(135deg, rgba(230, 190, 150, 0.95) 0%, rgba(200, 155, 115, 0.95) 100%);
  border: none;
  color: #1a0a2e;
  font-family: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.02em;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.6s ease, transform 0.6s ease, filter 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4), 0 0 24px rgba(230, 190, 150, 0.3);
}

.draw-another.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.draw-another:hover {
  filter: brightness(1.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 40px rgba(230, 190, 150, 0.55);
}

.card-text-body.typing::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  background: rgba(230, 215, 195, 0.7);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: caretBlink 1s step-end infinite;
}

@keyframes caretBlink { 50% { opacity: 0; } }

@media (max-width: 900px) {
  .card-text-panel {
    width: 280px;
    font-size: 0.95rem;
  }
}

/* ─────────────────────────────────────────────────────────────────
   Mobile layout: stack everything vertically, form/text below card,
   scroll hint at bottom of viewport. Body becomes scrollable.
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  html, body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100vh;
  }
  body {
    display: block !important;
    align-items: initial;
    justify-content: initial;
  }

  /* Scene shorter on mobile so the form/text panel below it lands in the
     same viewport as the card — no scrolling needed to read the text. */
  #scene {
    width: 100vw;
    height: 60vh !important;
    min-height: 500px;
  }

  /* Card stays centered horizontally; vertically inside its (taller) scene. */
  .chosen-wrapper.shifted-left {
    left: 50% !important;
  }

  /* Slightly smaller prompt text on mobile. */
  .prompt { font-size: 1.1rem; }

  /* Logo moves to top-center on mobile and is always visible. */
  .logo-link {
    width: 110px;
    top: 24px;
    bottom: auto !important;
    opacity: 0.9 !important;
    pointer-events: auto !important;
    transform: translateX(-50%) !important;
    z-index: 55;
  }

  /* Panels always live in normal flow on mobile. Hidden via opacity until JS
     adds .visible. position: relative so z-index applies (fixed bg-video
     would otherwise paint over a static element). */
  .gate-form-panel,
  .card-text-panel {
    position: relative !important;
    right: auto !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: calc(100% - 32px);
    max-width: 520px;
    margin: 0 auto 48px;
    padding: 16px;
    max-height: none !important;
    overflow: visible !important;
    opacity: 0;
    transition: opacity 0.6s ease;
    z-index: 40;
    box-sizing: border-box;
  }

  /* Hide the inactive panel via JS-controlled class, not display:none here */
  .gate-form-panel { display: none; }
  .card-text-panel { display: none; }
  .gate-form-panel.visible,
  .card-text-panel.visible {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Reading mode: after submit, hide the card area and let the text panel
     sit right below the logo at the top of the page. */
  body.reading-mode #scene {
    height: auto !important;
    min-height: 0 !important;
    padding: 72px 0 12px;
  }
  body.reading-mode .chosen-wrapper,
  body.reading-mode .deck,
  body.reading-mode .shuffle-cards,
  body.reading-mode .spread,
  body.reading-mode .prompt,
  body.reading-mode .scroll-hint {
    display: none !important;
  }

  .card-text-title {
    font-size: 1.7rem;
    margin-bottom: 16px;
  }
  .card-text-body {
    font-size: 1.05rem;
    line-height: 1.55;
  }
  .card-text-panel { margin: 12px auto 24px; padding: 12px 16px; }
  .gate-form-panel { margin: 12px auto 24px; padding: 12px 16px; }

  /* Solid black input fields on mobile for stronger contrast over the
     starfield background behind them. */
  .gate-field input {
    background: #000 !important;
    border-color: rgba(245, 230, 210, 0.45);
  }
  .gate-field input:focus {
    background: #0a0a0a !important;
    border-color: rgba(255, 220, 180, 0.95);
  }

  /* Larger, two-line title on mobile */
  .gate-form-title {
    font-size: 2rem;
    line-height: 1.15;
  }

}

/* Force the line break only on mobile widths */
.mobile-break { display: none; }
@media (max-width: 700px) {
  .mobile-break { display: inline; }
}

/* ── Scroll hint (mobile only) ───────────────────── */
.scroll-hint {
  display: none;
  position: absolute;
  /* Anchor just below the card. Scene is the positioning ancestor, so 50%
     of scene height = card center; +rh/2 = card bottom; +24px = small gap. */
  top: calc(50% + var(--rh) / 2 + 24px);
  left: 50%;
  transform: translateX(-50%);
  color: #ffffff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
  font-family: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-style: normal;
  font-weight: 500;
  font-size: 1.15rem;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: none;
  text-align: center;
  z-index: 60;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
  white-space: nowrap;
}

.scroll-hint span { display: block; }
.scroll-hint-arrow {
  margin-top: 8px;
  font-size: 2rem;
  animation: scrollBob 1.6s ease-in-out infinite;
}

@keyframes scrollBob {
  0%, 100% { transform: translateY(0);  opacity: 0.7; }
  50%      { transform: translateY(8px); opacity: 1; }
}

@media (max-width: 700px) {
  .scroll-hint.visible {
    display: block;
    opacity: 1;
    animation: scrollHintPulse 2.4s ease-in-out infinite;
  }
}

@keyframes scrollHintPulse {
  0%, 100% { opacity: 0.75; }
  50%      { opacity: 1; }
}

/* ── Logo (clickable, revealed with the card) ──────────────────── */
.logo-link {
  position: absolute;
  bottom: 6%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 160px;
  max-width: 40vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease, transform 1.2s ease;
  z-index: 50;
  display: block;
  text-decoration: none;
}

.logo-link.visible {
  opacity: 0.85;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.logo-link:hover { opacity: 1; }

.logo {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 480px) {
  .logo-link { width: 90px; top: 20px; }
}

