/* =====================================================================
   MALHAR 2026 - shared site chrome + theme
   Loaded by every STATIC page (hero + about/conclave/workforce/contact).
   The /experience game page does NOT use this - it has its own in-game UI.
   Plain CSS, served from static/ so all pages share one cached copy.
   ===================================================================== */

@font-face {
  font-family: 'Roller Coaster';
  src: url(/fonts/roller-coaster.woff2) format('woff2');
  font-display: swap;
}

:root {
  --ink: #060407;
  --ink-2: #0e0a12;
  --paper: #f4ead8;
  --paper-dim: rgba(244, 234, 216, 0.62);
  --paper-mute: rgba(244, 234, 216, 0.38);
  --gold-hi: #f7e3ab;
  --gold: #d9a94e;
  --gold-deep: #8a5a1d;
  --gold-line: rgba(217, 169, 78, 0.38);
  --gold-glow: rgba(217, 169, 78, 0.22);
  --pink: #f405f9;
  --header-h: clamp(72px, 7vw, 88px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

::selection {
  background: var(--pink);
  color: #fff;
}

html {
  scroll-behavior: smooth;
}

body {
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(217, 169, 78, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse 90% 80% at 50% 45%, #0e0a12 0%, var(--ink) 100%);
  background-color: var(--ink);
  color: var(--paper);
  font-family: 'Montserrat', sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#gl {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  display: block;
}

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

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

/* ── Header (shared) ───────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 44px);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* On the immersive hero the header floats fully transparent until scroll/hover */
.site-header.is-overlay {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 0;
  /* JS reveals after intro animation completes */
}

@keyframes chromeFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: clamp(12px, 1.5vw, 16px);
  font-family: 'Roller Coaster', 'Cinzel Decorative', serif;
  font-size: clamp(1.7rem, 2.6vw, 2.3rem);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--gold-hi);
}

.brand span {
  display: inline-block;
  line-height: 1;
  padding-top: 0.25em;
}

.brand img {
  width: clamp(38px, 4.5vw, 52px);
  height: clamp(38px, 4.5vw, 52px);
  object-fit: contain;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
}

.nav a {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-dim);
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
  transition: color 200ms ease, border-color 200ms ease;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--gold-hi);
  border-bottom-color: var(--gold-line);
}

.nav .nav-cta {
  color: #140b02;
  background: linear-gradient(178deg, var(--gold-hi) 0%, var(--gold) 55%, var(--gold-deep) 130%);
  border: 1px solid var(--gold-hi);
  border-radius: 2px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--gold-hi);
}

.nav .nav-cta:hover {
  color: #140b02;
  box-shadow: 0 0 30px var(--gold-glow);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  background: none;
  border: 0;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--gold-hi);
  border-radius: 2px;
  transition: transform 200ms ease, opacity 200ms ease;
}

@media (max-width: 760px) {
  .nav-toggle {
    display: flex;
    margin-right: 12px;
  }

  .nav {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: rgba(6, 4, 7, 0.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: none;
    transform: translateX(100%);
    transition: transform 300ms ease;
    z-index: 20;
  }

  .nav a {
    width: auto;
    text-align: center;
    padding: 10px;
    font-size: 1.4rem;
    font-family: 'Cinzel', serif;
  }

  .site-header.nav-open .nav {
    transform: translateX(0);
  }

  .nav .nav-cta {
    width: auto;
    margin: 16px auto 0;
    font-size: 1.2rem;
  }
}

/* ── Content-page shell ────────────────────────────────────────────── */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page main {
  flex: 1 0 auto;
  padding-top: var(--header-h);
}

.page-hero {
  position: relative;
  padding: clamp(60px, 8vh, 90px) clamp(20px, 6vw, 60px) clamp(20px, 5vh, 60px);
  text-align: center;
  background: transparent;
  border-bottom: 1px solid var(--gold-line);
}

.page-hero .eyebrow {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: clamp(0.7rem, 1.6vw, 0.9rem);
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  text-transform: uppercase;
  color: var(--gold);
}

.page-hero h1 {
  margin-top: 24px;
  margin-bottom: 0;
  padding-top: 10px;
  padding-bottom: 10px;
  line-height: 1.1;
  font-family: 'Roller Coaster', 'Cinzel Decorative', serif;
  font-weight: normal;
  font-size: clamp(2.6rem, 8vw, 5.2rem);
  letter-spacing: 0.02em;
  background: linear-gradient(178deg, var(--gold-hi) 8%, var(--gold) 46%, var(--gold-deep) 82%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.page-hero .lede {
  max-width: 620px;
  margin: 10px auto 0;
  color: var(--paper-dim);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  line-height: 1.7;
}

.section {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(40px, 8vh, 80px) clamp(20px, 6vw, 40px);
}

.section h2 {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: clamp(1.4rem, 3.4vw, 2rem);
  color: var(--gold-hi);
  margin-bottom: 18px;
}

.section p {
  color: var(--paper-dim);
  line-height: 1.8;
  margin-bottom: 16px;
  max-width: 70ch;
}

.section a.inline {
  color: var(--gold);
  border-bottom: 1px solid var(--gold-line);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-top: 28px;
}

/* About page: "What is Malhar?" + Iridescence split. minmax(0,…) instead of a
   fixed 300px min so the two columns never overflow narrow screens; stacks to
   one column on mobile. */
.about-split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

@media (max-width: 720px) {
  .about-split {
    grid-template-columns: 1fr;
  }
}

.card {
  padding: 24px;
  background: rgba(244, 234, 216, 0.03);
  border: 1px solid var(--gold-line);
  border-radius: 4px;
}

.card h3 {
  font-family: 'Cinzel', serif;
  color: var(--gold-hi);
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.card p {
  font-size: 0.9rem;
  margin-bottom: 0;
  color: var(--paper-dim);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 40px;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  text-transform: uppercase;
  color: #140b02;
  background: linear-gradient(178deg, var(--gold-hi) 0%, var(--gold) 55%, var(--gold-deep) 130%);
  border: 1px solid var(--gold-hi);
  border-radius: 2px;
  transition: box-shadow 200ms ease, transform 200ms ease;
  cursor: pointer;
}

.btn:hover {
  box-shadow: 0 0 40px var(--gold-glow);
  transform: translateY(-1px);
}

/* ── Index-styled Interactive Components ───────────────────────────── */
.search-container {
  max-width: 600px;
  margin: 30px auto 10px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 16px 24px 16px 52px;
  background: rgba(244, 234, 216, 0.03);
  border: 1px solid var(--gold-line);
  border-radius: 4px;
  color: var(--paper);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.search-input:focus {
  border-color: var(--gold-hi);
  box-shadow: 0 0 25px var(--gold-glow);
  background: rgba(244, 234, 216, 0.06);
}

.search-input::placeholder {
  color: var(--paper-mute);
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  pointer-events: none;
  font-size: 1.1rem;
}

/* Pillar Tabs */
.pillar-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin: 30px 0 40px;
}

.pillar-tab {
  flex: 1 1 200px;
  max-width: 260px;
  padding: 20px 24px;
  background: rgba(244, 234, 216, 0.03);
  border: 1px solid var(--gold-line);
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: all 200ms ease;
}

.pillar-tab:hover {
  background: rgba(244, 234, 216, 0.06);
  border-color: var(--gold-hi);
}

.pillar-tab.active {
  background: rgba(244, 234, 216, 0.08);
  border-color: var(--gold-hi);
  box-shadow: 0 0 20px var(--gold-glow);
}

.pillar-tab h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  color: var(--paper);
  margin-bottom: 6px;
}

.pillar-tab.active h3 {
  color: var(--gold-hi);
}

.pillar-tab .pillar-meta {
  font-size: 0.75rem;
  color: var(--paper-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Sub-Department Switcher */
.subdept-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 40px;
  padding: 10px;
  background: rgba(244, 234, 216, 0.03);
  border: 1px solid var(--gold-line);
  border-radius: 4px;
}

.subdept-btn {
  padding: 8px 18px;
  border-radius: 2px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--paper-dim);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 200ms ease;
  white-space: nowrap;
}

.subdept-btn:hover {
  color: var(--gold-hi);
}

.subdept-btn.active {
  background: linear-gradient(178deg, var(--gold-hi) 0%, var(--gold) 55%, var(--gold-deep) 130%);
  color: #140b02;
  font-weight: 700;
}

/* Department Showcase Panel */
.dept-showcase {
  display: grid;
  grid-template-columns: minmax(300px, 42%) 1fr;
  gap: 40px;
  align-items: start;
  background: rgba(244, 234, 216, 0.03);
  border: 1px solid var(--gold-line);
  border-radius: 4px;
  padding: clamp(24px, 4vw, 44px);
  margin-bottom: 60px;
}

@media (max-width: 860px) {
  .dept-showcase {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

.dept-image-wrap {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--gold-line);
  background: var(--ink-2);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.dept-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.dept-info h2 {
  font-family: 'Roller Coaster', 'Cinzel Decorative', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--gold-hi);
  margin-bottom: 14px;
  line-height: 1.1;
}

.dept-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.badge {
  padding: 5px 12px;
  border-radius: 2px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(217, 169, 78, 0.1);
  color: var(--gold-hi);
  border: 1px solid var(--gold-line);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dept-desc {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--paper-dim);
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gold-line);
}

.roster-title {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  color: var(--gold-hi);
  margin-bottom: 16px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.roster-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.member-pill {
  padding: 8px 14px;
  border-radius: 2px;
  font-size: 0.82rem;
  background: rgba(244, 234, 216, 0.03);
  border: 1px solid var(--gold-line);
  color: var(--paper-dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.member-pill.lead,
.member-pill.og,
.member-pill.coordi {
  background: rgba(217, 169, 78, 0.15);
  border-color: var(--gold-hi);
  color: var(--gold-hi);
  font-weight: 600;
}

/* Conclave & FAQ Index Styling */
.conclave-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.conclave-card {
  background: rgba(244, 234, 216, 0.03);
  border: 1px solid var(--gold-line);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.conclave-img-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--gold-line);
}

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

.conclave-content {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.conclave-content h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  color: var(--gold-hi);
  margin-bottom: 10px;
}

.conclave-content p {
  color: var(--paper-dim);
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.faq-list {
  max-width: 800px;
  margin: 30px auto 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: rgba(244, 234, 216, 0.03);
  border: 1px solid var(--gold-line);
  border-radius: 4px;
  overflow: hidden;
}

.faq-item.open {
  border-color: var(--gold-hi);
  background: rgba(244, 234, 216, 0.06);
}

.faq-question {
  width: 100%;
  padding: 18px 22px;
  background: none;
  border: none;
  color: var(--paper);
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq-question:hover {
  color: var(--gold-hi);
}

.faq-icon {
  font-size: 1.4rem;
  color: var(--gold);
  transition: transform 200ms ease;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
  color: var(--gold-hi);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms ease, padding 300ms ease;
  padding: 0 22px;
  color: var(--paper-dim);
  font-size: 0.92rem;
  line-height: 1.7;
}

.faq-item.open .faq-answer {
  max-height: 300px;
  padding: 0 22px 20px;
}

/* ── Contact department cards ──────────────────────────────────────── */
.contact-dept-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-dept-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 28px;
  background: rgba(244, 234, 216, 0.03);
  border: 1px solid var(--gold-line);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-dept-card:hover {
  background: rgba(244, 234, 216, 0.07);
  border-color: var(--gold-hi);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(217, 169, 78, 0.08);
}

.contact-dept-role {
  color: var(--paper-dim);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: 'Cinzel', serif;
}

.contact-dept-email {
  color: var(--gold-hi);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  word-break: break-all;
  transition: color 0.2s ease;
}

.contact-dept-card:hover .contact-dept-email {
  color: #fff;
}

@media (max-width: 520px) {
  .contact-dept-card {
    padding: 16px 20px;
    gap: 4px;
  }

  .contact-dept-role {
    font-size: 0.78rem;
  }

  .contact-dept-email {
    font-size: 1rem;
  }
}

/* ── Fixed social sidebar (bottom-left) ────────────────────────────── */
.social-sidebar {
  position: fixed;
  bottom: 30px;
  left: 22px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0;
}

.social-sidebar a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: #fff;
  transition: color 0.25s ease, transform 0.25s ease;
}

.social-sidebar a:hover {
  color: var(--gold-hi);
  transform: scale(1.15);
}

@media (max-width: 760px) {
  .social-sidebar {
    display: none;
  }
}

/* ── Footer (shared) ───────────────────────────────────────────────── */
.site-footer {
  flex-shrink: 0;
  padding: 40px clamp(20px, 6vw, 60px);
  border-top: 1px solid var(--gold-line);
  background: var(--ink-2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.site-footer .foot-brand {
  font-family: 'Roller Coaster', 'Cinzel Decorative', serif;
  font-size: 1.3rem;
  color: var(--gold-hi);
}

.site-footer .foot-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.site-footer .foot-links a {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-dim);
  transition: color 200ms ease;
}

.site-footer .foot-links a:hover {
  color: var(--gold-hi);
}

.site-footer .copy {
  font-size: 0.72rem;
  color: var(--paper-mute);
  letter-spacing: 0.08em;
}

/* Minimal footer variant overlaid on the immersive hero */
.hero-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 16px;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-mute);
  pointer-events: none;
  animation: chromeFade 900ms ease 400ms both;
}

.hero-footer a {
  pointer-events: auto;
  color: var(--paper-dim);
}

.hero-footer a:hover {
  color: var(--gold-hi);
}

/* ── Staggered mobile menu (ReactBits <StaggeredMenu /> — vanilla port) ──
   Built in site.js from the existing nav links. Colored underlayers slide in,
   then the panel, then the large numbered items stagger up — all via CSS
   transition-delays (no gsap needed). Only active where the hamburger shows. */
.sm-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  visibility: hidden;
}

.sm-root.sm-open {
  visibility: visible;
}

.sm-prelayer,
.sm-panel {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  transform: translateX(100%);
  will-change: transform;
}

.sm-prelayer {
  z-index: 1;
  transition: transform 0.52s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sm-prelayer.p1 {
  background: var(--gold-deep);
}

.sm-prelayer.p2 {
  background: var(--gold);
}

.sm-panel {
  z-index: 3;
  background: var(--ink-2);
  padding: clamp(100px, 18vh, 140px) clamp(32px, 10vw, 60px) 40px;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  overflow-y: auto;
  transition: transform 0.56s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sm-root.sm-open .sm-prelayer,
.sm-root.sm-open .sm-panel {
  transform: translateX(0);
}

.sm-root.sm-open .sm-prelayer.p1 {
  transition-delay: 0s;
}

.sm-root.sm-open .sm-prelayer.p2 {
  transition-delay: 0.08s;
}

.sm-root.sm-open .sm-panel {
  transition-delay: 0.16s;
}

.sm-root:not(.sm-open) .sm-prelayer.p2 {
  transition-delay: 0.06s;
}

.sm-root:not(.sm-open) .sm-prelayer.p1 {
  transition-delay: 0.12s;
}

.sm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.sm-list li {
  overflow: hidden;
}

.sm-link {
  position: relative;
  display: inline-block;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: clamp(1.55rem, 8vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--paper);
  transition: color 0.25s ease;
}

.sm-link .sm-inner {
  display: inline-block;
  transform: translateY(130%) rotate(8deg);
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.6s ease;
}

.sm-root.sm-open .sm-link .sm-inner {
  transform: none;
  opacity: 1;
}

.sm-root.sm-open li:nth-child(1) .sm-inner {
  transition-delay: 0.22s;
}

.sm-root.sm-open li:nth-child(2) .sm-inner {
  transition-delay: 0.30s;
}

.sm-root.sm-open li:nth-child(3) .sm-inner {
  transition-delay: 0.38s;
}

.sm-root.sm-open li:nth-child(4) .sm-inner {
  transition-delay: 0.46s;
}

.sm-root.sm-open li:nth-child(5) .sm-inner {
  transition-delay: 0.54s;
}

.sm-root.sm-open li:nth-child(6) .sm-inner {
  transition-delay: 0.62s;
}

.sm-link:hover,
.sm-link:focus-visible {
  color: var(--gold-hi);
}

.sm-link::after {
  display: none;
}

.sm-socials {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin-top: auto;
  padding-top: 0.6rem;
}

.sm-socials a {
  color: var(--paper-dim);
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
}

.sm-socials a:hover {
  color: var(--gold-hi);
}

/* hamburger → X morph (reuses the existing .nav-toggle 3 bars) */
.nav-toggle span {
  transition: transform 260ms ease, opacity 200ms ease;
}

.nav-toggle.is-x span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-x span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0.2);
}

.nav-toggle.is-x span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* lift the whole header (logo + X toggle) above the open panel */
.site-header.menu-open {
  z-index: 62;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* hide the logo when the mobile menu is open */
.site-header.menu-open .brand {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* the staggered menu replaces the old slide-down; only used where the
   hamburger is visible (<= 760px). Hide the whole apparatus on desktop. */
@media (min-width: 761px) {
  .sm-root {
    display: none;
  }
}

/* ── Desktop header — PillNav (ReactBits <PillNav /> — vanilla port) ─────
   The nav becomes a pill bar; each link is a pill whose gilded "hover circle"
   grows up from the pill's bottom on hover / active, flipping the text to ink.
   Themed to the Malhar palette. Desktop only (mobile uses the staggered menu). */
@media (min-width: 761px) {
  .site-header .nav {
    gap: 3px;
    padding: 4px;
    background: rgba(6, 4, 7, 0.5);
    border: 1px solid var(--gold-line);
    border-radius: 9999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .site-header.is-overlay .nav {
    background: rgba(6, 4, 7, 0.34);
  }

  .site-header .nav a {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    padding: 9px 20px;
    border-radius: 9999px;
    border: 1px solid transparent;
    color: var(--gold-hi);
    transition: color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  }

  .site-header .nav a::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    /* Center the 200px circle exactly at the top-center of the nav link (0, 0).
       This makes it bloom downwards from top to bottom while extending 100px left/right
       at y=0, guaranteeing 100% full coverage with zero black corners! */
    width: 200px;
    height: 200px;
    margin-left: -100px;
    margin-top: -100px;
    border-radius: 50%;
    background: linear-gradient(178deg, var(--gold-hi) 0%, var(--gold) 55%, var(--gold-deep) 130%);
    transform: scale(0);
    transform-origin: center center;
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: -1;
  }

  .site-header .nav a:hover,
  .site-header .nav a[aria-current="page"] {
    color: #140b02;
    border-color: var(--gold-hi);
    box-shadow: 0 0 18px var(--gold-glow);
  }

  .site-header .nav a:hover::before,
  .site-header .nav a[aria-current="page"]::before {
    transform: scale(1);
  }

  .site-header .nav a:hover {
    box-shadow: 0 0 32px var(--gold-glow);
  }

  /* "Enter World" stays a permanently-filled gilded pill */
  .site-header .nav .nav-cta {
    color: #140b02;
    border-radius: 9999px;
    border: 1px solid var(--gold-hi);
    margin-left: 3px;
    box-shadow: 0 0 18px var(--gold-glow);
  }

  .site-header .nav .nav-cta::before {
    display: none;
  }

  .site-header .nav .nav-cta:hover {
    box-shadow: 0 0 32px var(--gold-glow);
  }

  /* logo spins on hover (PillNav logo behaviour) */
  .brand img {
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .brand:hover img {
    transform: rotate(360deg);
  }
}