/* All styles live here so the CSP can stay style-src 'self'.
   No web fonts, no CDNs, no scripts: nothing loads from a third party. */
:root {
  --paper: #F1F3F0;
  --ink: #17242E;
  --muted: #56646D;
  --rule: #CDD3D0;
  --cable: #F2C230;
  --signal: #2F6FB0;
  --sans: "Segoe UI Variable Display", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
}
a { color: var(--signal); text-underline-offset: 0.18em; }
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }

/* Hidden until focused, for keyboard users */
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; border-radius: 6px;
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 1rem; }

/* Read by screen readers, not shown on screen */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header */
.top { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 0; }
.mark { white-space: nowrap; font-weight: 800; font-size: 1.125rem; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.top nav a { color: var(--ink); text-decoration: none; margin-left: 1.5rem; font-weight: 500; white-space: nowrap; }
.top nav a:hover, .top nav a[aria-current="page"] { text-decoration: underline; }

/* Hero */
.hero { display: grid; grid-template-columns: 1fr 1.05fr; gap: 3rem; align-items: center; padding: 3.5rem 0 5rem; }
h1 {
  font-size: clamp(2.4rem, 5.2vw, 4.1rem); line-height: 1.02; letter-spacing: -0.035em;
  font-weight: 800; margin: 0 0 1.5rem; max-width: 13ch;
}
.lede { font-size: 1.1875rem; color: var(--muted); max-width: 34rem; margin: 0 0 2rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn {
  display: inline-block; padding: 0.8rem 1.3rem; border-radius: 6px; font-weight: 600;
  text-decoration: none; border: 2px solid var(--ink);
}
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.secondary { color: var(--ink); }
.btn:hover { background: var(--cable); color: var(--ink); border-color: var(--ink); }

/* Network diagram */
figure { margin: 0; }
.topo { width: 100%; height: auto; display: block; }
.topo text { font-family: var(--mono); }
.topo .s-ink { stroke: var(--ink); }
.topo .s-muted { stroke: var(--muted); }
.topo .s-signal { stroke: var(--signal); }
.topo .f-ink { fill: var(--ink); }
.topo .f-paper { fill: var(--paper); }
.topo .f-muted { fill: var(--muted); }
.topo .f-signal { fill: var(--signal); }
.topo .f-cable { fill: var(--cable); }
.topo .blocked-static { display: none; }
figcaption { font-size: 0.9375rem; color: var(--muted); margin-top: 0.75rem; max-width: 36rem; }
@media (prefers-reduced-motion: reduce) {
  .topo .packet, .topo .blocked-anim { display: none; }
  .topo .blocked-static { display: inline; }
}

/* Sections */
section { padding: 4.5rem 0; border-top: 1px solid var(--rule); }
h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -0.025em; line-height: 1.1; margin: 0 0 0.75rem; font-weight: 800; }
.note { color: var(--muted); margin: 0 0 2.5rem; max-width: 40rem; }

/* Projects: one row per project, four columns that read like a ticket */
.proj-head, .proj {
  display: grid; grid-template-columns: 1.1fr 1fr 1.4fr 1fr; gap: 1.75rem;
}
.proj-head { font-size: 0.875rem; font-weight: 600; color: var(--muted); padding-bottom: 0.75rem; border-bottom: 2px solid var(--ink); }
.proj { padding: 1.5rem 0; border-bottom: 1px solid var(--rule); }
.proj h3 { font-size: 1.1875rem; line-height: 1.25; letter-spacing: -0.01em; margin: 0; }
.proj p { margin: 0; font-size: 0.98rem; }
/* Column labels: hidden visually on wide screens (the header row shows them),
   but always available to screen readers. Shown on narrow screens. */
.proj .k {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  font-size: 0.8125rem; font-weight: 600; color: var(--muted);
}
.tag {
  display: inline-block; margin-top: 0.5rem; background: var(--cable); color: var(--ink);
  font-size: 0.8125rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 3px;
}

/* Services */
.services { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.svc { border-left: 4px solid var(--ink); padding-left: 1.5rem; }
.svc h3 { font-size: 1.375rem; margin: 0 0 0.5rem; letter-spacing: -0.015em; }
.svc p { margin: 0 0 1rem; color: var(--muted); }
.svc ul { margin: 0; padding-left: 1.1rem; }
.svc li { margin-bottom: 0.3rem; }

/* Toolbox */
.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; margin: 0; }
.tools dt { font-weight: 700; margin-bottom: 0.5rem; }
.tools dd { margin: 0; color: var(--muted); line-height: 1.7; }
.creds { margin-top: 3rem; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.creds p { margin: 0.25rem 0 0; color: var(--muted); }
.creds strong { font-size: 1.0625rem; }

/* Contact */
.contact h2 { max-width: 18ch; }
.email { font-size: clamp(1.5rem, 3.4vw, 2.5rem); font-weight: 800; letter-spacing: -0.02em; color: var(--ink); text-decoration-color: var(--cable); text-decoration-thickness: 0.12em; overflow-wrap: anywhere; }
.email:hover { background: var(--cable); }
.elsewhere { margin-top: 1.5rem; }
.elsewhere a { margin-right: 1.5rem; }

/* "See the full ..." link at the end of a section */
.more { display: inline-block; margin-top: 2rem; font-weight: 600; }

/* Latest writing on the home page: reuses the .svc block */
.latest { list-style: none; margin: 0; padding: 0; max-width: 46rem; }
.latest p { margin: 0; }

/* Long-form pages (security, 404) */
.page { padding: 3.5rem 0 4.5rem; }
.page h1 { max-width: 18ch; }
.page section { padding: 3rem 0; }
.page section p, .page section li { max-width: 40rem; }
.page section p { margin: 0 0 1rem; }
.hdrs { margin: 1.5rem 0 0; max-width: 46rem; }
.hdrs div { padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.hdrs div:first-child { border-top: 2px solid var(--ink); }
.hdrs dt { font-weight: 700; overflow-wrap: anywhere; }
.hdrs dd { margin: 0.25rem 0 0; color: var(--muted); }
.hdrs .val { display: block; margin-top: 0.5rem; color: var(--ink); font-size: 0.9375rem; overflow-wrap: anywhere; }

/* Résumé */
.resume { padding: 2.5rem 0 3rem; max-width: 52rem; }
.resume h1 { max-width: none; margin-bottom: 1rem; }
.cv-contact { margin: 0 0 1.25rem; color: var(--muted); }
.cv-summary { font-size: 1.125rem; margin: 0 0 1.75rem; max-width: 46rem; }
.resume section { padding: 2.5rem 0; }
.resume h2 { margin-bottom: 1.25rem; }
.job + .job { margin-top: 2rem; }
.job h3 { font-size: 1.25rem; letter-spacing: -0.015em; line-height: 1.25; margin: 0; }
.when { margin: 0.25rem 0 0.75rem; color: var(--muted); }
.job h4 { font-size: 1rem; margin: 1.25rem 0 0.4rem; }
.resume ul { margin: 0; padding-left: 1.1rem; }
.resume li { margin-bottom: 0.45rem; }
.skills { margin: 0; }
.skills div { display: grid; grid-template-columns: 13rem 1fr; gap: 1.5rem; padding: 0.75rem 0; border-bottom: 1px solid var(--rule); }
.skills dt { font-weight: 700; }
.skills dd { margin: 0; color: var(--muted); }

footer { padding: 2rem 0 3rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.9375rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
footer a { margin-left: 0.75rem; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 1.5rem; }
  .proj-head { display: none; }
  .proj { grid-template-columns: 1fr; gap: 0.75rem; }
  .proj .k {
    position: static; width: auto; height: auto; margin: 0;
    overflow: visible; clip: auto; white-space: normal; display: block;
  }
  .services, .creds { grid-template-columns: 1fr; }
  .tools { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .skills div { grid-template-columns: 1fr; gap: 0.25rem; }
}
/* Seven nav links stop fitting beside the name below about 900px:
   stack the nav under the name instead of letting links break mid-label. */
@media (max-width: 900px) {
  .top { flex-wrap: wrap; gap: 0.5rem 0; }
  .top nav { width: 100%; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
  .top nav a { margin: 0; }
}
@media (max-width: 520px) {
  .tools { grid-template-columns: 1fr; }
  footer a { margin: 0 0.75rem 0 0; }
}

/* Print: used for the résumé PDF and for anyone printing a page */
@media print {
  @page { margin: 0.35in 0.45in; }
  :root { --paper: #FFFFFF; --muted: #3A464E; --rule: #BFC6C2; }
  body { font-size: 8.8pt; line-height: 1.27; }
  .wrap { max-width: none; padding: 0; }
  .skip, .top, footer, .no-print { display: none; }
  a { color: var(--ink); text-decoration: none; }
  .resume { padding: 0; max-width: none; }
  .resume h1 { font-size: 19pt; margin-bottom: 0.15rem; }
  .cv-contact br { display: none; }
  .cv-contact a::before { content: " / "; color: var(--muted); }
  .cv-contact { margin-bottom: 0.3rem; }
  .cv-summary { font-size: 8.8pt; margin-bottom: 0; max-width: none; }
  .resume section { padding: 0.35rem 0 0; border-top: 1.5pt solid var(--ink); margin-top: 0.35rem; }
  .resume h2 { font-size: 11pt; margin-bottom: 0.2rem; }
  .job + .job { margin-top: 0.4rem; }
  .job h3 { font-size: 9.8pt; display: inline; }
  .when { margin: 0; float: right; }
  .job h4, .job ul { clear: both; }
  .job h4 { font-size: 8.8pt; margin: 0.3rem 0 0.1rem; }
  .resume li { margin-bottom: 0.05rem; }
  .skills div { grid-template-columns: 10rem 1fr; gap: 0.75rem; padding: 0.05rem 0; border: 0; }
  h2, h3, h4 { break-after: avoid; }
  li { break-inside: avoid; }
}
