@import url("/assets/css/fonts.css?v=1");

:root {
  --primary: #2457A7;
  --primary-ink: #16386e;
  --accent: #A044C5;
  --background: #F6F8FC;
  --surface: #FFFFFF;
  --surface-2: #E9EEF7;
  --text: #1B2638;
  --muted: #5A6B80;
  --border: #CDD8E8;
  --rule: #1B2638;
  --ok: #1b5e3b;
  --warn: #8a3b12;
  --header-h: 64px;
  --sticky-cta-h: 62px;
  --radius: 2px;
  --max: 1180px;
  --font-display: "Poppins", "Noto Sans Devanagari", sans-serif;
  --font-body: "Noto Sans Devanagari", "Poppins", sans-serif;
  --shadow: 0 10px 28px rgb(27 38 56 / 0.08);
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
}

body {
  padding-top: var(--header-h);
  padding-bottom: calc(var(--sticky-cta-h) + env(safe-area-inset-bottom, 0px));
  min-width: 0;
}

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

a { color: var(--primary); }
a:hover { color: var(--primary-ink); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--primary);
  color: #fff;
  padding: 8px 12px;
  z-index: 80;
  white-space: nowrap;
}
.skip:focus { top: 12px; }

.wrap {
  width: min(100% - 32px, var(--max));
  margin-inline: auto;
  min-width: 0;
}

/* Utility bar */
.util {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 40;
  background: rgb(246 248 252 / 0.97);
  border-bottom: 2px solid var(--rule);
}
.util-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex: 0 0 auto;
}
.brand-mark {
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 18px;
  white-space: nowrap;
}
.brand-name span { color: var(--primary); }

.nav-toggle {
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 2px solid var(--rule);
  background: var(--surface);
  color: var(--text);
  display: none;
  place-items: center;
  cursor: pointer;
}
.nav-toggle-bars {
  width: 18px;
  height: 12px;
  display: block;
  background:
    linear-gradient(var(--text), var(--text)) 0 0 / 100% 2px no-repeat,
    linear-gradient(var(--text), var(--text)) 0 5px / 100% 2px no-repeat,
    linear-gradient(var(--text), var(--text)) 0 10px / 100% 2px no-repeat;
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.nav ul {
  display: flex;
  align-items: center;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  white-space: nowrap;
}
.btn:hover { background: var(--primary-ink); color: #fff; border-color: var(--primary-ink); }
.btn-ghost {
  background: var(--surface);
  color: var(--primary);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--primary-ink); }
.btn:active { transform: translateY(1px); }

.drawer-backdrop {
  display: none;
}

/* Mosaic newsroom hero */
.hero {
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  min-height: calc(100dvh - var(--header-h));
  background: var(--surface);
  border-bottom: 2px solid var(--rule);
}
.hero-copy {
  min-width: 0;
  padding: 28px 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 2px solid var(--rule);
  background:
    repeating-linear-gradient(transparent, transparent 31px, rgb(205 216 232 / 0.45) 32px);
}
.hero h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 4.2vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.035em;
  max-width: 16ch;
}
.hero-proof {
  margin: 0 0 18px;
  max-width: 38ch;
  color: var(--text);
  font-size: 18px;
}
.hero-actions { display: flex; gap: 10px; align-items: center; }
.hero-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 46ch;
}
.hero-mosaic {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  grid-template-rows: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 3px;
  background: var(--rule);
  min-width: 0;
  min-height: 0;
}
.tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--surface-2);
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.tile-a { grid-column: 1; grid-row: 1 / span 2; }
.tile-b { grid-column: 2; grid-row: 1; }
.tile-c { grid-column: 2; grid-row: 2; }
.tile figcaption {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgb(255 255 255 / 0.92);
  border: 1px solid var(--rule);
  color: var(--text);
  font-size: 11px;
  padding: 2px 6px;
  max-width: calc(100% - 16px);
}

/* Vertical topic ribbon */
.ribbon {
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  border-bottom: 2px solid var(--rule);
  background: var(--surface);
  min-width: 0;
}
.ribbon-rail {
  background: var(--text);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.ribbon-track {
  display: flex;
  overflow-x: auto;
  gap: 0;
  min-width: 0;
}
.ribbon-track a {
  flex: 1 0 25%;
  min-width: 140px;
  padding: 18px 16px;
  text-decoration: none;
  color: var(--text);
  border-right: 1px solid var(--border);
  min-width: 0;
}
.ribbon-track a:last-child { border-right: 0; }
.ribbon-track strong {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.03em;
}
.ribbon-track span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

/* Chapters */
.chapter {
  scroll-snap-align: start;
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.chapter h2,
.prose h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  max-width: 22ch;
}
.chapter h3,
.prose h3 {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 28px 0 8px;
}
.lede {
  max-width: 62ch;
  color: var(--text);
  margin: 0 0 24px;
}
.muted { color: var(--muted); }

.ledger {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 0;
  border: 2px solid var(--rule);
  background: var(--surface);
  min-width: 0;
}
.ledger dt,
.ledger dd {
  margin: 0;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.ledger dt {
  background: var(--surface-2);
  font-family: var(--font-display);
  font-weight: 600;
  border-right: 1px solid var(--border);
}
.ledger dd:last-of-type,
.ledger dt:last-of-type { border-bottom: 0; }

.board {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 24px;
  align-items: start;
  min-width: 0;
}
.board figure {
  margin: 0;
  border: 2px solid var(--rule);
  background: var(--surface);
  min-width: 0;
}
.board figcaption,
.media figcaption {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.callouts {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.callout {
  border-left: 3px solid var(--primary);
  padding: 8px 0 8px 12px;
  background: transparent;
}
.callout strong { display: block; font-family: var(--font-display); }

.corridor {
  counter-reset: step;
  display: grid;
  gap: 0;
  border-top: 2px solid var(--rule);
}
.step {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}
.step h3 { margin: 0 0 6px; }

.process {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 2px solid var(--rule);
  background: var(--surface);
}
.process li {
  list-style: none;
  margin: 0;
  padding: 16px;
  border-right: 1px solid var(--border);
  min-width: 0;
}
.process ol { display: contents; }
.process li:last-child { border-right: 0; }
.process strong {
  display: block;
  font-family: var(--font-display);
  margin-bottom: 6px;
}

.bench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 0;
  border: 2px solid var(--rule);
  background: var(--surface);
}
.bench + .bench { margin-top: 12px; }
.bench-body { padding: 18px; min-width: 0; }
.bench-meter {
  background: var(--surface-2);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  font-family: var(--font-display);
  font-size: 13px;
}
.meter-bar {
  height: 8px;
  background: var(--border);
  margin-top: 8px;
}
.meter-bar > i {
  display: block;
  height: 100%;
  background: var(--primary);
}

.columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  min-width: 0;
}
.columns > * { min-width: 0; }

.checks {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 2px solid var(--rule);
  background: var(--surface);
}
.checks li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.checks li:last-child { border-bottom: 0; }
.checks i {
  width: 16px;
  height: 16px;
  margin-top: 4px;
  border: 2px solid var(--primary);
  background: #fff;
}

.workshop {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  background: var(--rule);
  border: 2px solid var(--rule);
}
.panel {
  background: var(--surface);
  padding: 20px;
  min-width: 0;
}
.panel h3 { margin: 0 0 8px; }

.rail {
  background: var(--text);
  color: #fff;
  padding: 36px 0;
}
.rail h2 { color: #fff; }
.rail .lede { color: #d7deea; }
.rail .btn { background: #fff; color: var(--primary); border-color: #fff; }
.rail .btn:hover { background: var(--surface-2); }

.register {
  display: grid;
  gap: 0;
  border-top: 2px solid var(--rule);
}
.note-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.note-row time {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--primary);
}

.defs {
  display: grid;
  gap: 0;
}
.defs > div {
  display: grid;
  grid-template-columns: minmax(0, 0.4fr) minmax(0, 0.6fr);
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.defs dt {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
}
.defs dd { margin: 0; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 28px;
  align-items: start;
  min-width: 0;
}

.faq details {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.faq summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
}
.faq p { margin: 8px 0 0; max-width: 62ch; }

.timeline {
  border-left: 2px solid var(--rule);
  margin: 0;
  padding: 0 0 0 20px;
}
.timeline li {
  margin: 0 0 18px;
  min-width: 0;
}
.timeline strong { display: block; font-family: var(--font-display); }

.colophon {
  background: var(--surface-2);
  border-top: 2px solid var(--rule);
  color: var(--text);
}
.colophon p { max-width: 70ch; }

.media {
  margin: 28px 0;
  border: 2px solid var(--rule);
  background: var(--surface);
}
.media.hero-media { margin-top: 0; }

.prose p { max-width: 68ch; }
.prose ul,
.prose ol { max-width: 68ch; padding-left: 20px; }
.kicker {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 8px;
}

.page-hero {
  padding: 28px 0 12px;
  border-bottom: 2px solid var(--rule);
  background: var(--surface);
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 10px;
  max-width: 20ch;
}
.crumbs {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0 0 12px;
  font-size: 13px;
}
.crumbs li { white-space: nowrap; }
.crumbs li:not(:last-child)::after { content: "/"; margin-left: 8px; color: var(--muted); }

.site-footer {
  background: var(--surface);
  border-top: 2px solid var(--rule);
  padding: 36px 0 28px;
}
.foot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr));
  gap: 24px;
  min-width: 0;
}
.site-footer h2 {
  font-family: var(--font-display);
  font-size: 14px;
  margin: 0 0 10px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 6px; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--primary); }
.legal {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: none;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgb(246 248 252 / 0.98);
  border-top: 2px solid var(--rule);
}
.sticky-cta .btn {
  width: 100%;
}

.related-index a {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}
.related-index strong {
  font-family: var(--font-display);
  display: block;
}

/* Child article rhythm */
.article {
  padding: 28px 0 64px;
}
.article .wrap-article {
  width: min(100% - 32px, 780px);
  margin-inline: auto;
  min-width: 0;
}
.wide {
  width: min(100% - 32px, var(--max));
  margin-inline: auto;
}

/* 404 */
.err {
  min-height: calc(100dvh - var(--header-h) - 200px);
  display: grid;
  place-items: center;
  text-align: left;
  padding: 48px 0;
}

@media (max-width: 1023px) {
  .nav-toggle { display: grid; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    background: var(--surface);
    border-bottom: 2px solid var(--rule);
    display: none;
    padding: 12px 16px 20px;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .nav.is-open { display: flex; }
  .nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav li a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }
  .drawer-backdrop.is-open {
    display: block;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: rgb(27 38 56 / 0.28);
    z-index: 30;
  }
  .nav { z-index: 35; }
  .sticky-cta { display: block; }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }
  .hero-copy {
    border-right: 0;
    border-bottom: 2px solid var(--rule);
    padding: 22px 20px 20px;
    background: var(--surface);
  }
  .hero-mosaic {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 220px;
  }
  .tile-a { grid-column: 1; grid-row: 1; min-height: 220px; }
  .tile-b,
  .tile-c { display: none; }
  .ribbon {
    grid-template-columns: minmax(0, 1fr);
  }
  .ribbon-rail {
    writing-mode: horizontal-tb;
    transform: none;
    padding: 8px 12px;
    letter-spacing: 0.08em;
  }
  .ledger,
  .board,
  .bench,
  .columns,
  .split,
  .defs > div,
  .note-row,
  .process,
  .workshop,
  .foot-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .process ol { display: block; padding: 0; margin: 0; }
  .process li { border-right: 0; border-bottom: 1px solid var(--border); }
  .bench-meter { border-left: 0; border-top: 1px solid var(--border); }
  .hero h1 { max-width: none; }
}

@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  .sticky-cta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chapter,
  .hero,
  .ribbon { scroll-snap-align: none; }
}

@media (min-width: 1024px) {
  .snap-root {
    scroll-snap-type: y proximity;
  }
}
