/* 
 * HUMRAH EARLY ACCESS - 2.5D DIORAMA
 * Premium, cinematic, mobile-first sketchbook style.
 */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --color-bg: #f9f8f6;
  --color-text: #1a1a1a;
  --color-accent: #cc292b;
  --color-secondary: #5e5e5e;
  --color-border: rgba(0, 0, 0, 0.1);
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  --transition-smooth: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  --diorama-perspective: 1200px;
}

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

html {
  /* Remove smooth scroll on html to prevent conflict with custom rAF logic if needed, 
     but keeping it for anchor links is usually fine. */
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  background-image: 
    url('data:image/svg+xml,%3Csvg viewBox=%220 0 200 200%22 xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cfilter id=%22noiseFilter%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%220.65%22 numOctaves=%223%22 stitchTiles=%22stitch%22/%3E%3C/filter%3E%3Crect width=%22100%25%22 height=%22100%25%22 filter=%22url(%23noiseFilter)%22 opacity=%220.03%22/%3E%3C/svg%3E');
}

/* 2.5D Setup */
.diorama-body {
  perspective: var(--diorama-perspective);
  perspective-origin: center center;
  /* preserve-3d on sections allows child layers to stack in 3D space */
}

.diorama-section {
  transform-style: preserve-3d;
  position: relative;
}

/* Particles */
.graphite-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
  transform-style: preserve-3d;
  overflow: hidden;
}

.particle {
  position: absolute;
  background-color: var(--color-text);
  border-radius: 50%;
  opacity: 0.15;
  transition: transform 0.1s linear;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 24px;
}

.text-center { text-align: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-text);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  padding: 16px 32px;
  border-radius: 4px;
  text-decoration: none;
  transition: var(--transition-smooth);
  border: 1px solid var(--color-text);
  cursor: pointer;
  width: 100%;
  position: relative;
}

/* Subtle Embossed CTA */
.btn-embossed {
  box-shadow: 0px 4px 10px rgba(0,0,0,0.1), inset 0px 1px 0px rgba(255,255,255,0.2);
  transform: translateZ(10px);
}
.btn-embossed:hover {
  transform: translateZ(15px) scale(1.02);
  box-shadow: 0px 6px 15px rgba(0,0,0,0.15), inset 0px 1px 0px rgba(255,255,255,0.2);
}

.btn:hover:not(.btn-embossed) {
  background-color: transparent;
  color: var(--color-text);
}

.btn-small-text {
  display: block;
  font-size: 0.8rem;
  color: var(--color-secondary);
  margin-top: 8px;
  text-align: center;
}

/* Animations */
.reveal-up {
  opacity: 0;
  transform: translateY(30px) translateZ(0);
  transition: opacity 1s cubic-bezier(0.25, 1, 0.5, 1), transform 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.reveal-up.is-visible {
  opacity: 1;
  /* Keep Z-transforms active if set via JS, so just reset Y */
  transform: translateY(0);
}

.fade-in {
  opacity: 0;
  transition: opacity 1.2s ease;
}
.fade-in.is-visible {
  opacity: 1;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 64px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  transform-style: preserve-3d;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  mix-blend-mode: multiply;
}

.hero-bg::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(to top, var(--color-bg) 0%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  transform-style: preserve-3d;
}

.hero-title {
  font-size: 3.5rem;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--color-secondary);
}

.hero-tagline {
  font-size: 1.5rem;
  font-style: italic;
  margin-bottom: 24px;
}

/* Section 2: Loneliness */
.story-section {
  padding: 120px 0;
}

.story-sticky {
  position: relative;
  height: 200vh;
}

.story-sticky-inner {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  transform-style: preserve-3d;
}

.story-images {
  position: relative;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1/1;
  margin-bottom: 40px;
  transform-style: preserve-3d;
}

.story-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: multiply;
  will-change: transform, opacity;
}

#img-group {
  opacity: 0;
}

.story-fg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('data:image/svg+xml,%3Csvg viewBox=%220 0 100 100%22 xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cpath d=%22M10,90 Q30,80 90,95%22 stroke=%22%231a1a1a%22 stroke-width=%220.2%22 fill=%22none%22 opacity=%220.1%22/%3E%3C/svg%3E');
  background-size: cover;
  z-index: 10;
  pointer-events: none;
}

.story-text-container {
  text-align: center;
  padding: 0 24px;
  transform-style: preserve-3d;
}

.story-headline {
  font-size: 2.2rem;
  margin-bottom: 16px;
}

/* Editorial Content Blocks */
.editorial-section {
  padding: 100px 0;
  background-color: transparent;
}

.editorial-block {
  margin-bottom: 120px;
  transform-style: preserve-3d;
}

.editorial-block:last-child {
  margin-bottom: 0;
}

.editorial-text {
  margin-bottom: 40px;
  text-align: center;
  will-change: transform;
}

.editorial-headline {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.editorial-subhead {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--color-secondary);
}

.editorial-desc {
  color: var(--color-secondary);
  font-size: 1rem;
  max-width: 340px;
  margin: 0 auto;
}

.not-dating {
  display: inline-block;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 30px;
  margin: 16px 0;
}

.editorial-image {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  /* Subtle graphite shadow to simulate physical sketchbook paper floating */
  box-shadow: 0 15px 35px rgba(26, 26, 26, 0.08), 0 5px 15px rgba(26, 26, 26, 0.04);
  background-color: var(--color-bg);
  will-change: transform;
  transform-origin: center center;
}

.editorial-image img {
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

.safety-image-layer {
  /* Give the safety illustration a stronger "emerging" look */
  box-shadow: 0 20px 40px rgba(26, 26, 26, 0.12), 0 5px 15px rgba(26, 26, 26, 0.06);
}

/* Section 6: Early Access (You're Early) */
.early-access-section {
  padding: 160px 0;
  text-align: center;
}

.handwritten-text {
  font-size: 4rem;
  font-family: var(--font-heading);
  font-style: italic;
  margin-bottom: 40px;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 1.5s ease, transform 1.5s ease;
  will-change: transform, opacity;
}

.handwritten-text.is-visible {
  opacity: 1;
  /* If JS parallax is applied, JS will override transform scale, but CSS ensures fallback */
}

/* Final CTA */
.final-cta {
  position: relative;
  padding: 160px 0 100px;
  overflow: hidden;
}

.final-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  transform-style: preserve-3d;
}

.final-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  mix-blend-mode: multiply;
}

.final-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: linear-gradient(to bottom, var(--color-bg) 0%, transparent 100%);
}

.final-content {
  text-align: center;
  transform-style: preserve-3d;
}

/* Footer */
.footer {
  padding: 60px 0 40px;
  background-color: var(--color-text);
  color: var(--color-bg);
  text-align: center;
  position: relative;
  z-index: 100;
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.footer-tagline {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 32px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 0.85rem;
  opacity: 0.8;
}

.footer-links a {
  transition: opacity 0.3s;
}

.footer-links a:hover {
  opacity: 1;
}

/* Location Modal */
.location-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(250, 249, 246, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  padding: 24px;
}

.location-modal-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.location-modal {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  box-shadow: 10px 10px 0px rgba(0,0,0,0.05);
  border-radius: 8px;
  width: 100%;
  max-width: 440px;
  padding: 40px 32px;
  position: relative;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  background-image: 
    url('data:image/svg+xml,%3Csvg viewBox=%220 0 200 200%22 xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cfilter id=%22noiseFilter%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%220.65%22 numOctaves=%223%22 stitchTiles=%22stitch%22/%3E%3C/filter%3E%3Crect width=%22100%25%22 height=%22100%25%22 filter=%22url(%23noiseFilter)%22 opacity=%220.03%22/%3E%3C/svg%3E');
}

.location-modal-overlay.is-visible .location-modal {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--color-secondary);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.3s;
}
.modal-close:hover { color: var(--color-text); }

.modal-header { text-align: center; margin-bottom: 24px; }
.modal-icon { font-size: 2rem; display: block; margin-bottom: 12px; }
.modal-title { font-family: var(--font-body); font-size: 1.1rem; letter-spacing: 0.05em; font-weight: 600; margin-bottom: 8px; }
.modal-subtitle { font-size: 0.85rem; color: var(--color-accent); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.modal-content { font-size: 0.95rem; color: var(--color-secondary); margin-bottom: 32px; }
.modal-content p { margin-bottom: 16px; }
.modal-content p:last-child { margin-bottom: 0; }

.modal-actions { display: flex; flex-direction: column; gap: 16px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 24px;
  border: none;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-secondary:hover { color: var(--color-accent); }

/* Desktop optimization */
@media (min-width: 768px) {
  .footer-links {
    flex-direction: row;
    justify-content: center;
    gap: 32px;
  }
}

/* Reduced Motion - Disables parallax and 3D completely */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .reveal-up {
    opacity: 1;
    transform: none;
  }
  
  .fade-in {
    opacity: 1;
  }
  
  .diorama-body {
    perspective: none;
  }
  
  .graphite-particles {
    display: none;
  }
  
  .diorama-layer,
  .diorama-text-layer,
  .diorama-image-layer,
  .story-img {
    transform: none !important;
  }
  
  .btn-embossed {
    transform: none !important;
    box-shadow: none;
  }
  .location-modal {
    transform: none;
    transition: none;
  }
}
