/* ============================================
   AYODHYA SPIRITUAL HOMESTAY — Design System

   Direction: "Narrative Habitation"
   North Star: "Oil lamps. Lime walls. The Ramayana, told in rooms."
   Voice: "A temple priest who is also a grandmother."
   Lens: The Diya + The Courtyard

   Aesthetic: South Indian vernacular luxury
   References: Shankar Residence, Brindavana, Thotti Mane, Kaup Home
   ============================================ */

/* --- DESIGN TOKENS --- */
:root {
  /* Material-derived palette (updated from aesthetic reference) */
  --teak:             #5C3D2E;   /* Aged teak wood — columns, dados, furniture, nav */
  --ochre:            #C8956C;   /* Sun-baked earth plaster — primary warm tone */
  --mangalore:        #A0522D;   /* Clay roof tiles — footer, ground elements */
  --athangudi-green:  #4A7C59;   /* Hand-poured tile — accents, garden */
  --athangudi-cream:  #E8DCC8;   /* Hand-poured tile — card backgrounds, lighter walls */
  --red-oxide:        #8B3A2F;   /* Traditional floor polish — borders, dividers */
  --brass:            #C4903D;   /* Patinated brass lamp — CTAs, hover, metallic UI */
  --saffron:          #E86A10;   /* Temple cloth — primary accent, active states */
  --cream-plaster:    #F0E6D3;   /* Interior lime walls — PRIMARY background */
  --glass-yellow:     #D4A017;   /* Coloured transom — warm highlights */
  --glass-green:      #2E8B57;   /* Coloured transom — garden accent */
  --sindoor:          #CC3333;   /* Temple vermillion — threshold marks, emphasis */
  --tropical-green:   #2D5A27;   /* Garden foliage — nature sections */
  --kashaya:          #5C1A1B;   /* Deep maroon — puja, sacred sections */

  /* Functional colours */
  --bg-primary:       #F0E6D3;   /* Cream plaster — page background */
  --bg-warm:          #E8DCC8;   /* Athangudi cream — card/section backgrounds */
  --bg-dark:          #5C3D2E;   /* Dark teak — nav, footer, dark sections */
  --bg-sacred:        #5C1A1B;   /* Kashaya — sacred/spiritual sections */
  --text-primary:     #1A1108;   /* Lamp-soot black */
  --text-secondary:   #8B8589;   /* Dhoop smoke — captions, metadata */
  --text-on-dark:     #F0E6D3;   /* Cream on dark backgrounds */
  --accent-primary:   #E86A10;   /* Saffron — CTAs, links, active */
  --accent-hover:     #C4903D;   /* Brass — hover state */
  --divider:          #C8956C;   /* Ochre — horizontal rules */

  /* Typography — from Agent 2 Trend Brief */
  --font-display:     'Cormorant Garamond', serif;
  --font-body:        'Lora', serif;
  --font-label:       'Karla', sans-serif;
  --font-hindi:       'Noto Serif Devanagari', serif;

  /* Type scale — 1.333 (Perfect Fourth) */
  --text-xs:    0.8125rem;   /* 13px — captions */
  --text-sm:    0.875rem;    /* 14px — small labels */
  --text-base:  1.125rem;    /* 18px — body */
  --text-lg:    1.375rem;    /* 22px — lead */
  --text-xl:    1.5rem;      /* 24px — H3 */
  --text-2xl:   2rem;        /* 32px — H2 */
  --text-3xl:   3rem;        /* 48px — H1 */
  --text-4xl:   4rem;        /* 64px — Display */

  /* Spacing */
  --space-xs:   0.5rem;
  --space-sm:   1rem;
  --space-md:   2rem;
  --space-lg:   4rem;
  --space-xl:   6rem;
  --space-2xl:  8rem;
  --space-3xl:  12rem;

  /* Layout */
  --max-width:  1200px;
  --max-narrow: 720px;
  --max-wide:   1400px;
}

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

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

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover { color: var(--accent-hover); }

/* --- TYPOGRAPHY --- */

/* Display — Cormorant Garamond Light (sacred, carved, firelit) */
.t-display {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--text-4xl);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

h1, .t-h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--text-3xl);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-md);
}

h2, .t-h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-2xl);
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}

h3, .t-h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-xl);
  line-height: 1.3;
  margin-bottom: var(--space-sm);
}

/* Body — Lora (warm, readable, grandmother's voice) */
p {
  margin-bottom: 1.5em;
  max-width: 65ch;
}

.t-lead {
  font-size: var(--text-lg);
  font-style: italic;
  line-height: 1.6;
}

/* Label — Karla (quiet, functional, temple timetable) */
.t-label {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

/* Hindi — Noto Serif Devanagari */
.t-hindi {
  font-family: var(--font-hindi);
  font-weight: 300;
}

/* No bold anywhere — Light (300) and Regular (400) only */

/* --- NAVIGATION --- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-dark);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.4s ease;
}

.site-nav.hidden { transform: translateY(-100%); }

.nav-brand {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--text-xl);
  color: var(--text-on-dark);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
}

.nav-links a {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-on-dark);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  border-bottom-color: var(--saffron);
  color: var(--saffron);
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-on-dark);
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* --- SECTIONS --- */
.section {
  padding: var(--space-2xl) var(--space-md);
}

.section--sm { padding: var(--space-lg) var(--space-md); }
.section--lg { padding: var(--space-3xl) var(--space-md); }

.section--cream { background: var(--bg-primary); }
.section--warm { background: var(--bg-warm); }
.section--dark { background: var(--bg-dark); color: var(--text-on-dark); }
.section--sacred { background: var(--bg-sacred); color: var(--text-on-dark); }
.section--ochre { background: var(--ochre); color: var(--text-on-dark); }

.content {
  max-width: var(--max-width);
  margin: 0 auto;
}

.content--narrow { max-width: var(--max-narrow); }
.content--wide { max-width: var(--max-wide); }

/* --- HERO (Threshold Load pattern) --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  padding: var(--space-2xl) var(--space-md);
}

.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 40%,
    rgba(26, 17, 8, 0.6) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: var(--max-narrow);
  padding-bottom: var(--space-lg);
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--text-4xl);
  color: var(--text-on-dark);
  line-height: 1.1;
  margin-bottom: var(--space-sm);
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--athangudi-cream);
  font-style: italic;
  margin-bottom: var(--space-md);
}

.hero__scroll {
  display: inline-block;
  width: 1px;
  height: 40px;
  background: var(--brass);
  animation: scroll-hint 2s ease-in-out infinite;
}

@keyframes scroll-hint {
  0%, 100% { opacity: 0.3; transform: scaleY(0.5); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* --- FOUR DOORWAYS (Homepage below fold) --- */
.doorways {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  max-width: var(--max-wide);
  margin: 0 auto;
}

.doorway {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  cursor: pointer;
}

.doorway__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.6s ease;
}

.doorway:hover .doorway__img {
  transform: scale(1.03);
  filter: brightness(1.05) saturate(1.1);
}

.doorway__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-md) var(--space-sm);
  background: linear-gradient(transparent, rgba(26, 17, 8, 0.7));
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--text-xl);
  color: var(--text-on-dark);
}

/* --- CHAPTER SCROLL (Rooms page) --- */
.chapter {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: stretch;
}

.chapter:nth-child(even) { direction: rtl; }
.chapter:nth-child(even) > * { direction: ltr; }

.chapter__image {
  position: relative;
  overflow: hidden;
}

.chapter__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chapter__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-2xl) var(--space-lg);
  background: var(--bg-primary);
}

.chapter__number {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.chapter__name {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--text-3xl);
  color: var(--sindoor);
  margin-bottom: var(--space-xs);
}

.chapter__hindi {
  font-family: var(--font-hindi);
  font-weight: 300;
  font-size: var(--text-xl);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.chapter__story {
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--ochre);
  margin-bottom: var(--space-md);
  max-width: 50ch;
}

/* --- RITUAL CLOCK (Spiritual Life page) --- */
.timeline {
  max-width: var(--max-narrow);
  margin: 0 auto;
  position: relative;
  padding-left: 80px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 35px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--ochre);
}

.timeline__item {
  position: relative;
  padding: var(--space-md) 0;
  padding-left: var(--space-lg);
}

.timeline__time {
  position: absolute;
  left: -80px;
  top: var(--space-md);
  font-family: var(--font-label);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  width: 60px;
  text-align: right;
}

.timeline__dot {
  position: absolute;
  left: -13px;
  top: calc(var(--space-md) + 4px);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ochre);
  border: 2px solid var(--bg-primary);
}

.timeline__item.active .timeline__dot {
  background: var(--saffron);
  box-shadow: 0 0 12px rgba(232, 106, 16, 0.5);
}

.timeline__item.active .timeline__time {
  color: var(--saffron);
}

.timeline__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: var(--space-sm);
}

/* --- SLOW GALLERY --- */
.gallery-single {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.gallery-single__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}

.gallery-single__count {
  position: fixed;
  bottom: var(--space-md);
  left: var(--space-md);
  font-family: var(--font-label);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* --- LETTER FORM (Booking/Contact) --- */
.letter-form {
  max-width: var(--max-narrow);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-md);
}

.letter-form__field {
  margin-bottom: var(--space-lg);
}

.letter-form__label {
  font-family: var(--font-label);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  display: block;
  margin-bottom: var(--space-xs);
}

.letter-form__input,
.letter-form__textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-style: italic;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ochre);
  padding: var(--space-sm) 0;
  outline: none;
  transition: border-color 0.3s ease;
}

.letter-form__input:focus,
.letter-form__textarea:focus {
  border-bottom-color: var(--saffron);
}

.letter-form__textarea {
  resize: vertical;
  min-height: 120px;
}

/* --- BUTTONS --- */
.btn {
  font-family: var(--font-label);
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  padding: 0.875rem 2rem;
  border: none;
  cursor: pointer;
  transition: all 0.4s ease;
  display: inline-block;
  text-decoration: none;
}

.btn--primary {
  background: var(--saffron);
  color: var(--cream-plaster);
}
.btn--primary:hover {
  background: var(--brass);
  color: var(--cream-plaster);
}

.btn--outline {
  background: transparent;
  color: var(--saffron);
  border: 1px solid var(--saffron);
}
.btn--outline:hover {
  background: var(--saffron);
  color: var(--cream-plaster);
}

.btn--dark {
  background: var(--teak);
  color: var(--cream-plaster);
}
.btn--dark:hover {
  background: var(--mangalore);
}

/* --- SPLIT LAYOUT --- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: stretch;
}

.split--reverse { direction: rtl; }
.split--reverse > * { direction: ltr; }

.split__image {
  overflow: hidden;
}

.split__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.split__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-2xl) var(--space-lg);
}

/* --- DIVIDERS --- */
.divider {
  border: none;
  height: 1px;
  background: var(--ochre);
  margin: var(--space-lg) auto;
  max-width: var(--max-width);
}

.divider--thick {
  height: 3px;
  background: var(--mangalore);
}

.divider--brass {
  height: 2px;
  background: var(--brass);
  max-width: 60px;
}

/* --- CARDS --- */
.card {
  background: var(--bg-warm);
  overflow: hidden;
  transition: transform 0.3s ease;
}

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

.card__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.card__body {
  padding: var(--space-md);
}

/* --- PRICING TABLE --- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
  max-width: var(--max-width);
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg-warm);
  padding: var(--space-lg);
  text-align: center;
  border-top: 3px solid var(--ochre);
}

.pricing-card--featured {
  border-top-color: var(--saffron);
  position: relative;
}

.pricing-card__price {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--text-3xl);
  color: var(--teak);
  margin: var(--space-sm) 0;
}

.pricing-card__period {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --- FOOTER --- */
.site-footer {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  padding: var(--space-2xl) var(--space-md);
  text-align: center;
}

.site-footer a {
  color: var(--athangudi-cream);
}
.site-footer a:hover {
  color: var(--saffron);
}

.footer__tagline {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--text-2xl);
  color: var(--athangudi-cream);
  margin-bottom: var(--space-md);
}

.footer__info {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  line-height: 2;
}

/* --- FADE IN (IntersectionObserver) --- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.fade-in-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in-stagger.visible > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: translateY(0); }
.fade-in-stagger.visible > *:nth-child(2) { transition-delay: 0.15s; opacity: 1; transform: translateY(0); }
.fade-in-stagger.visible > *:nth-child(3) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.fade-in-stagger.visible > *:nth-child(4) { transition-delay: 0.45s; opacity: 1; transform: translateY(0); }

/* --- RESPONSIVE --- */

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --text-4xl: 3rem;
    --text-3xl: 2.25rem;
    --text-2xl: 1.75rem;
  }

  .doorways { grid-template-columns: repeat(2, 1fr); }
  .chapter { grid-template-columns: 1fr; min-height: auto; }
  .chapter:nth-child(even) { direction: ltr; }
  .chapter__image { aspect-ratio: 16 / 9; }
  .split { grid-template-columns: 1fr; }
  .split--reverse { direction: ltr; }
  .split__image { aspect-ratio: 16 / 9; }
}

/* Mobile */
@media (max-width: 640px) {
  :root {
    --text-4xl: 2.25rem;
    --text-3xl: 1.75rem;
    --text-2xl: 1.5rem;
    --text-base: 1rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;
  }

  .section { padding: var(--space-lg) var(--space-sm); }
  .doorways { grid-template-columns: 1fr; }

  .nav-links { display: none; }
  .nav-hamburger { display: block; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-dark);
    padding: var(--space-md);
    gap: var(--space-sm);
  }

  .timeline { padding-left: 60px; }
  .timeline__time { left: -60px; font-size: var(--text-xs); }

  .chapter__content { padding: var(--space-lg) var(--space-md); }
  .split__content { padding: var(--space-lg) var(--space-md); }
}

/* --- UTILITY --- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mt-lg { margin-top: var(--space-lg); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.full-bleed { width: 100vw; margin-left: calc(-50vw + 50%); }
