/* ==========================================================================
   Home page only — hero slider, section rail and home sections.
   Loaded after main.css and theme.css on index.html.
   ========================================================================== */

/* 6. Hero: section rail + slider ---------------------------------------- */
.h-hero { padding-block: 22px 8px; }
.h-hero .h-wrap {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.h-rail { position: sticky; top: 84px; display: grid; gap: 10px; }
.h-rail ol { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: rail -1; }
.h-rail li { counter-increment: rail; }
.h-rail a {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: .9375rem;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.h-rail ol a::before {
  content: counter(rail, decimal-leading-zero);
  font-size: .75rem;
  font-weight: 700;
  color: var(--accent-700);
  font-variant-numeric: tabular-nums;
}
.h-rail a:hover { border-color: var(--primary-100); transform: translateX(3px); color: var(--primary-800); }
.h-rail a.is-active {
  background: var(--primary-800);
  border-color: var(--primary-800);
  color: #ffffff;
  box-shadow: inset 4px 0 0 var(--accent);
}
:root[data-theme="dark"] .h-rail a.is-active { background: #1c3a6e; border-color: #1c3a6e; }
.h-rail a.is-active::before { color: #f6d97f; }
.h-rail-cta { display: grid; gap: 8px; margin-top: 8px; }
.h-rail-cta a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  color: #ffffff;
  transition: filter .2s ease, transform .2s ease;
}
.home .h-rail-cta a { color: #ffffff; }
.h-rail-cta a:hover { filter: brightness(1.1); transform: translateY(-1px); color: #ffffff; }
.h-rail-cta .is-green { background: #0b2e6f; }
.h-rail-cta .is-maroon { background: #8b1d33; }

/* Slider */
.h-slider {
  position: relative;
  width: 100%;  /* stops min-height + aspect-ratio from widening it past the column */
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 1920 / 700;
  min-height: 430px;
  border-radius: 24px;
  background: var(--slider-panel);
  box-shadow: var(--shadow-lg);
  color: #ffffff;
}
.h-slides { position: absolute; inset: 0; z-index: -2; margin: 0; padding: 0; list-style: none; }
.h-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.1s ease;
}
.h-slide.is-active { opacity: 1; }
.h-slide picture, .h-slide img { display: block; width: 100%; height: 100%; }
.h-slide img { object-fit: cover; }  /* no zoom: keeps the photo pixel-sharp */

.h-slider::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* as on chinmayapacr.in: shade only behind the text, photo fully clear from ~60% */
  background:
    linear-gradient(90deg, rgba(5, 18, 41, .80) 0%, rgba(5, 18, 41, .56) 28%, rgba(5, 18, 41, .18) 48%, rgba(5, 18, 41, 0) 60%),
    linear-gradient(0deg, rgba(0, 0, 0, .28) 0%, transparent 22%);
}

.h-slider-content {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  max-width: 620px;
  padding: clamp(22px, 3vw, 40px);
  text-shadow: 0 1px 12px rgba(0, 0, 0, .35);
}
.h-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(5, 18, 41, .72);
  border: 0;
  color: #f6d97f;
  text-shadow: none;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.h-chip .diya .bowl { fill: #f6d97f; }
.h-slider h1 {
  margin: 0 0 12px;
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(1.6rem, 1rem + 1.6vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.h-slider h1 span { font-style: italic; color: #f6d97f; font-weight: 500; }
.h-lead {
  margin: 0 0 18px;
  color: #ffffff;
  font-size: clamp(.875rem, .8rem + .25vw, 1.0rem);
  line-height: 1.6;
}

.h-entry { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; position: relative; }
.h-entry a {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px 10px 16px;
  border-radius: 14px;
  text-decoration: none;
  color: #ffffff;
  text-shadow: none;
  backdrop-filter: blur(6px);
  transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease;
}
.home .h-entry a { color: #ffffff; }
.h-entry a:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -12px rgba(0, 0, 0, .6); color: #ffffff; }
.h-entry .is-primary { background: rgba(228, 185, 43, .92); color: #241c05; }
.home .h-entry .is-primary { color: #241c05; }
.h-entry .is-primary:hover { background: #f0c53a; color: #241c05; }
.h-entry .is-ghost { background: rgba(11, 46, 111, .9); border: 1px solid rgba(255, 255, 255, .22); border-left: 4px solid #5881c8; }
.h-entry .is-ghost:hover { background: rgba(8, 34, 82, .9); }
.h-entry small {
  display: block;
  font-size: .6875rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .8;
  margin-bottom: 1px;
}
.h-entry strong { display: block; font-family: var(--font-heading); font-size: 1rem; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.h-entry .arrow {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  flex: none;
}
.h-entry .arrow svg { width: 15px; height: 15px; }
.h-entry .is-primary .arrow { background: rgba(36, 28, 5, .12); }

.h-controls {
  position: absolute;
  right: clamp(16px, 2vw, 28px);
  bottom: clamp(16px, 2vw, 24px);
  display: flex;
  align-items: center;
  gap: 12px;
}
.h-caption {
  position: absolute;
  right: clamp(18px, 2vw, 30px);
  bottom: clamp(66px, 5.6vw, 76px);
  margin: 0;
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(.95rem, .85rem + .35vw, 1.2rem);
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .6);
  text-align: right;
}
.h-counter {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: .8125rem;
  letter-spacing: .08em;
  color: #ffffff;
  min-width: 54px;
  text-align: center;
}
.h-counter b { color: #f6d97f; font-size: 1rem; }
.h-progress {
  display: flex;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(4, 13, 29, .55);
  backdrop-filter: blur(4px);
}
.h-progress button {
  position: relative;
  width: 22px;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .35);
  cursor: pointer;
  overflow: hidden;
  transition: width .3s ease;
}
.h-progress button[aria-current="true"] { width: 40px; }
.h-progress button i {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}
.h-progress button.is-done i { transform: scaleX(1); }
.h-progress button[aria-current="true"] i { animation: fill var(--slide-ms, 6000ms) linear forwards; }
.h-slider.is-paused .h-progress button[aria-current="true"] i { animation-play-state: paused; }
@keyframes fill { to { transform: scaleX(1); } }
.h-arrow {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 50%;
  background: rgba(4, 13, 29, .4);
  color: #ffffff;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background-color .2s ease;
}
.h-arrow:hover { background: rgba(255, 255, 255, .22); }
.h-arrow svg { width: 18px; height: 18px; }

/* 7. Quick links band ---------------------------------------------------- */
.h-band {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.home .quick-links { gap: 12px; }
.home .quick-link {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  font-family: var(--font-body);
  box-shadow: none;
}
.home .quick-link:hover { border-color: var(--accent); color: var(--primary-800); background: var(--surface); }
.home .quick-link small { color: var(--text-muted); }
.home .icon-badge { background: var(--primary-50); color: var(--primary); }
.home .icon-badge--accent { background: var(--accent-50); color: var(--accent-700); }
.home .icon-badge--secondary { background: var(--secondary-50); color: var(--secondary); }

/* 8. Sections ------------------------------------------------------------ */
.h-section { padding-block: clamp(24px, 3vw, 40px) 0; scroll-margin-top: 80px; }
.h-section:last-of-type { padding-bottom: clamp(32px, 4vw, 52px); }

.h-title {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  margin-bottom: clamp(16px, 2vw, 24px);
  padding: 18px 22px 18px 24px;
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: 6px 18px 18px 6px;
  background: var(--panel);
}
.h-title::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(42%, 420px);
  background-color: var(--pattern-ink);
  -webkit-mask: var(--kolam) 0 0 / 44px 44px repeat, linear-gradient(90deg, transparent, #000000 60%);
  -webkit-mask-composite: source-in;
  mask: var(--kolam) 0 0 / 44px 44px repeat, linear-gradient(90deg, transparent, #000000 60%);
  mask-composite: intersect;
  pointer-events: none;
}
.h-title > div { position: relative; z-index: 1; }
.h-title .eyebrow { margin-bottom: 4px; }
.h-title h2 { margin: 0; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem); }
.h-title .diya { width: 38px; height: 38px; position: relative; z-index: 1; }
.h-title--center { justify-content: center; text-align: center; border-left-width: 1px; border-radius: 18px; border-top: 4px solid var(--accent); }
.h-title--center .eyebrow { justify-content: center; }
.h-title--center::after { width: 100%; -webkit-mask: var(--kolam) 0 0 / 44px 44px repeat, radial-gradient(circle at 50% 50%, transparent 30%, #000000 85%); mask: var(--kolam) 0 0 / 44px 44px repeat, radial-gradient(circle at 50% 50%, transparent 30%, #000000 85%); -webkit-mask-composite: source-in; mask-composite: intersect; }

/* Trustee message */
.h-message {
  position: relative;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.h-message::before {
  content: "\201C";
  position: absolute;
  top: -18px;
  right: 30px;
  font-family: var(--font-heading);
  font-size: 9rem;
  line-height: 1;
  color: var(--accent);
  opacity: .25;
  pointer-events: none;
}
.h-portrait-frame { position: relative; margin: 0; }
.h-portrait-frame::before {
  content: "";
  position: absolute;
  inset: 14px -14px auto 14px;
  aspect-ratio: 4 / 5;
  border: 2px solid var(--accent);
  border-radius: 20px;
}
.h-portrait-frame img {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 15%;
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.h-portrait-frame figcaption { position: relative; margin-top: 26px; font-size: .875rem; color: var(--text-muted); line-height: 1.45; }
.h-portrait-frame figcaption strong { display: block; font-family: var(--font-heading); font-size: 1.125rem; color: var(--heading); }
.h-message-body p { color: var(--text); font-size: 1.0625rem; line-height: 1.8; }
.h-message-body p:first-child {
  font-family: var(--font-heading);
  font-size: clamp(1.125rem, 1rem + .4vw, 1.3rem);
  font-style: italic;
  line-height: 1.65;
  color: var(--heading);
}

/* Pillar cards */
.h-pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 26px); }
.h-pillar {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px 26px 26px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.h-pillar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--pillar, var(--primary));
}
.h-pillar:nth-child(2) { --pillar: var(--secondary); }
.h-pillar:nth-child(3) { --pillar: var(--accent); }
.h-pillar:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.h-pillar .pillar-icon {
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
  box-shadow: 0 0 0 5px var(--surface-alt), 0 0 0 6px var(--border);
}
.h-pillar h3 { font-size: 1.5rem; margin-bottom: 10px; }
.h-pillar p { color: var(--text-muted); font-size: .975rem; line-height: 1.7; }
.h-pillar .link-arrow { margin-top: auto; color: var(--primary); }

/* Values band */
.h-values {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(32px, 5vw, 60px) clamp(20px, 4vw, 56px);
  border-radius: 28px;
  background: linear-gradient(135deg, #5c1222 0%, #8b1d33 55%, #a3362a 100%);
  color: #fbe9ec;
  box-shadow: var(--shadow-lg);
}
:root[data-theme="dark"] .h-values { background: linear-gradient(135deg, #2e0a13 0%, #4d1020 55%, #5e1d18 100%); border: 1px solid #4a1d27; }
.h-values::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: rgba(246, 217, 127, .16);
  -webkit-mask: var(--kolam) 0 0 / 44px 44px repeat;
  mask: var(--kolam) 0 0 / 44px 44px repeat;
}
.h-values-head { text-align: center; margin-bottom: 30px; }
.h-values-head .eyebrow { color: #f6d97f; justify-content: center; }
.h-values-head .eyebrow::before { background: #f6d97f; }
.home .h-values h2 { color: #ffffff; margin: 0; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem); }
.h-values .grid { gap: 18px; }
.h-value {
  padding: 26px;
  border-radius: 18px;
  background: rgba(20, 4, 8, .28);
  border: 1px solid rgba(246, 217, 127, .28);
  backdrop-filter: blur(2px);
}
.h-value .value-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #f6d97f;
}
.h-value .value-label img { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(246, 217, 127, .5); }
.h-value p { margin: 0; color: #fff3f5; font-family: var(--font-heading); font-size: 1.3rem; line-height: 1.45; }
.h-value .sanskrit { display: block; margin-bottom: 6px; font-family: var(--font-body); font-style: italic; font-size: .875rem; letter-spacing: .04em; color: #f3c9d1; }
.h-values .btn--light { margin-top: 30px; }

/* Nutshell highlights */
.home .highlights { gap: 14px; counter-reset: hl; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .home .highlights { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); } }
.home .highlights li {
  position: relative;
  background: var(--panel);
  border-color: var(--border);
  color: var(--text);
  padding: 20px 18px 18px;
  font-size: .95rem;
  counter-increment: hl;
  transition: border-color .2s ease, transform .2s ease;
}
.home .highlights li:hover { border-color: var(--accent); transform: translateY(-2px); }
.home .highlights li::after {
  content: counter(hl, decimal-leading-zero);
  position: absolute;
  top: 8px;
  right: 12px;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: .8125rem;
  color: var(--text-subtle);
}
.home .highlights svg {
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 12px;
  background: var(--primary-50);
  color: var(--primary);
}

/* Guiding lights */
.home .patrons { gap: clamp(16px, 2vw, 28px); }
.home .patron .patron-frame {
  background: linear-gradient(160deg, var(--surface), var(--surface-alt));
  border-color: var(--border);
  border-radius: 20px;
}
.home .patron .patron-frame--round { background: radial-gradient(circle at 50% 45%, var(--accent-50), var(--surface) 70%); }
.home .patron .patron-frame--round img { height: 78%; border-radius: 50%; box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--accent); }
.home .patron .patron-frame picture { display: block; width: 100%; height: 100%; }
/* Long name kept on a single line: the size follows the card width */
.home .patron { container-type: inline-size; }
.home .patron figcaption strong.one-line { white-space: nowrap; font-size: min(1.0625rem, 3.2cqi); }
@media (max-width: 1300px) {
  .home .patrons { grid-template-columns: minmax(0, 1fr); max-width: 560px; margin-inline: auto; gap: 28px; }
}
.home .patron figcaption { color: var(--text-muted); }
.home .patron figcaption strong { color: var(--heading); font-family: var(--font-heading); font-size: 1.0625rem; }

/* Closing call to action */
.h-cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding: clamp(28px, 4vw, 52px);
  border-radius: 28px;
  background: linear-gradient(120deg, #05142f 0%, #0b2e6f 100%);
  color: #d6deec;
  box-shadow: var(--shadow-lg);
}
:root[data-theme="dark"] .h-cta { background: linear-gradient(120deg, #050b16 0%, #0b1e41 100%); border: 1px solid #1e293b; }
.h-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: rgba(246, 217, 127, .14);
  -webkit-mask: var(--kolam) 0 0 / 44px 44px repeat, linear-gradient(90deg, transparent 35%, #000000);
  -webkit-mask-composite: source-in;
  mask: var(--kolam) 0 0 / 44px 44px repeat, linear-gradient(90deg, transparent 35%, #000000);
  mask-composite: intersect;
}
.home .h-cta h2 { color: #ffffff; margin-bottom: 8px; font-size: clamp(1.6rem, 1.2rem + 1.3vw, 2.4rem); }
.h-cta h2 em { color: #f6d97f; }
.h-cta p { margin: 0; max-width: 560px; }
.h-cta .hero-actions { flex: none; }

/* Responsive ----------------------------------------------------------- */
@media (max-width: 1100px) {
  .h-hero .h-wrap { grid-template-columns: minmax(0, 1fr); }
  .h-rail { position: static; }
  .h-rail ol {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .h-rail ol::-webkit-scrollbar { display: none; }
  .h-rail li { flex: none; }
  .h-rail a { white-space: nowrap; padding: 9px 14px; }
  .h-rail a:hover { transform: none; }
  .h-rail-cta { display: none; }
}

@media (max-width: 900px) {
  .h-slider {
    aspect-ratio: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--slider-panel);
  }
  .h-slides { position: relative; z-index: 0; aspect-ratio: 1920 / 700; min-height: 200px; }
  .h-slider::after { display: none; }
  .h-slides::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(4, 13, 29, .55), transparent 55%);
  }
  .h-slider-content { height: auto; max-width: none; padding: 20px 18px 22px; text-shadow: none; }
  .h-slider h1 { font-size: 1.5rem; }
  .h-controls { top: 12px; bottom: auto; right: 12px; }
  .h-caption { display: none; }
  .h-message { grid-template-columns: minmax(0, 1fr); }
  .h-message .h-portrait-frame { max-width: 230px; }
  .h-pillars { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .h-entry { flex-direction: column; gap: 10px; }
  .h-entry .is-ghost { margin-left: 0; }
  .h-progress button { width: 14px; }
  .h-progress button[aria-current="true"] { width: 26px; }
  .h-counter { display: none; }
  .h-title { padding: 14px 16px; gap: 12px; }
  .h-title .diya { width: 30px; height: 30px; }
  .h-values { border-radius: 22px; }
  .h-value p { font-size: 1.15rem; }
  .h-cta .hero-actions { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .h-progress button[aria-current="true"] i { animation: none; transform: scaleX(1); }
}

/* Mid widths: the text panel is tall relative to the slider, so the
   controls and photo name move to the top-right corner */
@media (min-width: 901px) and (max-width: 1240px) {
  .h-controls { top: 16px; bottom: auto; }
  .h-caption { top: auto; bottom: 18px; }
  .h-slider-content { max-width: 62%; }
}
@media (max-width: 640px) {
  .h-chip { font-size: .625rem; letter-spacing: .1em; white-space: nowrap; }
}
