/* The Meaning of Life — Complete in Every Way */

:root {
  --bg-void: #050508;
  --bg-deep: #0d0d14;
  --bg-card: #14141c;
  --bg-elevated: #1a1a26;
  --amber: #e8a838;
  --amber-soft: #f0c878;
  --amber-dark: #b8860b;
  --cream: #f5f0e6;
  --indigo: #3d3a6e;
  --violet: #5a5280;
  --text-primary: #e8e4dc;
  --text-muted: #9a9588;
  --border: rgba(232, 168, 56, 0.2);
  --glow: rgba(232, 168, 56, 0.15);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4rem;
}

body {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.75;
  min-height: 100vh;
}

.ambient-bg {
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse 120% 90% at 50% -10%, rgba(61, 58, 110, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 85% 70%, rgba(232, 168, 56, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 15% 85%, rgba(232, 168, 56, 0.05) 0%, transparent 50%),
    var(--bg-deep);
  pointer-events: none;
  z-index: -2;
}

.starfield {
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(1.5px 1.5px at 15% 25%, rgba(232, 168, 56, 0.4), transparent),
    radial-gradient(1px 1px at 35% 65%, rgba(232, 168, 56, 0.25), transparent),
    radial-gradient(1.5px 1.5px at 55% 15%, rgba(232, 168, 56, 0.35), transparent),
    radial-gradient(1px 1px at 75% 55%, rgba(232, 168, 56, 0.2), transparent),
    radial-gradient(1px 1px at 90% 80%, rgba(232, 168, 56, 0.3), transparent),
    radial-gradient(1px 1px at 20% 90%, rgba(232, 168, 56, 0.2), transparent);
  background-size: 250% 250%;
  animation: star-drift 40s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
  opacity: 0.7;
}

@keyframes star-drift {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 13, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--amber);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav a {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--amber-soft);
}

/* Hero */
.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
}

.hero-content {
  max-width: 900px;
  text-align: center;
}

.hero-image-wrapper {
  margin-bottom: 2rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px var(--glow);
}

.hero-img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.hero-image-wrapper figcaption,
.image-block figcaption {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.5rem;
}

.clickable {
  cursor: pointer;
}

.clickable:hover {
  transform: scale(1.02);
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 300;
  color: var(--cream);
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
}

.tagline {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  color: var(--amber-soft);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.opening-quote {
  border-left: 3px solid var(--amber);
  padding-left: 1.5rem;
  margin: 2rem 0;
  text-align: left;
}

.opening-quote p {
  font-style: italic;
  font-size: 1.2rem;
  color: var(--text-primary);
}

.opening-quote cite {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: normal;
}

.hero-intro {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 700px;
  margin: 0 auto;
}

/* Sections */
.section {
  padding: 4rem 2rem;
}

.section.dark {
  background: rgba(20, 20, 28, 0.6);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.section h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 400;
  color: var(--cream);
  margin-bottom: 0.5rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--amber-soft);
  margin-bottom: 2rem;
}

/* Content with image */
.content-with-image {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-top: 2rem;
}

.content-with-image.reverse {
  direction: rtl;
}

.content-with-image.reverse > * {
  direction: ltr;
}

.text-block p {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.text-block strong {
  color: var(--amber-soft);
}

.text-block em {
  color: var(--text-muted);
  font-style: italic;
}

.image-block {
  margin: 0;
}

.image-block img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s, box-shadow 0.3s;
}

.image-block img:hover,
.gallery-item img:hover {
  box-shadow: 0 15px 50px rgba(232, 168, 56, 0.2);
}

.image-block figcaption {
  margin-top: 0.75rem;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.gallery-item {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card);
  transition: transform 0.3s;
}

.gallery-item:hover {
  transform: translateY(-4px);
}

.gallery-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.gallery-item figcaption {
  padding: 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 5, 8, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox:not([hidden]) {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  border: none;
  background: rgba(232, 168, 56, 0.2);
  color: var(--amber);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}

.lightbox-close:hover {
  background: var(--amber);
  color: var(--bg-deep);
}

.lightbox-content {
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 1rem;
}

/* Coda */
.coda {
  padding: 5rem 2rem;
  text-align: center;
}

.coda p {
  max-width: 700px;
  margin: 0 auto 1.5rem;
  font-size: 1.1rem;
}

.closing {
  margin-top: 2rem;
  padding: 2rem;
}

.closing p {
  font-style: italic;
  font-size: 1.3rem;
  color: var(--amber-soft);
}

.closing cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: normal;
}

/* Footer */
.footer {
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer .fine {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  opacity: 0.8;
}

.back-to-top {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  color: var(--amber);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.back-to-top:hover {
  background: var(--amber);
  color: var(--bg-deep);
}

/* Responsive */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    gap: 1rem;
  }

  .nav {
    justify-content: center;
  }

  .content-with-image,
  .content-with-image.reverse {
    grid-template-columns: 1fr;
    direction: ltr;
  }

  .content-with-image .image-block {
    order: -1;
  }

  .hero {
    min-height: auto;
    padding: 3rem 1.5rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }
}
