/* ---------- Lab write-up pages ---------- */
.wrap { max-width: 860px; }

/* Simplified nav for sub-pages */
.nav__back { display: inline-flex; align-items: center; gap: .5em; font-size: 14px; color: var(--overlay2); transition: color .2s ease; }
.nav__back:hover { color: var(--text); }

/* Hero */
.wr-hero { padding: 72px 0 36px; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--overlay1); margin-bottom: 22px; }
.breadcrumb a { color: var(--green); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { color: var(--surface2); }
.wr-titlerow { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; }
.wr-title { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -.03em; }
.wr-ip { font-size: 15px; color: var(--overlay2); }
.badge-root { display: inline-flex; align-items: center; gap: .5em; padding: 5px 13px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); border: 1px solid color-mix(in srgb, var(--green) 45%, transparent); }
.wr-lead { margin-top: 22px; font-size: 18px; color: var(--subtext0); max-width: 62ch; }
.wr-lead strong { color: var(--text); }

/* Attack chain / kill-chain stepper */
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 6px; margin-top: 30px; padding: 20px; border: 1px solid var(--surface0); border-radius: var(--radius); background: var(--mantle); }
.chain__label { width: 100%; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--overlay1); margin-bottom: 4px; }
.chain__step { display: inline-flex; align-items: center; gap: .5em; padding: 6px 12px; border-radius: 8px; font-size: 13.5px; color: var(--subtext1); background: var(--surface0); border: 1px solid var(--surface1); white-space: nowrap; }
.chain__step .nf { color: var(--accent, var(--mauve)); }
.chain__step--root { color: var(--crust); background: var(--green); border-color: var(--green); font-weight: 700; }
.chain__arrow { color: var(--overlay0); font-weight: 700; }

/* Steps */
.step { padding-top: 56px; }
.step__num { color: var(--green); font-size: 13px; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 14px; }
.step__num::before { content: "## "; color: var(--surface2); }
.step h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: 20px; }
.step h3 { font-size: 17px; font-weight: 700; color: var(--text); margin: 30px 0 12px; }
.step p { color: var(--subtext0); margin-bottom: 16px; }
.step p strong { color: var(--text); }
.step a { color: var(--blue); border-bottom: 1px dashed color-mix(in srgb, var(--blue) 50%, transparent); }
.step a:hover { color: var(--sapphire); }
.step ul:not(.chips) { margin: 0 0 16px; padding-left: 0; list-style: none; }
.step ul:not(.chips) li { position: relative; padding-left: 1.6em; margin-bottom: 8px; color: var(--subtext0); }
.step ul:not(.chips) li::before { content: "▸"; position: absolute; left: 0; color: var(--mauve); }
.step ul:not(.chips) li strong { color: var(--text); }
code.inline { font-family: var(--font); font-size: .9em; padding: 1px 6px; border-radius: 5px; background: var(--surface0); color: var(--peach); border: 1px solid var(--surface1); }

/* Terminal command/output blocks */
.cmd { margin: 0 0 18px; }
.cmd .term__body { font-size: 13.5px; }
.cmd pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--font); color: var(--subtext1); }
.cmd .ln { color: var(--green); }
.cmd .ln::before { content: "$ "; color: var(--overlay1); }
.cmd .ln--root::before { content: "# "; color: var(--red); }
.cmd .out { color: var(--overlay2); }
.cmd .hl { color: var(--yellow); }

/* Redacted secrets */
.redacted { position: relative; font-family: var(--font); padding: 1px 8px; border-radius: 5px; background: var(--surface1); color: transparent; border: 1px dashed var(--overlay0); user-select: none; letter-spacing: .1em; }
.redacted::after { content: "redacted"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; letter-spacing: .08em; color: var(--overlay1); }

/* Callout */
.note { display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--radius); background: color-mix(in srgb, var(--yellow) 8%, var(--mantle)); border: 1px solid color-mix(in srgb, var(--yellow) 35%, transparent); margin: 0 0 18px; }
.note .nf { color: var(--yellow); font-size: 1.2em; flex: none; margin-top: 2px; }
.note p { margin: 0; color: var(--subtext1); font-size: 15px; }
.note strong { color: var(--text); }

/* Ports table */
.ports { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 14px; }
.ports th, .ports td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--surface0); }
.ports th { color: var(--overlay1); font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.ports td:first-child { color: var(--mauve); font-weight: 700; white-space: nowrap; }
.ports tr:last-child td { border-bottom: none; }
.ports .star { color: var(--yellow); }

/* Footer nav between writeups */
.wr-end { margin-top: 56px; margin-bottom: 52px; padding: 30px 0 0; border-top: 1px solid var(--surface0); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; }

@media (max-width: 640px) {
  .wr-hero { padding: 48px 0 24px; }
  .step { padding-top: 44px; }
  .cmd .term__body { font-size: 12.5px; }
}

/* Inline arrow spacing (Iosevka arrow glyph has no trailing gap) */
.arw { margin: 0 .34em; color: inherit; }

/* Notebook tree + ASCII summary panel */
.tree, .panel { white-space: pre; overflow-x: auto; font-family: var(--font); line-height: 1.55; }
.t-root { color: var(--mauve); font-weight: 700; }
.t-b { color: var(--surface2); }
.t-dir { color: var(--blue); font-weight: 700; }
.t-box { color: var(--green); font-weight: 700; }
.t-dim { color: var(--overlay1); }
.t-note { color: var(--overlay0); font-style: italic; }
.panel .star { color: var(--yellow); }

/* ---------- Interactive notebook (CherryTree-style) ---------- */
.wr-narrow { max-width: 760px; }
.nb { margin: 0 0 36px; border: 1px solid var(--surface0); border-radius: var(--radius); overflow: hidden; background: var(--crust); box-shadow: 0 30px 80px -40px rgba(0,0,0,.6); }
.nb .term__bar { position: relative; }
.nb__count { margin-left: auto; font-size: 12px; color: var(--overlay1); letter-spacing: .04em; }
.nb__body { display: grid; grid-template-columns: minmax(210px, 300px) 1fr; height: 660px; }
.nb__tree { overflow: auto; border-right: 1px solid var(--surface0); padding: 10px 0; background: var(--mantle); font-size: 13.5px; -webkit-overflow-scrolling: touch; }
.nb__preview { overflow: auto; padding: 24px 26px; }
.nb__row { display: flex; align-items: center; gap: .3em; padding: 3px 12px 3px 0; cursor: pointer; white-space: nowrap; color: var(--subtext0); user-select: none; }
.nb__row:hover { background: color-mix(in srgb, var(--surface0) 55%, transparent); }
.nb__row--dir > .nb__label { color: var(--text); }
.nb__row--sel { background: color-mix(in srgb, var(--mauve) 16%, transparent); box-shadow: inset 2px 0 0 var(--mauve); }
.nb__row--sel > .nb__label { color: var(--mauve); }
.nb__chev { width: 1em; flex: none; color: var(--overlay1); font-size: .8em; text-align: center; transition: transform .15s ease; }
.nb__icon { flex: none; color: var(--surface2); width: .9em; text-align: center; }
.nb__row--dir > .nb__icon { color: var(--blue); }
.nb__label { overflow: hidden; text-overflow: ellipsis; }
.nb__ptitle { font-size: 21px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.nb__ppath { font-size: 12px; color: var(--overlay1); letter-spacing: .03em; margin: 5px 0 20px; }
.nb__content { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font); font-size: 14px; line-height: 1.5; tab-size: 4; -moz-tab-size: 4; color: var(--subtext1); margin: 0; }
.nb__content--empty { color: var(--overlay1); font-style: italic; }
.nb-redact { color: var(--overlay1); background: var(--surface0); border: 1px solid var(--surface1); border-radius: 4px; padding: 0 5px; font-size: .88em; }
.nb-omit { color: var(--overlay0); font-style: italic; }

@media (max-width: 760px) {
  .nb__body { grid-template-columns: 1fr; height: auto; }
  .nb__tree { max-height: 300px; border-right: none; border-bottom: 1px solid var(--surface0); }
  .nb__preview { min-height: 280px; max-height: 60vh; }
}
