/* Poop2Shell — style.css
   "Caution: wet floor" meets security advisory. Dark plum, caution yellow.
   Fonts self-hosted (SIL OFL) so the strict CSP stays intact. */

@font-face { font-family: "Archivo"; src: url("../fonts/archivo-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("../fonts/archivo-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("../fonts/archivo-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Archivo Black"; src: url("../fonts/archivo-black-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --bg: #16131F;
  --bg-deep: #0F0C17;
  --panel: #1F1A2B;
  --line: #3A3350;
  --text: #F3EFE6;
  --muted: #B3AAC6;
  --dim: #8C83A3;
  --yellow: #FFD12E;
  --yellow-dark: #C9A21F;
  --pink: #FF5C8A;
  --cyan: #59E3D0;
  --brown: #D9A06B;
  --display: "Archivo Black", "Arial Black", sans-serif;
  --body: "Archivo", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --hazard: repeating-linear-gradient(-45deg, var(--yellow) 0 14px, var(--bg-deep) 14px 28px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.65 var(--body); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; height: auto; }
.wrap { width: min(1200px, 100% - 48px); margin-inline: auto; }
a { color: var(--yellow); text-underline-offset: 3px; }
a:hover { color: #FFE27A; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--yellow); color: var(--bg); padding: 8px 14px; border-radius: 6px; }
.skip:focus { left: 8px; }
h1, h2 { font-family: var(--display); font-weight: 400; margin: 0; }
h3 { font: 600 22px/1.25 var(--body); margin: 0 0 12px; }
p { margin: 0 0 16px; }
.muted { color: var(--dim); }
.pink { color: var(--pink); }
.cyan { color: var(--cyan); }

code { font-family: var(--mono); font-size: .86em; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: .08em .38em; color: #FFE7A3; }

/* ---------- Caution tape ---------- */
.tape {
  background: var(--yellow); color: var(--bg-deep); overflow: hidden; white-space: nowrap;
  border-block: 5px solid transparent;
  border-image: var(--hazard) 5;
}
.tape-track { display: inline-flex; animation: tape 38s linear infinite; padding: 6px 0; }
.tape-track span { font: 400 15px/1 var(--display); text-transform: uppercase; letter-spacing: .04em; padding: 0 18px; }
.tape-track span::after { content: "▲"; margin-left: 36px; font-size: 11px; vertical-align: 2px; }
@keyframes tape { to { transform: translateX(-50%); } }

/* ---------- Top bar ---------- */
.top-inner { display: flex; justify-content: space-between; align-items: center; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 400 20px var(--display); }
.brand img { width: 34px; height: 34px; }
.top-link { font-weight: 600; font-size: 15px; color: var(--muted); }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 80px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1.08fr; gap: 56px; align-items: center; }
.chip-status { display: inline-flex; align-items: center; gap: 10px; background: rgba(255, 92, 138, .12); color: var(--pink); border: 1px solid rgba(255, 92, 138, .4); border-radius: 999px; padding: 5px 14px; font-weight: 600; font-size: 14px; margin-bottom: 18px; }
.blink { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); animation: blink 1.1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.hero h1 { font-size: clamp(58px, 8.4vw, 116px); line-height: .9; letter-spacing: -.03em; color: var(--yellow); margin-bottom: 18px; }
.tagline { font: 600 clamp(22px, 2.4vw, 30px)/1.25 var(--body); color: var(--text); max-width: 20em; margin-bottom: 18px; }
.summary { color: var(--muted); max-width: 34em; }
.alias { color: var(--dim); font-size: 15px; }
.alias strong { color: var(--brown); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn { display: inline-flex; align-items: center; font: 600 16px/1 var(--body); padding: 15px 22px; border-radius: 10px; text-decoration: none; border: 2px solid transparent; }
.btn-yellow { background: var(--yellow); color: var(--bg-deep); box-shadow: 0 4px 0 var(--yellow-dark); }
.btn-yellow:hover { color: var(--bg-deep); background: #FFDD5C; }
.btn-line { border-color: var(--line); color: var(--text); }
.btn-line:hover { border-color: var(--yellow); color: var(--yellow); }

/* ---------- Terminal ---------- */
.term { background: var(--bg-deep); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 6px rgba(255, 209, 46, .06), 0 40px 80px -30px rgba(0, 0, 0, .7); }
.term-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.dots { display: flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--pink); }
.dots i:nth-child(2) { background: var(--yellow); }
.dots i:nth-child(3) { background: var(--cyan); }
.term-title { font: 400 12.5px var(--mono); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.door { font: 600 12px var(--body); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.door b { font-weight: 600; color: var(--bg-deep); background: var(--cyan); padding: 2px 10px; border-radius: 999px; transition: background-color .3s; }
.door.warn b { background: var(--yellow); }
.door.occupied b { background: var(--pink); }
.term-body { height: 330px; overflow-y: auto; padding: 16px 18px 4px; font: 400 14px/1.6 var(--mono); color: #E8E2F2; white-space: pre-wrap; word-break: break-word; }
.term-body .l-cmd { color: #fff; }
.term-body .l-cmd .p { color: var(--cyan); }
.term-body .l-cmd.root .p { color: var(--pink); }
.term-body .l-ok { color: var(--cyan); }
.term-body .l-err { color: var(--pink); }
.term-body .l-warn { color: var(--yellow); }
.term-body .l-dim { color: var(--dim); }
.term-body .l-brown { color: var(--brown); }
.term-input { display: flex; gap: 10px; align-items: center; padding: 6px 18px 14px; font: 400 14px var(--mono); }
.prompt { color: var(--cyan); white-space: nowrap; }
.prompt.root { color: var(--pink); }
#term-in { flex: 1; min-width: 0; background: transparent; border: 0; color: #fff; font: inherit; caret-color: var(--yellow); outline: none; padding: 4px 0; }
.term-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--panel); }
.qc { font: 400 12.5px var(--mono); color: var(--text); background: var(--bg-deep); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.qc:hover { border-color: var(--yellow); color: var(--yellow); }
.term.pwned { border-color: var(--pink); box-shadow: 0 0 0 6px rgba(255, 92, 138, .14), 0 40px 80px -30px rgba(0, 0, 0, .7); }
.term.flushing { animation: flush 1.3s cubic-bezier(.6, 0, .4, 1); }
@keyframes flush { 60% { transform: rotate(540deg) scale(.1); opacity: .3; } 61% { transform: none; opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ---------- Severity band ---------- */
.band { background: var(--panel); border-block: 8px solid transparent; border-image: var(--hazard) 8; padding: 44px 0; }
.band-grid { display: grid; grid-template-columns: 340px 1fr; gap: 48px; align-items: center; }
.gauge { margin: 0; position: relative; }
.gauge path { fill: none; stroke-width: 20; }
.g-low { stroke: var(--cyan); }
.g-mid { stroke: var(--yellow); }
.g-high { stroke: var(--pink); }
.g-over { stroke: url(#haz); }
.g-tick { stroke: var(--dim); stroke-width: 2; }
.g-num { font: 400 12px var(--mono); fill: var(--muted); }
.g-num-over { fill: var(--yellow); font-weight: 700; font-size: 17px; }
.needle line { stroke: var(--text); stroke-width: 5; stroke-linecap: round; }
.needle { transform-origin: 160px 160px; transform: rotate(18deg); animation: sweep 1.8s cubic-bezier(.3, .7, .3, 1.25) .3s both; }
@keyframes sweep { from { transform: rotate(-180deg); } 75% { transform: rotate(32deg); } to { transform: rotate(18deg); } }
.hub { fill: var(--yellow); stroke: var(--bg-deep); stroke-width: 4; }
.gauge figcaption { display: flex; align-items: baseline; gap: 12px; margin-top: -14px; padding-left: 20px; }
.gauge-val { font: 400 54px/1 var(--display); color: var(--yellow); }
.gauge-cap { color: var(--muted); font-size: 15px; }
.readouts { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; }
.readouts div { border-left: 1px solid var(--line); padding: 6px 22px; }
.readouts dt { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.readouts dd { margin: 0; font: 400 clamp(24px, 2.6vw, 34px)/1.05 var(--display); }

/* ---------- Document layout ---------- */
.doc { display: grid; grid-template-columns: 250px 1fr; gap: 72px; padding: 88px 0 40px; }
.side-inner { position: sticky; top: 28px; }
.meta { margin: 0 0 32px; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.meta div { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.meta div:last-child { border-bottom: 0; }
.meta dt { font-size: 12.5px; color: var(--dim); }
.meta dd { margin: 0; font: 400 14px var(--mono); }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 10px; padding: 7px 12px; color: var(--muted); text-decoration: none; border-left: 3px solid var(--line); font-size: 15px; }
.toc a::before { content: counter(toc, decimal-leading-zero); font: 400 12px/1.9 var(--mono); color: var(--dim); }
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--yellow); border-left-color: var(--yellow); }
.toc a.active::before { color: var(--yellow); }

.content { max-width: 760px; min-width: 0; }
.content > section { padding-bottom: 72px; scroll-margin-top: 24px; }
.content h2 { font-size: clamp(32px, 3.6vw, 44px); line-height: 1.05; margin-bottom: 22px; }
.content h2::before { content: ""; display: block; width: 56px; height: 10px; background: var(--hazard); border-radius: 2px; margin-bottom: 16px; }
.content > section > p { color: #DCD5E8; }

.vector { font: 400 14px/1.6 var(--mono); background: var(--bg-deep); border: 1px solid var(--line); border-left: 4px solid var(--yellow); border-radius: 8px; padding: 14px 18px; overflow-x: auto; margin: 24px 0 0; color: var(--text); }
.vector span { color: var(--yellow); }
.vector .dim { color: var(--dim); }

.strip { list-style: none; margin: 0 0 40px; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; counter-reset: strip; }
.strip li { counter-increment: strip; position: relative; background: var(--panel); border: 2px solid var(--line); border-radius: 10px; padding: 30px 8px 14px; text-align: center; font-size: 13.5px; line-height: 1.3; color: var(--muted); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.strip li::before { content: counter(strip); position: absolute; top: 6px; left: 8px; font: 700 11px var(--mono); color: var(--yellow); }
.strip .ico { font-size: 26px; line-height: 1; }
.strip .strip-end { border-color: var(--pink); color: var(--text); }
.ico-hash { font: 700 28px var(--mono); color: var(--pink); }

.steps { list-style: none; margin: 0 0 8px; padding: 0; counter-reset: st; }
.steps li { counter-increment: st; display: flex; align-items: baseline; gap: 18px; font-size: 22px; font-weight: 600; padding: 6px 0; }
.steps li::before { content: counter(st); font: 400 44px/1 var(--display); color: var(--yellow); min-width: 34px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 15.5px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--panel); color: var(--muted); font-weight: 600; font-size: 13.5px; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; }
td:last-child { color: var(--muted); }
.st { display: inline-block; font: 700 12px/1 var(--mono); padding: 5px 9px; border-radius: 6px; white-space: nowrap; }
.st-bad { background: rgba(255, 92, 138, .14); color: var(--pink); }
.st-mid { background: rgba(255, 209, 46, .14); color: var(--yellow); }
.st-ok { background: rgba(89, 227, 208, .12); color: var(--cyan); }

.ioc { list-style: none; margin: 0; padding: 0; }
.ioc li { position: relative; padding: 12px 0 12px 34px; border-bottom: 1px dashed var(--line); }
.ioc li::before { content: ""; position: absolute; left: 4px; top: 18px; width: 16px; height: 14px; background: var(--yellow); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.ioc .ioc-strong { color: var(--pink); font-weight: 600; }
.ioc .ioc-strong::before { background: var(--pink); }

.keys { display: flex; flex-wrap: wrap; gap: 14px 34px; margin-bottom: 32px; }
.keys p { margin: 0; display: flex; align-items: center; gap: 8px; }
.os { color: var(--muted); font-size: 14px; margin-right: 4px; }
kbd { font: 400 18px/1 var(--display); background: var(--yellow); color: var(--bg-deep); border-radius: 8px; padding: 10px 12px 8px; box-shadow: 0 4px 0 var(--yellow-dark); min-width: 44px; text-align: center; }

.dodont { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dodont > div { background: var(--panel); border-radius: 12px; padding: 22px; border-top: 5px solid var(--cyan); }
.dodont .dont { border-top-color: var(--pink); }
.dodont h3 { font-family: var(--display); font-weight: 400; font-size: 26px; }
.do h3 { color: var(--cyan); }
.dont h3 { color: var(--pink); }
.dodont ul { list-style: none; margin: 0; padding: 0; }
.dodont li { position: relative; padding: 10px 0 10px 28px; color: var(--muted); font-size: 15.5px; border-top: 1px solid var(--line); }
.dodont li strong { color: var(--text); }
.dodont li::before { position: absolute; left: 0; top: 10px; font-weight: 700; }
.do li::before { content: "✓"; color: var(--cyan); }
.dont li::before { content: "✗"; color: var(--pink); }

.quiz { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz label { display: flex; gap: 12px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; cursor: pointer; font-size: 15.5px; line-height: 1.4; }
.quiz label:hover { border-color: var(--dim); }
.quiz label:has(input:checked) { border-color: var(--yellow); }
.quiz input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--yellow); flex: none; }
.quiz .quiz-fix { grid-column: 1 / -1; border-style: dashed; border-color: rgba(89, 227, 208, .45); }
.quiz .quiz-fix input { accent-color: var(--cyan); }
.quiz .quiz-fix:has(input:checked) { border-color: var(--cyan); border-style: solid; }
.verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; padding: 16px 18px; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 10px; font-size: 15.5px; }

.tl { list-style: none; margin: 0; padding: 0 0 0 26px; border-left: 2px solid var(--line); }
.tl li { position: relative; padding: 0 0 22px 6px; }
.tl li::before { content: ""; position: absolute; left: -35px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--yellow); }
.tl li:last-child::before { background: var(--pink); border-color: var(--pink); }
.tl time { font: 700 14px var(--mono); color: var(--yellow); }
.tl p { margin: 2px 0 0; color: #DCD5E8; }

details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); }
summary { list-style: none; cursor: pointer; padding: 18px 44px 18px 0; position: relative; font: 600 19px var(--body); }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 6px; top: 12px; font: 400 28px var(--display); color: var(--yellow); transition: transform .2s; }
details[open] summary::after { transform: rotate(45deg); color: var(--pink); }
details p { color: var(--muted); padding-bottom: 6px; }

/* ---------- Footer ---------- */
.foot { background: var(--bg-deep); border-top: 14px solid transparent; border-image: var(--hazard) 14; padding: 48px 0; margin-top: 40px; }
.foot-inner { display: flex; align-items: center; gap: 28px; }
.foot img { width: 96px; height: 96px; flex: none; }
.foot-line { font: 400 clamp(22px, 2.8vw, 32px)/1.15 var(--display); color: var(--yellow); margin-bottom: 10px; }
.foot-small { color: var(--dim); font-size: 14px; margin: 0; max-width: 60em; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--yellow); color: var(--bg-deep); font: 600 15px var(--body); padding: 12px 18px; border-radius: 10px; box-shadow: 0 4px 0 var(--yellow-dark), 0 20px 40px rgba(0, 0, 0, .5); max-width: calc(100% - 32px); }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .hero-grid { grid-template-columns: 1fr; }
  .band-grid { grid-template-columns: 1fr; justify-items: start; }
  .gauge { width: min(340px, 100%); }
  .doc { grid-template-columns: 1fr; gap: 24px; padding-top: 56px; }
  .side-inner { position: static; }
  .meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
  .meta div:nth-last-child(-n+3) { border-bottom: 0; }
  .toc { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .hero { padding-bottom: 56px; }
  .readouts { grid-template-columns: 1fr 1fr; row-gap: 20px; }
  .meta { grid-template-columns: 1fr 1fr; }
  .meta div:nth-last-child(-n+3) { border-bottom: 1px dashed var(--line); }
  .meta div:nth-last-child(-n+2) { border-bottom: 0; }
  .strip { grid-template-columns: repeat(3, 1fr); }
  .dodont, .quiz { grid-template-columns: 1fr; }
  .term-body { height: 290px; font-size: 13px; }
  .foot-inner { flex-direction: column; align-items: flex-start; }
  .term-title { visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
