/* ── Site Header ────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1100;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: var(--s5);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo__mark {
  height: 36px;
  width: auto;
}
.site-logo__text {
  font-family: var(--font-mono);
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--heading);
  letter-spacing: -0.02em;
}
.site-logo:hover {
  text-decoration: none;
}
.site-logo:hover .site-logo__text {
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: var(--s6);
  list-style: none;
  align-items: center;
}

.site-nav a {
  font-family: var(--font-mono);
  font-size: var(--fs-md);
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.15s;
}
.site-nav a:hover {
  color: var(--text);
}
.site-nav a.active {
  color: var(--text);
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 1px;
}

.nav-lang-item {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  padding: 3px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  margin-left: var(--s3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}
.lang-btn {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
  cursor: pointer;
}
a.lang-btn:hover {
  color: var(--text);
}
span.lang-btn.active {
  color: var(--accent);
  font-weight: bold;
  cursor: default;
}
.lang-sep {
  color: var(--border);
  user-select: none;
}

/* ── Nav Dropdowns ──────────────────────────────────────────── */
.site-nav li.has-dropdown { position: relative; }

.site-nav li.has-dropdown > a::after {
  content: ' ▾';
  font-size: 0.65em;
  opacity: 0.45;
  vertical-align: middle;
  margin-left: 1px;
}

.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  list-style: none;
  padding: 10px 0 var(--s2);
  min-width: 210px;
  z-index: 300;
  white-space: nowrap;
}

.site-nav li.has-dropdown:hover .nav-dropdown,
.site-nav li.has-dropdown:focus-within .nav-dropdown,
.site-nav li.has-dropdown.open .nav-dropdown {
  display: block;
}

.nav-dropdown li a {
  display: block;
  padding: var(--s3) var(--s5);
  font-size: var(--fs-sm);
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: none !important;
  transition: color 0.15s, background 0.15s;
}

.nav-dropdown li a:hover {
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.07);
}

.nav-dropdown__divider {
  height: 1px;
  background: var(--border);
  margin: var(--s1) 0;
  pointer-events: none;
}

/* Mobile nav: group labels and indented sub-items */
.mobile-nav__group-label {
  display: block;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: var(--s4) 0 var(--s1);
  font-family: var(--font-mono);
}

.mobile-nav__list li.mobile-nav__sub {
  padding-left: var(--s5);
}

.mobile-nav__sub a {
  padding: var(--s3) 0;
  font-size: var(--fs-sm);
}

/* Live station widget in header */
.station-live {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--s2);
  white-space: nowrap;
}
.station-live__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}
.station-live__dot.offline {
  background: var(--red);
  animation: none;
}
/* Nav live-data pill — links to /data/, shows station status dot */
.nav-data-pill {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid var(--border);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-data-pill:hover {
  color: var(--accent);
  border-color: var(--accent);
}


@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* ── Hero / Mission ─────────────────────────────────────── */
/* Dot-grid: 24px repeating SVG dots — instrument graph-paper feel */
.hero {
  /* Grid-aligned (96/64px), no vh — the old min-height:64vh created dead space. */
  padding: var(--s9) 0 var(--s8);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  /* Translucent panel → a gentle tonal step over the body's --bg sections, so the
     hero reads as a distinct banner without the bright-slab heaviness. Glows pulled
     back since they read hotter on the darker panel. */
  background-color: var(--hero-panel);
  background-image:
    radial-gradient(ellipse 50% 55% at 95% 5%, rgba(var(--accent-rgb),0.12) 0%, transparent 65%),
    radial-gradient(ellipse 30% 40% at 10% 90%, rgba(var(--amber-rgb),0.07) 0%, transparent 60%),
    url("/static/img/nepal-outline.svg"),
    url("data:image/svg+xml,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='1' cy='1' r='0.8' fill='%231d2438'/%3E%3C/svg%3E");
  background-size: auto, auto, 65% auto, auto;
  background-position: center, center, right 0% center, center;
  background-repeat: no-repeat, no-repeat, no-repeat, repeat;
  overflow: hidden;
}
/* Ensure the container doesn't stretch across the flex hero */
.hero > .container {
  width: 100%;
}
/* Left-edge accent rule — brand blue → amber, the banner's signature motif */
.hero::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 4px;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--accent) 25%,
    var(--amber) 75%,
    transparent 100%);
  opacity: 0.85;
}
.hero__mission {
  font-family: var(--font-sans);
  font-size: clamp(1.0625rem, 1.8vw, 1.2rem);
  font-weight: 400;
  line-height: var(--lh-body);
  max-width: 38em;
  color: var(--text);
  margin-top: var(--s4);
}
.hero__mission em {
  color: var(--accent-bright);
  font-style: normal;
}
.hero__sub {
  margin-top: var(--s4);
  /* Second tier under the title: larger than body, light weight, brighter than
     the old muted so the page's opening line is easy to land on. */
  font-size: var(--fs-2xl);
  font-weight: 400;
  line-height: var(--lh-body);
  color: var(--text-soft);
  max-width: 560px;
}

/* ── Inner-page hero (lighter variant for About, Research, etc.) ─── */
.page-hero {
  /* Grid-aligned 56→80px — deliberately taller than body sections (48→72) so the
     banner reads larger; lifted surface panel for the tonal step to the body. */
  padding: clamp(3.5rem, 7vw, 5rem) 0;
  position: relative;
  /* Translucent panel (was solid --surface-2) — a gentle tonal step over the body
     rather than a bright lifted slab; glow pulled back for the darker panel. */
  background-color: var(--hero-panel);
  background-image:
    radial-gradient(ellipse 40% 60% at 90% 10%, rgba(var(--accent-rgb),0.10) 0%, transparent 65%),
    url("data:image/svg+xml,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='1' cy='1' r='0.8' fill='%231d2438'/%3E%3C/svg%3E");
  overflow: hidden;
}
/* Nepal map outline — add to contextually relevant heroes only */
.page-hero--map {
  background-image:
    radial-gradient(ellipse 40% 60% at 90% 10%, rgba(var(--accent-rgb),0.10) 0%, transparent 65%),
    url("/static/img/nepal-outline.svg"),
    url("data:image/svg+xml,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='1' cy='1' r='0.8' fill='%231d2438'/%3E%3C/svg%3E");
  background-size: auto, 60% auto, auto;
  background-position: center, right 2% center, center;
  background-repeat: no-repeat, no-repeat, repeat;
}
/* Same left-edge rule as homepage hero */
.page-hero::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 4px;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--accent) 30%,
    var(--amber) 80%,
    transparent 100%);
  opacity: 0.8;
}
.page-hero .section__label {
  margin-bottom: var(--s4);
}
.page-hero h1 {
  font-family: var(--font-mono);
  /* Larger, editorial banner title. */
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0;
  /* Brand-colour title: blue→amber gradient fill, tying to the left-edge motif.
     Fallback colour for engines without background-clip:text. */
  color: var(--accent-bright);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .page-hero h1 {
    background: linear-gradient(100deg, var(--accent-bright) 0%, var(--amber-bright) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}
.page-hero .hero__sub {
  margin-top: var(--s3);
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  font-weight: 400;
  line-height: var(--lh-body);
  color: var(--text-soft);
  max-width: 40em;
}

/* ── Cards ──────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s5);
  margin-top: var(--s5);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s5);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card:hover {
  border-color: rgba(var(--accent-rgb),0.35);
  background: var(--grad-card-hover);
  box-shadow: var(--glow-accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.card__label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  /* Accent-coloured category eyebrow — gives card grids a visible signal beyond
     the repeated title+blurb. */
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--s3);
}
.card__title {
  color: var(--heading);
  font-family: var(--font-sans);
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: var(--lh-title);
  letter-spacing: -0.01em;
  margin-bottom: var(--s3);
}
.card__body {
  font-size: var(--fs-base);
  color: var(--text-soft);
  line-height: var(--lh-body);
}

/* Status badges */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-top: var(--s3);
}
.badge--active {
  background: var(--green-dim);
  color: var(--green);
}
.badge--building {
  background: var(--accent-dim);
  color: var(--accent);
}
.badge--testing {
  background: var(--accent-dim);
  color: var(--amber);
  border: 1px solid var(--amber);
}
.badge--planned {
  background: var(--surface-2);
  color: var(--text-muted);
}

/* ── Live Data Widget ───────────────────────────────────── */
.data-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s5) var(--s6);
  margin: var(--s6) 0;
}
.data-widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s5);
  flex-wrap: wrap;
  gap: var(--s3);
}
.data-widget__title {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.data-widget__readings {
  display: flex;
  gap: var(--s6);
  flex-wrap: wrap;
}
.reading {
  display: flex;
  flex-direction: column;
}
.reading__value {
  font-family: var(--font-mono);
  font-size: var(--fs-4xl);
  font-weight: 500;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
  line-height: var(--lh-data);
}
.reading__unit {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--accent);
  margin-left: 2px;
}
.reading__label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: var(--s2);
}

/* ── Chart container ────────────────────────────────────── */
.chart-wrap {
  position: relative;
  height: 200px;
  margin: var(--s5) 0;
}

/* ── Lab Notes ──────────────────────────────────────────── */
.note-list {
  margin-top: var(--s5);
  list-style: none;
  padding-left: 0;
}
.note-item {
  border-top: 1px solid var(--border);
  padding: var(--s5) 0;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--s5);
}
.note-item__meta {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.note-item__date {
  color: var(--text-dim);
}
.note-item__type {
  margin-top: var(--s2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: var(--fs-xs);
}
.note-item__title {
  color: var(--heading);
  font-family: var(--font-sans);
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: var(--lh-title);
  letter-spacing: -0.01em;
  margin-bottom: var(--s2);
}
.note-item__summary {
  color: var(--text-soft);
  font-size: var(--fs-base);
}
a.note-item {
  transition: background 0.18s ease, box-shadow 0.18s ease;
}
a.note-item:hover {
  background: rgba(var(--accent-rgb), 0.05);
  border-radius: var(--radius-sm);
  /* left accent bar via inset shadow — no layout shift on the grid */
  box-shadow: inset 3px 0 0 var(--accent);
}
a.note-item:hover .note-item__title {
  color: var(--accent-bright);
}

/* ── Page sections ──────────────────────────────────────── */
.section {
  /* Grid-aligned section rhythm: 44px → 64px — a deliberate middle ground.
     The fully-tight 36→56 lost the section-separation signal; this gives
     sections room to read as distinct while staying on the 8px grid. */
  padding: clamp(2.75rem, 5vw, 4rem) 0;
}
/* First content section directly under a page hero: the hero is now a lifted
   surface panel, so a normal section top padding sits fine against it. Keep a
   slightly reduced top to avoid an over-large gap. */
.page-hero + .container > section.section:first-of-type {
  padding-top: var(--s6);
}

/* Alternating full-bleed band — paints a tinted band behind a section that lives
   inside .container, via a 100vw pseudo (html has overflow-x:hidden, so no
   horizontal scroll). Lets sections alternate plain/banded without restructuring
   the DOM. Applied to alternating body sections in templates. */
.section--band {
  position: relative;
  z-index: 0;
}
.section--band::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  z-index: -1;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section__label {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-mono);
  font-size: var(--fs-md);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--accent);
  /* This label is an <h2>; cancel the generic prose-heading top margin
     (var(--s7)) so its spacing comes from its section's padding, not a
     stacked margin. Was the main source of the hero/section "void". */
  margin-top: 0;
  margin-bottom: var(--s5);
  padding: 4px 14px 4px var(--s4);
  border-left: 4px solid var(--accent);
  background: linear-gradient(90deg, rgba(var(--accent-rgb),0.12) 0%, transparent 82%);
}
/* Auto-numbered section index (01, 02, …) — a bigger, varied accent that gives
   the body a sense of progression. Excluded from page-hero eyebrows below. */
.section__label::before {
  counter-increment: hics-sec;
  content: counter(hics-sec, decimal-leading-zero);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--amber);
  letter-spacing: 0;
}
.page-hero .section__label::before {
  content: none;
  counter-increment: none;
}

/* ── Site Footer ────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--s8) 0 var(--s5);
  margin-top: var(--s9);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.site-footer a {
  color: var(--text-muted);
  transition: color 0.15s;
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--accent);
}
.site-footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--s7);
  align-items: start;
}
.site-footer__logo {
  display: block;
  margin-bottom: var(--s2);
  opacity: 0.9;
  max-width: 260px;
}
.site-footer__tagline {
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: var(--s3);
  font-style: italic;
}
.site-footer__coords {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.site-footer__nav-col {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}
.site-footer__nav-heading {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--s2);
}
.site-footer__nav-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s2) var(--s6);
}
.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--s6);
  padding-top: var(--s4);
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.lang-switcher {
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.lang-link {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
  padding: 2px var(--s2);
  border-radius: var(--radius);
}
.lang-link:hover {
  color: var(--text);
}
.lang-link.active {
  color: var(--accent);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

/* ── Utilities ──────────────────────────────────────────── */
/* The .text-muted UTILITY is applied to reading-length paragraphs across the
   templates as a "secondary paragraph" device, so it points at the readable
   --text-soft tier (12:1), not the dimmer --text-muted token. Component meta
   (labels, card meta, nav) reference --text-muted directly and stay calibrated
   — hierarchy there comes from size/case/font, not low contrast. */
.text-muted {
  color: var(--text-soft);
}
.text-meta {
  color: var(--text-muted);
}
.text-mono {
  font-family: var(--font-mono);
}
.text-accent {
  color: var(--accent);
}
.text-green {
  color: var(--green);
}
.text-amber {
  color: var(--amber);
}
.text-dim {
  color: var(--text-dim);
}
.mt-0 {
  margin-top: 0;
}
.mt-4 {
  margin-top: var(--s4);
}
.mt-5 {
  margin-top: var(--s5);
}
.mt-6 {
  margin-top: var(--s6);
}
.mt-7 {
  margin-top: var(--s7);
}

/* ── Mobile Menu ────────────────────────────────────────── */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--s1);
  min-width: 44px;
  min-height: 44px;
  z-index: 200;
}
.mobile-menu-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s, opacity 0.2s;
}
.mobile-menu-toggle.active .mobile-menu-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mobile-menu-toggle.active .mobile-menu-toggle__bar:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle.active .mobile-menu-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav {
  display: none;
  position: fixed;
  inset: var(--header-height) 0 0 0;
  background: var(--bg);
  z-index: 1090;
  padding: var(--s6) var(--s5);
  overflow-y: auto;
}
.mobile-nav.open {
  display: block;
}
.mobile-nav__list {
  list-style: none;
}
.mobile-nav__list li {
  border-bottom: 1px solid var(--border);
}
.mobile-nav__list a {
  display: block;
  padding: var(--s4) 0;
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  color: var(--text-muted);
  text-decoration: none;
}
.mobile-nav__list a:hover {
  color: var(--text);
}
.mobile-nav__station {
  margin-top: var(--s6);
  padding-top: var(--s5);
  border-top: 1px solid var(--border);
}
.mobile-nav__lang {
  margin-top: var(--s5);
  padding-top: var(--s4);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}
.mobile-nav__lang-label {
  color: var(--accent);
  font-weight: 600;
}
.mobile-nav__lang-link {
  color: var(--text-muted);
  text-decoration: none;
}
.mobile-nav__lang-link:hover {
  color: var(--text);
}

