/* aaronsawit.com
   Idea: a marked-up log printout. Cool paper, ink, and a highlighter that only ever touches the line that explains things.
   Red is reserved for symptoms. Yellow is reserved for causes. Nothing else gets a colour.
   Type: Darker Grotesque for headlines (tight, heavy, a little odd), Atkinson Hyperlegible Next for reading
   (drawn for low-vision readers, which suits someone who builds tools for kids who struggle with text), and its Mono sibling for evidence. */
:root {
  --paper: #eceef1;
  --panel: #ffffff;
  --ink: #0f1320;
  --ink-soft: #4a5166;
  --line: #cbd0da;
  --mark: #ffe14d;
  --mark-ink: #0f1320;
  --alert: #d7263d;
  --link: #0b4f8a;
  --display: "Darker Grotesque", "Arial Narrow", Arial, sans-serif;
  --sans: "Atkinson Hyperlegible Next", "Helvetica Neue", Arial, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --wrap: 74rem;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #131c2e; --panel: #1b263c; --ink: #eef1f8; --ink-soft: #a3aec6; --line: #30405c; --alert: #ff6b7d; --link: #8cc0f5; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 1.0625rem; line-height: 1.6; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--alert); outline-offset: 3px; border-radius: 2px; }
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--mark); color: var(--mark-ink); padding: 0.6rem 1rem; z-index: 10; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

h1, h2, h3 { font-family: var(--display); font-weight: 900; line-height: 0.95; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.9rem, 7.4vw, 6.4rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(2.3rem, 4.6vw, 3.8rem); }
h3 { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.eyebrow { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.02em; margin: 0 0 1.4rem; color: var(--ink-soft); }
.eyebrow a { color: inherit; }
.lede { font-size: clamp(1.15rem, 1.7vw, 1.35rem); line-height: 1.5; max-width: 44rem; margin: 1.5rem 0 0; color: var(--ink-soft); }

/* the highlighter: a slightly uneven stroke behind text, never a box */
mark, .hl { background: linear-gradient(100deg, transparent 0.4%, var(--mark) 1.6%, var(--mark) 97.5%, transparent 99.4%) no-repeat left 58% / 100% 90%; color: var(--mark-ink); padding: 0.02em 0.22em; margin: 0 -0.12em; border-radius: 0.18em 0.4em 0.22em 0.35em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.brand strong { font-family: var(--display); font-weight: 900; font-size: 1.5rem; letter-spacing: -0.02em; line-height: 1; }
.brand span { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-soft); }
.top nav { display: flex; align-items: center; gap: clamp(0.8rem, 2.2vw, 1.8rem); font-size: 0.95rem; }
.top nav a { color: var(--ink); text-decoration: none; padding: 0.35rem 0; border-bottom: 2px solid transparent; }
.top nav a:hover, .top nav a[aria-current="page"] { border-bottom-color: var(--ink); }
.top .nav-cta { background: var(--ink); color: var(--paper); padding: 0.5rem 0.95rem; border-radius: 4px; border: 0; }
.top .nav-cta:hover { background: var(--link); border: 0; }
@media (max-width: 40rem) { .brand span, .top nav .opt { display: none; } .top nav { font-size: 0.9rem; gap: 0.85rem; } }

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 2rem; }
.btn { display: inline-block; font-weight: 700; font-size: 1rem; text-decoration: none; padding: 0.8rem 1.25rem; border-radius: 4px; border: 2px solid var(--ink); color: var(--ink); background: none; cursor: pointer; font-family: var(--sans); }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--link); border-color: var(--link); color: #fff; }

/* ---------- hero ---------- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 6vw, 5rem); }
.hero h1 { max-width: 17ch; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); margin-top: clamp(2rem, 4vw, 3.25rem); align-items: start; }
@media (max-width: 56rem) { .hero-grid { grid-template-columns: 1fr; } }

/* evidence: a log excerpt with symptoms ticked in red and the cause highlighted */
.evidence { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.evidence figcaption { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-soft); padding: 0.7rem 1.1rem; border-bottom: 1px solid var(--line); }
.log { list-style: none; margin: 0; padding: 0.9rem 0; font-family: var(--mono); font-size: clamp(0.7rem, 1.25vw, 0.86rem); line-height: 1.5; overflow-x: auto; }
.log li { display: grid; grid-template-columns: 4.6rem 5.2rem minmax(0, 1fr); gap: 0.6rem; padding: 0.28rem 1.1rem; border-left: 3px solid transparent; white-space: nowrap; }
.log .t { color: var(--ink-soft); }
.log .tagcol { font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); }
.log .symptom { border-left-color: var(--alert); }
.log .symptom .tagcol { color: var(--alert); }
.log .cause .tagcol { color: var(--ink); font-weight: 700; }
.log .cause .msg { background: linear-gradient(100deg, transparent 0.4%, var(--mark) 1.2%, var(--mark) 98.4%, transparent 99.6%) no-repeat left / 100% 100%; color: var(--mark-ink); padding: 0 0.3em; margin-left: -0.3em; border-radius: 3px 8px 4px 7px; justify-self: start; }
.evidence .verdict { margin: 0; padding: 0.9rem 1.1rem 1.05rem; border-top: 1px solid var(--line); font-size: 0.98rem; }
.evidence .verdict a { font-weight: 700; }
@media (max-width: 34rem) { .log li { grid-template-columns: 3.9rem minmax(0, 1fr); } .log .tagcol { display: none; } }

@media (prefers-reduced-motion: no-preference) {
  .log li { opacity: 0; animation: line-in 0.35s ease-out forwards; }
  .log li:nth-child(1) { animation-delay: 0.15s; } .log li:nth-child(2) { animation-delay: 0.4s; } .log li:nth-child(3) { animation-delay: 0.65s; }
  .log li:nth-child(4) { animation-delay: 0.9s; } .log li:nth-child(5) { animation-delay: 1.15s; } .log li:nth-child(6) { animation-delay: 1.4s; }
  .log .cause .msg { background-size: 0% 100%; animation: sweep 0.7s cubic-bezier(0.3, 0.7, 0.2, 1) 1.9s forwards, ink-in 0.4s ease-out 2.05s forwards; }
  .log .cause .tagcol { opacity: 0; animation: line-in 0.3s ease-out 2.5s forwards; }
  .hero h1 mark { background-size: 0% 90%; color: inherit; animation: sweep-mark 0.8s cubic-bezier(0.3, 0.7, 0.2, 1) 2.2s forwards, ink-in 0.5s ease-out 2.35s forwards; }
  .log .cause .msg { color: inherit; }
}
@keyframes line-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes sweep { to { background-size: 100% 100%; } }
@keyframes sweep-mark { to { background-size: 100% 90%; } }
@keyframes ink-in { to { color: var(--mark-ink); } }

/* the ten-second box for recruiters */
.brief { margin: 0; border-top: 3px solid var(--ink); }
.brief div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.75rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.brief dt { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-soft); padding-top: 0.2rem; }
.brief dd { margin: 0; font-size: 1rem; line-height: 1.4; }
.brief dd strong { font-weight: 700; }

/* ---------- bands ---------- */
.band { padding: clamp(3.25rem, 7vw, 6rem) 0; border-top: 1px solid var(--line); }
.band-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); gap: 1.5rem 3rem; align-items: end; margin-bottom: clamp(1.75rem, 4vw, 3rem); }
.band-head p { margin: 0; color: var(--ink-soft); }
@media (max-width: 48rem) { .band-head { grid-template-columns: 1fr; } }

/* cases: what people said, then what it was */
.cases { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.cases li { border-bottom: 1px solid var(--line); }
.cases a { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) minmax(0, 1.15fr); gap: 0.5rem 2rem; padding: 1.35rem 0; text-decoration: none; color: var(--ink); align-items: start; }
.cases .when { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-soft); padding-top: 0.3rem; }
.cases .said { color: var(--ink-soft); font-size: 1.05rem; line-height: 1.4; padding-left: 0.9rem; border-left: 3px solid var(--alert); }
.cases .was { padding-left: 0.9rem; border-left: 3px solid var(--mark); font-family: var(--display); font-weight: 800; font-size: clamp(1.35rem, 2.2vw, 1.7rem); line-height: 1.12; letter-spacing: -0.01em; }
.cases a:hover .was span { background: linear-gradient(100deg, transparent 0.4%, var(--mark) 1.6%, var(--mark) 97.5%, transparent 99.4%); color: var(--mark-ink); border-radius: 0.18em 0.4em 0.22em 0.35em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.cases-key { display: flex; gap: 1.5rem; flex-wrap: wrap; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-soft); margin: 0 0 0.9rem; }
.cases-key span::before { content: ""; display: inline-block; width: 0.7rem; height: 0.7rem; margin-right: 0.45rem; vertical-align: -0.05rem; }
.cases-key .k-said::before { background: var(--alert); }
.cases-key .k-was::before { background: var(--mark); }
@media (max-width: 52rem) { .cases a { grid-template-columns: 1fr; gap: 0.6rem; } .cases .when { padding: 0; } }
.more { margin: 1.5rem 0 0; font-weight: 700; }

/* work */
.work-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.work-item > a { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(1.25rem, 3vw, 2.75rem); padding: clamp(1.25rem, 2.6vw, 2.1rem); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--ink); align-items: center; }
.work-item > a:hover { border-color: var(--ink); }
.work-item > a:hover h3 { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.12em; }
.work-kind { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-soft); margin: 0 0 0.6rem; }
.work-item h3 { font-size: clamp(2rem, 3.4vw, 2.75rem); font-weight: 900; }
.work-sum { margin: 0.8rem 0 0; color: var(--ink-soft); }
.metrics { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; gap: 0.35rem; }
.metrics li { font-weight: 700; font-size: 1rem; padding-left: 1rem; position: relative; }
.metrics li::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 0.5rem; height: 0.5rem; background: var(--mark); border: 1px solid var(--ink); }
.work-visual { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--paper); aspect-ratio: 16 / 10; }
.work-visual img, .work-visual svg { width: 100%; height: 100%; object-fit: cover; object-position: top; }
@media (max-width: 52rem) { .work-item > a { grid-template-columns: 1fr; } .work-visual { order: -1; } }

.tags { list-style: none; margin: 1.2rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tags li { font-family: var(--mono); font-size: 0.7rem; border: 1px solid var(--line); border-radius: 3px; padding: 0.2rem 0.5rem; color: var(--ink-soft); background: var(--panel); }

.also { margin-top: 2.5rem; }
.also h3 { font-size: 1.4rem; margin-bottom: 0.9rem; }
.also ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.also a { display: block; padding: 1.1rem 1.25rem 1.1rem 0; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); height: 100%; }
.also strong { display: block; font-size: 1rem; margin-bottom: 0.25rem; }
.also span { color: var(--ink-soft); font-size: 0.94rem; }

/* detections table */
.det { width: 100%; border-collapse: collapse; border-top: 2px solid var(--ink); font-size: 1rem; }
.det th { text-align: left; font-family: var(--mono); font-weight: 400; font-size: 0.72rem; color: var(--ink-soft); padding: 0.7rem 1rem 0.7rem 0; border-bottom: 1px solid var(--line); }
.det td { padding: 1rem 1rem 1rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.det td:first-child { font-weight: 700; }
.det td:first-child small { display: block; font-weight: 400; color: var(--ink-soft); font-size: 0.92rem; margin-top: 0.2rem; }
.tech { font-family: var(--mono); font-size: 0.74rem; white-space: nowrap; border: 1px solid var(--ink); border-radius: 3px; padding: 0.15rem 0.45rem; display: inline-block; margin: 0 0.25rem 0.25rem 0; text-decoration: none; color: var(--ink); }
a.tech:hover { background: var(--mark); color: var(--mark-ink); }
.pass { font-family: var(--mono); font-size: 0.78rem; white-space: nowrap; }
.pass::before { content: ""; display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #1f9d55; margin-right: 0.45rem; }
.table-scroll { overflow-x: auto; }
@media (max-width: 44rem) { .det .opt { display: none; } }

/* where I fit */
.fit { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.fit li { padding: 1.6rem 1.75rem 1.6rem 0; border-right: 1px solid var(--line); margin-right: 1.75rem; display: flex; flex-direction: column; gap: 0.7rem; }
.fit li:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.fit h3 { font-size: 1.65rem; }
.fit p { margin: 0; color: var(--ink-soft); font-size: 1rem; }
.fit a { margin-top: auto; font-weight: 700; align-self: flex-start; }
@media (max-width: 52rem) { .fit { grid-template-columns: 1fr; } .fit li { border-right: 0; margin-right: 0; padding-right: 0; border-bottom: 1px solid var(--line); } .fit li:last-child { border-bottom: 0; } }

/* about */
.about { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); }
.about h2 { margin-bottom: 1.5rem; }
.about p { margin: 0 0 1.1rem; max-width: 40rem; }
.about aside h3 { font-size: 1.35rem; margin: 0 0 0.8rem; }
.about aside h3:not(:first-child) { margin-top: 2rem; }
.facts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.facts li { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.facts strong { display: block; }
.facts span { color: var(--ink-soft); font-size: 0.95rem; }
@media (max-width: 52rem) { .about { grid-template-columns: 1fr; } }

/* contact */
.contact { background: var(--ink); color: var(--paper); padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.contact h2 { max-width: 18ch; }
.contact p { max-width: 38rem; margin: 1.25rem 0 0; opacity: 0.85; }
.contact .btn { border-color: var(--paper); color: var(--paper); }
.contact .btn:hover { background: var(--paper); color: var(--ink); }
.contact .btn-solid { background: var(--mark); border-color: var(--mark); color: var(--mark-ink); }
.contact .btn-solid:hover { background: var(--paper); border-color: var(--paper); color: var(--ink); }

.foot { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; padding: 2rem 0 3rem; display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between; font-size: 0.9rem; color: var(--ink-soft); }
.foot p { margin: 0; }
.foot a { color: inherit; }

/* ---------- documents: case studies, write-ups, detections, CV ---------- */
.doc-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(1.75rem, 4vw, 2.75rem); }
.doc-head h1 { font-size: clamp(2.6rem, 6vw, 5rem); max-width: 20ch; }
.verdict-box { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin-top: 2rem; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); overflow: hidden; }
.verdict-box div { padding: 1.1rem 1.3rem 1.2rem; }
.verdict-box div:first-child { border-right: 1px solid var(--line); border-left: 4px solid var(--alert); }
.verdict-box div:last-child { border-left: 4px solid var(--mark); }
.verdict-box dt { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-soft); margin-bottom: 0.35rem; }
.verdict-box dd { margin: 0; font-size: 1.08rem; line-height: 1.4; }
.verdict-box div:last-child dd { font-weight: 700; }
@media (max-width: 44rem) { .verdict-box { grid-template-columns: 1fr; } .verdict-box div:first-child { border-right: 0; border-bottom: 1px solid var(--line); } }
.meta { display: flex; flex-wrap: wrap; gap: 0.75rem 2.5rem; margin: 2rem 0 0; padding: 1rem 0; border-block: 1px solid var(--line); }
.meta dt { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-soft); }
.meta dd { margin: 0.15rem 0 0; font-weight: 700; }
.meta-metrics { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin: 1.5rem 0 0; padding: 0; }
.meta-metrics li { font-family: var(--display); font-weight: 800; font-size: 1.45rem; line-height: 1.1; }

.prose { max-width: none; padding-bottom: 3rem; }
.prose > * { max-width: 44rem; margin-inline: auto; }
.prose h2 { font-size: clamp(1.9rem, 3.2vw, 2.5rem); margin-top: 3rem; margin-bottom: 0.9rem; }
.prose h3 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 0.6rem; }
.prose p, .prose ul, .prose ol { margin-block: 0 1.15rem; }
.prose li { margin-bottom: 0.45rem; }
.prose code { font-family: var(--mono); font-size: 0.86em; background: var(--panel); border: 1px solid var(--line); padding: 0.08em 0.35em; border-radius: 3px; overflow-wrap: anywhere; }
.prose pre { max-width: 52rem; background: var(--panel); color: var(--ink); padding: 1.15rem 1.3rem; border-radius: 6px; overflow-x: auto; font-size: 0.82rem; line-height: 1.65; border: 1px solid var(--line); border-left: 4px solid var(--ink); }
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; overflow-wrap: normal; }
.prose blockquote { margin-inline: auto; padding: 0.25rem 0 0.25rem 1.25rem; border-left: 4px solid var(--mark); font-size: 1.15rem; }
.prose img { border-radius: 6px; border: 1px solid var(--line); }
.prose table { width: 100%; max-width: 52rem; border-collapse: collapse; font-size: 0.96rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 0.6rem 1rem 0.6rem 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.prose th { font-family: var(--mono); font-weight: 400; font-size: 0.74rem; color: var(--ink-soft); border-bottom: 2px solid var(--ink); }
.prose .diagram { max-width: 52rem; margin-block: 2rem; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); padding: 0.5rem; }
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; max-width: 60rem !important; margin-block: 2rem; }
@media (max-width: 36rem) { .shots { grid-template-columns: 1fr; } }

.list-head { font-size: 1.9rem; margin: 3rem 0 1rem; }
.post-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.post-row a { display: grid; grid-template-columns: 7rem minmax(0, 1fr) auto; gap: 0.5rem 1.5rem; align-items: baseline; padding: 1rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.post-row a:hover .post-title { text-decoration: underline; }
.post-date, .post-tag { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-soft); }
.post-title { font-weight: 700; font-size: 1.1rem; }
@media (max-width: 40rem) { .post-row a { grid-template-columns: 1fr; gap: 0.2rem; } }

.next { padding: 2rem 0 4rem; }
.next a { display: block; padding: 1.4rem 0; border-block: 2px solid var(--ink); text-decoration: none; color: var(--ink); }
.next span { display: block; font-family: var(--mono); font-size: 0.74rem; color: var(--ink-soft); margin-bottom: 0.3rem; }
.next strong { font-family: var(--display); font-weight: 900; font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1; }
.next a:hover strong { text-decoration: underline; text-decoration-thickness: 3px; }

/* rule cards on /detections/ */
.rule { max-width: 60rem; margin: 0 auto 2.5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); overflow: hidden; }
.rule-head { padding: 1.4rem 1.5rem 1.2rem; border-bottom: 1px solid var(--line); }
.rule-head h2 { font-size: clamp(1.6rem, 2.8vw, 2.1rem); margin-bottom: 0.7rem; }
.rule-head p { margin: 0.7rem 0 0; color: var(--ink-soft); }
.rule details { border-bottom: 1px solid var(--line); }
.rule details:last-child { border-bottom: 0; }
.rule summary { cursor: pointer; padding: 0.85rem 1.5rem; font-family: var(--mono); font-size: 0.8rem; }
.rule summary:hover { background: var(--paper); }
.rule pre { margin: 0; padding: 1.1rem 1.5rem 1.4rem; overflow-x: auto; font-family: var(--mono); font-size: 0.8rem; line-height: 1.6; border-top: 1px solid var(--line); background: var(--paper); }

/* diagrams */
.diagram { width: 100%; height: auto; display: block; }
.diagram text { font-family: var(--mono); font-size: 11px; fill: var(--ink); }
.diagram .dim { fill: var(--ink-soft); }
.diagram .box { fill: var(--panel); stroke: var(--line); stroke-width: 1.5; }
.diagram .box-key { fill: var(--ink); stroke: var(--ink); }
.diagram .on-key { fill: var(--paper); }
.diagram .on-signal { fill: #0f1320; }
.diagram .wire { stroke: var(--ink-soft); stroke-width: 1.5; fill: none; }
.diagram .bar { fill: var(--line); }
.diagram .bar-key { fill: var(--ink); }
.diagram .bar-signal { fill: var(--mark); }
.diagram .big { font-family: var(--display); font-size: 22px; font-weight: 900; }
.diagram .box-key ~ g .box { fill: var(--panel); }

/* ---------- CV ---------- */
.cv { max-width: 54rem; margin-inline: auto; padding: clamp(2rem, 5vw, 3.5rem) 0 4rem; }
.cv-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; flex-wrap: wrap; border-bottom: 3px solid var(--ink); padding-bottom: 1.25rem; }
.cv-top h1 { font-size: clamp(2.6rem, 6vw, 4rem); }
.cv-top p { margin: 0.4rem 0 0; color: var(--ink-soft); }
.cv-contact { list-style: none; margin: 0; padding: 0; font-size: 0.95rem; text-align: right; }
.cv h2 { font-size: 1.5rem; margin: 2.1rem 0 0.8rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--line); }
.cv h3 { font-family: var(--sans); font-weight: 700; font-size: 1.05rem; letter-spacing: 0; line-height: 1.3; }
.cv-item { margin-bottom: 1.15rem; }
.cv-item .sub { color: var(--ink-soft); font-size: 0.95rem; }
.cv-item ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.cv-item li { margin-bottom: 0.2rem; }
.cv-skills { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.45rem 1rem; margin: 0; }
.cv-skills dt { font-weight: 700; }
.cv-skills dd { margin: 0; }
.cv-summary { font-size: 1.1rem; margin: 1.4rem 0 0; }
@media (max-width: 36rem) { .cv-skills { grid-template-columns: 1fr; } .cv-contact { text-align: left; } }

@media print {
  :root { --paper: #fff; --panel: #fff; --ink: #000; --ink-soft: #333; --line: #bbb; --link: #000; }
  body { font-size: 10.5pt; line-height: 1.4; }
  .top, .foot, .skip, .no-print, .contact { display: none !important; }
  .cv { padding: 0; max-width: none; }
  .cv h2 { margin-top: 1.1rem; font-size: 13pt; }
  .cv-top h1 { font-size: 26pt; }
  .cv-item { margin-bottom: 0.6rem; break-inside: avoid; }
  a { text-decoration: none; }
  @page { margin: 14mm 15mm; }
}

/* narrow-screen polish */
.hero h1 mark { white-space: nowrap; }
.top nav a, .brand strong { white-space: nowrap; }
@media (max-width: 34rem) {
  .log li { white-space: normal; }
  .log .msg { overflow-wrap: anywhere; }
  .top nav { gap: 0.7rem; font-size: 0.86rem; }
  .top .nav-cta { padding: 0.45rem 0.7rem; }
  .brand strong { font-size: 1.3rem; }
}
