/* ===========================================================================
   Paper & Ink — a Swiss editorial design system.
   Stark ground, hairline rules, condensed display type, one red accent.
   Edit the tokens below to restyle the whole site.
   ======================================================================== */

:root {
  /* Colour ------------------------------------------------------------- */
  --paper:  #ffffff;   /* page ground                */
  --field:  #f6f5f3;   /* card / inset fill          */
  --ink:    #111111;   /* body text                  */
  --muted:  #6b6b6b;   /* secondary text             */
  --rule:   #e3e1de;   /* hairlines                  */
  --accent: #e63400;   /* the single accent          */
  --accent-soft: #ffe9e3;

  /* Type ---------------------------------------------------------------- */
  --display: "Archivo Narrow", "Arial Narrow", Helvetica, sans-serif;
  --body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Metrics ------------------------------------------------------------- */
  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 48px);
  --hair: 1px;
  --radius: 0px;              /* Swiss: no rounding. Raise for softer cards. */
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* Dark scheme: system preference, unless the toggle says otherwise. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:  #0f0f0f;
    --field:  #17171a;
    --ink:    #f0eeea;
    --muted:  #8f8b85;
    --rule:   #2a2926;
    --accent: #ff5227;
    --accent-soft: #34150c;
  }
}

:root[data-theme="dark"] {
  --paper:  #0f0f0f;
  --field:  #17171a;
  --ink:    #f0eeea;
  --muted:  #8f8b85;
  --rule:   #2a2926;
  --accent: #ff5227;
  --accent-soft: #34150c;
}

/* ---------------------------------------------------------------------- */
/* Base                                                                    */
/* ---------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern" 1;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
}
.skip:focus { left: 0; }

/* Shared type utilities -------------------------------------------------- */

.meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--muted);
  margin: 0;
}

.label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.display {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.02;
  text-transform: uppercase;
}

.accent { color: var(--accent); }

/* ---------------------------------------------------------------------- */
/* Masthead                                                                */
/* ---------------------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: var(--hair) solid var(--rule);
}

.masthead-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 62px;
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: .01em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-right: auto;
}
.wordmark:hover { color: var(--accent); }

.nav {
  display: flex;
  gap: 22px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nav a {
  position: relative;
  color: var(--muted);
  padding-block: 4px;
  transition: color .18s var(--ease);
}
.nav a:hover { color: var(--ink); }

.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
}

.masthead-tools { display: flex; gap: 8px; }

/* Mobile drawer. Above the breakpoint the toggle is hidden and .nav is the
   plain flex row above; below it, .nav becomes a panel under the masthead. */

.nav-toggle { display: none; padding-inline: 9px; }
.nav-icons { display: inline-flex; }
.nav-icons .is-close,
[aria-expanded="true"] .nav-icons .is-menu { display: none; }
[aria-expanded="true"] .nav-icons .is-close { display: inline-block; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .palette-open .palette-hint,
  .palette-open kbd { display: none; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 6px var(--gutter) 14px;
    background: var(--paper);
    border-bottom: var(--hair) solid var(--rule);
    box-shadow: 0 18px 30px -24px rgb(0 0 0 / .5);
  }
  .nav:not(.is-open) { display: none; }

  .nav a {
    padding-block: 13px;
    border-bottom: var(--hair) solid var(--rule);
  }
  .nav a:last-child { border-bottom: 0; }
  .nav a[aria-current="page"]::after { display: none; }
  .nav a[aria-current="page"] { color: var(--accent); }
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: var(--hair) solid var(--rule);
  border-radius: var(--radius);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 7px 10px;
  cursor: pointer;
  transition: border-color .18s var(--ease), color .18s var(--ease);
}
.ghost-btn:hover { color: var(--ink); border-color: var(--ink); }

kbd {
  font-family: var(--mono);
  font-size: 10px;
  border: var(--hair) solid var(--rule);
  border-radius: 2px;
  padding: 1px 4px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .palette-hint, .palette-open kbd { display: none; }
}
@media (max-width: 720px) {
  .masthead-inner { height: auto; padding-block: 12px; flex-wrap: wrap; }
  .nav { order: 3; width: 100%; gap: 18px; overflow-x: auto; padding-bottom: 2px; }
}

/* ---------------------------------------------------------------------- */
/* Hero                                                                    */
/* ---------------------------------------------------------------------- */

.hero {
  padding-block: clamp(56px, 11vw, 132px) clamp(40px, 7vw, 76px);
  border-bottom: var(--hair) solid var(--rule);
}

.hero-role {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}
.hero-role::after {
  content: "";
  flex: 1;
  height: var(--hair);
  background: var(--rule);
}

.hero-statement {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(2.6rem, 8.2vw, 6.4rem);
  line-height: .94;
  letter-spacing: -.015em;
  margin: 0 0 30px;
  max-width: 16ch;
}
.hero-statement .accent { color: var(--accent); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: end;
}

.hero-intro {
  font-size: clamp(1rem, 1.6vw, 1.14rem);
  color: var(--muted);
  margin: 0 0 22px;
  max-width: 52ch;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .07em;
  text-transform: uppercase;
  border: var(--hair) solid var(--rule);
  padding: 8px 13px;
  transition: border-color .18s var(--ease), color .18s var(--ease),
              background .18s var(--ease);
}
.hero-links a:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

/* Stat block: oversized condensed numerals, the Swiss signature. */
.hero-stats {
  display: grid;
  /* auto-fit so the row stays correct as stats are added or removed. */
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  border-top: 2px solid var(--ink);
}
.hero-stat { padding: 14px 0 4px; }
.hero-stat dt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.hero-stat dd {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  line-height: 1;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; align-items: start; }
  .hero-statement { max-width: none; }
}

/* ---------------------------------------------------------------------- */
/* Numbered sections                                                       */
/* ---------------------------------------------------------------------- */

.section {
  padding-block: clamp(44px, 6.5vw, 84px);
  border-bottom: var(--hair) solid var(--rule);
}
.section:last-of-type { border-bottom: 0; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 32px;
}

.section-index {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--accent);
  flex: none;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  letter-spacing: .005em;
  line-height: 1;
  margin: 0;
  flex: none;
}

.section-rule {
  flex: 1;
  height: var(--hair);
  background: var(--rule);
  transform: translateY(-4px);
}

.section-more {
  flex: none;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  transition: color .18s var(--ease);
}
.section-more:hover { color: var(--accent); }
.section-more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.section-more .icon { transition: transform .22s var(--ease); }
.section-more:hover .icon { transform: translateX(4px); }

@media (max-width: 640px) {
  .section-head { flex-wrap: wrap; gap: 10px; }
  .section-rule { min-width: 24px; }
}

/* Two-column body used inside sections ---------------------------------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(24px, 5vw, 64px);
}
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

.lede {
  font-size: 1.06rem;
  line-height: 1.62;
  margin: 0 0 18px;
}

/* ---------------------------------------------------------------------- */
/* Horizontal rails                                                        */
/* ---------------------------------------------------------------------- */

.rail { position: relative; }

.rail-track {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  /* Bleed to the viewport edge so cards run off-screen like a filmstrip. */
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  border-top: 2px solid var(--ink);
}
.rail-track::-webkit-scrollbar { display: none; }

.rail-item {
  flex: 0 0 clamp(258px, 30vw, 340px);
  scroll-snap-align: start;
  border-right: var(--hair) solid var(--rule);
  padding: 22px 26px 26px 0;
  margin-right: 26px;
}
.rail-item:last-child { border-right: 0; margin-right: 0; }

.rail-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.rail-progress {
  position: relative;
  flex: 1;
  height: 2px;
  background: var(--rule);
}
.rail-bar {
  position: absolute;
  inset-block: 0;
  left: 0;
  width: 30%;
  background: var(--accent);
  transition: transform .12s linear, width .2s var(--ease);
}

.rail-arrows { display: flex; gap: 6px; }

.rail-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  background: none;
  border: var(--hair) solid var(--rule);
  color: var(--ink);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease),
              color .18s var(--ease);
}
.rail-arrow:hover:not(:disabled) {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.rail-arrow:disabled { opacity: .3; cursor: default; }

/* ---------------------------------------------------------------------- */
/* Cards                                                                   */
/* ---------------------------------------------------------------------- */

.card-index {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.card-title {
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 1.28rem;
  line-height: 1.1;
  letter-spacing: .005em;
  margin: 0 0 10px;
}

.card-blurb {
  font-size: .94rem;
  color: var(--muted);
  line-height: 1.58;
  margin: 0 0 16px;
}

.status {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 2px 7px;
  border: var(--hair) solid var(--rule);
}
.status[data-status="shipped"]  { color: var(--accent); border-color: var(--accent); }
.status[data-status="building"] { color: var(--ink); }
.status[data-status="archived"] { color: var(--muted); }

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}
.stack li {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--muted);
  background: var(--field);
  padding: 3px 8px;
}

.card-links { display: flex; gap: 14px; }
.card-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: var(--hair) solid var(--rule);
  padding-bottom: 2px;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.card-links a:hover { color: var(--accent); border-color: var(--accent); }

/* Project grid (full page) ---------------------------------------------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0;
  border-top: 2px solid var(--ink);
}
.project-grid > * {
  padding: 26px 28px 30px 0;
  border-bottom: var(--hair) solid var(--rule);
  border-right: var(--hair) solid var(--rule);
}
@media (max-width: 640px) {
  .project-grid > * { padding-right: 0; border-right: 0; }
}

/* A filtered-out card must not keep its grid slot. */
.project-grid > [hidden] { display: none; }

.blog-card-link { display: block; }
.card-title a:hover { color: var(--accent); }

/* ---------------------------------------------------------------------- */
/* Certificates and badges                                                 */
/* ---------------------------------------------------------------------- */

.cred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 0;
  border-top: 2px solid var(--ink);
}
.cred-grid > * {
  padding: 26px 28px 30px 0;
  border-bottom: var(--hair) solid var(--rule);
  border-right: var(--hair) solid var(--rule);
}
@media (max-width: 640px) {
  .cred-grid > * { padding-right: 0; border-right: 0; }
}

/* The thumbnail, and the "View" chip that fades in over it on hover. */
.cred-shot {
  position: relative;
  display: block;
  margin-bottom: 16px;
}
.cred-shot .cover {
  /* Certificates are landscape documents — show the whole page, not a crop. */
  background: var(--field);
  border: var(--hair) solid var(--rule);
  /* .cred-shot owns the spacing; .has-cover would otherwise add its own. */
  margin-bottom: 0;
}
.cred-shot .cover > img { object-fit: contain; }

.cred-open {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.cred-shot:hover .cred-open,
.cred-shot:focus-visible .cred-open { opacity: 1; transform: none; }

.cred-type {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  padding: 2px 7px;
  border: var(--hair) solid var(--rule);
  color: var(--muted);
}

.cred-title {
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 1.12rem;
  line-height: 1.16;
  margin: 0 0 8px;
}

.cred-org {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 14px;
}
.cred-org .icon { flex: none; }

/* Rail variant on the home page — no bottom rule, tighter title. */
.cred-rail-item .cred-title { font-size: 1.02rem; }

/* ---------------------------------------------------------------------- */
/* Lightbox — image credentials only; PDFs open in a new tab.              */
/* ---------------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 5vw, 56px);
}
.lightbox[hidden] { display: none; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: blur(4px);
}

.lightbox-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: min(1100px, 100%);
  max-height: 100%;
  margin: 0;
}
.lightbox-panel img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  background: var(--paper);
  border: 2px solid var(--paper);
}
.lightbox-panel figcaption {
  color: var(--paper);
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: var(--hair) solid color-mix(in srgb, var(--paper) 45%, transparent);
  color: var(--paper);
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.lightbox-close:hover { background: var(--paper); color: var(--ink); }

/* ---------------------------------------------------------------------- */
/* Post rows — the index-style list                                        */
/* ---------------------------------------------------------------------- */

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--ink);
}

.post-row { border-bottom: var(--hair) solid var(--rule); }

.post-row > a {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto 26px;
  gap: 22px;
  align-items: baseline;
  padding: 20px 0;
  transition: background .2s var(--ease), padding-inline .2s var(--ease);
}
.post-row > a:hover {
  background: var(--field);
  padding-inline: 14px;
}

.post-week {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .09em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.post-headline {
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  font-size: clamp(1.1rem, 2.1vw, 1.5rem);
  line-height: 1.12;
  letter-spacing: .005em;
  margin: 0 0 6px;
}
.post-row > a:hover .post-headline { color: var(--accent); }

.post-summary {
  font-size: .93rem;
  color: var(--muted);
  margin: 0;
  max-width: 62ch;
}

.post-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--muted);
  white-space: nowrap;
}
.post-aside > span { display: inline-flex; align-items: center; gap: 5px; }

@media (max-width: 680px) {
  .post-row > a { grid-template-columns: 60px minmax(0, 1fr); gap: 14px; }
  .post-aside { grid-column: 2; text-align: left; }
}

/* Tag filter ------------------------------------------------------------ */

.filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
}
.filter-btn {
  background: none;
  border: var(--hair) solid var(--rule);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 6px 11px;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.filter-btn:hover { color: var(--ink); border-color: var(--ink); }
.filter-btn[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.filter-count { color: inherit; opacity: .6; }

.empty-note {
  padding: 30px 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}

/* ---------------------------------------------------------------------- */
/* Timeline (experience & education)                                       */
/* ---------------------------------------------------------------------- */

.timeline { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }

.tl-item {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 26px;
  padding: 26px 0;
  border-bottom: var(--hair) solid var(--rule);
}

.tl-when {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .07em;
  color: var(--muted);
  text-transform: uppercase;
}
.tl-when strong { display: block; color: var(--accent); font-weight: 500; }

.tl-role {
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 1.24rem;
  line-height: 1.14;
  margin: 0 0 3px;
}

.tl-org {
  font-size: .95rem;
  color: var(--muted);
  margin: 0 0 12px;
}
.tl-org a { border-bottom: var(--hair) solid var(--rule); }
.tl-org a:hover { color: var(--accent); border-color: var(--accent); }

.tl-points { margin: 0; padding-left: 18px; }
.tl-points li { margin-bottom: 6px; font-size: .96rem; }
.tl-points li::marker { color: var(--accent); }

@media (max-width: 680px) {
  .tl-item { grid-template-columns: 1fr; gap: 10px; }
}

/* Courses & achievements ------------------------------------------------ */

.entry-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }

.entry {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: var(--hair) solid var(--rule);
}
.entry-year {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.entry-title {
  font-weight: 600;
  font-size: 1.02rem;
  margin: 0 0 3px;
}
.entry-sub { font-size: .92rem; color: var(--muted); margin: 0; }
.entry-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  border-bottom: var(--hair) solid var(--rule);
}
.entry-link:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 620px) {
  .entry { grid-template-columns: 56px minmax(0, 1fr); gap: 14px; }
  .entry-link { grid-column: 2; }
}

/* Skills ---------------------------------------------------------------- */

.skill-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 20px;
  padding: 15px 0;
  border-bottom: var(--hair) solid var(--rule);
  align-items: baseline;
}
.skill-row:first-child { border-top: 2px solid var(--ink); }
.skill-items { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; margin: 0; padding: 0; }
.skill-items li {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--field);
  padding: 4px 9px;
}
@media (max-width: 620px) { .skill-row { grid-template-columns: 1fr; gap: 8px; } }

/* ---------------------------------------------------------------------- */
/* Page headers & article prose                                            */
/* ---------------------------------------------------------------------- */

.page-head {
  padding-block: clamp(40px, 7vw, 78px) clamp(26px, 4vw, 44px);
  border-bottom: var(--hair) solid var(--rule);
}
.page-title {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(2.2rem, 6.4vw, 4.4rem);
  line-height: .98;
  letter-spacing: -.012em;
  margin: 12px 0 0;
  max-width: 20ch;
}
.page-sub a {
  color: var(--accent);
  border-bottom: var(--hair) solid currentColor;
}
.page-sub {
  color: var(--muted);
  max-width: 58ch;
  margin: 16px 0 0;
  font-size: 1.02rem;
}

.article { padding-block: clamp(34px, 5vw, 56px) 0; }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 20px;
}
.article-meta .accent { color: var(--accent); }

.prose {
  max-width: 68ch;
  padding-block: 8px clamp(40px, 6vw, 72px);
  font-size: 1.06rem;
  line-height: 1.72;
}
.prose > *:first-child { margin-top: 0; }

.prose h2 {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1.42rem;
  letter-spacing: .005em;
  line-height: 1.15;
  margin: 2.1em 0 .6em;
  padding-top: .7em;
  border-top: var(--hair) solid var(--rule);
}
.prose h3 {
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 1.14rem;
  margin: 1.7em 0 .4em;
}
.prose p { margin: 0 0 1.15em; }
.prose a {
  color: var(--accent);
  border-bottom: var(--hair) solid currentColor;
}
.prose a:hover { background: var(--accent-soft); }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 22px; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--accent); }

.prose blockquote {
  margin: 1.6em 0;
  padding: 2px 0 2px 22px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-size: 1.04rem;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose code {
  font-family: var(--mono);
  font-size: .87em;
  background: var(--field);
  padding: 2px 5px;
}
.prose pre {
  background: var(--field);
  border-left: 2px solid var(--accent);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 1.5em 0;
  font-size: .88rem;
  line-height: 1.55;
}
.prose pre code { background: none; padding: 0; font-size: inherit; }

.prose hr { border: 0; border-top: var(--hair) solid var(--rule); margin: 2.4em 0; }

/* Screenshots and diagrams inside a post body. Add {: .narrow } after the
   image in Markdown to cap a small screenshot at a sensible width instead of
   letting it stretch across the column. */
.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.6em 0;
  background: var(--field);
  border: var(--hair) solid var(--rule);
}
.prose img.narrow { max-width: 360px; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: .95rem;
  display: block;
  overflow-x: auto;
}
.prose th, .prose td {
  text-align: left;
  padding: 9px 12px 9px 0;
  border-bottom: var(--hair) solid var(--rule);
}
.prose th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--ink);
}

.codehilite { margin: 1.5em 0; }
.codehilite pre { margin: 0; }

/* Post navigation ------------------------------------------------------- */

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 2px solid var(--ink);
  margin-bottom: clamp(40px, 6vw, 72px);
}
.post-nav a {
  padding: 22px 20px 24px 0;
  transition: background .2s var(--ease);
}
.post-nav a:hover { background: var(--field); }
.post-nav a + a {
  border-left: var(--hair) solid var(--rule);
  padding-left: 20px;
  text-align: right;
}
.post-nav .label { display: block; margin-bottom: 7px; }
.post-nav strong {
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 1.05rem;
  line-height: 1.15;
}
.post-nav a:hover strong { color: var(--accent); }
@media (max-width: 620px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav a + a {
    border-left: 0;
    border-top: var(--hair) solid var(--rule);
    padding-left: 0;
    text-align: left;
  }
}

/* Buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .09em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  border: var(--hair) solid var(--ink);
  padding: 11px 18px;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.btn-ghost { background: none; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------------------------------------------------------------------- */
/* Footer                                                                  */
/* ---------------------------------------------------------------------- */

.footer {
  border-top: 2px solid var(--ink);
  margin-top: 0;
  padding-block: 40px 52px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
}
.footer-name {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1.15rem;
  margin: 0 0 4px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  border-bottom: var(--hair) solid transparent;
}
.footer-links a:hover { color: var(--accent); border-color: var(--accent); }
.footer-legal { width: 100%; }

/* ---------------------------------------------------------------------- */
/* Command palette                                                         */
/* ---------------------------------------------------------------------- */

.palette { position: fixed; inset: 0; z-index: 90; }
.palette[hidden] { display: none; }

.palette-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 42%, transparent);
  backdrop-filter: blur(2px);
}

.palette-panel {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  margin: min(14vh, 120px) auto 0;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 10px 10px 0 color-mix(in srgb, var(--ink) 12%, transparent);
}

.palette-input {
  width: 100%;
  border: 0;
  border-bottom: var(--hair) solid var(--rule);
  background: none;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.02rem;
  padding: 17px 20px;
  outline: none;
}
.palette-input::placeholder { color: var(--muted); }

.palette-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  max-height: 46vh;
  overflow-y: auto;
}
.palette-list li a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 20px;
}
.palette-list li[data-active] a,
.palette-list li a:hover { background: var(--field); }
.palette-list li[data-active] a { box-shadow: inset 2px 0 0 var(--accent); }

.palette-kind {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--muted);
  flex: none;
  width: 58px;
}
.palette-label { font-size: .97rem; }

.palette-foot {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 10px 20px;
  border-top: var(--hair) solid var(--rule);
}

/* ---------------------------------------------------------------------- */
/* Reveal on scroll                                                        */
/* ---------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* Print: resume should print cleanly. ----------------------------------- */
@media print {
  .masthead, .footer, .palette, .no-print { display: none !important; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .page-head { padding-block: 0 12pt; }
  a { color: #000; }
}
