/* ==========================================================================
   AIZAKU CORPORATION — Terminal Layout
   Directorate of Defense · Shinsei Concordia · Registry CDR-4471-AZK

   Layout model
     .statusrail   fixed classification strip, full width
     .shell        grid: [ .rail 316px | .view 1fr ]
     .rail         full-height sticky command rail (drawer below 1080px)
     .view         the scrolling document; every block has its own structure
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts (local)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Orbitron";
  src: url("../fonts/Orbitron-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rajdhani";
  src: url("../fonts/Rajdhani-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rajdhani";
  src: url("../fonts/Rajdhani-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   2. Tokens
   -------------------------------------------------------------------------- */
:root {
  --ink:        #040508;
  --ink-2:      #070910;
  --panel:      #0b0e15;
  --panel-2:    #10141d;
  --panel-3:    #161b26;

  --line:       #191f2c;
  --line-2:     #28303f;

  --text:       #e8ebf2;
  --text-2:     #a2aabb;
  --text-3:     #676f81;

  --brand:      #b3121c;
  --brand-deep: #6f0d14;
  --brand-hot:  #ff3241;
  --brand-glow: rgba(179, 18, 28, 0.35);
  --brand-film: rgba(179, 18, 28, 0.07);

  --state:      #377bf1;   /* Concordia imperial blue */
  --state-film: rgba(55, 123, 241, 0.1);
  --gold:       #d4af37;


  --f-display: "Orbitron", "Segoe UI", system-ui, sans-serif;
  --f-body:    "Rajdhani", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono:    ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", monospace;

  --strip: 28px;    /* classification strip */
  --rail:  316px;   /* command rail width */
  --pad:   clamp(1.25rem, 3.4vw, 3.75rem);

  --t-fast: 0.16s cubic-bezier(0.4, 0, 0.2, 1);
  --t-med:  0.32s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 0.65s cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   3. Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--strip) + 1.5rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.62;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.2; }
p  { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }

a { color: var(--text); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brand-hot); }

::selection { background: var(--brand); color: #fff; }
:focus-visible { outline: 2px solid var(--state); outline-offset: 3px; }

.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;
}

/* Keyboard-only escape hatch: parked above the viewport, slides in on focus.
   Offset by the classification strip so it does not mask the registry line. */
.skip-link {
  position: fixed;
  top: var(--strip); left: 50%;
  z-index: 999;
  transform: translate(-50%, -200%);
  padding: 0.7rem 1.4rem;
  background: var(--brand);
  color: #fff;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: transform var(--t-fast);
}
.skip-link:focus { transform: translate(-50%, 0); color: #fff; }

/* Shared type helpers ------------------------------------------------------ */
.mono {
  font-family: var(--f-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.tick {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--f-mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brand-hot);
}
.tick::before { content: ""; width: 20px; height: 1px; background: currentColor; }
.tick--state { color: var(--state); }
.tick--muted { color: var(--text-3); }

/* Registry marker — the house diamond, not a status light. */
.marker {
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.72);
  transform: rotate(45deg);
}

/* --------------------------------------------------------------------------
   4. Backdrop
   -------------------------------------------------------------------------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 1000px 700px at 88% -6%, rgba(179, 18, 28, 0.15), transparent 58%),
    radial-gradient(ellipse 800px 700px  at 4% 102%, rgba(111, 13, 20, 0.14), transparent 58%);
}
.backdrop__stars,
.backdrop__stars::before {
  content: "";
  position: absolute;
  inset: -50% 0 0;
  height: 200%;
  background-image:
    radial-gradient(1.4px 1.4px at 20px 30px,   rgba(255,255,255,.55), transparent),
    radial-gradient(1px 1px     at 150px 95px,  rgba(255,215,215,.45), transparent),
    radial-gradient(1.4px 1.4px at 265px 165px, rgba(255,255,255,.4),  transparent),
    radial-gradient(1px 1px     at 62px 225px,  rgba(200,215,255,.45), transparent),
    radial-gradient(1.4px 1.4px at 335px 58px,  rgba(255,255,255,.33), transparent);
  background-size: 380px 380px;
  animation: drift 150s linear infinite;
}
.backdrop__stars::before { background-size: 250px 250px; opacity: 0.45; animation-duration: 100s; animation-direction: reverse; }

.backdrop__scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.011) 0 1px, transparent 1px 3px);
}
@keyframes drift { from { transform: translateY(0); } to { transform: translateY(-380px); } }

/* --------------------------------------------------------------------------
   5. Classification strip
   -------------------------------------------------------------------------- */
.statusrail {
  position: fixed;
  inset: 0 0 auto;
  z-index: 130;
  height: var(--strip);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-inline: 1rem;
  overflow: hidden;
  background: linear-gradient(90deg, var(--brand-deep) 0%, #46080e 34%, var(--ink-2) 82%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-family: var(--f-mono);
  font-size: 0.64rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.76);
  white-space: nowrap;
}
.statusrail__item { display: inline-flex; align-items: center; gap: 0.5rem; }
.statusrail__mid { color: rgba(255, 255, 255, 0.5); margin-inline: auto; }
.statusrail__clock { font-variant-numeric: tabular-nums; }

@media (max-width: 760px) { .statusrail__mid { display: none; } }
@media (max-width: 620px) { .statusrail__long { display: none; } }
@media (max-width: 420px) { .statusrail { font-size: 0.56rem; letter-spacing: 0.1em; gap: 0.6rem; } }

/* --------------------------------------------------------------------------
   6. Shell
   -------------------------------------------------------------------------- */
.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  padding-top: var(--strip);
}

.view { min-width: 0; border-left: 1px solid var(--line); }

/* --------------------------------------------------------------------------
   7. Command rail
   -------------------------------------------------------------------------- */
.rail {
  position: sticky;
  top: var(--strip);
  z-index: 100;
  height: calc(100vh - var(--strip));
  display: flex;
  flex-direction: column;
  background: var(--ink-2);
}

.rail__top { padding: 1.5rem 1.4rem 1.25rem; }

.rail__brand { display: block; margin-bottom: 1.1rem; }
.rail__brand img { width: 158px; transition: opacity var(--t-fast); }
.rail__brand:hover img { opacity: 0.7; }

.rail__sub {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  line-height: 1.7;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--text-3);
}
.rail__sub b { color: var(--brand-hot); font-weight: 500; }

.rail__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.rail__body::-webkit-scrollbar { width: 6px; }
.rail__body::-webkit-scrollbar-thumb { background: var(--line-2); }

/* Rail navigation ---------------------------------------------------------- */
.railnav { padding: 0.75rem 0; }

.railnav a {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 0.4rem;
  padding: 0.62rem 1.4rem;
  color: var(--text-3);
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: color var(--t-fast), background var(--t-fast);
}
.railnav a::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 2px; height: 0;
  background: var(--brand-hot);
  transform: translateY(-50%);
  transition: height var(--t-med);
}
.railnav a span:first-child { color: var(--line-2); transition: color var(--t-fast); }
.railnav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.022); }
.railnav a:hover span:first-child { color: var(--brand); }
.railnav a.is-active { color: var(--text); background: var(--brand-film); }
.railnav a.is-active::before { height: 60%; }
.railnav a.is-active span:first-child { color: var(--brand-hot); }

/* Rail telemetry ----------------------------------------------------------- */
.railstat {
  margin-top: auto;
  padding: 1.15rem 1.4rem;
  border-top: 1px solid var(--line);
}
.railstat h2 {
  font-family: var(--f-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.9rem;
}

/* Meter -------------------------------------------------------------------- */
.meter {
  margin-bottom: 0.95rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.2rem 0.5rem;
  font-family: var(--f-mono);
  font-size: 0.61rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.meter__name { color: var(--text-3); }
.meter__val {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.meter__bar {
  grid-column: 1 / -1;
  height: 3px;
  background: var(--panel-3);
  overflow: hidden;
}
.meter__bar i {
  display: block;
  height: 100%;
  background: var(--brand);
  transition: width 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Identity rows ------------------------------------------------------------ */
.railstat__ids {
  display: grid;
  gap: 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--line-2);
}
.railstat__ids div {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--f-mono);
  font-size: 0.61rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.railstat__ids dt { color: var(--text-3); white-space: nowrap; }
.railstat__ids .fill { flex: 1; border-bottom: 1px dotted var(--line-2); }
.railstat__ids dd {
  margin: 0;
  color: var(--text-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.railstat__ids dd.alert { color: var(--gold); }

/* Rail footer -------------------------------------------------------------- */
.railfoot {
  padding: 1.1rem 1.4rem 1.4rem;
  border-top: 1px solid var(--line);
}
.seal {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.7rem 0.5rem 0.5rem;
  border: 1px solid var(--line);
  background: var(--state-film);
  transition: border-color var(--t-fast);
}
.seal:hover { border-color: var(--state); }
.seal img { height: 30px; width: auto; }
.seal span {
  font-family: var(--f-mono);
  font-size: 0.57rem;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.railfoot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  margin-top: 1rem;
}
.railfoot__links button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color var(--t-fast);
}
.railfoot__links button:hover { color: var(--brand-hot); }

/* Short viewports: shed the rail's decorative lines so the seal and the
   legal links stay above the fold instead of hiding behind a scrollbar. */
@media (min-width: 1081px) and (max-height: 900px) {
  .rail__top  { padding-block: 1.15rem 1rem; }
  .rail__sub  { display: none; }
  .railnav    { padding-block: 0.45rem; }
  .railnav a  { padding-block: 0.5rem; }
  .railstat   { padding-block: 0.95rem; }
  /* Charter and cycle also live in the status strip and the hero ledger. */
  .railstat__ids div:nth-child(n+3) { display: none; }
}

@media (min-width: 1081px) and (max-height: 800px) {
  .meter { margin-bottom: 0.75rem; }
  .railstat__ids { display: none; }
}

/* Rail drawer toggle (mobile only) ---------------------------------------- */
.rail__toggle {
  display: none;
  width: 42px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--t-fast);
}
.rail__toggle:hover { border-color: var(--brand); }
.rail__toggle span {
  display: block;
  width: 18px; height: 1.5px;
  margin: 4px auto;
  background: currentColor;
  transition: transform var(--t-fast), opacity var(--t-fast);
}
.rail__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.rail__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.rail__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* Rail → top bar + drawer -------------------------------------------------- */
@media (max-width: 1080px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .view  { border-left: 0; }

  .rail {
    position: sticky;
    top: var(--strip);
    height: auto;
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(7, 9, 16, 0.94);
  }
  .rail__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem var(--pad);
  }
  .rail__brand { margin: 0; }
  .rail__brand img { width: 128px; }
  .rail__sub { display: none; }
  .rail__toggle { display: block; }

  .rail__body {
    display: none;
    max-height: min(72vh, 620px);
    padding-bottom: 0.5rem;
  }
  .rail__body.is-open { display: flex; animation: drop var(--t-med); }
  .railnav a, .railstat, .railfoot { padding-inline: var(--pad); }
  .railstat { margin-top: 0; }
}
@keyframes drop {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   8. Blocks — shared chrome
   -------------------------------------------------------------------------- */
.block {
  padding: clamp(3rem, 6vw, 5.5rem) var(--pad);
  border-bottom: 1px solid var(--line);
}
.block:last-of-type { border-bottom: 0; }

.block__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}
.block__head > div:first-child { max-width: 62ch; }
.block__head .tick { margin-bottom: 0.8rem; }
.block__head h2 {
  font-family: var(--f-display);
  font-size: clamp(1.45rem, 2.9vw, 2.2rem);
  letter-spacing: 0.01em;
  margin-bottom: 0.7rem;
  text-wrap: balance;
}
.block__head p { color: var(--text-2); font-size: 1.03rem; }

.block__count {
  font-family: var(--f-mono);
  font-size: 0.63rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-bottom: 0.35rem;
}

/* --------------------------------------------------------------------------
   9. Buttons
   -------------------------------------------------------------------------- */
.btn {
  --chamfer: 11px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.82rem 1.5rem;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-family: var(--f-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.btn > * { position: relative; z-index: 1; }

/* The sweep is skewed, so it has to overhang horizontally — otherwise the
   shear leaves an uncovered wedge in the top-left and bottom-right corners.
   `overflow: hidden` on the button trims the excess. */
.btn::before {
  content: "";
  position: absolute;
  inset: 0 -14px;
  background: var(--brand);
  transform: translateX(-110%) skewX(-14deg);
  transition: transform var(--t-med);
}
.btn:hover { color: #fff; border-color: var(--brand); }
.btn:hover::before { transform: translateX(0) skewX(-14deg); }

.btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  box-shadow: 0 6px 26px var(--brand-glow);
  clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer));
}
.btn--primary::before { background: var(--brand-hot); }

/* A small button needs a smaller chamfer, or the cut eats into the label. */
.btn--sm { --chamfer: 7px; padding: 0.58rem 1.05rem; font-size: 0.66rem; }

/* --------------------------------------------------------------------------
   10. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - var(--strip));
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("../hero.png") center / cover no-repeat;
  filter: saturate(1.12) contrast(1.04);
  opacity: 0.6;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(75deg, var(--ink) 8%, rgba(4, 5, 8, 0.86) 40%, rgba(4, 5, 8, 0.28) 85%),
    linear-gradient(0deg, var(--ink) 1%, transparent 40%);
}

.hero__main {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(4rem, 9vw, 7rem) var(--pad) clamp(2rem, 4vw, 3rem);
}

.hero__flags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }

.flag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.34rem 0.7rem;
  border: 1px solid var(--line-2);
  background: rgba(7, 9, 16, 0.66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--f-mono);
  font-size: 0.63rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}
.flag i { font-size: 0.75em; color: var(--brand-hot); }
.flag--state i { color: var(--state); }
.flag--gold  i { color: var(--gold); }

.hero h1 {
  font-family: var(--f-display);
  font-size: clamp(2.1rem, 5.6vw, 4.4rem);
  line-height: 1.03;
  margin-bottom: 1.3rem;
  max-width: 17ch;
  text-wrap: balance;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--brand-hot), var(--brand-deep) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__lede {
  max-width: 58ch;
  margin-bottom: 1.3rem;
  color: var(--text-2);
  font-size: 1.09rem;
}
.hero__lede strong { color: var(--text); font-weight: 600; }

.hero__motto {
  max-width: 56ch;
  margin-bottom: 2rem;
  padding-left: 1rem;
  border-left: 2px solid var(--brand);
  font-family: var(--f-mono);
  font-size: 0.72rem;
  line-height: 1.95;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-3);
}
.hero__motto b { color: var(--text-2); font-weight: 500; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* Registry ledger across the hero foot ------------------------------------- */
.ledger {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  background: rgba(4, 5, 8, 0.86);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.ledger div {
  padding: 0.95rem var(--pad);
  border-left: 1px solid var(--line);
  transition: background var(--t-fast);
}
.ledger div:first-child { border-left: 0; }
.ledger div:hover { background: var(--brand-film); }
.ledger dt {
  font-family: var(--f-mono);
  font-size: 0.56rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.28rem;
}
.ledger dd { margin: 0; font-weight: 600; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 1400px) { .ledger div { padding-inline: 1.1rem; } }
@media (max-width: 1080px) { .ledger { grid-template-columns: repeat(3, 1fr); } .ledger div:nth-child(-n+3) { border-top: 0; } .ledger div:nth-child(3n+1) { border-left: 0; } .ledger div:nth-child(n+4) { border-top: 1px solid var(--line); } }
@media (max-width: 560px)  { .ledger { grid-template-columns: repeat(2, 1fr); } .ledger div:nth-child(odd) { border-left: 0; } .ledger div:nth-child(even) { border-left: 1px solid var(--line); } .ledger div:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* --------------------------------------------------------------------------
   11. §01 Mandate — statement + telemetry bar
   -------------------------------------------------------------------------- */
.mandate {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 3rem);
}
.statement {
  font-family: var(--f-display);
  font-size: clamp(1.15rem, 2.1vw, 1.65rem);
  line-height: 1.5;
  max-width: 26ch;
  text-wrap: balance;
}
.statement b { color: var(--brand-hot); font-weight: 700; }

.mandate__split {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
@media (max-width: 900px) { .mandate__split { grid-template-columns: 1fr; } }
.mandate__body { display: grid; gap: 1rem; color: var(--text-2); }

.gauges {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
@media (max-width: 720px) { .gauges { grid-template-columns: repeat(2, 1fr); } }

.gauge {
  padding: 1.35rem 1.1rem;
  background: var(--panel);
  transition: background var(--t-med);
}
.gauge:hover { background: var(--panel-2); }
.gauge__num {
  font-family: var(--f-display);
  font-size: clamp(1.6rem, 3.1vw, 2.4rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.gauge__num span { color: var(--brand-hot); }
.gauge__label {
  margin-top: 0.55rem;
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* --------------------------------------------------------------------------
   12. §02 Systems — registry rows
   -------------------------------------------------------------------------- */
.reglist { border-top: 1px solid var(--line); }

.reg {
  position: relative;
  display: grid;
  grid-template-columns: 62px minmax(210px, 1fr) minmax(0, 1.75fr) 168px;
  gap: 1.5rem;
  align-items: start;
  padding: 1.6rem 1.5rem 1.6rem 0;
  border-bottom: 1px solid var(--line);
  transition: background var(--t-med);
}
.reg::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: -1px;
  width: 2px;
  background: var(--brand-hot);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--t-med);
}
.reg:hover { background: var(--panel); }
.reg:hover::before { transform: scaleY(1); }

.reg__idx {
  padding-left: 1.4rem;
  font-family: var(--f-display);
  font-size: 0.86rem;
  color: var(--line-2);
  padding-top: 0.15rem;
  transition: color var(--t-med);
}
.reg:hover .reg__idx { color: var(--brand); }

.reg__id h3 { font-size: 1.24rem; margin-bottom: 0.25rem; }
.reg__desig {
  display: block;
  font-family: var(--f-mono);
  font-size: 0.63rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.reg__desc { color: var(--text-2); font-size: 0.99rem; }

.reg__meta { display: grid; gap: 0.5rem; justify-items: start; }
.reg__meta span {
  font-family: var(--f-mono);
  font-size: 0.61rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
}
.reg__meta .reg__state { padding: 0.18rem 0.5rem; border: 1px solid currentColor; }
.reg__meta .reg__state--live    { color: var(--brand-hot); }
.reg__meta .reg__state--trial   { color: var(--text-3); }
.reg__meta .reg__state--rollout { color: var(--gold); }

@media (max-width: 1100px) {
  .reg { grid-template-columns: 52px minmax(0, 1fr); gap: 0.6rem 1rem; padding-right: var(--pad); }
  .reg__idx { padding-left: 1rem; grid-row: 1; }
  .reg__id { grid-column: 2; }
  .reg__desc { grid-column: 2; }
  .reg__meta { grid-column: 2; grid-auto-flow: column; justify-content: start; gap: 0.6rem; }
}
@media (max-width: 560px) { .reg__meta { grid-auto-flow: row; } }

/* --------------------------------------------------------------------------
   13. §03 Technology — sticky split
   -------------------------------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
@media (max-width: 980px) { .split { grid-template-columns: 1fr; } }

.split__aside {
  position: sticky;
  top: calc(var(--strip) + 2rem);
}
@media (max-width: 980px) { .split__aside { position: static; } }

.split__aside h2 {
  font-family: var(--f-display);
  font-size: clamp(1.45rem, 2.9vw, 2.2rem);
  margin: 0.8rem 0 0.8rem;
}
.split__aside p { color: var(--text-2); }

.entries { border-top: 1px solid var(--line); }
.entry {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left var(--t-med);
}
.entry:hover { padding-left: 0.6rem; }
.entry__glyph {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line-2);
  color: var(--brand-hot);
  transition: border-color var(--t-med), background var(--t-med);
}
.entry:hover .entry__glyph { border-color: var(--brand); background: var(--brand-film); }
.entry h3 { font-size: 1.1rem; margin-bottom: 0.35rem; }
.entry p { color: var(--text-2); font-size: 0.98rem; }

/* --------------------------------------------------------------------------
   14. §04 Programs — horizontal milestone track
   -------------------------------------------------------------------------- */
.track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(272px, 336px);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.track::-webkit-scrollbar { height: 8px; }
.track::-webkit-scrollbar-thumb { background: var(--line-2); }
.track::-webkit-scrollbar-track { background: var(--ink-2); }

.mile {
  position: relative;
  scroll-snap-align: start;
  padding: 1.5rem 1.4rem 1.6rem;
  background: var(--panel);
  transition: background var(--t-med);
}
.mile:hover { background: var(--panel-2); }
.mile::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: var(--line-2);
}
.mile--done::before    { background: var(--brand); }
.mile--active::before  { background: linear-gradient(90deg, var(--gold) 55%, var(--line-2) 55%); }
.mile--planned::before { background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 12px); }

.mile__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-family: var(--f-mono);
  font-size: 0.61rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.mile__date { color: var(--brand-hot); }
.mile__state { padding: 0.16rem 0.48rem; border: 1px solid currentColor; }
.mile--done    .mile__state { color: var(--brand-hot); }
.mile--active  .mile__state { color: var(--gold); }
.mile--planned .mile__state { color: var(--text-3); }

.mile h3 { font-size: 1.06rem; margin-bottom: 0.4rem; }
.mile p { color: var(--text-2); font-size: 0.95rem; }

.track__hint {
  margin-top: 0.9rem;
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* --------------------------------------------------------------------------
   15. §05 Facilities — coordinate grid
   -------------------------------------------------------------------------- */
.sites {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.site {
  position: relative;
  overflow: hidden;
  padding: 1.6rem 1.5rem;
  background: var(--panel);
  transition: background var(--t-med);
}
.site:hover { background: var(--panel-2); }
.site__no {
  position: absolute;
  top: -0.4rem; right: 0.5rem;
  font-family: var(--f-display);
  font-size: 4.2rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.028);
  pointer-events: none;
}
.site h3 { font-size: 1.06rem; margin-bottom: 0.3rem; }
.site__loc {
  display: block;
  margin-bottom: 0.75rem;
  font-family: var(--f-mono);
  font-size: 0.61rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brand-hot);
}
.site p { color: var(--text-2); font-size: 0.95rem; }
.site__coord {
  display: block;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--line-2);
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.13em;
  color: var(--text-3);
}

/* --------------------------------------------------------------------------
   16. §06 Careers — posting rows
   -------------------------------------------------------------------------- */
.posts { border-top: 1px solid var(--line); }
.post {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(0, 1.5fr) 190px 150px;
  gap: 1.25rem;
  align-items: center;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
  transition: background var(--t-med), padding-left var(--t-med);
}
.post:hover { background: var(--panel); padding-left: 0.75rem; }
.post h3 { font-size: 1.06rem; }
.post p { color: var(--text-2); font-size: 0.95rem; }
.post__site,
.post__clr {
  font-family: var(--f-mono);
  font-size: 0.61rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
}
.post__clr { color: var(--gold); justify-self: start; padding: 0.18rem 0.5rem; border: 1px solid currentColor; }

@media (max-width: 1080px) {
  .post { grid-template-columns: minmax(0, 1fr); gap: 0.45rem; }
  .post__clr { justify-self: start; }
}

/* --------------------------------------------------------------------------
   17. §07 Contact
   -------------------------------------------------------------------------- */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }

.contact__panel { padding: clamp(1.5rem, 3vw, 2.3rem); background: var(--panel); }
.contact__panel h3 { font-family: var(--f-display); font-size: 1.1rem; margin-bottom: 1.2rem; }

.rows { display: grid; gap: 0.85rem; }
.rows > div {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}
.rows > div:last-child { border-bottom: 0; padding-bottom: 0; }
.rows dt {
  font-family: var(--f-mono);
  font-size: 0.61rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-top: 0.3rem;
}
.rows dd { margin: 0; }
.rows a { color: var(--brand-hot); border-bottom: 1px solid rgba(255, 50, 65, 0.3); }
@media (max-width: 520px) { .rows > div { grid-template-columns: 1fr; gap: 0.2rem; } }

.notice {
  padding: 1.05rem 1.15rem;
  border: 1px solid var(--line-2);
  border-left: 2px solid var(--gold);
  background: rgba(247, 181, 0, 0.035);
  font-size: 0.92rem;
  color: var(--text-2);
}
.notice + .notice { margin-top: 0.85rem; }
.notice strong {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.notice--state { border-left-color: var(--state); background: rgba(55, 123, 241, 0.04); }
.notice--state strong { color: var(--state); }

/* --------------------------------------------------------------------------
   18. View footer
   -------------------------------------------------------------------------- */
.viewfoot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem var(--pad);
  border-top: 1px solid var(--line);
  background: var(--ink-2);
  font-family: var(--f-mono);
  font-size: 0.61rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.viewfoot a { color: var(--text-3); }
.viewfoot a:hover { color: var(--brand-hot); }

/* --------------------------------------------------------------------------
   19. Dialogs
   -------------------------------------------------------------------------- */
dialog {
  width: min(740px, calc(100vw - 2rem));
  max-height: min(84vh, 880px);
  padding: 0;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.72);
}
dialog::backdrop {
  background: rgba(2, 3, 6, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
dialog[open] { animation: modal-in var(--t-med); }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.modal__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.35rem;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line-2);
}
.modal__head h3 {
  font-family: var(--f-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.modal__close {
  flex: none;
  width: 32px; height: 32px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast);
}
.modal__close:hover { border-color: var(--brand); color: var(--brand-hot); }

.modal__body { padding: 1.35rem; overflow-y: auto; max-height: calc(84vh - 58px); }
.modal__body h4 {
  margin: 1.5rem 0 0.45rem;
  font-family: var(--f-mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-hot);
}
.modal__body h4:first-child { margin-top: 0; }
.modal__body p, .modal__body li { color: var(--text-2); font-size: 0.95rem; }
.modal__body p + p { margin-top: 0.65rem; }
.modal__body ul { margin-top: 0.55rem; padding-left: 1.05rem; list-style: square; }
.modal__body li::marker { color: var(--brand); }
.modal__body a { color: var(--brand-hot); }

/* --------------------------------------------------------------------------
   20. Storage notice & back-to-top
   -------------------------------------------------------------------------- */
.notice-box {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 200;
  width: min(440px, calc(100vw - 2rem));
  display: none;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.1rem;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-top: 2px solid var(--brand);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}
.notice-box.is-open { display: flex; animation: rise var(--t-med); }
/* Without this the button is a shrinkable flex item and its label spills
   out of both sides of the box. */
.notice-box .btn { flex: none; align-self: center; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.notice-box strong {
  display: block;
  margin-bottom: 0.28rem;
  font-family: var(--f-mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.notice-box p { color: var(--text-2); font-size: 0.89rem; }

.to-top {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 150;
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border: 1px solid var(--line-2);
  background: rgba(11, 14, 21, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-2);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--t-med), transform var(--t-med), visibility var(--t-med),
              border-color var(--t-fast), color var(--t-fast);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--brand); color: var(--brand-hot); }
.notice-box.is-open ~ .to-top { bottom: 8.2rem; }

/* --------------------------------------------------------------------------
   21. Reveal
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--t-slow), transform var(--t-slow);
  transition-delay: var(--reveal-delay, 0ms);

  /* Safety net: if the script never runs (blocked, 404, parse error) the
     observer never adds .is-in, so unfold everything after a short delay
     rather than leaving the document blank. The script cancels this the
     moment it executes by putting `.js` on <html>. */
  animation: reveal-failsafe 1ms linear 2.5s forwards;
}
.js [data-reveal] { animation: none; }
[data-reveal].is-in { opacity: 1; transform: none; }

@keyframes reveal-failsafe {
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   22. Preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

@media print {
  .backdrop, .statusrail, .rail, .to-top, .notice-box { display: none !important; }
  .shell { display: block; padding-top: 0; }
  .view { border: 0; }
  body { background: #fff; color: #000; }
  .hero { min-height: 0; }
  .hero::before, .hero::after { display: none; }
}
