/* Self-hosted fonts: JetBrains Mono 2.211 + Space Grotesk 2.000 (Google Fonts sources), variable wght, subset to latin + Polish + arrows U+2190–2193, U+2197 */
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/jetbrains-mono-400-700-latin-pl.18da0ede.woff2) format('woff2');
  unicode-range: U+0000-02CC, U+02CE-02D7, U+02DA, U+02DC-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2000-206F, U+20A0-20C0, U+2113, U+2122, U+2190-2193, U+2197, U+2212, U+2215, U+2C60-2C7F, U+A720-A7FF, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/space-grotesk-400-700-latin-pl.58ecec44.woff2) format('woff2');
  unicode-range: U+0000-02CC, U+02CE-02D7, U+02DA, U+02DC-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2000-206F, U+20A0-20C0, U+2113, U+2122, U+2190-2193, U+2197, U+2212, U+2215, U+2C60-2C7F, U+A720-A7FF, U+FEFF, U+FFFD;
}
:root {
  --bg:          #f4f5f2;
  --bg-2:        #ffffff;
  --bg-3:        #eef0eb;
  --panel:       #ffffff;
  --panel-line:  #d9dcd3;
  --grid-line:   rgba(20,26,22,0.045);
  --ink:         #14181a;
  --ink-soft:    #414a48;
  --ink-faint:   #646e6a;
  --accent:      #077a5a;
  --accent-ink:  #ffffff;
  --danger:      #b4531a;
  --gold:        #8a6510;
  --radius:      4px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:          #0a0e0d;
  --bg-2:        #0f1513;
  --bg-3:        #121a17;
  --panel:       #101613;
  --panel-line:  #22302a;
  --grid-line:   rgba(120,255,214,0.035);
  --ink:         #e7efe9;
  --ink-soft:    #a5b4ad;
  --ink-faint:   #73857d;
  --accent:      #34e0a1;
  --accent-ink:  #04140e;
  --danger:      #ff8a5c;
  --gold:        #e6c56a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:          #0a0e0d;
    --bg-2:        #0f1513;
    --bg-3:        #121a17;
    --panel:       #101613;
    --panel-line:  #22302a;
    --grid-line:   rgba(120,255,214,0.035);
    --ink:         #e7efe9;
    --ink-soft:    #a5b4ad;
    --ink-faint:   #73857d;
    --accent:      #34e0a1;
    --accent-ink:  #04140e;
    --danger:      #ff8a5c;
    --gold:        #e6c56a;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 74px; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 34px 34px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: clip;
}
a { color: inherit; }
h1,h2,h3,h4 { font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; margin: 0; }
p { margin: 0 0 1em; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 9px 14px; border-radius: var(--radius);
        background: var(--accent); color: var(--accent-ink); font-family: var(--mono); font-size: 13px; text-decoration: none; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 clamp(18px, 5vw, 40px); }

/* ---- eyebrow / mono labels ---- */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 14px;
}
/* the marker sits on the first line when a long label wraps on a phone */
.eyebrow::before {
  content: "";
  width: 9px; height: 9px; flex: none; margin-top: 0.42em;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  display: inline-block;
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; text-underline-offset: 3px; }
.mono { font-family: var(--mono); }
/* A group label inside a section, with the same marker as the eyebrow. It gets space above
   only when a card grid already stands over it, so the first group stays close to the
   section heading and every later one has room. */
.eyebrow--grp { margin-bottom: 14px; }
.grid3 + .eyebrow--grp, .grid2 + .eyebrow--grp { margin-top: 38px; }

/* ---- top nav ---- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--panel-line);
}
.nav-inner { display: flex; align-items: center; gap: 20px; height: 58px; }
.brand {
  font-family: var(--mono); font-weight: 700; font-size: 14px;
  letter-spacing: 0.04em; text-decoration: none; color: var(--ink);
  white-space: nowrap;
}
.brand span { color: var(--accent); }
.brand .b-full, .brand .b-short { color: var(--ink); }
.brand .b-full span { color: var(--accent); }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.03em;
  text-decoration: none; color: var(--ink-soft);
  padding: 7px 11px; border-radius: var(--radius); white-space: nowrap;
}
.nav-links a:hover { color: var(--accent); background: var(--bg-3); }
.nav-links a.desktop-only { display: none; }
.toggle {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.05em;
  background: var(--bg-3); color: var(--ink-soft);
  border: 1px solid var(--panel-line); border-radius: var(--radius);
  padding: 7px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.toggle:hover { color: var(--accent); border-color: var(--accent); }
/* The label stays "dark mode" (a toggle button names its effect, aria-pressed carries the
   state); the pressed state is also drawn, so sighted users can see that it is on. */
.toggle[aria-pressed="true"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
/* The sixth link (credentials) fits in the bar only from ~900px; below that the row pushed
   .nav-inner wider and the theme switch slid off the screen. */
@media (min-width: 900px) { .nav-links a.desktop-only { display: inline-block; } }
/* Below 760px the logo, the links and the switch do not fit in one row. Without this the
   link bar pushed .nav-inner wider and the switch ended up off screen, clipped by the
   body's horizontal overflow, so the theme could not be changed on a phone. The links get
   their own horizontal scrolling; the logo and the button stay put. */
.brand .b-short { display: none; }
@media (max-width: 759px) {
  .nav-inner { gap: 12px; }
  .brand { flex: 0 0 auto; font-size: 13px; }
  /* The scrollbar is hidden, so nothing said that more links waited past the right edge
     (at 390px "services" and "contact" were off screen). The mask fades the content at the
     scrolling edge, a cue that works without a mouse. Where scroll-driven animations are
     supported, the fade goes away once the bar is scrolled to the end. */
  .nav-links { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none;
               --nav-fade: 26px;
               -webkit-mask-image: linear-gradient(to right, #000 calc(100% - var(--nav-fade)), transparent);
                       mask-image: linear-gradient(to right, #000 calc(100% - var(--nav-fade)), transparent); }
  .nav-links::-webkit-scrollbar { width: 0; height: 0; }
  .nav-links a { padding: 7px 8px; }
  @supports (animation-timeline: scroll(self inline)) {
    .nav-links { animation: nav-fade-out linear both; animation-timeline: scroll(self inline); }
  }
  .toggle { flex: 0 0 auto; }
  .toggle #themeLabel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  /* the three links that matter on a phone, so nothing hides past the edge;
     $= also matches the /#about form the write-up page uses */
  .nav-links a[href$="#about"], .nav-links a[href$="#projects"] { display: none; }
  .brand .b-full { display: none; }
  .brand .b-short { display: inline; }
}
/* Registering the property lets the fade length animate smoothly; without @property only
   the initial value applies, which leaves a fixed gradient at the edge. */
@property --nav-fade { syntax: "<length>"; inherits: false; initial-value: 26px; }
@keyframes nav-fade-out { from { --nav-fade: 26px; } to { --nav-fade: 0px; } }

/* ---- section frame ---- */
section { padding: clamp(48px, 8vw, 92px) 0; border-bottom: 1px solid var(--panel-line); position: relative; }
.sec-head { margin-bottom: 40px; }
.sec-head h2 {
  font-size: clamp(26px, 4.6vw, 40px);
  letter-spacing: -0.02em;
}
.sec-head .lead { color: var(--ink-soft); max-width: 62ch; margin-top: 12px; font-size: 16.5px; }

/* ---- HERO ---- */
.hero { padding-top: clamp(46px, 8vw, 86px); border-bottom: none; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: clamp(30px, 5vw, 54px); align-items: start; }
@media (min-width: 860px) { .hero-grid { grid-template-columns: 1.55fr 0.95fr; } }

.hero h1 {
  font-size: clamp(38px, 8vw, 74px);
  letter-spacing: -0.035em;
  line-height: 0.98;
  margin: 4px 0 0;
}
h1, h2, .hero-proof { text-wrap: balance; }
/* the one fact worth remembering, right under the name and linked to the reports */
.hero-proof { font-size: clamp(22px, 3.4vw, 32px); line-height: 1.2; letter-spacing: -0.02em;
              font-weight: 600; margin: 16px 0 0; max-width: 24ch; }
.hero-proof a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px;
                text-underline-offset: 7px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.hero-proof a:hover { text-decoration-color: var(--accent); }
.hero-role {
  font-size: clamp(16px, 2.2vw, 18px); line-height: 1.6;
  color: var(--ink-soft); margin-top: 20px; max-width: 54ch;
}
.hero-role b { color: var(--ink); font-weight: 600; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
@media (max-width: 480px) {
  .cta-row .btn-primary { flex: 1 1 100%; justify-content: center; }
  .cta-row .btn-ghost { flex: 1 1 0; justify-content: center; }
  .cta-row .btn-icon { flex: 0 0 auto; }
}
.btn {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.03em;
  text-decoration: none; padding: 12px 20px; border-radius: var(--radius);
  display: inline-flex; align-items: center; gap: 9px; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border: 1px solid var(--panel-line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon { padding: 12px 13px; }

/* portrait card */
.portrait-card {
  border: 1px solid var(--panel-line); border-radius: var(--radius);
  background: var(--panel); padding: 12px; position: relative;
}
.portrait-frame {
  position: relative; aspect-ratio: 1/1; border-radius: 3px; overflow: hidden;
  background: linear-gradient(135deg, var(--bg-3), var(--bg-2));
  display: grid; place-items: center;
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* theme.js shows the monogram only if the portrait fails to load */
.monogram {
  font-family: var(--sans); font-weight: 700; font-size: clamp(22px, 9vw, 104px);
  color: var(--accent); letter-spacing: -0.04em;
}
.portrait-foot {
  display: flex; justify-content: space-between; gap: 8px;
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint);
  padding: 11px 4px 3px; letter-spacing: 0.06em; flex-wrap: wrap;
}
.portrait-foot .ok { color: var(--accent); display: inline-flex; align-items: center; gap: 7px; }
.portrait-foot .ok::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
                             box-shadow: 0 0 8px var(--accent); animation: pulse 2.1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.78); } }
@media (prefers-reduced-motion: reduce) { .portrait-foot .ok::before { animation: none; } }
/* On a phone the portrait shrinks to an avatar row above the name, so the reports are no
   longer pushed one and a half screens down. */
@media (max-width: 859px) {
  .portrait-card { order: -1; display: flex; align-items: center; gap: 14px;
                   border: 0; background: none; padding: 0; }
  .portrait-frame { flex: none; width: 64px; height: 64px; border-radius: 50%; }
  .portrait-foot { flex-direction: column; gap: 2px; padding: 0; font-size: 12px; }
}

/* stat strip */
.stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  margin-top: 40px; background: var(--panel-line);
  border: 1px solid var(--panel-line); border-radius: var(--radius); overflow: hidden;
}
@media (min-width: 620px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.hero-grid > .stats { grid-column: 1 / -1; margin-top: 0; }
.stat { background: var(--panel); }
/* Every tile is proof and leads to its source. A link that does not look like one is
   useless, hence the arrow at rest and the underline on hover. */
.stat-link { display: block; height: 100%; padding: 20px 18px; color: inherit; text-decoration: none; }
.stat-link:hover .lbl,
.stat-link:focus-visible .lbl { color: var(--accent); }
.stat-link:hover .lbl { text-decoration: underline; text-underline-offset: 3px; }
.stat-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.stat .num { font-family: var(--sans); font-weight: 700; font-size: clamp(26px, 5vw, 34px); color: var(--accent); letter-spacing: -0.02em; }
.stat .lbl { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); margin-top: 4px; line-height: 1.4; }
.stat .go { color: var(--accent); }

/* ---- DISCLOSED RESEARCH ---- */
.reports { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 900px) { .reports { grid-template-columns: 1fr 1fr; } }
.rep {
  background: var(--panel); border: 1px solid var(--panel-line);
  border-radius: var(--radius); padding: 22px 22px 18px;
  display: flex; flex-direction: column;
}
.rep-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sev {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--danger); border: 1px solid currentColor; border-radius: 999px; padding: 4px 11px;
}
.rep-id { font-size: 11.5px; color: var(--ink-faint); }
.rep h3 { font-size: 17px; line-height: 1.35; margin: 14px 0 0; letter-spacing: -0.01em; }
.rep-sum { color: var(--ink-soft); font-size: 14.5px; margin-top: 10px; }
.rep code {
  font-family: var(--mono); font-size: 0.88em; background: var(--bg-2);
  border: 1px solid var(--panel-line); border-radius: 3px; padding: 1px 5px;
  word-break: break-word;
}
.rep-kv { margin-top: 16px; border-top: 1px solid var(--panel-line); padding-top: 12px; }
.rep-kv > div { display: flex; gap: 10px; padding: 3px 0; font-family: var(--mono); font-size: 13px; }
.rep-kv dt { color: var(--ink-faint); flex: 0 0 92px; letter-spacing: 0.05em; }
.rep-kv dd { color: var(--ink-soft); margin: 0; }
.rep-kv dd.ok { color: var(--accent); }
.rep-kv dd a { color: var(--accent); }
.rep .proj-links { margin-top: auto; padding-top: 16px; }
.rep-foot {
  margin-top: 20px; font-family: var(--mono); font-size: 12.5px;
  color: var(--ink-faint); text-align: center;
}
.rep-foot a { color: var(--accent); }

/* link to the write-up, under the report cards */
.rep-more { display: flex; align-items: center; gap: 10px 16px; margin-top: 18px; padding: 18px 22px;
            border: 1px solid var(--panel-line); border-radius: var(--radius); background: var(--panel);
            color: var(--ink); text-decoration: none; }
.rep-more:hover { border-color: var(--accent); }
.rep-more .k { flex: none; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
               text-transform: uppercase; color: var(--accent); }
.rep-more .t { font-size: 15.5px; font-weight: 500; line-height: 1.45; }
.rep-more .arr { margin-left: auto; flex: none; font-family: var(--mono); color: var(--accent); }
.rep-more:hover .t { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 560px) { .rep-more { flex-wrap: wrap; } .rep-more .arr { display: none; } }

/* ---- EXPLOIT CHAIN (interactive, on the write-up page) --------------- */
.chain { margin-top: 44px; border: 1px solid var(--panel-line); border-radius: var(--radius);
         background: var(--panel); overflow: hidden; }
.chain-head { padding: 26px 26px 0; }
.chain-head h2 { font-size: 20px; margin: 0 0 8px; letter-spacing: -0.01em; }
.chain-head p { color: var(--ink-soft); font-size: 15px; margin: 0; max-width: 68ch; }

/* the value's path, lit step by step */
.flow { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch;
        margin: 22px 0 0; padding: 0 26px; }
.flow .node { flex: 1 1 150px; border: 1px solid var(--panel-line); border-radius: var(--radius);
              padding: 9px 12px; background: var(--bg-3); position: relative;
              transition: border-color .18s ease, background .18s ease, color .18s ease; }
.flow .node span { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--ink);
                   word-break: break-all; }
.flow .node em { display: block; font-style: normal; font-family: var(--mono); font-size: 11px;
                 letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint);
                 margin-top: 3px; }
.flow .node.lit { border-color: var(--accent); background: var(--bg-2); }
.flow .node.lit span { color: var(--accent); }
.flow .node.done { border-color: var(--accent); opacity: 0.55; }

/* step tabs */
.chain-nav { display: flex; flex-wrap: wrap; gap: 1px; background: var(--panel-line);
             margin: 22px 0 0; border-top: 1px solid var(--panel-line);
             border-bottom: 1px solid var(--panel-line); }
.chain-nav button { flex: 1 1 160px; background: var(--bg-3); border: 0; cursor: pointer;
                    font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em;
                    color: var(--ink-soft); padding: 14px 16px; text-align: left;
                    transition: background .16s ease, color .16s ease; }
.chain-nav button b { display: block; font-size: 11px; color: var(--ink-faint);
                      letter-spacing: 0.14em; margin-bottom: 3px; font-weight: 500; }
.chain-nav button:hover { background: var(--bg-2); color: var(--ink); }
.chain-nav button[aria-selected="true"] { background: var(--panel); color: var(--accent); }
.chain-nav button[aria-selected="true"] b { color: var(--accent); }
.chain-nav button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.chain-panel { padding: 24px 26px 4px; }
.chain-panel h3 { font-size: 16.5px; margin: 0 0 10px; letter-spacing: -0.01em; }
.chain-panel p { color: var(--ink-soft); font-size: 15px; margin: 0 0 14px; max-width: 70ch; }
.chain-panel .note { font-size: 13.5px; color: var(--ink-faint); border-left: 2px solid var(--panel-line);
                     padding-left: 12px; }
.chain-panel .note strong { color: var(--ink); }

.code { font-family: var(--mono); font-size: 12.5px; line-height: 1.8; background: var(--bg-3);
        border: 1px solid var(--panel-line); border-radius: var(--radius);
        padding: 14px 16px; overflow-x: auto; margin: 0 0 14px; color: var(--ink); }
.code .c { color: var(--ink-faint); }
.hot { color: var(--danger); }
.code .ok { color: var(--accent); }

.chain-out { border-top: 1px solid var(--panel-line); background: var(--bg-3);
             padding: 20px 26px; }
.chain-out p { margin: 0; font-size: 14.5px; color: var(--ink-soft); max-width: 74ch; }
.chain-out b { color: var(--ink); }

/* The detection panel: the same slab as .chain-out, with a heading and a list of signals
   instead of a single paragraph. It closes the chain from the defender's side, so it sits
   under the replay it refers to. */
.chain-out.det h2 { font-size: 17px; margin: 0 0 10px; letter-spacing: -0.01em; }
.chain-out.det p { margin: 0 0 16px; }
.det-sig { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.det-sig li { font-size: 14px; line-height: 1.6; color: var(--ink-soft); max-width: 74ch;
              border-left: 2px solid var(--panel-line); padding-left: 14px; }
.det-sig li b { display: block; font-family: var(--mono); font-size: 11px; font-weight: 500;
                letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent);
                margin-bottom: 4px; }
.det-rules { margin: 18px 0 0; font-size: 14px; color: var(--ink-soft); max-width: 74ch; }
.det-rules a { color: var(--accent); }
/* Route and meta-key names (POST /wp/v2/media/<id>/finalize, _wp_attachment_backup_sizes)
   are one long word each; below ~360px they pushed the panel past its slab. They break
   mid-word only when nothing else fits. */
.chain-out p, .chain-out.det p, .det-sig li, .chain-panel p, .rep-sum { overflow-wrap: break-word; }
.chain-out .mono, .det-sig .mono, .chain-panel p .mono, .rep-sum code { overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  .flow .node, .chain-nav button { transition: none; }
}

/* ---- PoC REPLAY (self-playing terminal) ------------------------------ */
/* The replay sits inside .chain, which has no padding of its own; without this the heading,
   the terminal and the player bar touched the panel border while every sibling
   (.chain-head, .chain-out) is inset by 26px. */
.replay { margin-top: 22px; padding: 0 26px 24px; }
.replay-head h2 { font-size: 20px; margin: 0 0 8px; letter-spacing: -0.01em; }
.replay-head p { color: var(--ink-soft); font-size: 15px; margin: 0 0 16px; max-width: 70ch; }

.term { margin: 0; border: 1px solid var(--panel-line); border-radius: var(--radius);
        background: #0c0f11; overflow: hidden; box-shadow: 0 6px 30px rgba(0,0,0,0.18); }
:root[data-theme="dark"] .term { background: #08110d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .term { background: #08110d; } }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px;
            background: rgba(255,255,255,0.04); border-bottom: 1px solid rgba(255,255,255,0.06); }
.term-bar .dot { width: 11px; height: 11px; border-radius: 50%; background: #3a3f42; }
.term-bar .dot:nth-child(1) { background: #e0524f; }
.term-bar .dot:nth-child(2) { background: #e8b23c; }
.term-bar .dot:nth-child(3) { background: #7cc242; }
.term-title { margin-left: 10px; font-family: var(--mono); font-size: 11.5px;
              color: #8a938f; letter-spacing: 0.02em; }

.term-body { margin: 0; padding: 18px 18px 20px; font-family: var(--mono);
             font-size: 12.5px; line-height: 1.75; color: #cdd6d0;
             min-height: 220px; max-height: 460px; overflow-y: auto; white-space: pre-wrap;
             word-break: break-word; }
.term-body .cmd { color: #eaf0ec; }
.term-body .cmd::before { content: "$ "; color: #34e0a1; }
.term-body .prompt2::before { content: "  "; }
.term-body .out { color: #9aa39d; }
.term-body .ok  { color: #34e0a1; }
.term-body .hot { color: #ff8a5c; font-weight: 600; }
.term-body .win { color: #e8b23c; }
.term-body .cur { display: inline-block; width: 8px; height: 15px; background: #34e0a1;
                  vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---- PLAYER (progress bar + one button) ---- */
.player { display:flex; align-items:center; gap:12px; margin-top:12px; flex-wrap:wrap; }
.pbtn { flex:none; width:42px; height:42px; border-radius:50%; border:0; cursor:pointer;
        background:var(--accent); color:var(--accent-ink); display:grid; place-items:center;
        transition:filter .16s ease; }
.pbtn:hover { filter:brightness(1.08); }
.pbtn:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.ic-play, .ic-pause, .ic-replay { display:block; }
.ic-play { width:0; height:0; border-left:13px solid currentColor;
           border-top:8px solid transparent; border-bottom:8px solid transparent; margin-left:3px; }
.ic-pause { width:13px; height:15px; border-left:4px solid currentColor;
            border-right:4px solid currentColor; }
.ic-replay { width:14px; height:14px; border:2.5px solid currentColor; border-radius:50%;
             border-right-color:transparent; transform:rotate(-45deg); }
.ptrack { flex:1 1 160px; height:6px; border-radius:99px; background:var(--panel-line);
          cursor:pointer; position:relative; min-width:120px; }
.ptrack:focus-visible { outline:2px solid var(--accent); outline-offset:4px; }
.pfill { height:100%; border-radius:99px; background:var(--accent); width:100%;
         transition:width .12s linear; }
.pstep { font-size:11.5px; color:var(--ink-faint); font-variant-numeric:tabular-nums; flex:none; }

.replay-note { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); }
.replay-note a { color: var(--accent); }

@media (max-width: 640px) { .term-body { font-size: 11.5px; max-height: 60vh; } }
@media (prefers-reduced-motion: reduce) { .term-body .cur { animation: none; } }

/* ---- CREDENTIALS (CTFs, certificates, education, languages, kept short) ---- */
/* Five cards in an auto-fit grid left empty cells (the grid line colour showed through):
   three holes in the second row at four columns, two at three columns. Hence explicit
   breakpoints, with a span on the cards that would otherwise sit alone — every row is
   full at every width. */
.cred-grid { display:grid; gap:1px; background:var(--panel-line); border:1px solid var(--panel-line);
             border-radius:var(--radius); overflow:hidden;
             grid-template-columns:1fr; }
@media (min-width:600px) {   /* 2 columns: 2 + 2 + fifth card full width */
  .cred-grid { grid-template-columns:repeat(2,1fr); }
  .cred--wide { grid-column:1 / -1; }
  .cred--wide ul { flex-direction:row; flex-wrap:wrap; gap:10px 34px; }
  .cred--wide li { min-width:150px; }
}
@media (min-width:900px) {   /* 3 columns: 3 + (fourth spans 2, fifth spans 1) */
  .cred-grid { grid-template-columns:repeat(3,1fr); }
  .cred:nth-child(4) { grid-column:span 2; }
  .cred--wide { grid-column:auto; }
  .cred--wide ul { flex-direction:column; gap:11px; }
}
.cred { background:var(--panel); padding:20px 22px; }
.cred h3 { font-size:13px; font-family:var(--mono); letter-spacing:.06em; text-transform:uppercase;
           color:var(--accent); margin:0 0 14px; }
.cred ul { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:11px; }
.cred li { font-size:14px; color:var(--ink-soft); line-height:1.4; }
.cred li b { color:var(--ink); font-weight:600; }
.cred li span { display:block; font-family:var(--mono); font-size:11.5px; color:var(--ink-faint); margin-top:2px; }
.cred li span a { color:var(--accent); }
.cred li .mk { display:inline; color:var(--gold); text-transform:uppercase; letter-spacing:.06em; }

/* ---- ABOUT ---- */
.about-body { max-width: 70ch; }
.about-body p { color: var(--ink-soft); font-size: 17px; }
.about-body p strong { color: var(--ink); font-weight: 600; }
.about-body p.lead-p { font-size: 18.5px; color: var(--ink); }

/* ---- generic card grids ---- */
.grid3 { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .grid3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid3 { grid-template-columns: repeat(3, 1fr); } }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 760px) { .grid2 { grid-template-columns: repeat(2, 1fr); } }

.proj-card {
  border: 1px solid var(--panel-line); border-radius: var(--radius);
  background: var(--panel); padding: 20px;
  display: flex; flex-direction: column;
}
/* a long title wraps under its tag instead of squeezing beside it */
.proj-card h3 { font-size: 17px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.proj-card h3 .tagm { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 999px; padding: 2px 8px; }
.proj-card p { color: var(--ink-soft); font-size: 14px; margin: 12px 0 16px; }
.proj-card p a { color: var(--ink); text-underline-offset: 3px;
                 text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.proj-card p a:hover { color: var(--accent); }
.proj-links { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.proj-links a {
  font-family: var(--mono); font-size: 12px; text-decoration: none;
  color: var(--ink-soft); border: 1px solid var(--panel-line); border-radius: var(--radius);
  padding: 6px 11px; display: inline-flex; align-items: center; gap: 7px;
}
.proj-links a:hover { color: var(--accent); border-color: var(--accent); }
/* The service cards borrow the .rep-kv table from the reports. Inside .proj-card it also
   needs a gap above the link row: in one column the card is as tall as its content, so
   margin-top:auto on .proj-links moves nothing. */
.proj-card .rep-kv { margin-bottom: 18px; }

/* ---- ALSO BUILT (the products, folded into one list) ---- */
.also { list-style: none; margin: 0; padding: 0; border: 1px solid var(--panel-line);
        border-radius: var(--radius); background: var(--panel); }
.also li { display: grid; grid-template-columns: minmax(150px, 190px) 1fr; gap: 4px 18px;
           padding: 14px 20px; border-top: 1px solid var(--panel-line);
           font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); }
.also li:first-child { border-top: 0; }
.also .nm { font-family: var(--mono); font-size: 13px; }
.also .nm a { color: var(--ink); text-decoration: none;
              border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.also a:hover { color: var(--accent); }
.also .ds a { color: var(--accent); }
@media (max-width: 600px) { .also li { grid-template-columns: 1fr; } }
.also-more { margin-top: 10px; }
.also-more > summary { display: inline-flex; align-items: center; gap: 8px; padding: 8px 2px;
                       font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft);
                       cursor: pointer; list-style: none; }
.also-more > summary::-webkit-details-marker { display: none; }
.also-more > summary::before { content: "+"; width: 1ch; color: var(--accent); font-weight: 700; }
.also-more[open] > summary::before { content: "−"; }
.also-more > summary:hover { color: var(--accent); }
.also-more > .also { margin-top: 6px; }

/* ---- CONTACT ---- */
.contact-wrap { text-align: center; }
.contact-wrap h2 { font-size: clamp(30px, 6vw, 54px); letter-spacing: -0.03em; }
.contact-mail {
  display: inline-block; margin-top: 20px;
  font-family: var(--mono); font-size: clamp(15px, 3.5vw, 22px);
  color: var(--accent); text-decoration: none; word-break: break-all;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); padding-bottom: 3px;
}
.contact-mail:hover { border-color: var(--accent); }
.contact-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 34px; }
.contact-wrap .eyebrow { justify-content: center; }
.contact-wrap .contact-lead { color: var(--ink-soft); max-width: 56ch; margin: 16px auto 0; }

/* footer */
footer { padding: 34px 0 46px; }
.foot-inner { display: flex; flex-wrap: wrap; gap: 12px 22px; justify-content: space-between; align-items: center; }
.foot-inner p { margin: 0; font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); letter-spacing: 0.04em; }
.foot-inner a { color: inherit; text-underline-offset: 3px; }
.foot-inner a:hover { color: var(--accent); }

/* ---- WRITE-UP PAGE ---- */
.article-head { padding-bottom: clamp(30px, 5vw, 48px); border-bottom: none; }
.article-head h1 { font-size: clamp(30px, 5.6vw, 52px); letter-spacing: -0.03em; line-height: 1.05; max-width: 20ch; }
.article-date { margin: 14px 0 0; font-family: var(--mono); font-size: 12px;
                letter-spacing: 0.04em; color: var(--ink-faint); }
.article-head .lead { color: var(--ink-soft); max-width: 66ch; margin-top: 18px; font-size: 17px; }
.article-head .rep-kv { max-width: 780px; margin-top: 26px; }
.article-head .rep-kv dt { flex-basis: 104px; }
.article-body { padding-top: 0; }
.article-body .chain { margin-top: 0; }
.article-foot { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* ---- PRINT ---- */
@media print {
  :root, :root[data-theme="dark"] {
    --bg:#fff; --bg-2:#fff; --bg-3:#fff; --panel:#fff; --panel-line:#c9cdc6;
    --ink:#0c0f10; --ink-soft:#2b3230; --ink-faint:#565f5c;
    --accent:#0a7d5e; --gold:#8a6510; --danger:#9a4416;
  }
  body { background: #fff !important; background-image: none !important; color: #0c0f10; font-size: 11pt; }
  .nav, .toggle, .cta-row, .portrait-foot, .stats, .contact-links { display: none !important; }
  .nav { position: static; }
  section { padding: 14px 0; border-bottom: 1px solid #d5d8d2; page-break-inside: auto; }
  .hero { padding-top: 6px; }
  .hero h1 { font-size: 26pt; }
  .portrait-card { border: none; padding: 0; max-width: 42mm; }
  .hero-grid { grid-template-columns: 1fr auto; gap: 10mm; align-items: start; }
  .portrait-frame { border-radius: 2mm; }
  .proj-card, .rep, .cred { page-break-inside: avoid; break-inside: avoid; }
  .proj-card { box-shadow: none; border: 1px solid #d5d8d2; }
  a { color: #0c0f10; text-decoration: none; }
  .sec-head { margin-bottom: 16px; }
  .contact-mail { color: #0a7d5e; }
  /* the write-up prints whole: every step at once, no player */
  .chain-panel[hidden] { display: block !important; }
  .chain-nav, .player, .flow, .article-foot { display: none !important; }
  .term-body { max-height: none; overflow: visible; }
  .rep-more { border: 1px solid #d5d8d2; }
  @page { margin: 14mm; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
