/* =====================================================================
   BASE — reset, typography, layout primitives
   ===================================================================== */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-variant-ligatures: common-ligatures;
}

body.is-locked { overflow: hidden; }

img, picture, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select { font: inherit; color: inherit; }

button { background: none; border: 0; cursor: pointer; }

/* The UA rule for [hidden] is display:none, but any author `display` on the
   same element beats it — which silently broke every JS filter that toggles
   `el.hidden` on a grid or flex element. */
[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; padding: 0; }

hr { border: 0; border-top: 1px solid var(--line); }

/* ---- Headings ------------------------------------------------------ */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -0.005em;
  color: var(--green-900);
  text-wrap: balance;
}

h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-3); }
h4 { font-size: var(--step-2); }
h5 { font-size: var(--step-1); }

p { text-wrap: pretty; }

/* Hindi names get a typeface that actually respects Devanagari. */
.hindi, [lang="hi"] {
  font-family: var(--font-hindi);
  font-weight: 400;
  letter-spacing: 0;
}

/* ---- Selection & focus --------------------------------------------- */
::selection { background: var(--gold-200); color: var(--green-900); }

:focus-visible {
  outline: 2px solid var(--gold-600);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--green-700);
  color: var(--white);
  padding: var(--sp-3) var(--sp-5);
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---- Layout -------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.section { padding-block: clamp(2.75rem, 5.5vw, 5.5rem); }
.section-sm { padding-block: clamp(2rem, 3.5vw, 3rem); }

.section-cream { background: var(--cream); }
.section-white { background: var(--white); }
.section + .section-white,
.section-white + .section { border-top: 1px solid var(--line-soft); }

.section-green {
  background: var(--green-800);
  color: var(--green-050);
  position: relative;
}
.section-green h1, .section-green h2, .section-green h3 { color: var(--white); }

/* Paper grain over the coloured sections — subtle, never noticeable outright. */
.section-green::before,
.grain::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  opacity: .55;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.section-green > * { position: relative; z-index: 1; }

.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-6); }

.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Two-column splits. Use these instead of an inline grid-template-columns:
   an inline style wins over the media query below and strands the layout in
   two columns on a phone. */
.split {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.split--aside { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.split--main  { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }

@media (max-width: 900px) {
  .split,
  .split--aside,
  .split--main { grid-template-columns: 1fr; }
}

.flex { display: flex; gap: var(--sp-4); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.flex-center { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ---- Editorial furniture ------------------------------------------- */

/* Small-caps gold eyebrow — the brand's signature label style. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before,
.eyebrow.centered::after {
  content: '';
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: .6;
}
.section-green .eyebrow { color: var(--gold-400); }

.section-head {
  display: grid;
  gap: var(--sp-3);
  max-width: 62ch;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}
.section-head.centered {
  justify-items: center;
  text-align: center;
  margin-inline: auto;
}
.section-head p {
  color: var(--muted);
  font-size: var(--step-1);
  line-height: 1.6;
}
.section-green .section-head p { color: var(--green-100); }

/* Hairline rule with a diamond — used between sections. */
.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  color: var(--gold-400);
}
.rule::before, .rule::after {
  content: '';
  height: 1px;
  flex: 1;
  max-width: 90px;
  background: linear-gradient(90deg, transparent, currentColor);
}
.rule::after { background: linear-gradient(90deg, currentColor, transparent); }
.rule span {
  width: 6px; height: 6px;
  transform: rotate(45deg);
  background: currentColor;
}

.lead {
  font-size: var(--step-1);
  line-height: 1.68;
  color: var(--ink-soft);
}

.muted { color: var(--muted); }
.gold { color: var(--gold-700); }

.prose { max-width: 68ch; }
.prose p + p,
.prose ul + p,
.prose p + ul,
.prose p + h3,
.prose ul + h3 { margin-top: var(--sp-4); }
.prose h3 {
  font-size: var(--step-2);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-2);
}
.prose ul { list-style: none; display: grid; gap: var(--sp-2); }
.prose ul li {
  position: relative;
  padding-left: var(--sp-5);
}
.prose ul li::before {
  content: '';
  position: absolute;
  left: 4px; top: .62em;
  width: 5px; height: 5px;
  transform: rotate(45deg);
  background: var(--gold-600);
}
.prose a { color: var(--green-600); text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote {
  border-left: 2px solid var(--gold-400);
  padding-left: var(--sp-5);
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.4;
  color: var(--green-700);
  margin-block: var(--sp-6);
}

/* ---- Motion -------------------------------------------------------- */
/* Scroll reveals are hidden ONLY when scripting is confirmed working, because
   the thing that un-hides them is JavaScript. The `js` class is set by a tiny
   inline script in the head and removed again if the app script has not
   started within a couple of seconds — so a blocked or failed asset can never
   leave the page permanently blank. */
.js .reveal {
  opacity: 0;
  transform: translateY(10px);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity .45s var(--ease-out), transform .45s var(--ease-out);
}
.reveal.is-visible[data-delay="1"] { transition-delay: .08s; }
.reveal.is-visible[data-delay="2"] { transition-delay: .16s; }
.reveal.is-visible[data-delay="3"] { transition-delay: .24s; }
.reveal.is-visible[data-delay="4"] { transition-delay: .32s; }
.reveal.is-visible[data-delay="5"] { transition-delay: .40s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---- Responsive grid collapse -------------------------------------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 780px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
