:root {
  --bg: #0b0709;
  --ink: #f4eadc;
  --muted: #c4b3a3;
  --dim: #8e7c70;
  --saffron: #ff8a2a;
  --gold: #e6b45c;
  --line: rgba(244, 234, 220, 0.16);

  /* One family for both scripts: Tiro Devanagari Marathi ships matching Latin. */
  --serif: 'Tiro Devanagari Marathi', Georgia, serif;
  --deva: 'Tiro Devanagari Marathi', 'Noto Serif Devanagari', serif;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'Inter', system-ui, sans-serif; /* ponytail: labels use the UI face; name kept to avoid churn */

  /* Calligraphy for titles, headings and quotes (Devanagari + matching Latin); Tiro stays for reading */
  /* Rozha One: high-contrast and regal, shapes every Marathi conjunct correctly. One weight only,
     so headings use it as drawn (no faux bold). Other faces can be tried on fonts.html. */
  --display: 'Rozha One', 'Tiro Devanagari Marathi', serif;
  --display-weight: 400;
  /* One centred frame: content never runs past 1440px; on wider screens the margins grow instead */
  --frame: 1440px;
  --gutter: max(clamp(16px, 4vw, 64px), calc((100vw - var(--frame)) / 2 + 64px));
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: clip; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 50; background: var(--bg);
  display: grid; place-content: center; justify-items: center; gap: 18px;
  transition: opacity 1.1s var(--ease), visibility 1.1s;
}
.loader__word { font-family: var(--deva); font-size: clamp(32px, 5vw, 52px); color: var(--gold); letter-spacing: .02em; animation: breathe 2.4s ease-in-out infinite; }
.loader__line { width: 120px; height: 1px; background: linear-gradient(90deg, transparent, var(--saffron), transparent); animation: sweep 1.6s ease-in-out infinite; }
.is-ready .loader { opacity: 0; visibility: hidden; }
@keyframes breathe { 50% { opacity: .55; } }
@keyframes sweep { 0% { transform: scaleX(.2); opacity: .3; } 50% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(.2); opacity: .3; } }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gutter);
  opacity: 0; transform: translateY(-10px);
  transition: opacity 1s var(--ease) .9s, transform 1s var(--ease) .9s;
}
.is-ready .nav { opacity: 1; transform: none; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand__mark { width: 34px; height: 34px; color: var(--gold); }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__en { font-family: var(--serif); font-size: 22px; font-weight: 400; letter-spacing: .02em; }
.brand__mr { font-family: var(--deva); font-size: 12px; color: var(--dim); margin-top: 3px; }

.nav__links { display: flex; gap: clamp(20px, 3vw, 44px); }
.nav__links a { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; position: relative; padding: 6px 0; }
.nav__links span { font: 500 11.5px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.nav__links small { font: 12px/1 var(--deva); color: var(--dim); transition: color .3s; }
.nav__links a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--saffron); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.nav__links a:hover::after, .nav__links a:focus-visible::after { transform: scaleX(1); }
.nav__links a:hover small { color: var(--gold); }
.nav__toggle { display: none; width: 40px; height: 40px; position: relative; }
.nav__toggle span:not(.sr-only) { position: absolute; left: 10px; right: 10px; height: 1.4px; background: var(--ink); transition: transform .3s; }
.nav__toggle span:nth-child(1) { top: 16px; }
.nav__toggle span:nth-child(2) { top: 23px; }
.nav--open .nav__toggle span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.nav--open .nav__toggle span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; height: 100vh; height: 100svh; min-height: 620px;
  overflow: hidden; isolation: isolate; touch-action: pan-y;
}

.scene { position: absolute; inset: -3% -3% 0 -3%; z-index: 0; }
.scene .layer { position: absolute; inset: 0; will-change: transform; }
.sky {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    #0f0c1d 0%, #1f1630 22%, #452438 42%, #8a3a3a 56%,
    #d8693a 66%, #f3a457 73%, #ffd795 79%, #ffd795 100%);
}
.sun {
  position: absolute; left: 44%; top: 63%; width: 58vmin; height: 58vmin;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 214, 1) 0 6%, rgba(255, 206, 130, .6) 14%, rgba(255, 150, 70, .2) 36%, transparent 68%);
  animation: sun-pulse 9s ease-in-out infinite;
}
@keyframes sun-pulse { 50% { opacity: .85; transform: translate(-50%, -50%) scale(1.04); } }

.range { position: absolute; left: 0; bottom: 0; width: 100%; display: block; }
.range .flag { filter: drop-shadow(0 0 6px rgba(255, 120, 30, .8)); }
.range .torch { animation: flicker 1.3s steps(6) infinite; }
.range .torch:nth-of-type(2n) { animation-duration: 1.7s; }
@keyframes flicker { 0%, 100% { opacity: 1; } 30% { opacity: .55; } 60% { opacity: .85; } 80% { opacity: .4; } }

.drift { position: absolute; left: 0; right: 0; overflow: hidden; pointer-events: none; }
.drift__track {
  position: absolute; top: 0; bottom: 0; left: 0; width: 200%;
  background-repeat: repeat-x; background-size: 50% 100%;
  animation: drift var(--dur, 120s) linear infinite;
}
.drift--reverse .drift__track { animation-direction: reverse; }
@keyframes drift { to { transform: translate3d(-50%, 0, 0); } }
.drift--breathe { animation: fog-breathe 14s ease-in-out infinite; }
@keyframes fog-breathe { 50% { opacity: var(--o2, .6); } }

.scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(11, 7, 9, .86) 0%, rgba(11, 7, 9, .55) 30%, rgba(11, 7, 9, 0) 56%),
    linear-gradient(0deg, rgba(11, 7, 9, .9) 0%, rgba(11, 7, 9, 0) 24%),
    linear-gradient(180deg, rgba(11, 7, 9, .55) 0%, rgba(11, 7, 9, 0) 18%);
}

/* ---------- Figure ---------- */
.figure {
  position: absolute; z-index: 2; bottom: 0;
  right: max(16px, calc(var(--gutter) + 1vw));
  height: min(94svh, 1150px);
  aspect-ratio: var(--ar, 0.7273);
}
.figure__inner {
  position: absolute; inset: 0;
  opacity: 0; transform: translateY(40px);
  transition: opacity 2s var(--ease) .3s, transform 2.4s var(--ease) .3s;
}
.is-ready .figure__inner { opacity: 1; transform: none; }
.figure__canvas, .figure__inner img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.figure--fallback img:last-child { opacity: 0; transition: opacity .8s; }
.figure--fallback:hover img:last-child { opacity: 1; }

.figure__hint {
  position: absolute; z-index: 6; left: 50%; bottom: 30%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 999px;
  background: rgba(11, 7, 9, .55); border: 1px solid rgba(255, 170, 110, .25); backdrop-filter: blur(6px);
  font: 500 10.5px/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink);
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity 1s var(--ease);
}
.is-ready .figure__hint { opacity: 1; transition-delay: 2.6s; }
.is-ready .figure__hint.is-hidden { opacity: 0; transition-delay: 0s; }
.figure__hint-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--saffron); box-shadow: 0 0 0 0 rgba(255, 138, 42, .6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(255, 138, 42, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 138, 42, 0); } }

.fog-front { position: absolute; left: 0; right: 0; bottom: 0; height: 36%; z-index: 3; pointer-events: none; }
.fog-front::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(0deg, var(--bg) 0%, rgba(11, 7, 9, .7) 22%, rgba(11, 7, 9, 0) 60%);
}
.embers { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; pointer-events: none; }

/* ---------- Copy ---------- */
.hero__content {
  position: absolute; z-index: 5; left: var(--gutter); top: 47%;
  transform: translateY(-50%); max-width: min(600px, 46vw);
}
.hero__content > * {
  opacity: 0; transform: translateY(22px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
  transition-delay: calc(1.1s + var(--i, 0) * .12s);
}
.is-ready .hero__content > * { opacity: 1; transform: none; }

.eyebrow { display: flex; align-items: center; gap: 12px; font: 500 11.5px/1 var(--mono); letter-spacing: .04em; color: var(--muted); }
.eyebrow__sep { width: 28px; height: 1px; background: var(--saffron); }
.hero__mr { font-family: var(--deva); font-size: clamp(20px, 2vw, 28px); color: var(--gold); margin-top: 26px; }
.hero__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(40px, 5vw, 82px); line-height: .94; letter-spacing: -.01em;
  margin-top: 10px; text-wrap: balance;
}
.hero__title em { font-style: italic; font-weight: 400; color: var(--saffron); text-shadow: 0 0 40px rgba(255, 120, 40, .35); }
.hero__lede { margin-top: 24px; max-width: 440px; font-size: 15.5px; line-height: 1.65; color: var(--muted); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 24px;
  border-radius: 999px; font: 500 14px/1 var(--sans);
  transition: background .35s, color .35s, border-color .35s, transform .35s var(--ease);
}
@media (hover: hover) and (pointer: fine) { .btn:hover { transform: translateY(-2px); } }
.btn:active { transform: scale(.97); transition-duration: .12s; }
.btn--primary { background: var(--ink); color: #1a0f0a; }
.btn--primary:hover { background: var(--saffron); }
.btn--ghost { border: 1px solid rgba(244, 234, 220, .3); }
.btn--ghost:hover { border-color: var(--ink); }
.btn:focus-visible, .nav a:focus-visible, .nav__toggle:focus-visible { outline: 2px solid var(--saffron); outline-offset: 3px; }

.hero__stats {
  position: absolute; z-index: 5; left: var(--gutter); bottom: clamp(24px, 5vh, 48px);
  display: flex; gap: clamp(28px, 4vw, 56px);
  padding-top: 18px; border-top: 1px solid var(--line);
  opacity: 0; transition: opacity 1.2s var(--ease) 1.9s;
}
.is-ready .hero__stats { opacity: 1; }
.hero__stats dt { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3vw, 42px); line-height: 1; }
.hero__stats dd { margin-top: 8px; font: 500 10.5px/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--dim); }

.hero__quote { margin-top: 34px; padding-left: 16px; border-left: 1px solid var(--saffron); }
.hero__quote p { font-family: var(--deva); font-size: 16px; color: var(--gold); }
.hero__quote cite { display: block; margin-top: 4px; font: 400 10.5px/1.4 var(--mono); letter-spacing: .1em; color: var(--dim); font-style: normal; }

/* ---------- Cursor ---------- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none;
  width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  border: 1px solid rgba(255, 190, 130, .55);
  box-shadow: 0 0 18px rgba(255, 120, 40, .25), inset 0 0 12px rgba(255, 120, 40, .15);
  opacity: 0; transition: opacity .4s, width .4s var(--ease), height .4s var(--ease), margin .4s var(--ease), border-color .4s;
}
.cursor.is-on { opacity: 1; }
.cursor.is-hot { width: 84px; height: 84px; margin: -42px 0 0 -42px; border-color: rgba(255, 150, 70, .9); }
@media (hover: none) { .cursor { display: none; } }

/* ---------- Align tool (?align) ---------- */
.align-panel {
  position: fixed; left: 16px; bottom: 16px; z-index: 60; padding: 14px 16px; border-radius: 10px;
  background: rgba(0, 0, 0, .85); color: #fff; font: 12px/1.6 var(--mono); white-space: pre;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px), (max-height: 760px) {
  .hero__quote { display: none; }
}
@media (max-width: 860px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute; top: 100%; right: var(--gutter); left: var(--gutter);
    flex-direction: column; gap: 4px; padding: 14px 18px; border-radius: 14px;
    background: rgba(20, 13, 14, .94); border: 1px solid var(--line); backdrop-filter: blur(10px);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .3s, transform .3s var(--ease), visibility .3s;
  }
  .nav__links a { flex-direction: row; align-items: baseline; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav__links a:last-child { border-bottom: 0; }
  .nav--open .nav__links { opacity: 1; visibility: visible; transform: none; }

  .figure { right: 50%; transform: translateX(50%); height: 56svh; bottom: auto; top: 9svh; }
  .figure__hint { bottom: 22%; }
  .scrim { z-index: 3; background: linear-gradient(0deg, rgba(11, 7, 9, .97) 0%, rgba(11, 7, 9, .88) 34%, rgba(11, 7, 9, 0) 56%), linear-gradient(180deg, rgba(11, 7, 9, .55), transparent 20%); }
  .hero__content { top: auto; bottom: var(--gutter); right: var(--gutter); transform: none; max-width: none; }
  .hero__mr { margin-top: 14px; }
  .hero__lede { font-size: 14.5px; margin-top: 14px; }
  .hero__actions { margin-top: 20px; flex-wrap: nowrap; }
  .btn { height: 44px; padding: 0 18px; font-size: 13px; }
  .hero__title { font-size: clamp(38px, 11vw, 56px); }
  .hero__stats { display: none; }
  .fog-front { height: 60%; }
}

@media (prefers-reduced-motion: reduce) {
  .drift__track, .sun, .drift--breathe, .loader__word, .loader__line, .figure__hint-dot { animation: none !important; }
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; }
}

/* ---------- Sound toggle ---------- */
.nav { gap: 22px; }
.brand { margin-right: auto; }
.nav__links { order: 0; }
.sound-btn { order: 1; }
.nav__toggle { order: 2; }
.sound-btn {
  display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  font: 500 10.5px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  transition: border-color .3s, color .3s, background .3s;
}
.sound-btn:hover { border-color: rgba(255, 170, 110, .5); color: var(--ink); }
.sound-btn:focus-visible { outline: 2px solid var(--saffron); outline-offset: 3px; }
.sound-btn__bars { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.sound-btn__bars i { width: 2px; height: 3px; background: currentColor; border-radius: 1px; transition: height .3s; }
.sound-btn[data-state="on"] { color: var(--saffron); border-color: rgba(255, 138, 42, .45); }
.sound-btn[data-state="on"] i { animation: eq .9s ease-in-out infinite alternate; }
.sound-btn[data-state="on"] i:nth-child(2) { animation-delay: -.3s; animation-duration: .7s; }
.sound-btn[data-state="on"] i:nth-child(3) { animation-delay: -.6s; animation-duration: 1.1s; }
.sound-btn[data-state="on"] i:nth-child(4) { animation-delay: -.15s; animation-duration: .8s; }
.sound-btn[data-state="waiting"] { color: var(--ink); animation: wait-pulse 2s ease-in-out infinite; }
@keyframes eq { from { height: 3px; } to { height: 12px; } }
@keyframes wait-pulse { 50% { border-color: rgba(255, 138, 42, .7); box-shadow: 0 0 0 4px rgba(255, 138, 42, .12); } }
@media (max-width: 860px) {
  .sound-btn { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .sound-btn__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
@media (prefers-reduced-motion: reduce) { .sound-btn i { animation: none !important; } }

/* ---------- Language (Marathi first) ---------- */
:root:not([data-lang="en"]) [data-l="en"],
:root[data-lang="en"] [data-l="mr"] { display: none !important; }
/* Devanagari: its own face, never tracked or uppercased (that breaks the shirorekha), never below 13px */
[lang="mr"]:not(html) { font-family: var(--mr-face, var(--deva)); letter-spacing: 0 !important; text-transform: none !important; }
/* minimum size only for plain text spans (small labels) — titles with their own class keep their size */
[lang="mr"]:not(html):not([class]) { font-size: max(1em, 13px); }
[lang="mr"] em { font-style: normal; }
/* Vowel signs rise above and drop below the line: Marathi headings need room */
:root:not([data-lang="en"]) :is(.hero__title, .h2, .chron-panel__en, .vitrine__en, .fort-card__en, .next__en, .council__role h3, .fort-type h3) { line-height: 1.28; }
:root:not([data-lang="en"]) .hero__title { font-size: clamp(40px, 5.6vw, 88px); }

.lang-btn {
  order: 1; height: 36px; min-width: 52px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px;
  font: 600 12px/1 var(--sans); letter-spacing: .04em; color: var(--ink);
  transition: border-color .3s, background .3s, transform .12s var(--ease);
}
.lang-btn:hover { border-color: rgba(255, 170, 110, .5); background: rgba(255, 138, 42, .08); }
.lang-btn:active, .sound-btn:active, .nav__toggle:active { transform: scale(.95); }
.lang-btn:focus-visible { outline: 2px solid var(--saffron); outline-offset: 3px; }
@media (max-width: 860px) { .lang-btn { height: 40px; padding: 0 12px; } }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; animation-timing-function: cubic-bezier(.23, 1, .32, 1); }

.skip { position: fixed; left: 12px; top: -64px; z-index: 200; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: #1a0f0a; font: 500 14px/1 var(--sans); transition: top .2s var(--ease); }
.skip:focus { top: 12px; }

/* ---------- Headline: each line rises out of its own mask ---------- */
.hero__title [data-l] { display: block; }
.ln { display: block; overflow: hidden; padding: .16em 0 .12em; margin: -.16em 0 -.12em; }
.ln > span { display: block; transform: translateY(112%); transition: transform 1.3s cubic-bezier(.23, 1, .32, 1) calc(1.25s + var(--n, 0) * .12s); }
.ln:nth-child(2) > span { --n: 1; }
.ln:nth-child(3) > span { --n: 2; }
.is-ready .ln > span { transform: none; }
.hero__stats dt { font-variant-numeric: tabular-nums; }

/* ---------- Calligraphic display ---------- */
:is(.hero__title, .hero__mr, .hero__quote p, .brand__en, .loader__word,
    .h2, .ch-intro__mr, .ch-intro__num, .next__mr, .next__en,
    .fort-card__mr, .fort-card__en, .fort-type .mr, .fort-type h3,
    .chron-panel__mr, .chron-panel__en, .vitrine__mr, .vitrine__en,
    .council__role .mr, .council__role h3, .seal__text, .raiyat__q, .raiyat__en) {
  --mr-face: var(--display);
  font-family: var(--display);
  font-style: normal;
}
:is(.hero__title, .h2, .ch-intro__mr, .next__mr, .fort-card__mr, .chron-panel__mr, .vitrine__mr, .council__role .mr, .brand__en, .loader__word) { font-weight: var(--display-weight, 700); }
:is(.hero__mr, .hero__quote p, .raiyat__q, .raiyat__en, .next__en, .fort-card__en, .chron-panel__en, .vitrine__en, .council__role h3, .fort-type h3, .ch-intro__num) { font-weight: 400; }
/* The pen's ascenders and vowel signs need air in both scripts */
:is(.hero__title, .h2) { line-height: 1.12; letter-spacing: 0; }
:root:not([data-lang="en"]) :is(.hero__title, .h2, .chron-panel__en, .vitrine__en, .fort-card__en, .next__en, .council__role h3, .fort-type h3) { line-height: 1.32; }
.hero__title em, .h2 em { font-style: normal; }
.hero__title { font-size: clamp(38px, 4.6vw, 76px); }
:root:not([data-lang="en"]) .hero__title { font-size: clamp(34px, 4.3vw, 68px); }
.hero__content { max-width: min(640px, 46vw); }
/* The pen's ascenders rise higher than Tiro's: give the line masks more headroom */
.ln { padding: .32em 0 .2em; margin: -.32em 0 -.2em; }
.hero__quote p { font-size: 20px; }

/* Home: realistic 3D Sahyadri replaces the drawn layers (js/vista3d.js) */
.scene .vista-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene--3d > :not(.vista-gl) { display: none; }

/* ---------- Home hero, minimal: one left column on one rhythm, stats beneath it ---------- */
.figure__hint, .hero__quote { display: none !important; }
.hero__content { top: auto; transform: none; bottom: calc(clamp(24px, 5vh, 48px) + 132px); max-width: min(560px, 44vw); }
.hero__mr { margin-top: 20px; font-size: clamp(18px, 1.5vw, 22px); }
.hero__title { margin-top: 8px; }
:root:not([data-lang="en"]) .hero__title { font-size: clamp(34px, 3.9vw, 62px); line-height: 1.16; }
.hero__lede { margin-top: 20px; max-width: 430px; }
.hero__actions { margin-top: 28px; }
.hero__stats { gap: 0; width: min(560px, 44vw); }
.hero__stats > div { flex: 1; padding-left: 22px; border-left: 1px solid var(--line); }
.hero__stats > div:first-child { padding-left: 0; border-left: 0; }
/* tighter headline: the lines sit close, राजा's tall line no longer pushes a gap */
:root:not([data-lang="en"]) h1.hero__title { line-height: .98; }   /* h1: outranks the shared heading rule above */
:root[data-lang="en"] .hero__title { line-height: 1.04; }
.hero__title [data-l="mr"] em { line-height: .9; }
/* the statue sits a little lower, clear of the menu (one canvas holds both images and the reveal, so they move together) */
@media (min-width: 861px) { .hero .figure { bottom: -3svh; height: min(86svh, 1060px); } }
/* menu legible over the bright sky (WCAG AA: text ≥ 4.5:1 against what's behind it) */
.nav { background: linear-gradient(180deg, rgba(11, 7, 9, .82) 0%, rgba(11, 7, 9, .5) 65%, rgba(11, 7, 9, 0)); }
.nav__links span, .brand { text-shadow: 0 1px 10px rgba(0, 0, 0, .6); }
.nav__links small, .brand__mr { color: var(--muted); }
/* stats: out of the hero's bottom fade, and in readable tones */
main > section.hero:first-child { --foot: 9vh; -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - var(--foot)), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - var(--foot)), transparent); }
@media (min-width: 861px) {
  .hero .hero__stats { bottom: calc(var(--foot) + 10px); }                  /* just above the short fade at the foot */
  .hero .hero__content { bottom: calc(var(--foot) + 10px + 128px); }
}
@media (min-width: 861px) and (max-height: 780px) { .hero .hero__content { bottom: calc(var(--foot) + 14px); } }
.hero__stats dd { color: var(--muted); }
.hero__stats { border-top-color: rgba(244, 234, 220, .24); }
.hero__stats > div { border-left-color: rgba(244, 234, 220, .24); }
@media (max-width: 860px) {
  .hero__content { bottom: var(--gutter); max-width: none; }
  :root:not([data-lang="en"]) .hero__title { font-size: clamp(30px, 8.6vw, 46px); }
}
@media (min-width: 861px) and (max-height: 780px) {
  /* short laptop screens: the stats step aside so the column never reaches the menu */
  .hero__stats { display: none; }
  .hero__content { bottom: clamp(28px, 6vh, 56px); }
  :root:not([data-lang="en"]) .hero__title { font-size: clamp(32px, 3.4vw, 52px); }
}

/* ---------- Soft seams between sections ----------
   Every section's edges fade into the page colour, so neighbours dissolve into each other
   instead of meeting at a hard line. The mask moves with the section, so pinned scenes
   only fade as they arrive and leave, never while they are held on screen. */
main section {
  --seam: clamp(140px, 28vh, 320px);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 var(--seam), #000 calc(100% - var(--seam)), transparent);
  mask-image: linear-gradient(180deg, transparent, #000 var(--seam), #000 calc(100% - var(--seam)), transparent);
}
/* the first section sits under the menu: keep its top, soften only its foot */
main > section:first-child {
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - var(--seam)), transparent);
  mask-image: linear-gradient(180deg, #000 calc(100% - var(--seam)), transparent);
}
@media (max-width: 860px) { main section { --seam: clamp(80px, 16vh, 160px); } }

/* ---------- Hero title: three lines, three acts ----------
   दगडातून   — carved: a chisel edge uncovers grey stone letters (dust flies, js/main.js), then they warm to ivory
   स्वराज्य घडवणारा — forged: the words arrive white-hot and cool through orange and gold
   राजा      — crowned: the word lands like a royal seal, flashes, then keeps a slow gold sheen and a king's fire */
.hero__title .ln > span { transform: none !important; transition: none;
  -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 55%); mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  -webkit-mask-size: 260% 100%; mask-size: 260% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0; mask-position: 100% 0; }
.is-ready .hero__title .ln:nth-child(1) > span { animation: t-chisel 1.5s cubic-bezier(.55, 0, .35, 1) 1.2s both, t-stone 1.4s ease 2.7s both; }
.is-ready .hero__title .ln:nth-child(2) > span { animation: t-chisel 1.1s cubic-bezier(.5, 0, .3, 1) 2.3s both, t-forge 2.4s ease-out 2.3s both; }
.hero__title .ln:nth-child(3) { overflow: visible; }
.hero__title .ln:nth-child(3) > span { -webkit-mask-image: none; mask-image: none; }
@keyframes t-chisel { to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
@keyframes t-stone {
  from { color: #9a9184; text-shadow: 0 1px 0 rgba(255, 240, 220, .35), 0 -1px 0 rgba(0, 0, 0, .7), 0 3px 10px rgba(0, 0, 0, .5); }
  to { color: var(--ink); text-shadow: 0 2px 30px rgba(0, 0, 0, .35); }
}
@keyframes t-forge {
  0% { color: #fff3d6; text-shadow: 0 0 10px #ffb060, 0 0 30px #ff6a1a, 0 0 70px #ff3a0a; }
  35% { color: #ff9a3a; text-shadow: 0 0 8px #ff6a1a, 0 0 30px rgba(255, 80, 20, .7); }
  70% { color: #e6b45c; text-shadow: 0 0 16px rgba(255, 120, 40, .35); }
  100% { color: var(--ink); text-shadow: 0 2px 30px rgba(0, 0, 0, .35); }
}

/* राजा: big, gold, and the last word to arrive */
.hero__title [data-l="mr"] em {
  display: inline-block; position: relative; font-size: 1.75em; line-height: 1; font-weight: var(--display-weight, 700);
  color: transparent; text-shadow: none;
  background: linear-gradient(100deg, #e0661a 0%, #ff9a3a 30%, #ffe2a0 46%, #fff6dc 50%, #ffe2a0 54%, #ff9a3a 70%, #e0661a 100%);
  background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text;
}
.hero__title .ln:nth-child(3) em { display: inline-block; position: relative; opacity: 0; transform-origin: 30% 60%; }
.is-ready .hero__title .ln:nth-child(3) em {
  animation: raja-in 1.3s cubic-bezier(.2, .9, .2, 1) 3.2s both, raja-breathe 4.2s ease-in-out 4.6s infinite, raja-shine 6s ease-in-out 4.8s infinite;
}
.hero__title .ln:nth-child(3) em::after {          /* the flash as the seal lands */
  content: ''; position: absolute; inset: -40% -25%; pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, rgba(255, 226, 160, .55), rgba(255, 140, 40, .18) 55%, transparent);
  mix-blend-mode: screen;
}
.is-ready .hero__title .ln:nth-child(3) em::after { animation: raja-flash 1.1s ease-out 3.75s both; }
@keyframes raja-in {
  0% { opacity: 0; transform: scale(1.55) translateY(-6%); filter: blur(18px) brightness(2.2); }
  55% { opacity: 1; transform: scale(.97); filter: blur(0) brightness(1.5) drop-shadow(0 0 50px rgba(255, 150, 50, .9)); }
  78% { transform: scale(1.012); }
  100% { opacity: 1; transform: none; filter: drop-shadow(0 0 28px rgba(255, 130, 40, .45)); }
}
@keyframes raja-flash { 0% { opacity: 0; transform: scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes raja-breathe {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 28px rgba(255, 130, 40, .45)); }
  50% { opacity: 1; filter: drop-shadow(0 0 46px rgba(255, 140, 40, .72)); }
}
@keyframes raja-shine { 0% { background-position: 100% 0; } 45%, 100% { background-position: 0 0; } }

@media (prefers-reduced-motion: reduce) {
  .hero__title .ln > span { -webkit-mask-image: none; mask-image: none; animation: none !important; }
  .hero__title .ln:nth-child(3) em { opacity: 1; animation: none !important; background-position: 50% 0; filter: drop-shadow(0 0 28px rgba(255, 130, 40, .45)); }
  .hero__title .ln:nth-child(3) em::after { display: none; }
}

/* ---------- Prologue: letterboxed, one line at a time, over a flight into the fog ---------- */
.prologue { height: 620vh; }
.prologue .pin__sticky { isolation: isolate; background: var(--bg); display: grid; place-items: center; }
.prologue .pin__sticky::before {                    /* a quiet pool of shade behind the words */
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 46% at 50% 52%, rgba(6, 5, 9, .62), transparent 72%), linear-gradient(0deg, rgba(6, 5, 9, .5), transparent 35%);
}
.prologue__bars i { position: absolute; left: 0; right: 0; height: 10vh; background: #000; z-index: 3; transform: scaleY(var(--bars, 0)); }
.prologue__bars i:first-child { top: 0; transform-origin: top; }
.prologue__bars i:last-child { bottom: 0; transform-origin: bottom; }
.beat {
  position: absolute; left: var(--gutter); right: var(--gutter); top: 50%; translate: 0 -50%;
  max-width: 980px; margin: 0 auto; text-align: center; pointer-events: none;
  opacity: var(--a, 0); filter: blur(calc(var(--in, 1) * 14px));
  transform: translateY(calc(var(--in, 1) * 24px)) scale(calc(1 + var(--in, 1) * .04));
}
.beat__when { font: 500 12px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--saffron); }
.beat__when [lang="mr"] { font-size: 17px; letter-spacing: 0; }
.beat__line { margin-top: 22px; font-family: var(--display); font-weight: var(--display-weight, 700); font-size: clamp(30px, 4.2vw, 64px); line-height: 1.25; color: var(--ink); text-wrap: balance; text-shadow: 0 2px 30px rgba(0, 0, 0, .6); }
.beat--last .beat__line { font-size: clamp(36px, 5.4vw, 84px); }
.beat__line em { font-style: normal; color: var(--gold); }
.prologue__cue { position: absolute; bottom: 12vh; left: 50%; translate: -50% 0; z-index: 4; opacity: var(--cue, 1); display: grid; justify-items: center; gap: 10px; font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.prologue__cue::after { content: ''; width: 1px; height: 46px; background: linear-gradient(var(--saffron), transparent); animation: cue 2.2s var(--ease) infinite; transform-origin: top; }
.prologue__cue [lang="mr"] { font-size: 15px; letter-spacing: 0; }

/* ---------- The four chapters, as acts ---------- */
.acts { padding: 120px var(--gutter) 160px; }
.acts__title { margin-top: 14px; }
.acts__grid { margin-top: 56px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.act {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 340px; padding: 26px 24px;
  border-radius: 14px; overflow: hidden; isolation: isolate; color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .01)); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .6s var(--ease), box-shadow .6s;
}
.act::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: .55; transition: opacity .6s, transform 1.2s var(--ease); background: var(--act-bg); }
.act--killa { --act-bg: radial-gradient(120% 80% at 70% 100%, rgba(255, 140, 60, .35), transparent 60%), linear-gradient(180deg, #1c1218, #2a1a18); }
.act--chronicles { --act-bg: radial-gradient(120% 80% at 30% 100%, rgba(120, 150, 210, .3), transparent 60%), linear-gradient(180deg, #0c1020, #1a1a28); }
.act--armory { --act-bg: radial-gradient(120% 80% at 50% 100%, rgba(255, 80, 30, .4), transparent 60%), linear-gradient(180deg, #160a08, #261010); }
.act--legacy { --act-bg: radial-gradient(120% 80% at 50% 100%, rgba(255, 200, 110, .35), transparent 60%), linear-gradient(180deg, #1c1420, #2a2018); }
.act__num { font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--saffron); }
.act__num [lang="mr"] { font-size: 15px; letter-spacing: 0; }
.act__mr { margin-top: auto; font-family: var(--display); font-weight: var(--display-weight, 700); font-size: clamp(40px, 3.6vw, 60px); line-height: 1.15; color: var(--gold); }
.act__en { font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.act__go { position: absolute; right: 22px; top: 22px; font-size: 20px; color: var(--dim); transition: transform .5s var(--ease), color .5s; }
@media (hover: hover) {
  .act:hover { transform: translateY(-6px); box-shadow: inset 0 0 0 1px rgba(255, 138, 42, .5), 0 30px 60px -30px rgba(255, 110, 30, .45); }
  .act:hover::before { opacity: 1; transform: scale(1.06); }
  .act:hover .act__go { transform: translateX(4px); color: var(--saffron); }
}
.act:focus-visible { outline: 2px solid var(--saffron); outline-offset: 3px; }
@media (max-width: 1000px) { .acts__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .acts__grid { grid-template-columns: 1fr; } .act { min-height: 200px; } }
@media (prefers-reduced-motion: reduce) { .beat { filter: none; transform: none; } }

/* ---------- One film grade for every page: still grain + soft vignette (no motion) ---------- */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 40; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 50%, transparent 58%, rgba(4, 2, 4, .45) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Progress line + skip scene (js/progress.js) ---------- */
.hud__rail { position: fixed; z-index: 45; right: 18px; top: 30vh; height: 40vh; width: 2px; border-radius: 2px; background: rgba(244, 234, 220, .1); pointer-events: none; }
.hud__fill { position: absolute; inset: 0; border-radius: 2px; background: linear-gradient(180deg, var(--gold), var(--saffron)); transform-origin: top; transform: scaleY(0); box-shadow: 0 0 10px rgba(255, 138, 42, .5); }
.hud__ticks i { position: absolute; right: -3px; width: 8px; height: 1px; background: rgba(244, 234, 220, .45); }
.hud__label { position: absolute; right: 16px; top: 50%; translate: 0 -50%; white-space: nowrap; padding: 6px 12px; border-radius: 999px;
  font: 500 12px/1 var(--sans); color: var(--ink); background: rgba(14, 9, 12, .72); backdrop-filter: blur(8px);
  opacity: 0; transform: translateX(8px); transition: opacity .5s, transform .5s var(--ease); }
.hud__label:lang(mr), .hud__label { font-family: var(--sans), var(--deva); }
.hud.is-named .hud__label { opacity: 1; transform: none; }
.hud__skip { position: fixed; z-index: 45; right: var(--gutter); bottom: 26px; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px;
  border-radius: 999px; border: 1px solid rgba(244, 234, 220, .25); background: rgba(14, 9, 12, .6); backdrop-filter: blur(8px);
  color: var(--ink); font: 500 13px/1 var(--sans); cursor: pointer; transition: border-color .3s, background .3s, opacity .4s; }
.hud__skip [data-l="mr"] { font-family: var(--deva); font-size: 14px; }
.hud__skip:hover { border-color: var(--saffron); background: rgba(40, 20, 12, .8); }
.hud__skip:focus-visible { outline: 2px solid var(--saffron); outline-offset: 3px; }
.hud__skip[hidden] { display: none; }
.hud::after { content: ''; position: fixed; inset: 0; z-index: 46; background: #000; opacity: 0; pointer-events: none; }
.hud.is-cutting::after { animation: hud-cut .62s ease-in-out both; }
@keyframes hud-cut { 0% { opacity: 0; } 40%, 55% { opacity: 1; } 100% { opacity: 0; } }
@media (max-width: 860px) { .hud__rail { display: none; } .hud__skip { right: 16px; bottom: 16px; height: 36px; padding: 0 14px; font-size: 12px; } }

/* ---------- Rocks under the last section of each page (js/rocks3d.js) ---------- */
.has-rocks { position: relative; isolation: isolate; }
.rocks-gl { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 72%; z-index: -1; pointer-events: none; display: block;
  -webkit-mask-image: linear-gradient(0deg, #000 55%, transparent); mask-image: linear-gradient(0deg, #000 55%, transparent); }
@media (max-width: 860px) { .rocks-gl { height: 48%; } }

/* ---------- Home: one landscape from top to bottom (js/vista3d.js, journey) ---------- */
body.has-journey { background: transparent; }   /* html keeps the page colour; the landscape sits between them */
.vista-gl.vista-gl--page { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; display: block; }
.has-journey .scrim {   /* keep the text side dark; let the land run on below the hero */
  background: linear-gradient(90deg, rgba(11, 7, 9, .86) 0%, rgba(11, 7, 9, .55) 30%, rgba(11, 7, 9, 0) 56%), linear-gradient(0deg, rgba(11, 7, 9, .35) 0%, rgba(11, 7, 9, 0) 22%);
}
.has-journey .prologue .pin__sticky { background: transparent; }
/* the last scene is exactly one screen: the page comes to rest with the cards centred over the mountain's foot */
.has-journey #acts { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-top: 96px; padding-bottom: 72px; }
.has-journey .act { background: rgba(12, 8, 10, .42); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
