:root {
  /* Earth & Spirit Palette */
  --color-earth: #772014; /* Clay/Blood/Roots - Deep red for grounding */
  --color-night: #2f394d; /* Mystery/Depth - Deep slate blue for reflection */
  --color-bone: #f0ebd8;  /* Parchment/Clarity - Warm off-white for reading */
  --color-spirit: #2c8c99; /* Water/Healing - Teal accent */
  --color-fire: #ff9000;   /* Illumination - Bright orange for primary actions/CTAs */

  /* Fluid Typography (Scales seamlessly from mobile to desktop) */
  --text-xs: clamp(0.8rem, 0.17vw + 0.76rem, 0.89rem);
  --text-sm: clamp(1rem, 0.34vw + 0.91rem, 1.19rem);
  --text-base: clamp(1.25rem, 0.61vw + 1.1rem, 1.58rem);
  --text-lg: clamp(1.56rem, 1vw + 1.31rem, 2.11rem);
  --text-xl: clamp(1.95rem, 1.56vw + 1.56rem, 2.81rem);
  --text-2xl: clamp(2.44rem, 2.38vw + 1.85rem, 3.75rem);
  
  /* Mystical Shadows */
  --shadow-glow: 0 10px 40px -10px rgba(44, 140, 153, 0.3);
  --shadow-deep: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

/* --- Base & Reset --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background-color: var(--color-night);
  color: var(--color-bone);
  font-family: 'Vollkorn', serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* --- Organic Texture Overlay --- */
.texture-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image: url('/images/0090b-512x512.webp');
  background-size: 256px;
  mix-blend-mode: multiply;
  opacity: 0.4;
  pointer-events: none;
  z-index: 1;
}

/* --- Hand-Drawn Transitions --- */
.divider {
  position: absolute; left: 0; width: 100%; height: 30px;
  background-image: url('/images/border.webp');
  background-repeat: repeat-x; background-size: auto 30px;
  z-index: 20; pointer-events: none;
}
.divider.top { top: -15px; }
.divider.bottom { bottom: -15px; transform: rotate(180deg); }

/* --- Layout Containers & Grids --- */
.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.5rem; }

/* Specialized Grid for Homepage Intro */
.grid-intro { 
  display: grid; 
  grid-template-columns: 1.1fr 0.9fr; 
  gap: 3rem; 
  align-items: stretch; 
}

/* --- Navigation --- */
.master-nav {
  position: absolute; top: 0; left: 0; width: 100%;
  padding: 2rem 0; z-index: 1000;
}
.nav-container {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
}
.nav-brand img { width: 180px; transition: opacity 2s ease; }
.nav-menu { display: flex; gap: 2.5rem; }
.nav-link {
  color: var(--color-bone);
  font-family: 'PT Serif', serif;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-decoration: none;
  transition: color 0.4s ease;
}
.nav-link:hover { color: var(--color-fire); }

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-family: 'Montserrat', sans-serif;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  padding: 1rem 2.5rem;
  text-decoration: none;
  border-radius: 2px;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
  overflow: hidden;
  text-align: center;
}
.btn-fire { background-color: var(--color-fire); color: var(--color-night); border: 1px solid var(--color-fire); }
.btn-fire:hover { background-color: #ffaa33; box-shadow: var(--shadow-deep); transform: translateY(-3px); }
.btn-outline { border: 1px solid var(--color-bone); color: var(--color-bone); }
.btn-outline:hover { background-color: var(--color-bone); color: var(--color-night); }
.btn-bone { background-color: var(--color-bone); color: var(--color-night); border: 1px solid var(--color-bone); }
.btn-bone:hover { background-color: #fff; box-shadow: var(--shadow-deep); transform: translateY(-3px); }

/* --- Homepage Hero Section --- */
.hero {
  position: relative; height: 80vh; min-height: 600px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; background-color: #000;
}
.hero video {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0.5;
}
.hero-logo { width: 300px; position: relative; z-index: 5; }

/* --- Subpage Headers --- */
.page-header {
  position: relative; height: 50vh; min-height: 400px;
  display: flex; align-items: center; justify-content: center;
  background-color: var(--color-night); background-size: cover; background-position: center;
}
.page-header::before { content: ''; position: absolute; inset: 0; background: rgba(47,57,77,0.7); z-index: 1; }
.page-header h1 { position: relative; z-index: 10; font-family: 'Great Vibes', cursive; font-size: var(--text-2xl); color: var(--color-bone); font-weight: 400; text-align: center; }

/* --- Homepage Intro Text --- */
.intro {
  background-color: var(--color-bone);
  color: var(--color-night);
  padding: 8rem 0 0 0; 
  position: relative;
}
.intro-text { 
  padding-bottom: 4rem; 
  display: flex;
  flex-direction: column;
  justify-content: center; 
}
.intro h2 { font-size: var(--text-lg); font-weight: 400; margin-bottom: 1.5rem; line-height: 1.2; font-family: 'PT Serif', serif; }
.intro p { font-size: var(--text-sm); margin-bottom: 1.5rem; opacity: 0.85; line-height: 1.8; }
.intro-image-wrapper { height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.intro-image-wrapper img { width: 100%; max-width: 420px; display: block; filter: drop-shadow(0 20px 30px rgba(0,0,0,0.15)); }

/* --- Glass/Textural Cards (Used across multiple pages) --- */
.card {
  background: rgba(240, 235, 216, 0.03);
  border: 1px solid rgba(240, 235, 216, 0.1);
  padding: 3rem;
  backdrop-filter: blur(5px);
  transition: transform 0.4s ease, background 0.4s ease;
}
.card:hover { transform: translateY(-5px); background: rgba(240, 235, 216, 0.08); box-shadow: var(--shadow-deep); }
.card h3 { font-size: var(--text-lg); margin-bottom: 1rem; border-bottom: 1px solid rgba(240,235,216,0.2); padding-bottom: 1rem; font-family: 'PT Serif', serif; }
.card ul { list-style: none; margin-top: 1.5rem; }
.card li { margin-bottom: 1rem; font-size: var(--text-sm); display: flex; align-items: flex-start; opacity: 0.9; }
.card li::before { content: '✧'; color: var(--color-fire); margin-right: 10px; font-size: 1.2em; }

/* Service Icon Thumbnails inside cards */
.service-icon {
  width: 65px; height: 65px; margin-bottom: 1.5rem;
  object-fit: contain;
  transition: transform 0.4s ease;
}
.card:hover .service-icon { transform: scale(1.1); }

/* --- Offerings Section (Homepage) --- */
.offerings {
  background-color: var(--color-earth);
  padding: 8rem 0;
  position: relative;
}
.offerings-header { text-align: center; margin-bottom: 5rem; }
.offerings-header h2 { font-size: var(--text-xl); font-family: 'PT Serif', serif; font-weight: 400; }

/* --- The Mestizo Journey (About Page) --- */
.journey-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; margin-bottom: 2rem; }
.journey-text { padding: 3rem; background: rgba(240, 235, 216, 0.05); border: 1px solid rgba(240, 235, 216, 0.1); font-size: var(--text-base); opacity: 0.9; line-height: 1.8; }
.journey-img { width: 100%; height: 350px; object-fit: cover; border-radius: 2px; }

/* --- The Threshold (Universal Clarity Call Footer Block) --- */
.threshold {
  background-image: url('/images/table-header.webp');
  background-size: cover; background-position: center; background-attachment: fixed;
  padding: 10rem 0; position: relative; text-align: center;
}
.threshold-overlay {
  position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(47,57,77,0.9), rgba(119,32,20,0.85)); z-index: 1;
}
.threshold-content {
  position: relative; z-index: 10; max-width: 700px; margin: 0 auto;
}
.threshold h2 { font-size: var(--text-2xl); font-family: 'Great Vibes', cursive; color: var(--color-fire); margin-bottom: 1rem; font-weight: 400; }
.threshold h3 { font-size: var(--text-lg); font-family: 'PT Serif', serif; margin-bottom: 2rem; font-weight: 400; }
.threshold p { font-size: var(--text-base); margin-bottom: 3rem; opacity: 0.9; }

/* --- Footer --- */
.footer { background-color: #1a1f2b; padding: 5rem 0 2rem; position: relative; }
.footer-logo { width: 160px; margin-bottom: 1.5rem; opacity: 0.7; transition: opacity 0.3s; }
.footer-logo:hover { opacity: 1; }
.social-links { display: flex; gap: 1rem; margin-top: 1rem; }
.social-links img { width: 24px; opacity: 0.6; transition: opacity 0.3s; }
.social-links img:hover { opacity: 1; }

/* --- Cinematic Animations (Triggered by .page-home class on body) --- */
@keyframes fadeOutCenter {
  0% { opacity: 1; filter: blur(0); }
  100% { opacity: 0; filter: blur(10px); visibility: hidden; }
}
@keyframes fadeInNav {
  0% { opacity: 0; filter: blur(5px); }
  100% { opacity: 1; filter: blur(0); }
}
.page-home .hero-logo { animation: fadeOutCenter 2s ease-in-out 3.5s forwards; }
.page-home .nav-brand img { opacity: 0; animation: fadeInNav 2s ease-out 4.5s forwards; }

/* --- Mobile Responsiveness --- */
@media (max-width: 900px) {
  /* Collapse all grids to single column */
  .grid-2, .grid-3, .grid-4, .journey-grid, .grid-intro { grid-template-columns: 1fr; gap: 3rem; }
  
  /* Navigation */
  .nav-menu { display: none; /* Hide standard links on mobile to prevent overlap */ }
  .nav-container { justify-content: center; }
  
  /* Disable cinematic fade on mobile to keep branding visible */
  .page-home .nav-brand img { opacity: 1; animation: none; } 
  
  /* Intro Adjustments */
  .intro-text { padding-bottom: 0; text-align: center; }
  .intro-text .btn { width: 100%; margin-bottom: 10px; }
  .intro-image-wrapper img { width: 75%; }
  
  /* Subpage Tweaks */
  .journey-text { padding: 2rem; font-size: var(--text-sm); }
  .card { padding: 2rem; }
  .threshold { padding: 6rem 0; }
  
  /* Footer */
  .footer .grid-2 { gap: 2rem; text-align: center; }
  .footer .grid-2 > div { display: flex; flex-direction: column; align-items: center !important; }
}