/* =============================================
   RABBIT HOLES — Immersive Panoramic Experiences
   NerdSip 2026
   ============================================= */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --rh-dark: #070d0b;
  --rh-surface: #0e1a16;
  --rh-emerald: #10b981;
  --rh-emerald-glow: rgba(16, 185, 129, 0.15);
  --rh-text: #e2e8f0;
  --rh-text-muted: #94a3b8;
  --rh-font: 'Inter', system-ui, -apple-system, sans-serif;
  --rh-serif: 'Playfair Display', Georgia, serif;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--rh-dark);
  color: var(--rh-text);
  font-family: var(--rh-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================
   LANDING PAGE
   ========================================== */

.rh-landing {
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--rh-dark);
}

/* Floating particles */
.rh-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.rh-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--rh-emerald);
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 6px 2px rgba(16, 185, 129, 0.3), 0 0 12px 4px rgba(16, 185, 129, 0.1);
  animation: rh-twinkle var(--dur, 4s) var(--delay, 0s) infinite ease-in-out;
}

@keyframes rh-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.7); }
  50% { opacity: var(--peak, 0.6); transform: scale(1.1); }
}

/* Hero */
.rh-hero {
  position: relative;
  z-index: 1;
  min-height: 55vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10rem 1.5rem 4rem;
}

.rh-hero-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--rh-emerald);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: rh-fade-up 0.8s 0.2s ease forwards;
}

.rh-hero h1 {
  font-family: var(--rh-serif);
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 700;
  line-height: 1.05;
  background: linear-gradient(160deg, #fff 20%, var(--rh-emerald) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: rh-fade-up 0.8s 0.4s ease forwards;
}

.rh-hero p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--rh-text-muted);
  max-width: 540px;
  line-height: 1.75;
  opacity: 0;
  animation: rh-fade-up 0.8s 0.6s ease forwards;
}

@keyframes rh-fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.rh-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 6rem;
}

.rh-card {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  background: var(--rh-surface);
  border: 1px solid rgba(16, 185, 129, 0.08);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease;
  text-decoration: none;
  color: inherit;
  display: block;
  opacity: 0;
  animation: rh-fade-up 0.7s ease forwards;
}

.rh-card:nth-child(1) { animation-delay: 0.8s; }
.rh-card:nth-child(2) { animation-delay: 0.95s; }
.rh-card:nth-child(3) { animation-delay: 1.1s; }

.rh-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 64px rgba(16, 185, 129, 0.12), 0 0 0 1px rgba(16, 185, 129, 0.2);
}

.rh-card-img-wrap {
  overflow: hidden;
  height: 220px;
}

.rh-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.rh-card:hover .rh-card-img {
  transform: scale(1.1);
}

.rh-card-body {
  padding: 1.75rem;
}

.rh-card-body h2 {
  font-family: var(--rh-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.rh-card-body p {
  font-size: 0.95rem;
  color: var(--rh-text-muted);
  line-height: 1.65;
}

.rh-card-enter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rh-emerald);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.rh-card-enter svg {
  transition: transform 0.3s ease;
}

.rh-card:hover .rh-card-enter svg {
  transform: translateX(5px);
}

/* Landing footer */
.rh-landing-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.rh-landing-footer a {
  color: var(--rh-emerald);
  text-decoration: none;
  font-weight: 600;
}

.rh-landing-footer p {
  color: var(--rh-text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ==========================================
   PANORAMA EXPERIENCE PAGES
   ========================================== */

/* Top bar */
.rh-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(to bottom, rgba(7, 13, 11, 0.9) 0%, rgba(7, 13, 11, 0.4) 60%, transparent 100%);
  pointer-events: none;
}

.rh-topbar > * {
  pointer-events: auto;
}

.rh-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.rh-back:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.rh-progress-wrap {
  flex: 1;
  max-width: 180px;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.rh-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--rh-emerald);
  border-radius: 2px;
  transition: width 0.08s linear;
}

/* Viewport & Track */
.rh-viewport {
  width: 100vw;
  height: 100vh;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
  background: var(--rh-dark);
}

.rh-viewport:active {
  cursor: grabbing;
}

.rh-viewport::-webkit-scrollbar {
  display: none;
}

.rh-track {
  position: relative;
  height: 100vh;
  display: inline-block;
  min-width: 100vw;
}

.rh-image {
  height: 100vh;
  width: auto;
  min-width: 100vw;
  display: block;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

/* Bottom gradient overlay — hidden on mobile where it causes stacking issues.
   Chapters carry their own gradient backgrounds for readability. */
.rh-gradient {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 42%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(7, 13, 11, 0.3) 25%,
    rgba(7, 13, 11, 0.7) 55%,
    rgba(7, 13, 11, 0.92) 100%
  );
  pointer-events: none;
  z-index: -1;
}

/* Vignette */
.rh-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.45);
}

/* Chapters */
.rh-chapter {
  position: absolute;
  bottom: 4rem;
  width: 22%;
  min-width: 260px;
  max-width: 520px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 2rem 2rem 2rem;
  z-index: 10;
  /* Own gradient so text is readable independent of fixed overlay */
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(7, 13, 11, 0.5) 15%,
    rgba(7, 13, 11, 0.85) 40%,
    rgba(7, 13, 11, 0.95) 100%
  );
  padding-top: 4rem;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.rh-chapter.visible {
  opacity: 1;
  transform: translateY(0);
}

.rh-chapter .rh-kicker {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rh-emerald);
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.65rem;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 1rem;
}

.rh-chapter h1,
.rh-chapter h2 {
  font-family: var(--rh-serif);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.rh-chapter h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: #fff;
}

.rh-chapter h2 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  color: #fff;
}

.rh-chapter p {
  font-size: clamp(0.88rem, 1.8vw, 1rem);
  line-height: 1.8;
  color: rgba(226, 232, 240, 0.92);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

/* CTA section in last chapter */
.rh-cta-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.rh-cta-section .rh-cta-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.35rem;
}

.rh-cta-section .rh-cta-desc {
  font-size: 0.85rem !important;
  color: var(--rh-text-muted) !important;
  margin-bottom: 1rem;
}

.rh-cta-buttons {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.rh-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  border-radius: 0.7rem;
  background: var(--rh-emerald);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.rh-cta-btn:hover {
  background: #0ea572;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25);
}

.rh-cta-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.rh-cta-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Next rabbit hole link */
.rh-next-hole {
  margin-top: 2rem;
  text-align: center;
}

.rh-next-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.4rem;
}

.rh-next-link {
  display: inline-block;
  color: #34d399;
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.rh-next-link:hover {
  color: #6ee7b7;
}

/* Scroll hint */
.rh-scroll-hint {
  position: fixed;
  bottom: 2.5rem;
  right: 1.5rem;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  transition: opacity 0.5s ease;
  animation: rh-hint-breathe 2.5s infinite ease-in-out;
}

.rh-scroll-hint.hidden {
  opacity: 0;
  pointer-events: none;
}

.rh-scroll-hint svg {
  animation: rh-hint-nudge 1.8s infinite ease-in-out;
}

@keyframes rh-hint-breathe {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.9; }
}

@keyframes rh-hint-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 900px) {
  .rh-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
  }
}

@media (max-width: 768px) {
  .rh-hero {
    padding: 7rem 1.25rem 2.5rem;
    min-height: 45vh;
  }

  .rh-grid {
    padding: 1rem 1.25rem 4rem;
    gap: 1.5rem;
  }

  .rh-card-img-wrap {
    height: 180px;
  }

  .rh-chapter {
    width: 85vw;
    min-width: unset;
    max-width: 340px;
    padding: 1.25rem;
    bottom: 5rem;
    max-height: 55vh;
  }

  .rh-gradient {
    height: 50%;
  }

  .rh-scroll-hint {
    bottom: 1.5rem;
    right: 1rem;
  }

  .rh-topbar {
    padding: 0.6rem 0.75rem;
  }

  .rh-progress-wrap {
    max-width: 100px;
  }
}

@media (min-width: 2000px) {
  .rh-chapter {
    width: 540px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01s !important;
    animation-delay: 0s !important;
    transition-duration: 0.01s !important;
  }
}
