/* ==========================================================================
   BlueGrid India — design system
   Palette derived from the official BlueGrid logo artwork.
   Concept: surface -> depth. Public site and Library read on chart paper;
   the protected portal descends into deep water.
   ========================================================================== */

:root {
  /* brand — sampled from Bluegrid_Logo.png */
  --navy:        #001B58;
  --marine:      #016DB9;
  --signal:      #0196E0;
  --signal-lift: #4FC3F7;

  /* depth */
  --abyss:   #020C17;
  --deep:    #04182B;
  --deep-2:  #072742;
  --deep-3:  #0B3457;

  /* surface */
  --paper:   #F4F8FA;
  --paper-2: #E9F1F6;
  --paper-3: #D9E6EF;

  /* ink */
  --ink:      #04162B;
  --ink-2:    #35506A;
  --ink-3:    #556F88;
  --on-deep:      #EAF4FB;
  --on-deep-2:    #9DB9CE;
  --on-deep-3:    #6C8AA4;

  --rule:      rgba(0, 27, 88, .13);
  --rule-soft: rgba(0, 27, 88, .07);
  --rule-deep: rgba(140, 196, 232, .17);
  --rule-deep-soft: rgba(140, 196, 232, .09);

  --shell: 1240px;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);

  --sans: "Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --focus: 0 0 0 2px var(--paper), 0 0 0 4px var(--signal);
  --focus-deep: 0 0 0 2px var(--abyss), 0 0 0 4px var(--signal-lift);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 3px; }
.is-deep :focus-visible, .deep :focus-visible { box-shadow: var(--focus-deep); }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--navy); color: #fff; padding: .75rem 1.25rem;
  font-family: var(--mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------ primitives */
.shell { max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.shell--wide { max-width: 1600px; }

.eyebrow {
  font-family: var(--mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--marine);
  margin: 0 0 1.25rem;
  display: flex; align-items: center; gap: .75rem;
}
.eyebrow::before {
  content: ""; width: 1.75rem; height: 1px; background: currentColor; opacity: .55; flex: none;
}
.eyebrow--deep { color: var(--signal-lift); }

.display {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(2.5rem, 6.2vw, 5rem);
  line-height: .99;
  letter-spacing: -.032em;
  margin: 0;
  text-wrap: balance;
}
.h2 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(1.75rem, 3.6vw, 2.85rem);
  line-height: 1.08;
  letter-spacing: -.024em;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}
.h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(1.15rem, 1.9vw, 1.4rem);
  line-height: 1.25;
  letter-spacing: -.014em;
  margin: 0 0 .6rem;
}
.lede {
  font-size: clamp(1.0625rem, 1.55vw, 1.28rem);
  line-height: 1.62;
  color: var(--ink-2);
  max-width: 62ch;
  margin: 0;
}
.lede--deep { color: var(--on-deep-2); }

/* ---------------------------------------------------------------- buttons */
.btn {
  --btn-bg: var(--navy);
  --btn-fg: #fff;
  display: inline-flex; align-items: center; gap: .85rem;
  padding: 1.05rem 1.9rem;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid var(--btn-bg);
  border-radius: 2px;
  font-family: var(--mono); font-size: .78rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; text-decoration: none;
  cursor: pointer;
  transition: background .35s var(--ease), border-color .35s var(--ease),
              color .35s var(--ease), transform .35s var(--ease);
}
.btn:hover { --btn-bg: var(--marine); transform: translateY(-1px); }
.btn .btn__arrow { transition: transform .35s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); border-color: var(--rule); }
.btn--ghost:hover { --btn-bg: transparent; --btn-fg: var(--marine); border-color: var(--marine); }

.btn--signal { --btn-bg: var(--signal); --btn-fg: #00121F; }
.btn--signal:hover { --btn-bg: var(--signal-lift); }

.btn--onDeep { --btn-bg: transparent; --btn-fg: var(--on-deep); border-color: var(--rule-deep); }
.btn--onDeep:hover { --btn-bg: rgba(1,150,224,.14); --btn-fg: #fff; border-color: var(--signal); }

.btn--sm { padding: .7rem 1.15rem; font-size: .68rem; letter-spacing: .13em; }

/* -------------------------------------------------------------- contours */
/* The signature: a bathymetric survey field. Navy hairlines on paper,
   luminous traces in the deep. Drawn once on load, then still. */
.contours { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.contours svg { width: 100%; height: 100%; }
.contours path {
  fill: none;
  stroke: var(--navy);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  animation: contour-in 1.6s var(--ease) forwards;
}
.contours circle { fill: var(--marine); opacity: 0; animation: contour-in 1.2s var(--ease) forwards; }
.contours--deep path { stroke: var(--signal-lift); }
.contours--deep circle { fill: var(--signal); }

@keyframes contour-in { to { opacity: var(--o, .1); } }

@media (prefers-reduced-motion: reduce) {
  .contours path, .contours circle { opacity: var(--o, .1); animation: none; }
}


/* ------------------------------------------------------- official identity */
/* The supplied artwork is used exactly as provided — no recolouring, no
   derived symbol. Where a surface is too dark for the navy wordmark, the
   official lockup sits on a light container instead of being altered. */
.logoplate {
  display: inline-flex; align-items: center; justify-content: center;
  background: #FFFFFF;
  border-radius: 2px;
  padding: 8px 12px;
  line-height: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06);
}
.logoplate img { display: block; height: 44px; width: auto; }
.logoplate--lg { padding: 26px 32px; border-radius: 3px; }
.logoplate--lg img { height: 104px; }
.logoplate--sm { padding: 6px 9px; }
.logoplate--sm img { height: 34px; }

@media (max-width: 820px) {
  .logoplate { padding: 6px 9px; }
  .logoplate img { height: 34px; }
  .logoplate--lg { padding: 20px 24px; }
  .logoplate--lg img { height: 76px; }
}

/* ---------------------------------------------------------------- header */
.masthead {
  position: sticky; top: 0; z-index: 60;
  background: rgba(244, 248, 250, .86);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .4s var(--ease), background .4s var(--ease);
}
.masthead.is-stuck { border-bottom-color: var(--rule); }
.masthead__inner {
  max-width: var(--shell); margin-inline: auto; padding: .7rem var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.masthead__mark { display: flex; align-items: center; text-decoration: none; }
/* light surfaces: official artwork direct; dark surfaces: on a light container */
.masthead__mark > picture > img { height: 46px; width: auto; }
.masthead__mark .logoplate img { height: 44px; width: auto; }

.masthead--deep {
  background: rgba(2, 12, 23, .82);
  border-bottom: 1px solid var(--rule-deep-soft);
  color: var(--on-deep);
}
.masthead--deep.is-stuck { border-bottom-color: var(--rule-deep); }

/* portal navigation */
.pnav { display: flex; align-items: center; gap: .35rem; }
.pnav a {
  padding: .55rem .85rem;
  font-family: var(--mono); font-size: .72rem; font-weight: 400;
  letter-spacing: .13em; text-transform: uppercase;
  text-decoration: none; color: var(--on-deep-2);
  border-radius: 2px;
  transition: color .3s var(--ease), background .3s var(--ease);
}
.pnav a:hover { color: var(--on-deep); background: rgba(255,255,255,.05); }
.pnav a[aria-current="page"] { color: var(--signal-lift); }
.pnav .pnav__exit { color: var(--on-deep-3); border: 1px solid var(--rule-deep); margin-left: .6rem; }
.pnav .pnav__exit:hover { color: #fff; border-color: var(--signal); background: transparent; }

.pnav__toggle { display: none; background: none; border: 1px solid var(--rule-deep); border-radius: 2px;
  padding: .5rem .8rem; font-family: var(--mono); font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--on-deep-2); cursor: pointer; }

@media (max-width: 820px) {
  .masthead__mark > picture > img { height: 36px; }
  .masthead__mark .logoplate img { height: 34px; }
  .pnav__toggle { display: block; }
  .pnav {
    position: absolute; top: 100%; right: 0; left: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--deep); border-block: 1px solid var(--rule-deep);
    padding: .5rem var(--gutter) 1rem;
    display: none;
  }
  .pnav.is-open { display: flex; }
  .pnav a { padding: .9rem 0; border-bottom: 1px solid var(--rule-deep-soft); }
  .pnav .pnav__exit { margin: .75rem 0 0; text-align: center; }
}

/* ---------------------------------------------------------------- footer */
.colophon {
  border-top: 1px solid var(--rule);
  padding: 4rem 0 3rem;
  background: var(--paper-2);
}
.colophon__grid {
  display: grid; gap: 2.5rem;
  grid-template-columns: minmax(200px, 1fr) auto;
  align-items: start;
}
.colophon__logo img { height: 66px; width: auto; margin-bottom: 1.25rem; }
.colophon__line { font-size: .95rem; color: var(--ink-2); margin: 0 0 .3rem; }
.colophon__line a { color: var(--marine); text-decoration: none; }
.colophon__line a:hover { text-decoration: underline; }
.colophon__credit {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 2rem; line-height: 1.9;
}
.colophon__credit strong { display: block; font-weight: 500; color: var(--ink-2); letter-spacing: .1em; }
.colophon--deep { background: var(--abyss); border-top-color: var(--rule-deep-soft); }
.colophon--deep .colophon__logo { margin-bottom: 1.25rem; }
.colophon--deep .colophon__line { color: var(--on-deep-2); }
.colophon--deep .colophon__line a { color: var(--signal-lift); }
.colophon--deep .colophon__credit { color: var(--on-deep-3); }
.colophon--deep .colophon__credit strong { color: var(--on-deep-2); }

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

/* ===================================================== PUBLIC HOMEPAGE == */
.hero {
  position: relative;
  min-height: min(92vh, 900px);
  display: flex; align-items: center;
  padding: clamp(4rem, 11vh, 8rem) 0 clamp(3.5rem, 8vh, 6rem);
  background:
    radial-gradient(120% 90% at 78% 12%, rgba(1,150,224,.10), transparent 62%),
    linear-gradient(180deg, #FBFDFE 0%, var(--paper) 46%, var(--paper-2) 100%);
  overflow: hidden;
}
.hero__inner { position: relative; z-index: 1; max-width: var(--shell); margin-inline: auto;
  padding-inline: var(--gutter); width: 100%; }
.hero__logo { width: clamp(200px, 26vw, 310px); height: auto; margin-bottom: clamp(2rem, 5vh, 3.25rem); }
.hero__title { max-width: 17ch; }
.hero__title .accent { color: var(--marine); }
.hero__lede { margin-top: 1.75rem; max-width: 54ch; }
.hero__actions { margin-top: clamp(2.25rem, 5vh, 3rem); display: flex; flex-wrap: wrap; gap: 1rem 1.5rem;
  align-items: center; }
.hero__hint {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-3);
}

/* scale bar — the chart vernacular, and an honest index of the three sections */
.hero__index {
  margin-top: clamp(3rem, 7vh, 5rem);
  display: grid; gap: 0;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
}
.hero__index a {
  padding: 1.25rem 1.25rem 1.25rem 0;
  text-decoration: none;
  border-right: 1px solid var(--rule-soft);
  display: block;
  transition: color .3s var(--ease);
}
.hero__index a:last-child { border-right: 0; }
.hero__index .n {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .16em; color: var(--ink-3);
  display: block; margin-bottom: .5rem;
}
.hero__index .t { font-weight: 500; font-size: .98rem; letter-spacing: -.01em; }
.hero__index a:hover .t { color: var(--marine); }
@media (max-width: 640px) {
  .hero__index { grid-template-columns: 1fr; }
  .hero__index a { border-right: 0; border-bottom: 1px solid var(--rule-soft); padding-block: 1rem; }
}

/* section rhythm */
.band { padding: clamp(4.5rem, 11vh, 8rem) 0; position: relative; }
.band--rule { border-top: 1px solid var(--rule); }
.band--tint { background: var(--paper-2); }
.band--deep { background: var(--deep); color: var(--on-deep); }

.band__head { max-width: 60ch; margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }

.two-col {
  display: grid; gap: clamp(2rem, 5vw, 4.5rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

.statement {
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  line-height: 1.42; letter-spacing: -.018em; font-weight: 400;
  color: var(--ink); margin: 0; text-wrap: pretty;
}
.statement strong { font-weight: 600; color: var(--navy); }

/* ecosystem lattice */
.lattice { position: relative; margin-top: clamp(2rem, 4vw, 3rem); }
.lattice svg { width: 100%; height: auto; overflow: visible; }
.lattice__link { stroke: var(--navy); stroke-width: 1; opacity: .16; transition: opacity .35s var(--ease), stroke .35s var(--ease); }
.lattice__link.is-lit { opacity: .85; stroke: var(--signal); stroke-width: 1.5; }
.lattice__node { cursor: default; }
.lattice__dot {
  fill: var(--paper); stroke: var(--navy); stroke-width: 1.4;
  transition: fill .3s var(--ease), stroke .3s var(--ease), r .3s var(--ease);
}
.lattice__node.is-active .lattice__dot { fill: var(--signal); stroke: var(--marine); }
.lattice__label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
  fill: var(--ink-2); transition: fill .3s var(--ease);
}
.lattice__node.is-active .lattice__label { fill: var(--navy); font-weight: 500; }
.lattice__hit { fill: transparent; cursor: pointer; }
.lattice__caption {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 1.75rem;
}

/* audience split */
.split { display: grid; gap: 0; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); }
.split__col { padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 3rem) 0 0; }
.split__col + .split__col { border-left: 1px solid var(--rule); padding-left: clamp(1.5rem, 3vw, 3rem); }
.split__tag {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--marine); margin: 0 0 1.1rem;
}
.split__body { color: var(--ink-2); margin: 0; max-width: 46ch; }
@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
  .split__col + .split__col { border-left: 0; border-top: 1px solid var(--rule); padding-left: 0; }
  .split__col { padding-right: 0; padding-bottom: 2rem; }
}

/* closing call */
.closing {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--deep) 0%, var(--abyss) 100%);
  color: var(--on-deep);
  padding: clamp(5rem, 12vh, 9rem) 0;
  text-align: center;
}
.closing__inner { position: relative; z-index: 1; }
.closing .display { color: #fff; }
.closing .lede { margin-inline: auto; text-align: center; color: var(--on-deep-2); }
.closing__actions { margin-top: 2.75rem; }

/* ============================================================== GATEWAY == */
.gate {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 3rem var(--gutter);
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(1,109,185,.20), transparent 60%),
    linear-gradient(180deg, var(--deep) 0%, var(--abyss) 70%);
  color: var(--on-deep);
  position: relative; overflow: hidden;
}
.gate__card { position: relative; z-index: 1; width: 100%; max-width: 440px; text-align: center; }
.gate__logo { margin: 0 auto 2.5rem; }
.gate__title {
  font-size: 1.6rem; font-weight: 600; letter-spacing: -.018em; margin: 0 0 .6rem; color: #fff;
}
.gate__sub { font-size: .95rem; color: var(--on-deep-2); margin: 0 0 2.5rem; }

.field { text-align: left; position: relative; }
.field__label {
  display: block; font-family: var(--mono); font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--on-deep-3); margin-bottom: .6rem;
}
.field__wrap { position: relative; display: flex; }
.field input {
  flex: 1; width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--rule-deep);
  border-radius: 2px;
  padding: 1rem 3.5rem 1rem 1.1rem;
  font-family: var(--sans); font-size: 1rem; color: #fff;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.field input::placeholder { color: var(--on-deep-3); }
.field input:focus { outline: none; border-color: var(--signal); background: rgba(1,150,224,.08); }
.field.is-error input { border-color: #E4736A; }
.field__peek {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; padding: .6rem .7rem;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--on-deep-3);
}
.field__peek:hover { color: var(--signal-lift); }
.field__error {
  min-height: 1.4rem; margin: .7rem 0 0;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .08em;
  color: #F09A93; opacity: 0; transition: opacity .3s var(--ease);
}
.field.is-error .field__error { opacity: 1; }
.gate__submit { width: 100%; justify-content: center; margin-top: 1.5rem; }
.gate__note {
  margin-top: 2.25rem; font-size: .82rem; line-height: 1.6; color: var(--on-deep-3);
}
.gate__back {
  margin-top: 2.5rem; display: inline-block;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--on-deep-3); text-decoration: none;
}
.gate__back:hover { color: var(--signal-lift); }

/* =============================================================== PORTAL == */
.deep {
  background: var(--abyss);
  color: var(--on-deep);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.deep main { flex: 1; }

.portal-hero {
  position: relative; overflow: hidden;
  padding: clamp(3.5rem, 9vh, 6.5rem) 0 clamp(2.5rem, 6vh, 4rem);
  background: radial-gradient(100% 80% at 20% 0%, rgba(1,109,185,.18), transparent 60%);
}
.portal-hero__inner { position: relative; z-index: 1; }
.portal-hero .display { color: #fff; font-size: clamp(2.1rem, 5vw, 3.75rem); }

/* three experiences */
.experiences { display: grid; gap: 1px; background: var(--rule-deep-soft);
  border-block: 1px solid var(--rule-deep-soft); }
.xcard {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  padding: clamp(2rem, 4.5vw, 3.25rem) 0;
  background: var(--abyss);
  text-decoration: none;
  transition: background .4s var(--ease);
}
.xcard:hover { background: var(--deep); }
.xcard__body { display: flex; gap: clamp(1.25rem, 3vw, 2.5rem); }
.xcard__num {
  font-family: var(--mono); font-size: .8rem; font-weight: 500; letter-spacing: .1em;
  color: var(--signal); padding-top: .45rem; flex: none;
}
.xcard__title {
  font-size: clamp(1.5rem, 3vw, 2.15rem); font-weight: 600; letter-spacing: -.022em;
  color: #fff; margin: 0 0 .5rem; line-height: 1.06;
}
.xcard__kicker { font-size: 1.02rem; color: var(--on-deep); margin: 0 0 1rem; }
.xcard__copy { font-size: .95rem; line-height: 1.65; color: var(--on-deep-2); margin: 0 0 1.6rem; max-width: 52ch; }
.xcard__cta {
  display: inline-flex; align-items: center; gap: .7rem;
  font-family: var(--mono); font-size: .72rem; font-weight: 500; letter-spacing: .15em;
  text-transform: uppercase; color: var(--signal-lift);
}
.xcard:hover .xcard__cta .btn__arrow { transform: translateX(4px); }
.xcard__cta .btn__arrow { transition: transform .35s var(--ease); }

.xcard__visual {
  position: relative; border: 1px solid var(--rule-deep-soft); border-radius: 2px; overflow: hidden;
  background: var(--deep-2); aspect-ratio: 16 / 10;
}
.xcard__visual img { width: 100%; height: 100%; object-fit: cover; opacity: .9;
  transition: transform .8s var(--ease), opacity .5s var(--ease); }
.xcard:hover .xcard__visual img { transform: scale(1.03); opacity: 1; }
.xcard__visual--pad img { object-fit: contain; padding: 8%; }

@media (max-width: 880px) {
  .xcard { grid-template-columns: 1fr; }
  .xcard__visual { order: -1; }
}

/* recommended journey */
.journey { padding: clamp(3.5rem, 8vh, 6rem) 0; }
.journey__list { display: grid; gap: 0; margin: 2.5rem 0 0; padding: 0; list-style: none;
  counter-reset: none; }
.journey__item {
  display: grid; grid-template-columns: 4.5rem 1fr; gap: 1.5rem;
  padding: 1.6rem 0; border-top: 1px solid var(--rule-deep-soft);
}
.journey__item:last-child { border-bottom: 1px solid var(--rule-deep-soft); }
.journey__n { font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; color: var(--signal); padding-top: .28rem; }
.journey__t { font-weight: 500; color: #fff; margin: 0 0 .2rem; }
.journey__d { font-size: .92rem; color: var(--on-deep-2); margin: 0; }

/* =========================================================== DECK VIEWER = */
.viewer {
  position: fixed; inset: 0;
  background: #000; color: #fff;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.viewer__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem clamp(.9rem, 2.5vw, 1.6rem);
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.85);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
  flex: none;
}
.viewer.is-immersive .viewer__bar { opacity: 0; transform: translateY(-100%); pointer-events: none; }
.viewer.is-immersive.is-awake .viewer__bar { opacity: 1; transform: none; pointer-events: auto; }
.viewer__group { display: flex; align-items: center; gap: .4rem; }

.vbtn {
  background: none; border: 1px solid rgba(255,255,255,.14); border-radius: 2px;
  padding: .5rem .8rem; cursor: pointer;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .13em; text-transform: uppercase;
  color: rgba(255,255,255,.72); text-decoration: none;
  display: inline-flex; align-items: center; gap: .5rem;
  transition: color .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
}
.vbtn:hover { color: #fff; border-color: var(--signal); background: rgba(1,150,224,.14); }
.vbtn[aria-pressed="true"] { color: #00121F; background: var(--signal); border-color: var(--signal); }

.viewer__stage {
  flex: 1; position: relative;
  padding: clamp(.5rem, 2vw, 1.75rem);
  min-height: 0;
}
/* The slide is sized by the stage, not by its own intrinsic height, so it can
   never overflow and get clipped. object-fit: contain keeps every slide's
   original aspect ratio — no crop, no distortion, whatever the screen. */
.viewer__stage > picture {
  position: absolute;
  inset: clamp(.5rem, 2vw, 1.75rem);
  display: block;
}
.viewer__slide {
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 30px 70px rgba(0,0,0,.55));
  transition: opacity .32s var(--ease);
}
.viewer__slide.is-swapping { opacity: 0; }

.viewer__edge {
  position: absolute; top: 0; bottom: 0; width: clamp(56px, 9vw, 110px);
  border: 0; background: none; cursor: pointer; color: #fff;
  display: grid; place-items: center; opacity: 0;
  transition: opacity .35s var(--ease);
}
.viewer__stage:hover .viewer__edge { opacity: .5; }
.viewer__edge:hover { opacity: 1 !important; background: linear-gradient(90deg, rgba(0,0,0,.45), transparent); }
.viewer__edge--next:hover { background: linear-gradient(270deg, rgba(0,0,0,.45), transparent); }
.viewer__edge--prev { left: 0; }
.viewer__edge--next { right: 0; }
.viewer__edge:disabled { opacity: 0 !important; cursor: default; }

.viewer__foot {
  flex: none;
  display: flex; align-items: center; justify-content: center; gap: 1.5rem;
  padding: .75rem 1rem 1.1rem;
  transition: opacity .5s var(--ease);
}
.viewer.is-immersive .viewer__foot { opacity: 0; pointer-events: none; }
.viewer.is-immersive.is-awake .viewer__foot { opacity: 1; pointer-events: auto; }
.viewer__count {
  font-family: var(--mono); font-size: .82rem; letter-spacing: .18em; color: rgba(255,255,255,.85);
  font-variant-numeric: tabular-nums;
}
.viewer__count b { font-weight: 500; color: var(--signal-lift); }
.viewer__title {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255,255,255,.42); max-width: 42ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.viewer__track { display: flex; gap: 4px; }
.viewer__tick { width: 22px; height: 3px; background: rgba(255,255,255,.18); border: 0; padding: 0;
  cursor: pointer; transition: background .3s var(--ease); border-radius: 1px; }
.viewer__tick:hover { background: rgba(255,255,255,.45); }
.viewer__tick[aria-current="true"] { background: var(--signal); }

.thumbs {
  position: absolute; inset: auto 0 0 0; z-index: 5;
  background: rgba(0,0,0,.94); border-top: 1px solid rgba(255,255,255,.1);
  padding: 1.25rem clamp(.9rem, 2.5vw, 1.6rem) 1.5rem;
  transform: translateY(101%); transition: transform .45s var(--ease);
  max-height: 62vh; overflow-y: auto;
}
.thumbs.is-open { transform: none; }
.thumbs__grid {
  display: grid; gap: .9rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.thumb { background: none; border: 1px solid rgba(255,255,255,.12); padding: 0; cursor: pointer;
  border-radius: 2px; overflow: hidden; text-align: left; transition: border-color .3s var(--ease); }
.thumb:hover { border-color: rgba(255,255,255,.5); }
.thumb[aria-current="true"] { border-color: var(--signal); }
.thumb img { width: 100%; aspect-ratio: 3/2; object-fit: cover; display: block; }
.thumb__meta { padding: .5rem .6rem .6rem; }
.thumb__n { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; color: var(--signal-lift); }
.thumb__t { font-size: .76rem; color: rgba(255,255,255,.72); line-height: 1.3; margin-top: .2rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 700px) {
  .viewer__title, .viewer__track { display: none; }
  /* reclaim space for the slide on small screens */
  .viewer__stage { padding: .35rem; }
  .viewer__stage > picture { inset: .35rem; }
  .viewer__foot { padding: .5rem 1rem .7rem; }
}

/* ======================================================= PROTOTYPE FRAME = */
.frame { position: fixed; inset: 0; display: flex; flex-direction: column; background: #04101a; }
.frame__bar {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem clamp(.9rem, 2.5vw, 1.5rem);
  background: rgba(2,12,23,.94); border-bottom: 1px solid rgba(255,255,255,.08);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.frame.is-immersive .frame__bar { opacity: 0; transform: translateY(-100%); pointer-events: none; }
.frame.is-immersive.is-awake .frame__bar { opacity: 1; transform: none; pointer-events: auto; }
.frame__label { font-family: var(--mono); font-size: .7rem; letter-spacing: .15em;
  text-transform: uppercase; color: rgba(255,255,255,.55); }
.frame iframe { flex: 1; width: 100%; border: 0; background: #04101a; min-height: 0; }

/* launcher */
.launch { display: grid; gap: 1px; background: var(--rule-deep-soft);
  border-block: 1px solid var(--rule-deep-soft); grid-template-columns: 1fr 1fr; }
@media (max-width: 800px) { .launch { grid-template-columns: 1fr; } }
.launch__door {
  background: var(--abyss); padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.5rem);
  text-decoration: none; display: flex; flex-direction: column; gap: 1rem;
  transition: background .4s var(--ease);
}
.launch__door:hover { background: var(--deep); }
.launch__tag { font-family: var(--mono); font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--signal); }
.launch__t { font-size: clamp(1.35rem, 2.6vw, 1.85rem); font-weight: 600; letter-spacing: -.02em;
  color: #fff; margin: 0; line-height: 1.1; }
.launch__d { font-size: .95rem; color: var(--on-deep-2); margin: 0; max-width: 44ch; }
.launch__go { margin-top: auto; font-family: var(--mono); font-size: .72rem; letter-spacing: .15em;
  text-transform: uppercase; color: var(--signal-lift); display: inline-flex; gap: .6rem; align-items: center; }

.notice {
  margin-top: 2rem; padding: 1.1rem 1.35rem;
  border: 1px solid var(--rule-deep-soft); border-left: 2px solid var(--signal);
  background: rgba(1,150,224,.05);
  font-size: .88rem; line-height: 1.6; color: var(--on-deep-2);
}
.notice strong { color: var(--on-deep); font-weight: 500; }

/* ============================================================== LIBRARY == */
.library { background: var(--paper); color: var(--ink); min-height: 100vh;
  display: flex; flex-direction: column; }
.library main { flex: 1; }

.masthead--lib { background: rgba(244,248,250,.9); border-bottom: 1px solid var(--rule); }
.masthead--lib .pnav a { color: var(--ink-2); }
.masthead--lib .pnav a:hover { color: var(--navy); background: rgba(0,27,88,.05); }
.masthead--lib .pnav a[aria-current="page"] { color: var(--marine); }
.masthead--lib .pnav__exit { color: var(--ink-3); border-color: var(--rule); }
.masthead--lib .pnav__exit:hover { color: var(--navy); border-color: var(--marine); }
.masthead--lib .pnav__toggle { color: var(--ink-2); border-color: var(--rule); }
@media (max-width: 820px) {
  .masthead--lib .pnav { background: var(--paper); border-color: var(--rule); }
  .masthead--lib .pnav a { border-bottom-color: var(--rule-soft); }
}

.lib-hero { padding: clamp(3rem, 7vh, 5rem) 0 clamp(2rem, 4vh, 3rem); position: relative; overflow: hidden; }
.lib-hero__inner { position: relative; z-index: 1; }

.searchbar { position: relative; margin-top: 2.5rem; max-width: 640px; }
.searchbar input {
  width: 100%; padding: 1.05rem 3rem 1.05rem 1.15rem;
  border: 1px solid var(--rule); border-radius: 2px; background: #fff;
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.searchbar input:focus { outline: none; border-color: var(--marine); box-shadow: 0 0 0 3px rgba(1,150,224,.14); }
.searchbar input::placeholder { color: var(--ink-3); }
.searchbar__icon { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); pointer-events: none; }
.searchbar__hint { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em;
  color: var(--ink-3); margin-top: .8rem; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 2.25rem 0 0; }
.filter {
  background: none; border: 1px solid var(--rule); border-radius: 999px;
  padding: .5rem 1rem; cursor: pointer;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-2);
  transition: all .3s var(--ease);
}
.filter:hover { border-color: var(--marine); color: var(--marine); }
.filter[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

.doc-grid {
  display: grid; gap: 1px; background: var(--rule-soft);
  border-block: 1px solid var(--rule);
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  margin-top: clamp(2rem, 5vh, 3.25rem);
}
.doc-card {
  background: var(--paper); padding: clamp(1.5rem, 2.5vw, 2rem);
  text-decoration: none; display: flex; flex-direction: column; gap: .75rem;
  transition: background .35s var(--ease);
}
.doc-card:hover { background: #fff; }
.doc-card__top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.doc-card__num { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; color: var(--marine); }
.doc-card__cat {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
}
.doc-card__title { font-size: 1.18rem; font-weight: 600; letter-spacing: -.016em; line-height: 1.22;
  margin: 0; color: var(--navy); }
.doc-card__sub { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; color: var(--ink-3);
  text-transform: uppercase; margin: -.3rem 0 0; }
.doc-card__desc { font-size: .92rem; line-height: 1.6; color: var(--ink-2); margin: .35rem 0 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.doc-card__foot {
  margin-top: auto; padding-top: 1.1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
}
.doc-card__time { color: var(--ink-3); }
.doc-card__go { color: var(--marine); display: inline-flex; gap: .5rem; align-items: center; }
.doc-card:hover .doc-card__go .btn__arrow { transform: translateX(4px); }
.doc-card__go .btn__arrow { transition: transform .35s var(--ease); }

.results { margin-top: 2rem; }
.result {
  display: block; text-decoration: none; padding: 1.35rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.result:hover { background: rgba(1,150,224,.03); }
.result__doc { font-family: var(--mono); font-size: .7rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--marine); margin-bottom: .35rem; }
.result__section { font-weight: 600; font-size: 1.02rem; color: var(--navy); margin: 0 0 .35rem; }
.result__excerpt { font-size: .92rem; line-height: 1.6; color: var(--ink-2); margin: 0; }
.result__excerpt mark { background: rgba(1,150,224,.22); color: var(--navy); padding: 0 .12em; border-radius: 2px; }
.results__meta { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); padding-bottom: .75rem; border-bottom: 1px solid var(--rule); }
.results__empty { padding: 2.5rem 0; color: var(--ink-2); }

.resume {
  margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; border: 1px solid var(--rule); border-left: 2px solid var(--signal);
  background: #fff;
}
.resume__label { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3); }
.resume__title { font-weight: 500; color: var(--navy); margin-right: auto; }

/* ==================================================== READING EXPERIENCE = */
.reader { display: grid; grid-template-columns: 250px minmax(0, 1fr) 250px;
  gap: clamp(1.5rem, 3vw, 3rem); align-items: start;
  max-width: 1560px; margin-inline: auto; padding: 0 var(--gutter) 5rem; }

.rail { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow-y: auto;
  padding: 2.5rem 0 2rem; font-size: .88rem; }
.rail__title { font-family: var(--mono); font-size: .7rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-3); margin: 0 0 1rem; }
.rail__list { list-style: none; margin: 0; padding: 0; }
.rail__list a {
  display: block; padding: .45rem 0 .45rem .8rem; text-decoration: none; color: var(--ink-2);
  border-left: 2px solid var(--rule-soft); line-height: 1.35; font-size: .84rem;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.rail__list a:hover { color: var(--navy); border-left-color: var(--marine); }
.rail__list a[aria-current="true"], .rail__list a.is-current {
  color: var(--navy); font-weight: 500; border-left-color: var(--signal); }
.rail__list .lvl3 { padding-left: 1.6rem; font-size: .8rem; color: var(--ink-3); }
.rail__sep { height: 1px; background: var(--rule); margin: 1.5rem 0; }

.progress { position: fixed; top: 0; left: 0; height: 2px; background: var(--signal);
  width: 0; z-index: 80; transition: width .12s linear; }

.doc { padding: 2.5rem 0 0; max-width: 72ch; }
.doc__head { padding-bottom: 2rem; border-bottom: 1px solid var(--rule); margin-bottom: 2.5rem; }
.doc__crumb { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--marine); margin: 0 0 1rem; }
.doc__title { font-family: var(--sans); font-weight: 600; font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  line-height: 1.06; letter-spacing: -.026em; color: var(--navy); margin: 0 0 .75rem; text-wrap: balance; }
.doc__sub { font-size: 1.05rem; color: var(--ink-2); margin: 0; }
.doc__meta { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1.5rem;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); }

.doc__body { font-family: var(--serif); font-size: 1.14rem; line-height: 1.78; color: #16283C; }
.doc__body p { margin: 0 0 1.35rem; }
.doc__body h2 {
  font-family: var(--sans); font-weight: 600; font-size: clamp(1.4rem, 2.4vw, 1.75rem);
  line-height: 1.18; letter-spacing: -.018em; color: var(--navy);
  margin: 3.25rem 0 1.1rem; scroll-margin-top: 100px; position: relative;
}
.doc__body h3 {
  font-family: var(--sans); font-weight: 600; font-size: 1.16rem; line-height: 1.3;
  letter-spacing: -.01em; color: var(--navy); margin: 2.5rem 0 .9rem; scroll-margin-top: 100px;
}
.doc__body h4 {
  font-family: var(--mono); font-weight: 500; font-size: .74rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--marine); margin: 2rem 0 .7rem;
}
.doc__body ul { margin: 0 0 1.5rem; padding-left: 1.2rem; }
.doc__body li { margin-bottom: .5rem; padding-left: .35rem; }
.doc__body li::marker { color: var(--signal); }
.doc__body mark { background: rgba(1,150,224,.24); color: inherit; padding: 0 .12em; }

.anchor {
  position: absolute; left: -1.6rem; top: .15em;
  opacity: 0; text-decoration: none; color: var(--ink-3); font-size: .8em;
  transition: opacity .25s var(--ease);
  padding: 0 .35rem;
}
.doc__body h2:hover .anchor, .anchor:focus-visible { opacity: 1; }
.anchor:hover { color: var(--marine); }
@media (max-width: 1080px) { .anchor { display: none; } }

.doc__nav { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule-soft); }
.doc__nav a { background: var(--paper); padding: 1.5rem 1.25rem; text-decoration: none;
  transition: background .3s var(--ease); }
.doc__nav a:hover { background: #fff; }
.doc__nav .dir { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: .4rem; }
.doc__nav .nm { font-weight: 500; color: var(--navy); line-height: 1.3; }
.doc__nav a.is-end { color: var(--ink-3); font-family: var(--mono); font-size: .7rem;
  letter-spacing: .12em; text-transform: uppercase; }
.doc__nav .next { text-align: right; }
@media (max-width: 640px) { .doc__nav { grid-template-columns: 1fr; } }

.toast {
  position: fixed; left: 50%; bottom: 2rem; transform: translate(-50%, 1rem);
  background: var(--navy); color: #fff; padding: .75rem 1.25rem; border-radius: 2px;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease), transform .3s var(--ease);
  z-index: 90;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1180px) {
  .reader { grid-template-columns: 220px minmax(0, 1fr); }
  .reader__context { display: none; }
}
@media (max-width: 900px) {
  .reader { grid-template-columns: 1fr; }
  .reader__nav { display: none; }
  .doc { padding-top: 1.5rem; }
}

/* ------------------------------------------------------------- utilities */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.is-hidden { display: none !important; }
.loading {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); padding: 3rem 0;
}
.loading--deep { color: var(--on-deep-3); }
