/* why-nginx.php (rebuilt 2026-09-27). The page's pictures are built in HTML, one shape per section:
   a route with seven stops and the exits where a request can leave early, a load balancer fanning
   out to servers with the method switched by the reader, one server's PHP-FPM pools with a
   failover, an annotated server block and the trap one missing line opens, accounts drawn as walled
   rooms on a floor plan, php.ini as three tiers of who may change what, the cache as strata a
   request drops through, and a terminal. Copper is the one accent (the path a request takes, what
   is locked); patina marks what answers or is allowed; warn ink only where something is refused.
   Motion is transform and opacity, 160-320ms ease-out, once on reveal or on a switch; hover only
   on a real pointer; reduced motion keeps the colour changes and drops the movement. Everything is
   drawn in full without the script: the reveal only hides what html.anim-ready has promised to show. */

.ng-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; }
.ng-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.ng-actions-c { justify-content: center; }
.ng-link { display: inline-flex; align-items: center; gap: 6px; color: var(--copper-ink); font-weight: 600; text-decoration: none; }
.ng-link span { display: inline-block; transition: transform var(--dur-1) var(--ease-out); }
html[dir="rtl"] .ng-link span { transform: scaleX(-1); }
.ng-links { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.ng-pair code, .ng-points code, .ng-notes code, .ng-walls code, .ng-tiers code, .ng-outcomes code, .ng-spec dd code, .ng-servers span code {
    font-family: var(--font-mono); font-size: .88em; padding: 1px 6px; border-radius: 5px; background: var(--well); color: var(--text-strong); unicode-bidi: isolate; word-break: break-word; }

/* a segmented switch, shared by the three pictures the reader can change */
.ng-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 22px; background: var(--bg-alt); }
.ng-seg label { display: inline-flex; align-items: center; min-height: 38px; padding: 6px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--text-2); cursor: pointer; user-select: none; transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out); }
.ng-lb .ng-seg label { font-family: var(--font-mono); font-size: 13.5px; }
#ng-lb-rr:checked ~ .ng-lb-top label[for="ng-lb-rr"], #ng-lb-lc:checked ~ .ng-lb-top label[for="ng-lb-lc"], #ng-lb-ih:checked ~ .ng-lb-top label[for="ng-lb-ih"],
#ng-pl-up:checked ~ .ng-pl-top label[for="ng-pl-up"], #ng-pl-re:checked ~ .ng-pl-top label[for="ng-pl-re"],
#ng-cs-a:checked ~ .ng-cs-top label[for="ng-cs-a"], #ng-cs-u:checked ~ .ng-cs-top label[for="ng-cs-u"] { background: var(--text-strong); color: var(--bg); }
#ng-lb-rr:focus-visible ~ .ng-lb-top label[for="ng-lb-rr"], #ng-lb-lc:focus-visible ~ .ng-lb-top label[for="ng-lb-lc"], #ng-lb-ih:focus-visible ~ .ng-lb-top label[for="ng-lb-ih"],
#ng-pl-up:focus-visible ~ .ng-pl-top label[for="ng-pl-up"], #ng-pl-re:focus-visible ~ .ng-pl-top label[for="ng-pl-re"],
#ng-cs-a:focus-visible ~ .ng-cs-top label[for="ng-cs-a"], #ng-cs-u:focus-visible ~ .ng-cs-top label[for="ng-cs-u"] { outline: 2px solid var(--copper-ink); outline-offset: 2px; }
.ng-tag { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); padding: 5px 11px; border: 1px dashed var(--line-strong, var(--line)); border-radius: 999px; }

/* a configuration file: a title bar and a well; always left to right */
.ng-file { margin: 0; min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-2); overflow: hidden; }
.ng-file-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 12.5px; color: var(--text-2); }
.ng-file-top small { font-family: var(--font-body); font-size: 12px; color: var(--text-muted); }
.ng-file pre, .ng-tier pre, .ng-term pre { margin: 0; padding: 14px 16px; overflow-x: auto; background: var(--well); font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; color: var(--text); text-align: left; tab-size: 4; }
.ng-file pre code, .ng-tier pre code, .ng-term pre code { background: none; padding: 0; font: inherit; color: inherit; white-space: pre; word-break: normal; }
.ng-pair { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; margin-top: clamp(40px, 5vw, 64px); }

/* ---- 1. the route: a rail down the start edge, one row per stop, the exits at the far end ---------- */
.ng-route { position: relative; list-style: none; margin: 0; padding: 0; }
.ng-route::before { content: ''; position: absolute; top: 32px; bottom: 32px; inset-inline-start: 17px; width: 2px; background: linear-gradient(to bottom, var(--line-strong, var(--line)), var(--copper-ink)); transform-origin: center top; transition: transform 700ms var(--ease-out); }
.ng-stop { position: relative; display: grid; grid-template-columns: 36px minmax(0, 15rem) minmax(0, 1fr) minmax(0, 14rem); gap: 0 28px; align-items: center; padding: 14px 0; transition: opacity 320ms var(--ease-out), transform 320ms var(--ease-out); }
.ng-stop + .ng-stop::before { content: ''; position: absolute; top: 0; inset-inline: 64px 0; border-top: 1px solid var(--line); }
.ng-dot { grid-column: 1; grid-row: 1 / span 2; position: relative; z-index: 1; display: grid; place-items: center; width: 36px; height: 36px; border: 1.5px solid var(--line-strong, var(--line)); border-radius: 50%; background: var(--bg); font-family: var(--font-mono); font-size: 13px; color: var(--copper-ink); }
.ng-stop.is-php .ng-dot { background: var(--copper-ink); border-color: var(--copper-ink); color: var(--bg); }
.ng-stop b { grid-column: 2; grid-row: 1; font-size: 17px; line-height: 1.35; color: var(--text-strong); }
.ng-stop p { grid-column: 3; grid-row: 1; margin: 0; max-width: 60ch; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.ng-exit { grid-column: 4; grid-row: 1; justify-self: end; display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border: 1px dashed currentColor; border-radius: 999px; font-style: normal; font-size: 13px; line-height: 1.4; }
/* the spur: a request leaving the line sideways */
.ng-exit::before { content: ''; flex: none; width: 8px; height: 8px; border-inline-start: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px); }
.ng-exit.is-stop { color: var(--warn-ink); }
.ng-exit.is-done { color: var(--patina-ink); }
.ng-route .ng-stop:nth-child(2) { transition-delay: 60ms; }
.ng-route .ng-stop:nth-child(3) { transition-delay: 120ms; }
.ng-route .ng-stop:nth-child(4) { transition-delay: 180ms; }
.ng-route .ng-stop:nth-child(5) { transition-delay: 240ms; }
.ng-route .ng-stop:nth-child(6) { transition-delay: 300ms; }
.ng-route .ng-stop:nth-child(7) { transition-delay: 360ms; }
html.anim-ready .ng-route:not(.revealed)::before { transform: scaleY(0); }
html.anim-ready .ng-route:not(.revealed) .ng-stop { opacity: 0; transform: translateY(8px); }

/* ---- 2. the balancer --------------------------------------------------------------------------- */
.ng-lb, .ng-pl, .ng-cs { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-2); overflow: hidden; }
.ng-lb-top, .ng-pl-top, .ng-cs-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.ng-lb-say { padding: 16px 20px 0; }
.ng-lb-say p { display: none; margin: 0; max-width: 72ch; font-size: 15.5px; line-height: 1.65; color: var(--text-2); }
.ng-lb-body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 24px 32px; align-items: center; padding: 20px; }
.ng-lb-code { box-shadow: none; }
.ng-lb .m-rr, .ng-lb .m-lc, .ng-lb .m-ih { display: none; }
#ng-lb-rr:checked ~ .ng-lb-say .m-rr, #ng-lb-lc:checked ~ .ng-lb-say .m-lc, #ng-lb-ih:checked ~ .ng-lb-say .m-ih,
#ng-lb-rr:checked ~ .ng-lb-body .ng-servers .m-rr, #ng-lb-lc:checked ~ .ng-lb-body .ng-servers .m-lc, #ng-lb-ih:checked ~ .ng-lb-body .ng-servers .m-ih { display: block; animation: ng-in 220ms var(--ease-out); }
#ng-lb-rr:checked ~ .ng-lb-body pre .m-rr, #ng-lb-lc:checked ~ .ng-lb-body pre .m-lc, #ng-lb-ih:checked ~ .ng-lb-body pre .m-ih { display: inline; }
.ng-lb pre .ng-hl { color: var(--copper-ink); font-weight: 600; }
.ng-lb pre .ng-c { color: var(--text-muted); }
/* a switched line slides into place; it never starts invisible, so a paused timeline still shows it */
@keyframes ng-in { from { transform: translateY(4px); } to { transform: none; } }

.ng-fan { display: grid; grid-template-columns: minmax(0, 132px) minmax(28px, 1fr) minmax(0, 210px); align-items: center; }
.ng-node { display: flex; flex-direction: column; gap: 4px; padding: 16px 14px; border: 1.5px solid var(--copper-ink); border-radius: 14px; background: var(--bg); text-align: center; }
.ng-node b { font-size: 18px; color: var(--text-strong); }
.ng-node small { font-family: var(--font-mono); font-size: 11.5px; line-height: 1.4; color: var(--text-muted); word-break: break-word; }
.ng-wires-box { position: relative; align-self: stretch; min-height: 100%; }
.ng-wires { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; }
html[dir="rtl"] .ng-wires { transform: scaleX(-1); }
.ng-wires path { fill: none; stroke: var(--line-strong, var(--line)); stroke-width: 2; vector-effect: non-scaling-stroke; transition: stroke var(--dur-1) var(--ease-out), opacity var(--dur-1) var(--ease-out); }
.ng-wires .w4 { stroke-dasharray: 5 5; }
.ng-servers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-rows: repeat(4, minmax(84px, auto)); }
.ng-servers li { align-self: center; margin: 5px 0; padding: 10px 12px; border: 1px solid var(--line-strong, var(--line)); border-radius: 12px; background: var(--bg); transition: border-color var(--dur-1) var(--ease-out), opacity var(--dur-1) var(--ease-out); }
.ng-servers li > code { font-family: var(--font-mono); font-size: 13px; color: var(--text-strong); background: none; padding: 0; }
.ng-servers li > i { margin-inline-start: 8px; font-family: var(--font-mono); font-size: 11px; font-style: normal; color: var(--text-muted); padding: 1px 7px; border: 1px dashed var(--line-strong, var(--line)); border-radius: 999px; }
.ng-servers li span { margin-top: 4px; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.ng-servers .is-backup { border-style: dashed; }
/* round robin: three wires carry the turn; least_conn: the idle one; ip_hash: each its own, no standby */
#ng-lb-rr:checked ~ .ng-lb-body .ng-wires :is(.w1, .w2, .w3) { stroke: var(--copper-ink); }
#ng-lb-lc:checked ~ .ng-lb-body .ng-wires .w3 { stroke: var(--copper-ink); }
#ng-lb-lc:checked ~ .ng-lb-body .ng-servers .s3 { border-color: var(--copper-ink); }
#ng-lb-ih:checked ~ .ng-lb-body .ng-wires .w1 { stroke: var(--copper-ink); }
#ng-lb-ih:checked ~ .ng-lb-body .ng-wires .w2 { stroke: var(--patina-ink); }
#ng-lb-ih:checked ~ .ng-lb-body .ng-wires .w3 { stroke: var(--warn-ink); }
#ng-lb-ih:checked ~ .ng-lb-body .ng-wires .w4 { opacity: .25; }
#ng-lb-ih:checked ~ .ng-lb-body .ng-servers .s4 { border-style: dotted; }
#ng-lb-ih:checked ~ .ng-lb-body .ng-servers .s4 :is(code, span) { color: var(--text-muted); }   /* struck out by colour and line, not by opacity */
#ng-lb-ih:checked ~ .ng-lb-body .ng-servers .s4 > code { text-decoration: line-through; }

.ng-spec { margin: 0; }
.ng-spec > div { padding: 15px 0 17px; border-top: 1px solid var(--line); }
.ng-spec dt { font-family: var(--font-mono); font-size: 13.5px; color: var(--copper-ink); }
.ng-spec dd { margin: 6px 0 0; font-size: 15px; line-height: 1.65; color: var(--text-2); }
.ng-spec-lb { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(24px, 3vw, 40px); margin-top: clamp(32px, 4vw, 48px); }
.ng-spec-1 > div:last-child { border-bottom: 1px solid var(--line); }
.ng-spec-1 > .ng-links { padding-top: 18px; border-bottom: 0; }
.ng-spec-1 dt:not([translate]) { font-family: var(--font-body); font-size: 16px; font-weight: 600; color: var(--text-strong); }

/* ---- 3. the pools ------------------------------------------------------------------------------ */
.ng-pl-map { padding: 22px 20px 24px; }
.ng-pl-door { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; width: fit-content; max-width: 100%; margin: 0 auto; padding: 10px 18px; border: 1.5px solid var(--copper-ink); border-radius: 12px; background: var(--bg); }
.ng-pl-door b { font-size: 17px; color: var(--text-strong); }
.ng-pl-route { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.ng-pl-route code { font-family: var(--font-mono); font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--well); color: var(--text-2); }
.ng-pl-pools { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-top: 40px; }
/* the bus under the door: copper to the two members of one upstream, patina to the admin lane */
.ng-pl-pools::before { content: ''; position: absolute; top: 0; inset-inline: calc((100% - 32px) / 6); height: 2px; background: linear-gradient(to right, var(--copper-ink) 50%, var(--patina-ink) 50%); }
html[dir="rtl"] .ng-pl-pools::before { background: linear-gradient(to left, var(--copper-ink) 50%, var(--patina-ink) 50%); }
.ng-pool { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; border: 1px solid var(--line-strong, var(--line)); border-radius: 14px; background: var(--bg); transition: opacity 240ms var(--ease-out), border-color 240ms var(--ease-out); }
.ng-pipe { position: absolute; top: -40px; inset-inline-start: calc(50% - 1px); width: 2px; height: 40px; background: var(--copper-ink); transform-origin: top; transition: opacity 240ms var(--ease-out); }
.ng-pool.p-c .ng-pipe { top: -40px; background: var(--patina-ink); }
.ng-pool code { align-self: flex-start; font-family: var(--font-mono); font-size: 12.5px; color: var(--text-strong); background: none; padding: 0; }
.ng-pool b { font-size: 15.5px; color: var(--text-strong); }
.ng-pool small { display: none; font-size: 13px; line-height: 1.5; color: var(--text-2); }
#ng-pl-up:checked ~ .ng-pl-map .ng-pool .st-up, #ng-pl-re:checked ~ .ng-pl-map .ng-pool .st-re { display: block; }
.ng-slots { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.ng-slots i { width: 12px; height: 12px; border-radius: 3px; border: 1.5px solid var(--line-strong, var(--line)); transition: background-color 240ms var(--ease-out), border-color 240ms var(--ease-out); }
.ng-pool.p-a .ng-slots i:nth-child(-n+3), .ng-pool.p-b .ng-slots i:nth-child(-n+3) { background: var(--copper-ink); border-color: var(--copper-ink); }
.ng-pool.p-c .ng-slots i:nth-child(1) { background: var(--patina-ink); border-color: var(--patina-ink); }
#ng-pl-re:checked ~ .ng-pl-map .ng-pool.p-a .ng-slots i:nth-child(-n+6) { background: var(--copper-ink); border-color: var(--copper-ink); }
#ng-pl-re:checked ~ .ng-pl-map .ng-pool.p-b { border-style: dashed; }
#ng-pl-re:checked ~ .ng-pl-map .ng-pool.p-b :is(b, small, span, code, p) { color: var(--text-muted); }   /* dimmed by colour, not opacity */
#ng-pl-re:checked ~ .ng-pl-map .ng-pool.p-b .ng-slots i { background: none; border-color: var(--line-strong, var(--line)); }
#ng-pl-re:checked ~ .ng-pl-map .ng-pool.p-b .ng-pipe { opacity: .2; }
#ng-pl-re:checked ~ .ng-pl-map .ng-pool.p-b small { color: var(--text); }

.ng-points { list-style: none; margin: 0; padding: 0; }
.ng-points li { padding: 16px 0 18px; border-top: 1px solid var(--line); }
.ng-points li:last-child { border-bottom: 1px solid var(--line); }
.ng-points b { display: block; font-size: 17px; color: var(--text-strong); }
.ng-points p { margin: 6px 0 0; font-size: 15px; line-height: 1.65; color: var(--text-2); }

/* ---- 4. the door: an annotated server block ------------------------------------------------------ */
.ng-conf { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.ng-conf .ng-file { position: sticky; top: 96px; }
.ng-conf pre { padding-left: 40px; }
.ng-ln { display: block; position: relative; margin-left: -40px; padding: 2px 16px 2px 40px; border-left: 2px solid transparent; transition: background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out); }
.ng-ln::before { content: attr(data-n); position: absolute; left: 13px; top: 2px; font-size: 11.5px; color: var(--copper-ink); }
.ng-notes { list-style: none; margin: 0; padding: 0; }
.ng-notes li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 4px 14px; padding: 16px 0 18px; border-top: 1px solid var(--line); }
.ng-notes li:last-child { border-bottom: 1px solid var(--line); }
.ng-notes li::before { content: attr(data-n); grid-row: 1 / span 3; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line-strong, var(--line)); border-radius: 50%; font-family: var(--font-mono); font-size: 12px; color: var(--copper-ink); }
.ng-notes b { font-size: 17px; color: var(--text-strong); }
.ng-notes p { grid-column: 2; margin: 4px 0 0; font-size: 15px; line-height: 1.65; color: var(--text-2); }
.ng-notes .ng-link { grid-column: 2; margin-top: 10px; font-size: 14.5px; }

.ng-trap { margin-top: clamp(40px, 5vw, 64px); padding: clamp(20px, 3vw, 32px); border: 1px solid var(--line); border-radius: 18px; background: var(--bg); }
.ng-trap h3 { margin: 0 0 20px; font-size: clamp(19px, 2vw, 22px); color: var(--text-strong); }
.ng-url { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 24px; }
.ng-url > span { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding-bottom: 10px; }
.ng-url code { font-family: var(--font-mono); font-size: clamp(18px, 2.6vw, 28px); line-height: 1.2; color: var(--text-strong); background: none; padding: 0 0 8px; word-break: break-all; }
.ng-url .u-real code { border-bottom: 3px solid var(--patina-ink); }
.ng-url .u-fake code { border-bottom: 3px dashed var(--warn-ink); color: var(--text-muted); }
.ng-url small { font-size: 13px; line-height: 1.45; color: var(--text-2); max-width: 30ch; padding-inline-end: 16px; }
.ng-outcomes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; }
.ng-outcomes > div { padding-top: 14px; border-top: 2px solid; }
.ng-outcomes .o-bad { border-color: var(--warn-ink); }
.ng-outcomes .o-good { border-color: var(--patina-ink); }
.ng-outcomes b { font-size: 16px; color: var(--text-strong); }
.ng-outcomes p { margin: 6px 0 0; font-size: 15px; line-height: 1.65; color: var(--text-2); }

/* ---- 5. the floor plan --------------------------------------------------------------------------- */
.ng-plan { --wall: color-mix(in srgb, var(--text-strong) 72%, transparent);
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 22px; border-radius: 18px;
    background-color: var(--bg-alt);
    background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 24px 24px; }
.ng-room { position: relative; min-width: 0; padding: 18px 18px 20px; border: 4px solid var(--wall); background: var(--surface); }
.ng-room + .ng-room { border-inline-start-width: 0; }
.ng-room header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.ng-room header code { font-family: var(--font-mono); font-size: 20px; font-weight: 600; color: var(--text-strong); background: none; padding: 0; }
.ng-room header span { font-size: 12.5px; color: var(--text-muted); }
.ng-room dl { margin: 0; }
.ng-room dl > div { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.ng-room dl > div:last-child { border-bottom: 0; }
.ng-room dt { font-size: 12.5px; color: var(--text-muted); }
.ng-room dd { margin: 2px 0 0; font-family: var(--font-mono); font-size: 13px; color: var(--text-strong); word-break: break-all; text-align: start; }
html[dir="rtl"] .ng-room dd { text-align: end; }
/* the shop reaches for the clinic: a dashed arrow to the wall between them, and a mark where it stops */
.ng-room.is-from::after { content: ''; position: absolute; top: 50%; inset-inline-end: 0; width: 34%; border-top: 2px dashed var(--warn-ink); transform-origin: right center; transition: transform 480ms var(--ease-out) 200ms; }
html[dir="rtl"] .ng-room.is-from::after { transform-origin: left center; }
.ng-room.is-to::before { content: '\00D7'; position: absolute; z-index: 1; top: calc(50% - 15px); inset-inline-start: -17px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--warn-ink); color: var(--bg); font-size: 20px; line-height: 1; font-weight: 700; transition: transform 240ms var(--ease-out) 600ms, opacity 240ms var(--ease-out) 600ms; }
html.anim-ready .ng-plan:not(.revealed) .ng-room.is-from::after { transform: scaleX(0); }
html.anim-ready .ng-plan:not(.revealed) .ng-room.is-to::before { opacity: 0; transform: scale(.6); }
.ng-breach { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 18px; padding: 12px 16px; border: 1px dashed var(--warn-ink); border-radius: 12px; background: var(--surface); }
.ng-breach-say { font-size: 14px; color: var(--text-2); }
.ng-breach-try { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-strong); background: none; padding: 0; word-break: break-all; }
.ng-wall-hit { display: flex; flex-wrap: wrap; gap: 6px; margin-inline-start: auto; }
.ng-wall-hit i { font-family: var(--font-mono); font-size: 12px; font-style: normal; color: var(--warn-ink); padding: 3px 9px; border: 1px solid var(--warn-ink); border-radius: 999px; }

.ng-pair-walls { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.ng-close h2 { text-wrap: balance; }
.ng-walls { list-style: none; margin: 0; padding: 0; counter-reset: ng-wall; }
.ng-walls li { counter-increment: ng-wall; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 2px 12px; padding: 16px 0 18px; border-top: 1px solid var(--line); }
.ng-walls li:last-child { border-bottom: 1px solid var(--line); }
.ng-walls li::before { content: counter(ng-wall); grid-row: 1 / span 2; align-self: start; display: grid; place-items: center; width: 36px; height: 36px; border: 3px solid var(--wall, var(--text-strong)); border-radius: 4px; font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--text-strong); }
.ng-walls b { font-size: 17px; color: var(--text-strong); }
.ng-walls p { grid-column: 2; margin: 4px 0 0; font-size: 15px; line-height: 1.65; color: var(--text-2); }

/* ---- 6. php.ini per account: three tiers -------------------------------------------------------- */
.ng-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.ng-tier { min-width: 0; display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--line); border-top: 3px solid; border-radius: 4px 4px 16px 16px; background: var(--surface); }
.ng-tier.t-lock { border-top-color: var(--copper-ink); }
.ng-tier.t-open { border-top-color: var(--patina-ink); }
.ng-tier.t-site { border-top: 3px dashed var(--text-muted); }
.ng-tier h3 { margin: 0; font-size: 17px; line-height: 1.5; color: var(--text-strong); }
.ng-tier h3::before { content: ''; display: inline-block; vertical-align: -3px; margin-inline-end: 10px; width: 16px; height: 18px; background: currentColor; -webkit-mask: var(--ng-lock) center / contain no-repeat; mask: var(--ng-lock) center / contain no-repeat; }
.ng-tier.t-lock h3::before { color: var(--copper-ink); --ng-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 20'%3E%3Cpath d='M4 9V6a5 5 0 0 1 10 0v3' fill='none' stroke='%23000' stroke-width='2'/%3E%3Crect x='1' y='9' width='16' height='11' rx='2'/%3E%3C/svg%3E"); }
.ng-tier.t-open h3::before { color: var(--patina-ink); --ng-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 20'%3E%3Cpath d='M4 9V6a5 5 0 0 1 9.6-2' fill='none' stroke='%23000' stroke-width='2'/%3E%3Crect x='1' y='9' width='16' height='11' rx='2'/%3E%3C/svg%3E"); }
.ng-tier.t-site h3::before { color: var(--text-muted); --ng-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 20'%3E%3Cpath d='M3 1h8l5 5v13H3z' fill='none' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M6 11h7M6 15h7' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E"); }
.ng-tier > p { flex: 1; margin: 10px 0 16px; font-size: 14.5px; line-height: 1.6; color: var(--text-2); }
.ng-tier pre { border-radius: 10px; font-size: 12.5px; }
.ng-tiers-note { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--text-muted); }

.ng-agree { margin-top: clamp(40px, 5vw, 64px); }
.ng-agree h3 { margin: 0 0 8px; font-size: clamp(19px, 2vw, 22px); color: var(--text-strong); }
.ng-chain { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr); gap: 8px 24px; align-items: center; padding: 20px 0; border-top: 1px solid var(--line); }
.ng-chain:last-child { border-bottom: 1px solid var(--line); }
.ng-chain-name { font-size: 16px; color: var(--text-strong); }
.ng-chain-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ng-chain-row span { display: inline-flex; flex-direction: column; gap: 2px; padding: 8px 12px; border: 1px solid var(--line-strong, var(--line)); border-radius: 10px; background: var(--surface); }
.ng-chain-row code { font-family: var(--font-mono); font-size: 13px; color: var(--text-strong); background: none; padding: 0; }
.ng-chain-row small { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.ng-chain-row span:last-of-type { border-color: var(--copper-ink); }
.ng-chain-row i { font-style: normal; font-family: var(--font-mono); font-size: 20px; color: var(--copper-ink); }
.ng-chain p { grid-column: 2; margin: 4px 0 0; max-width: 72ch; font-size: 15px; line-height: 1.65; color: var(--text-2); }

/* ---- 7. the cache strata ------------------------------------------------------------------------ */
.ng-strata { list-style: none; margin: 0; padding: 0; }
.ng-strata li { display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr); gap: 4px 20px; align-items: center; padding: 0 20px 0 0; border-top: 1px solid var(--line); transition: opacity 240ms var(--ease-out); }
html[dir="rtl"] .ng-strata li { padding: 0 0 0 20px; }
.ng-strata li:first-child { border-top: 0; }
.ng-strata .l2 { background: var(--tint-03); }
.ng-strata .l3 { background: var(--tint-05); }
.ng-strata .l4 { background: color-mix(in srgb, var(--tint-05) 100%, var(--tint-03)); }
.ng-strata .l5 { background: var(--tint-08); }
.ng-l-name { padding: 16px 0; }
.ng-l-name b { display: block; font-size: 16px; color: var(--text-strong); }
.ng-l-name small { display: block; margin-top: 3px; font-size: 13.5px; line-height: 1.5; color: var(--text-muted); }
.ng-l-state span { display: none; font-size: 14px; line-height: 1.5; color: var(--text-2); padding-block: 12px; }
#ng-cs-a:checked ~ .ng-strata .st-a, #ng-cs-u:checked ~ .ng-strata .st-u { display: block; animation: ng-in 220ms var(--ease-out); }
.ng-l-state .is-hit { color: var(--patina-ink); font-weight: 600; }
.ng-l-state .is-skip { color: var(--warn-ink); }
.ng-l-state .is-off { color: var(--text-muted); }
/* the depth rail: the request's path down through the layers, and a dot where it is answered */
.ng-depth { position: relative; align-self: stretch; }
.ng-depth::before { content: ''; position: absolute; top: 0; bottom: 0; inset-inline-start: 23px; width: 3px; background: var(--copper-ink); transform-origin: top; transform: scaleY(0); transition: transform 260ms var(--ease-out); }
.ng-depth::after { content: ''; position: absolute; top: calc(50% - 7px); inset-inline-start: 17.5px; width: 14px; height: 14px; border-radius: 50%; background: var(--patina-ink); box-shadow: 0 0 0 4px var(--surface); opacity: 0; transform: scale(.5); transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
#ng-cs-a:checked ~ .ng-strata .l1 .ng-depth::before { transform: scaleY(1); }
#ng-cs-a:checked ~ .ng-strata .l2 .ng-depth::before { transform: scaleY(.5); transition-delay: 120ms; }
#ng-cs-a:checked ~ .ng-strata .l2 .ng-depth::after { opacity: 1; transform: none; transition-delay: 260ms; }
#ng-cs-a:checked ~ .ng-strata :is(.l3, .l4, .l5) .ng-l-name :is(b, small) { color: var(--text-muted); }   /* dimmed by colour, not opacity: stays above 4.5:1 */
#ng-cs-u:checked ~ .ng-strata :is(.l1, .l3, .l4) .ng-depth::before { transform: scaleY(1); }
#ng-cs-u:checked ~ .ng-strata .l2 .ng-depth::before { transform: scaleY(1); background: repeating-linear-gradient(to bottom, var(--copper-ink) 0 5px, transparent 5px 10px); }
#ng-cs-u:checked ~ .ng-strata .l2 .ng-l-name :is(b, small) { color: var(--text-muted); }
#ng-cs-u:checked ~ .ng-strata .l2 .ng-depth::before { transition-delay: 60ms; }
#ng-cs-u:checked ~ .ng-strata .l3 .ng-depth::before { transition-delay: 120ms; }
#ng-cs-u:checked ~ .ng-strata .l4 .ng-depth::before { transition-delay: 180ms; }
#ng-cs-u:checked ~ .ng-strata .l5 .ng-depth::before { transform: scaleY(.5); transition-delay: 240ms; }
#ng-cs-u:checked ~ .ng-strata .l5 .ng-depth::after { opacity: 1; transform: none; transition-delay: 380ms; }

/* ---- 8. the rest of the file ---------------------------------------------------------------------- */
.ng-craft { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.ng-term { margin: 0; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-2); }
.ng-term figcaption { margin: 0 0 14px; font-size: 17px; font-weight: 600; color: var(--text-strong); }
.ng-term pre { border-radius: 10px; background: var(--well-deep, var(--well)); }
.ng-term pre .p { color: var(--copper-ink); }
.ng-term pre .o { color: var(--patina-ink); }
.ng-term p { margin: 12px 0 20px; font-size: 15px; line-height: 1.65; color: var(--text-2); }
.ng-term p:last-child { margin-bottom: 0; }
.ng-more { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(40px, 5vw, 56px); padding-top: 24px; border-top: 1px solid var(--line); }
.ng-more a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line-strong, var(--line)); border-radius: 999px; font-size: 14.5px; font-weight: 600; color: var(--text-strong); text-decoration: none; transition: border-color var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out); }

/* ---- pointer, motion ---------------------------------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
    .ng-seg label:hover { color: var(--text-strong); }
    .ng-link:hover span { transform: translateX(3px); }
    html[dir="rtl"] .ng-link:hover span { transform: scaleX(-1) translateX(3px); }
    .ng-more a:hover { border-color: var(--copper-ink); background: var(--tint-03); }
    .ng-conf:has(.ng-notes li[data-n="1"]:hover) .ng-ln[data-n="1"],
    .ng-conf:has(.ng-notes li[data-n="2"]:hover) .ng-ln[data-n="2"],
    .ng-conf:has(.ng-notes li[data-n="3"]:hover) .ng-ln[data-n="3"],
    .ng-conf:has(.ng-notes li[data-n="4"]:hover) .ng-ln[data-n="4"],
    .ng-conf:has(.ng-notes li[data-n="5"]:hover) .ng-ln[data-n="5"],
    .ng-conf:has(.ng-notes li[data-n="6"]:hover) .ng-ln[data-n="6"] { background: var(--tint-05); border-left-color: var(--copper-ink); }
}
@media (prefers-reduced-motion: reduce) {
    .ng-route::before, .ng-stop, .ng-depth::before, .ng-depth::after, .ng-room.is-from::after, .ng-room.is-to::before, .ng-pool, .ng-pipe, .ng-link span { transition: none !important; }
    html.anim-ready .ng-route:not(.revealed)::before { transform: none; }
    html.anim-ready .ng-route:not(.revealed) .ng-stop { opacity: 1; transform: none; }
    html.anim-ready .ng-plan:not(.revealed) .ng-room.is-from::after { transform: none; }
    html.anim-ready .ng-plan:not(.revealed) .ng-room.is-to::before { opacity: 1; transform: none; }
    .ng-lb .m-rr, .ng-lb .m-lc, .ng-lb .m-ih, .ng-l-state span { animation: none !important; }
}

/* ---- narrow --------------------------------------------------------------------------------------- */
@media (max-width: 1120px) {
    .ng-stop { grid-template-columns: 36px minmax(0, 12rem) minmax(0, 1fr); gap: 0 22px; align-items: start; }
    .ng-stop b { padding-top: 7px; }
    .ng-stop p { padding-top: 8px; }
    .ng-exit { grid-column: 3; grid-row: 2; justify-self: start; margin-top: 10px; }
    .ng-spec-lb { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
    .ng-lb-body { grid-template-columns: minmax(0, 1fr); }
    .ng-fan { max-width: 600px; }
}
@media (max-width: 900px) {
    .ng-pair, .ng-pair-walls, .ng-conf, .ng-craft { grid-template-columns: minmax(0, 1fr); }
    .ng-conf .ng-file { position: static; }
    .ng-tiers { grid-template-columns: minmax(0, 1fr); }
    .ng-plan { grid-template-columns: minmax(0, 1fr); }
    .ng-room + .ng-room { border-inline-start-width: 4px; border-top-width: 0; }
    .ng-room.is-from::after { top: auto; bottom: 0; inset-inline-end: auto; inset-inline-start: 50%; width: 0; height: 30%; border-top: 0; border-inline-start: 2px dashed var(--warn-ink); transform-origin: center bottom; }
    html[dir="rtl"] .ng-room.is-from::after { transform-origin: center bottom; }
    html.anim-ready .ng-plan:not(.revealed) .ng-room.is-from::after { transform: scaleY(0); }
    .ng-room.is-to::before { top: -17px; inset-inline-start: calc(50% - 15px); }
}
@media (max-width: 760px) {
    .ng-stop { grid-template-columns: 36px minmax(0, 1fr); gap: 0 16px; }
    .ng-dot { grid-row: 1 / span 3; }
    .ng-stop p { grid-column: 2; grid-row: 2; padding-top: 4px; }
    .ng-exit { grid-column: 2; grid-row: 3; }
    .ng-stop + .ng-stop::before { inset-inline-start: 52px; }
    .ng-lb-top, .ng-pl-top, .ng-cs-top, .ng-lb-say { padding-inline: 16px; }
    .ng-lb-body { padding: 16px; }
    .ng-seg { width: 100%; }
    .ng-seg label { flex: 1 1 auto; justify-content: center; text-align: center; padding-inline: 10px; }
    .ng-spec-lb { grid-template-columns: minmax(0, 1fr); }
    .ng-pl-map { padding-inline: 16px; }
    .ng-pl-pools { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 20px; }
    .ng-pl-pools::before { display: none; }
    .ng-pipe { display: none; }
    .ng-pool { border-inline-start: 3px solid var(--copper-ink); }
    .ng-pool.p-c { border-inline-start-color: var(--patina-ink); }
    .ng-outcomes { grid-template-columns: minmax(0, 1fr); }
    .ng-chain { grid-template-columns: minmax(0, 1fr); }
    .ng-chain p { grid-column: 1; }
    .ng-chain-row { flex-direction: column; align-items: flex-start; gap: 4px; }
    .ng-chain-row i { padding-inline-start: 16px; line-height: 1.1; }
    .ng-strata li { grid-template-columns: 40px minmax(0, 1fr); padding-inline-end: 16px; }
    html[dir="rtl"] .ng-strata li { padding: 0 0 0 16px; }
    .ng-depth { grid-row: 1 / span 2; }
    .ng-depth::before { inset-inline-start: 19px; }
    .ng-depth::after { inset-inline-start: 13.5px; }
    .ng-l-name { padding-bottom: 0; }
    .ng-l-state span { padding-block: 6px 16px; }
    .ng-plan { padding: 14px; }
    .ng-wall-hit { margin-inline-start: 0; }
}
@media (max-width: 600px) {
    /* the fan folds: the door on top, the four servers in a grid under it */
    .ng-fan { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .ng-wires-box { display: none; }
    .ng-node { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 10px; position: relative; margin-bottom: 22px; }
    .ng-node::after { content: ''; position: absolute; top: 100%; inset-inline-start: calc(50% - 1px); width: 2px; height: 22px; background: var(--copper-ink); }
    .ng-servers { grid-template-rows: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-top: 10px; border-top: 2px solid var(--copper-ink); border-radius: 0; }
    .ng-servers li { margin: 0; align-self: stretch; }
    #ng-lb-lc:checked ~ .ng-lb-body .ng-servers :is(.s1, .s2) { border-style: dashed; }
    #ng-lb-lc:checked ~ .ng-lb-body .ng-servers :is(.s1, .s2) :is(code, span) { color: var(--text-muted); }
    .ng-url code { font-size: 17px; }
}

/* Arabic in the mono stack takes Plex Mono's full-width spaces; Arabic labels take the body face,
   code and figures stay mono. */
html[dir="rtl"] .ng-tag, html[dir="rtl"] .ng-exit { font-family: var(--font-body); }
/* a directive is read left to right on every page: its semicolon must not jump to the other end */
html[dir="rtl"] .ng-spec dt[translate] { direction: ltr; text-align: right; }
html[dir="rtl"] .ng-stop b, html[dir="rtl"] .ng-l-name b { line-height: 1.5; }
