:root {
  /* Cinematic Dark Theme Tokens */
  --color-bg: #0a0808;      /* Deep black with a hint of warm brown */
  --color-text: #f0e6d2;    /* Soft off-white parchment feel */
  --color-primary: #8a1c1c; /* Blood red for pain / depth */
  --color-accent: #cca352;  /* Soft gold for hope / light */
  --color-surface: rgba(26, 24, 24, 0.6);
  --color-border: rgba(204, 163, 82, 0.2);

  --font-sans: 'Outfit', sans-serif;
  --font-serif: 'Playfair Display', serif;

  --spacing-sm: clamp(0.5rem, 2vw, 1rem);
  --spacing-md: clamp(1.5rem, 4vw, 2rem);
  --spacing-lg: clamp(2rem, 6vw, 4rem);
  --spacing-xl: clamp(3rem, 10vw, 8rem);

  --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

/* Typography */
h1, h2, h3 {
  font-weight: 600;
  line-height: 1.1;
}

.hero-title {
  font-size: clamp(3.5rem, 8vw, 7rem);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin-bottom: var(--spacing-sm);
}

.hero-subtitle {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 300;
  opacity: 0.8;
  max-width: 600px;
}

.section-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: var(--spacing-lg);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 60px;
  height: 2px;
  background-color: var(--color-primary);
  transition: width 0.4s ease;
}

.section-title:hover::after {
  width: 100%;
}

.highlight {
  color: var(--color-primary);
  text-shadow: 0 0 30px rgba(138, 28, 28, 0.4);
}

/* Common Layout */
section {
  padding: var(--spacing-xl) 5%;
  position: relative;
  z-index: 2;
}

/* Navigation */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(10,8,8,0.9) 0%, rgba(10,8,8,0) 100%);
  backdrop-filter: blur(10px);
}

.logo {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-accent);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: var(--transition-smooth);
}

.nav-links a:hover {
  color: var(--color-accent);
}

.nav-cta {
  background-color: transparent;
  border: 1px solid var(--color-accent);
  padding: 0.5rem 1.2rem;
  border-radius: 4px;
}

.nav-cta:hover {
  background-color: var(--color-accent);
  color: var(--color-bg) !important;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 1px;
  border-radius: 4px;
  transition: var(--transition-smooth);
  text-transform: uppercase;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-text);
  box-shadow: 0 4px 20px rgba(138, 28, 28, 0.4);
}

.btn-primary:hover {
  background-color: #a32222;
  box-shadow: 0 4px 30px rgba(138, 28, 28, 0.6);
  transform: translateY(-2px);
}

.btn-accent {
  background-color: var(--color-accent);
  color: var(--color-bg);
  box-shadow: 0 4px 20px rgba(204, 163, 82, 0.3);
}

.btn-accent:hover {
  background-color: #dcb866;
  box-shadow: 0 4px 30px rgba(204, 163, 82, 0.5);
  transform: translateY(-2px);
}

/* Hero Section */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  position: relative;
  overflow: hidden;
}

.hero-content {
  flex: 1;
  max-width: 600px;
  z-index: 2;
}

.hero-actions {
  margin-top: var(--spacing-md);
}

.hero-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
  z-index: 2;
}

.book-cover-wrapper {
  width: 100%;
  max-width: 400px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.1s;
}

.book-cover {
  width: 100%;
  height: auto;
  /* Use drop-shadow so the shadow hugs the cut-out shape instead of making a square box */
  filter: drop-shadow(-10px 10px 20px rgba(0,0,0,0.8));
  display: block;
}

.book-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120%;
  height: 120%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(138,28,28,0.4) 0%, rgba(0,0,0,0) 70%);
  z-index: -1;
  filter: blur(40px);
  pointer-events: none;
}

/* The Experience (Scroll Story) */
.scroll-story {
  /* Removed manual height here because GSAP pinning automatically handles the scroll distance. 
     Keeping this was creating an accidental double-gap of empty space! */
  position: relative;
  padding: 0;
}

.story-container {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  overflow: hidden;
}

.story-text {
  position: absolute;
  text-align: center;
  max-width: 800px;
  padding: 0 2rem;
  opacity: 0;
  transform: translateY(30px);
}

.story-text h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3.5rem);
  color: var(--color-accent);
  margin-bottom: 1rem;
  font-style: italic;
}

.story-text p {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  opacity: 0.8;
}

/* Visual Gallery */
.gallery-grid {
  display: grid;
  /* Switched to a 2-column layout so the 4 quotes sit in a perfect 2x2 square */
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.quote-card {
  background: linear-gradient(135deg, rgba(35, 30, 30, 0.7), rgba(20, 18, 18, 0.5));
  border: 1px solid rgba(204, 163, 82, 0.3);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  padding: 3rem 2rem;
  border-radius: 8px;
  position: relative;
  backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
}

.quote-card:hover {
  transform: translateY(-10px);
  border-color: var(--color-accent);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.quote-mark {
  font-family: var(--font-serif);
  font-size: 6rem;
  color: var(--color-primary);
  opacity: 0.2;
  position: absolute;
  top: -10px;
  left: 20px;
  line-height: 1;
}

.poetry-text {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.8;
  position: relative;
  z-index: 2;
}

/* About & Author */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

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

.author-image-wrapper {
  width: 250px;
  height: 250px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  padding: 5px;
  border: 2px solid var(--color-accent);
  position: relative;
}

.author-image-wrapper::before {
  content: '';
  position: absolute;
  top: -10px; left: -10px; right: -10px; bottom: -10px;
  border-radius: 50%;
  border: 1px dashed var(--color-primary);
  animation: spin 20s linear infinite;
}

.author-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  transition: var(--transition-smooth);
}

.author-profile:hover .author-image {
  transform: scale(1.05);
}

.author-name {
  font-size: 1.5rem;
  font-family: var(--font-serif);
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

/* CTA */
#cta {
  text-align: center;
  padding: 6rem 5%;
}

.glass-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 4rem 2rem;
  border-radius: 16px;
  backdrop-filter: blur(20px);
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at top right, rgba(138,28,28,0.2), transparent);
  pointer-events: none;
}

.glass-panel h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.glass-panel p {
  margin-bottom: 2rem;
  opacity: 0.8;
}

.email-form {
  display: flex;
  gap: 1rem;
  justify-content: center;
  max-width: 500px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.email-form input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.4);
  border-radius: 4px;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
  transition: var(--transition-smooth);
}

.email-form input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 10px rgba(204, 163, 82, 0.2);
}

.email-form-status {
  min-height: 1.5rem;
  margin-top: 1rem;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.email-form-status.is-success,
.email-form-status.is-error {
  opacity: 1;
}

.email-form-status.is-success {
  color: var(--color-accent);
}

.email-form-status.is-error {
  color: #ff8f8f;
}

/* Footer */
footer {
  background-color: #050404;
  padding: 4rem 5% 2rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-brand h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--color-accent);
}

.footer-brand p {
  font-size: 0.9rem;
  opacity: 0.6;
}

.social-links {
  display: flex;
  gap: 1.5rem;
}

.social-icon {
  color: var(--color-text);
  opacity: 0.6;
  transition: var(--transition-smooth);
}

.social-icon:hover {
  color: var(--color-accent);
  opacity: 1;
  transform: translateY(-3px);
}

/* Ambient Effects */
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}

.ambient-glow.dark-red {
  width: 60vw;
  height: 60vw;
  background: var(--color-primary);
  top: -20vh;
  left: -20vw;
  animation: pulse-glow 15s infinite alternate;
}

.ambient-glow.soft-gold {
  width: 40vw;
  height: 40vw;
  background: var(--color-accent);
  bottom: -10vh;
  right: -10vw;
  opacity: 0.3;
  animation: pulse-glow 20s infinite alternate-reverse;
}

/* Particles Container */
#particles-container {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.particle {
  position: absolute;
  background: var(--color-accent);
  border-radius: 50%;
  opacity: 0;
}

/* Keyframes */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse-glow {
  0% { transform: scale(1) translate(0, 0); opacity: 0.5; }
  100% { transform: scale(1.1) translate(5%, 5%); opacity: 0.8; }
}

/* Media Queries */
@media (max-width: 900px) {
  .hero-content, .hero-visual {
    flex: none;
    width: 100%;
  }

  /* Make title smaller to fit mobile screens better */
  .hero-title {
    font-size: clamp(2.2rem, 10vw, 3.5rem);
  }
  
  #hero {
    flex-direction: column;
    /* Prevent centering from pushing content off the top edge */
    justify-content: flex-start;
    text-align: center;
    gap: 2rem;
    padding-top: 120px; /* Leave space for the navbar */
    padding-bottom: 60px;
    height: auto; /* Allow the section to grow taller than the screen if needed */
  }

  /* Scale down the cover slightly for mobile space */
  .book-cover-wrapper {
    max-width: 260px;
    margin: 0 auto;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr; /* Switch to 1 column on mobile */
  }
  
  .about-grid {
    grid-template-columns: 1fr;
  }
  
  .email-form {
    flex-direction: column;
  }
  
  .nav-links {
    display: none; /* simple mobile fallback, might add hamburger later if needed */
  }
  
  .footer-content {
    flex-direction: column;
    gap: 2rem;
    text-align: center;
  }
}
