/* natu — hand-written, no build step. Fonts are self-hosted (SIL OFL, see /fonts). */

@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-latin-wght-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  /* Night file: black, plus three deep tones. Each has one job: blue holds the page, purple is the rule, green is the lab. */
  --black: #07080D;      /* the page */
  --navy: #0D1328;       /* raised surfaces: the file card, the status key */
  --navy-2: #141C3A;     /* hover, the card's offset shadow */
  --navy-3: #0B1022;     /* the footer */
  --violet: #2A1650;     /* the rule's band */
  --green: #0A211A;      /* the lab room */
  --green-2: #061510;    /* the lab's sunken panel */

  --text: #ECEAF4;       /* the light on the page: text, and the redaction tape */
  --tape: #DDDAEB;       /* the redaction stroke: the same light, a notch lower so a row of them does not glare */
  --text-2: #A7ABC4;     /* secondary text */
  --rule: #262E4C;       /* hairlines */
  --edge: #6E789F;       /* structural lines and control borders (3:1 or more) */
  --lilac: #B9A6FF;      /* accent and warning: the purple, lit */
  --mint: #56B88C;       /* done / alive: the green, lit */
  --sky: #7AA7F2;        /* being checked: the blue, lit */

  --bg: var(--black);
  --fg: var(--text);
  --mut: var(--text-2);
  --line: var(--rule);
  --strong: var(--edge);
  --acc: var(--lilac);

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Plex Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;

  --gut: clamp(1.25rem, 4.5vw, 4rem);
  --top: 3.5rem;
}

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

html {
  /* Type grows gently with the viewport so 1920 and 2560 screens are not left with tiny text. */
  font-size: clamp(100%, calc(59.4% + 0.5vw), 137.5%);
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
  background: var(--black);
  scrollbar-color: #3A4368 var(--black);
  scroll-padding-top: calc(var(--top) + 1rem);
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

::selection { background: #4B2E9E; color: #fff; }

body {
  margin: 0;
  /* A little deep blue in the top corner, so the page opens with some air instead of flat black. */
  background: var(--bg) radial-gradient(64rem 40rem at 88% 16rem, #101A3E 0%, rgba(16, 26, 62, 0) 70%) no-repeat;
  color: var(--fg);
  font: 400 1.0625rem/1.6 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
b, strong { font-weight: 600; }
button { font: inherit; color: inherit; }

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

.wrap { width: 100%; max-width: 78rem; margin-inline: auto; padding-inline: var(--gut); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip { position: absolute; left: var(--gut); top: -5rem; z-index: 20; background: var(--text); color: var(--black); padding: .6rem 1rem; text-decoration: none; }
.skip:focus { top: .5rem; }

.eyebrow, .sec__tag, .mini, .card dt, .ledger__head, .net__cap, .path__h, .meter, .step__has span, .foot__end {
  font: 500 .75rem/1.4 var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
}
.eyebrow { color: var(--mut); }

/* Redaction: the page's one recurring mark. Same width everywhere, so it says nothing about the name it covers.
   On a dark page the ink is light: one pass of a pale marker over the name. The mask gives it the uneven edge of a
   stroke made by hand, which is what tells it apart from an empty field or a loading placeholder. */
.bar { --stroke: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20' preserveAspectRatio='none'%3E%3Cpath d='M1.5 3.6C9 2.2 17 3.9 27 2.9C39 1.8 50 3.7 62 2.6C73 1.7 86 3.4 98.2 2.2C99.4 5.5 98.6 9 99.6 12.5C99.9 14.6 99 16.3 98.6 17.6C88 18.9 77 16.9 65 17.9C52 18.9 41 17 29 18.1C19 19 9 17.2 1 18.3C.2 14.5 1.4 11 .5 7.5C.3 6 .9 4.6 1.5 3.6Z'/%3E%3C/svg%3E"); display: inline-block; vertical-align: -0.12em; width: 6.5rem; height: 1em; background: var(--tape); -webkit-mask: var(--stroke) center / 100% 100% no-repeat; mask: var(--stroke) center / 100% 100% no-repeat; }
@media (forced-colors: active) { .bar { background: CanvasText; forced-color-adjust: none; } }
.bar--s { width: 5rem; }
.bar--xs { width: 3.4rem; }

/* ── Top bar ── */
.top { position: sticky; top: 0; z-index: 10; background: var(--black); border-bottom: 1px solid var(--line); }
.top__in { display: flex; align-items: center; gap: 1.5rem; min-height: var(--top); }
.top__name { font: 600 1.35rem/1 var(--serif); letter-spacing: -.02em; text-decoration: none; padding: .4rem 0; }
.top__nav { display: none; gap: 1.4rem; margin-left: auto; }
.top__nav a { font: 400 .8rem/1 var(--mono); letter-spacing: .04em; text-decoration: none; color: var(--mut); padding: .6rem 0; }
.top__nav a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: .3em; }
.lang { display: flex; margin-left: auto; border: 1px solid var(--strong); border-radius: 2px; }
.no-js .lang { display: none; }
.lang button { appearance: none; border: 0; background: transparent; font: 500 .8rem/1 var(--mono); letter-spacing: .06em; padding: .55rem .7rem; min-width: 2.75rem; min-height: 2.25rem; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--text); color: var(--black); }
.lang button:not([aria-pressed="true"]):hover { background: var(--navy-2); }
@media (min-width: 60em) {
  .top__nav { display: flex; }
  .lang { margin-left: 0; }
}

/* ── Hero ── */
.hero { display: grid; gap: 2.5rem; padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(3rem, 7vw, 5.5rem); }
.hero__name { font: 560 clamp(6rem, 21vw, 14rem)/.78 var(--serif); letter-spacing: -.045em; margin: .12em 0 .22em -.04em; }
.hero__lead { font: 400 clamp(1.5rem, 1.05rem + 1.9vw, 2.45rem)/1.17 var(--serif); letter-spacing: -.012em; max-width: 21em; text-wrap: pretty; }
.hero__note { margin-top: 1.4rem; max-width: 34em; color: var(--mut); }
.hero__note strong { color: var(--fg); }

.card { align-self: end; border: 1px solid var(--strong); background: var(--navy); box-shadow: .4rem .4rem 0 var(--navy-2); }
.card__row { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .75rem; padding: .7rem 1rem; align-items: baseline; }
.card__row + .card__row { border-top: 1px solid var(--line); }
.card dt { color: var(--mut); }
.card dd { font-size: .98rem; line-height: 1.35; }
.card__muted { color: var(--mut); font-size: .9rem; white-space: nowrap; }
.live { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--mint); margin-right: .5rem; }
@media (min-width: 60em) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 21rem); gap: 4rem; align-items: end; }
}

/* ── The rule ── */
.rule { background: var(--violet); color: var(--text); border-block: 1px solid #4A3183; }
.rule :focus-visible { outline-color: var(--text); }
.rule__in { display: grid; gap: 1rem 4rem; padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.rule .eyebrow { color: var(--lilac); }
.rule__q { font: italic 500 clamp(2.6rem, 1.4rem + 5.4vw, 6rem)/.95 var(--serif); letter-spacing: -.03em; }
.rule__t { max-width: 30em; font-size: 1.1rem; }
@media (min-width: 60em) {
  .rule__in { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: end; }
  .rule .eyebrow { grid-column: 1 / -1; }
}

/* ── Sections ── */
.sec { display: grid; gap: 1.25rem; padding-block: clamp(3.5rem, 8vw, 6.5rem); }
main > .sec + .sec { border-top: 1px solid var(--line); }
.sec__tag { color: var(--mut); display: flex; gap: .8rem; align-items: baseline; }
.sec__n { color: var(--acc); }
.sec__body > * + * { margin-top: 1.5rem; }
h2 { font: 480 clamp(2rem, 1.35rem + 2.5vw, 3.3rem)/1.04 var(--serif); letter-spacing: -.025em; max-width: 17em; text-wrap: balance; }
.lead { font-size: 1.2rem; line-height: 1.5; max-width: 38em; text-wrap: pretty; }
@media (min-width: 60em) {
  .sec { grid-template-columns: 11rem minmax(0, 1fr); gap: 2rem; }
  .sec__tag { position: sticky; top: calc(var(--top) + 1.5rem); align-self: start; flex-direction: column; gap: .3rem; padding-top: .9rem; }
}

/* ── 01 Ground ── */
.cols { display: grid; gap: 2.5rem; margin-top: 2.5rem !important; }
.col h3 { font: 500 1.45rem/1.15 var(--serif); letter-spacing: -.01em; padding-bottom: .8rem; border-bottom: 1px solid var(--strong); }
.gloss li { padding: .7rem 0; border-bottom: 1px solid var(--line); font: 500 .92rem/1.4 var(--mono); }
@media (min-width: 48em) { .cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; } }

/* ── 02 Method ── */
.flow { display: grid; margin-top: 2.5rem !important; counter-reset: none; }
.flow li { position: relative; padding: 0 0 1.6rem 3.2rem; }
.flow li::before { content: ""; position: absolute; left: .95rem; top: 2rem; bottom: 0; width: 1px; background: var(--strong); }
.flow li:last-child::before { display: none; }
.flow__n { position: absolute; left: 0; top: 0; width: 2rem; height: 2rem; border: 1px solid var(--strong); border-radius: 50%; background: var(--black); display: grid; place-items: center; font: 500 .85rem/1 var(--mono); }
.flow h3 { font: 500 1.3rem/1.2 var(--serif); padding-top: .2rem; }
.flow p { color: var(--mut); font-size: .97rem; line-height: 1.45; margin-top: .3rem; }
.flow__gate .flow__n { background: var(--acc); border-color: var(--acc); color: var(--black); }
.flow__gate h3 { color: var(--acc); }
.flow .flow__stop { display: inline-flex; gap: .5rem; align-items: baseline; margin-top: .7rem; padding: .45rem .6rem; border: 1px dashed var(--acc); color: var(--acc); font: 500 .82rem/1.35 var(--mono); }
.x { flex: none; width: .6rem; height: .6rem; background: linear-gradient(45deg, transparent 43%, currentColor 43% 57%, transparent 57%), linear-gradient(-45deg, transparent 43%, currentColor 43% 57%, transparent 57%); }
@media (min-width: 40em) {
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem 0; }
  .flow li { padding: 3rem 1.25rem 0 0; }
  .flow li::before { left: 2rem; right: 0; top: 1rem; bottom: auto; width: auto; height: 1px; }
  .flow li:last-child::before { display: block; right: auto; width: 0; }
  .flow li:nth-child(3)::before { display: none; }
}
/* ── 03 Reports ── */
.st { flex: none; display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; border: 2px solid var(--mut); }
.st--ok { background: var(--mint); border-color: var(--mint); }
.st--wait { border-color: var(--lilac); background: linear-gradient(90deg, var(--lilac) 50%, transparent 50%); }
.st--check { border-color: var(--sky); border-width: 3px; }
.st--dup { border-radius: 1px; background: var(--mut); }
.st--none { border-width: 1.5px; }

.ledger { margin-top: 3rem !important; }
.ledger h3 { font: 500 1.6rem/1.15 var(--serif); letter-spacing: -.015em; }
.ledger__d { color: var(--mut); max-width: 40em; margin-top: .5rem; }
.ledger__d em { font-style: normal; font-family: var(--mono); font-size: .92em; color: var(--fg); }
.ledger__head { display: none; color: var(--mut); }
.rows { margin-top: 1.25rem; border-top: 1px solid var(--strong); }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem 1rem; align-items: center; padding: .95rem 0; border-bottom: 1px solid var(--line); }
.row__what { grid-column: 1 / -1; grid-row: 1; }
.row__what b { display: block; font-size: 1.06rem; line-height: 1.35; }
.row__what small { display: block; color: var(--mut); font-size: .9rem; line-height: 1.4; margin-top: .15rem; }
.row__name { line-height: 1; }
.row__state { display: flex; align-items: center; gap: .55rem; font: 400 .82rem/1.35 var(--mono); }
@media (min-width: 48em) {
  .ledger__head, .row { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) minmax(0, 17.5rem); gap: 1.5rem; }
  .ledger__head { margin-top: 1.5rem; padding-bottom: .6rem; }
  .ledger__head + .rows { margin-top: 0; }
  .row__what { grid-column: auto; grid-row: auto; }
}

/* ── 04 Lab (the one green room) ── */
/* Everywhere else the page is black and blue. The lab is the only place lit green, wall to wall, and its diagram is drawn on squared paper. */
.lab { --bg: var(--green); --mut: #A5C0B4; --line: #1F4135; --strong: #6F9585; background: var(--bg); color: var(--fg); border-block: 1px solid #2C5A4A; }
.lab__grid { display: grid; gap: 3rem; margin-top: 3rem !important; }

.net { border: 1px solid #2C5A4A; padding: 1.25rem; background-color: var(--green-2); background-image: linear-gradient(rgba(165, 192, 180, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(165, 192, 180, .06) 1px, transparent 1px); background-size: 1.25rem 1.25rem; }
.net__cap, .path__h { color: var(--mut); margin-bottom: 1rem; }
.node { border: 1px solid var(--strong); background: var(--green-2); padding: .7rem .85rem; display: grid; gap: .15rem; position: relative; transition: border-color .4s, background-color .4s; }
.node__name { font: 500 1.05rem/1.2 var(--mono); }
.node__desc { color: var(--mut); font-size: .9rem; line-height: 1.4; }
.node--kali { border-color: var(--acc); }
.node--kali .node__name { color: var(--acc); }
.wire { width: 2px; height: 2.6rem; margin-left: 1.6rem; background: repeating-linear-gradient(to bottom, var(--acc) 0 6px, transparent 6px 12px); background-size: 2px 12px; transition: opacity .4s; }
.domain { border: 1px dashed var(--strong); padding: 1.5rem .85rem .85rem; display: grid; gap: .75rem; position: relative; }
.domain__label { position: absolute; top: -.7em; left: .7rem; background: var(--green-2); padding: 0 .45rem; font: 400 .78rem/1.4 var(--mono); color: var(--mut); }
.node__flag { display: none; justify-self: start; margin-top: .4rem; padding: .15rem .45rem; background: var(--acc); color: var(--black); font: 500 .72rem/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.net[data-step="6"] .node--dc { border-color: var(--acc); background: #1D1A3D; }
.net[data-step="6"] .node__flag { display: inline-block; }
.net[data-step="1"] .wire { opacity: .25; }
@media (prefers-reduced-motion: no-preference) {
  .net:not([data-step="1"]) .wire { animation: march .9s linear infinite; }
}
@keyframes march { to { background-position-y: 12px; } }

.meter { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem .75rem; align-items: center; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--mut); }
.meter__bars { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.meter__bars i { height: .55rem; background: var(--line); transition: background-color .3s; }
.meter__n { color: var(--fg); }
.net[data-step="1"] .meter i:nth-child(-n+1),
.net[data-step="2"] .meter i:nth-child(-n+2),
.net[data-step="3"] .meter i:nth-child(-n+3),
.net[data-step="4"] .meter i:nth-child(-n+4),
.net[data-step="5"] .meter i:nth-child(-n+5),
.net[data-step="6"] .meter i:nth-child(-n+6) { background: var(--acc); }

.step { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: 1rem; position: relative; padding-bottom: 2.25rem; }
.step::before { content: ""; position: absolute; left: 1.1rem; top: 2.25rem; bottom: 0; width: 1px; background: var(--line); }
.step:last-child { padding-bottom: 0; }
.step:last-child::before { display: none; }
.step__n { width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center; font: 500 .9rem/1 var(--mono); background: var(--acc); color: var(--black); border: 1px solid var(--acc); transition: background-color .3s, color .3s; }
.steps.is-live .step:not(.is-reached) .step__n { background: transparent; color: var(--acc); }
.step h4 { font: 500 1.5rem/1.15 var(--serif); letter-spacing: -.01em; padding-top: .2rem; }
.step__term { font: 400 .88rem/1.4 var(--mono); color: var(--acc); margin-top: .25rem; }
.step p:not([class]) { color: #D3DED8; margin-top: .6rem; max-width: 36em; }
.step__has { margin-top: .8rem; display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: baseline; }
.step__has span { color: var(--mut); }
.step__has b { font-weight: 600; }
.path__cta { margin-top: 2.5rem; }
@media (min-width: 60em) {
  .lab__grid { grid-template-columns: minmax(0, 21rem) minmax(0, 1fr); gap: 4rem; align-items: start; }
  .net { position: sticky; top: calc(var(--top) + 1.5rem); }
}

/* ── Buttons / external links ── */
.btn { display: inline-flex; align-items: center; gap: .6rem; padding: .75rem 1rem; border: 1px solid var(--fg); font: 500 .88rem/1.2 var(--mono); text-decoration: none; transition: background-color .15s, color .15s; }
.btn:hover { background: var(--fg); color: var(--bg); }
.ext { width: .75rem; height: .75rem; flex: none; }

/* ── 05 HTB ── */
.boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .6rem; margin-top: 2.25rem !important; }
.boxes li { border: 1px solid var(--strong); padding: .8rem .85rem; font: 500 .95rem/1.2 var(--mono); display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.boxes li::after { content: ""; flex: none; width: .4rem; height: .75rem; border: solid var(--mint); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-.1rem, -.1rem); }
.htb__meta { display: grid; gap: .6rem; margin-top: 2rem !important; }
.htb__meta p { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .75rem; align-items: baseline; }
.mini { color: var(--mut); }

/* ── 06 / 07 item lists ── */
.items { display: grid; gap: 0 2.5rem; margin-top: 2.5rem !important; border-top: 1px solid var(--strong); }
.items li { padding: 1.3rem 0 1.5rem; border-bottom: 1px solid var(--line); }
.items h3 { font: 500 1.35rem/1.2 var(--serif); letter-spacing: -.01em; }
.items p { color: var(--mut); margin-top: .45rem; max-width: 34em; }
.items .btn { color: var(--fg); margin-top: .4rem; }
@media (min-width: 48em) { .items { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── Footer ── */
.foot { --bg: var(--navy-3); background: var(--bg); border-top: 1px solid var(--strong); padding-block: clamp(3.5rem, 8vw, 6rem) 2rem; }
.foot__q { font: italic 480 clamp(2.2rem, 1.2rem + 4.6vw, 5.2rem)/1 var(--serif); letter-spacing: -.03em; max-width: 14em; }
.bar--big { width: 2.6em; height: .62em; vertical-align: -.02em; }
.foot__links { display: grid; gap: 0; margin-top: clamp(2.5rem, 6vw, 4.5rem); border-top: 1px solid var(--strong); }
.foot__links a { display: grid; gap: .2rem; padding: 1.1rem 0; text-decoration: none; border-bottom: 1px solid var(--rule); }
.foot__links b { font: 500 1.05rem/1.3 var(--mono); text-decoration: underline; text-underline-offset: .25em; text-decoration-thickness: 1px; }
.foot__links span { color: var(--mut); font-size: .95rem; }
.foot__links a:hover b { color: var(--acc); }
.foot__end { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; justify-content: space-between; margin-top: 2.5rem; color: var(--mut); }
@media (min-width: 48em) {
  .foot__links { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 2.5rem; }
}

@media print {
  .top, .lang { display: none; }
  /* On paper the file goes back to ink on white. */
  :root, .lab, .foot { --bg: #fff; --fg: #000; --mut: #333; --line: #bbb; --strong: #000; --acc: #000; --text: #000; --black: #fff; --tape: #000; --navy: #fff; --navy-2: #fff; --violet: #fff; --green-2: #fff; --mint: #000; --sky: #000; --lilac: #000; color-scheme: light; }
  html, body { background: #fff; }
  .rule, .lab, .net, .node { border-color: #000; background-image: none; }
}
