:root {
  color-scheme: light;
  --paper: #f4ead8;
  --paper-warm: #eadbc2;
  --paper-dark: #241914;
  --bone: #fff8e9;
  --ink: #241914;
  --ink-soft: #5d4637;
  --ink-mute: #765d49;
  --ink-faint: #7d654c;
  --brand: #3d5a73;
  --brand-light: #4d7291;
  --sand: #e3d0b1;
  --stone: #bda383;
  --accent-blue: var(--brand-light);
  --accent-text: var(--brand);
  --accent-soft: #334d63;
  --accent-mark: var(--brand-light);
  --olive: #8b7a4b;

  --bg: var(--paper);
  --surface: var(--bone);
  --accent: var(--accent-blue);
  --rule: #c8ad88;
  --rule-light: #dac6a9;
  --header-bg: rgba(244, 234, 216, .92);
  --grain-opacity: .11;
  --grain-blend: multiply;
  --image-filter: none;
  --avatar-filter: invert(1) saturate(.9) contrast(1.04);
  --logo-filter: saturate(.82) contrast(1.04);
  --tap-highlight: rgba(77, 114, 145, .28);
  --shadow-card: 0 0 0 1px var(--rule-light), 0 8px 28px rgba(68, 38, 17, .08);
  --button-bg: var(--brand);
  --button-bg-hover: var(--accent-soft);
  --button-text: #fff8e9;
  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Charter", Georgia, serif;
  --font-body: "Newsreader", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Charter", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --max: 1360px;
  --page-gutter: 144px;
  --header-offset: 120px;
  --measure: 760px;
  --radius: 12px;
  --ease: ease;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141413;
  --paper-warm: #1d1d1b;
  --paper-dark: #faf9f5;
  --bone: #30302e;
  --ink: #f5f4ed;
  --ink-soft: #d8d3c6;
  --ink-mute: #b2ac9f;
  --ink-faint: #8f897f;
  --brand: #6a9bc4;
  --brand-light: #7eb0d8;
  --sand: #3d3d3a;
  --stone: #6b6a64;
  --accent-blue: var(--brand-light);
  --accent-text: #9ec5e8;
  --accent-soft: #8aa8c9;
  --accent-mark: var(--brand-light);
  --olive: var(--stone);
  --rule: #504e49;
  --rule-light: #3d3d3a;
  --header-bg: rgba(20, 20, 19, .92);
  --grain-opacity: .045;
  --grain-blend: screen;
  --image-filter: none;
  --avatar-filter: saturate(.92) contrast(1.04) brightness(.96);
  --logo-filter: saturate(.9) contrast(1.04) brightness(1.08);
  --tap-highlight: rgba(126, 176, 216, .36);
  --shadow-card: 0 0 0 1px var(--rule-light), 0 4px 24px rgba(0, 0, 0, .22);
  --button-bg: var(--brand);
  --button-bg-hover: var(--accent-soft);
  --button-text: #1d1512;
}

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

html {
  scroll-behavior: smooth;
  background: var(--paper);
  scroll-padding-top: var(--header-offset);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

main > section[id]:not(.hero),
#contact {
  scroll-margin-top: var(--header-offset);
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  overflow-x: hidden;
  counter-reset: doc-section;
}

body:before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: var(--grain-blend);
}

a {
  color: inherit;
  text-decoration-color: var(--brand-light);
  text-underline-offset: .18em;
}

::selection {
  background: var(--brand);
  color: var(--button-text);
}

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

button {
  font: inherit;
  font-weight: 400;
}

strong,
b {
  font-weight: 400;
}

button,
a {
  -webkit-tap-highlight-color: var(--tap-highlight);
}

button,
a {
  touch-action: manipulation;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 4px;
}

.shell {
  width: min(var(--max), calc(100% - var(--page-gutter)));
  margin: 0 auto;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-text);
}

p {
  text-wrap: pretty;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.meta-strip {
  min-height: 32px;
  border-bottom: 1px solid var(--rule-light);
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.meta-strip-inner {
  width: min(var(--max), calc(100% - var(--page-gutter)));
  min-height: 32px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.meta-strip-inner span:nth-child(2) {
  justify-self: center;
  color: var(--ink-mute);
}

.meta-strip-inner span:last-child {
  justify-self: end;
}

.pulse-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--accent-blue);
  animation: pulse 2.4s ease-in-out infinite;
}

.nav {
  position: relative;
  min-height: 68px;
  width: min(var(--max), calc(100% - var(--page-gutter)));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  min-width: 0;
  flex: 1 1 auto;
  font-size: 17px;
  letter-spacing: .01em;
  text-decoration: none;
}

.brand span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 0;
  object-fit: contain;
  border: 0;
  filter: var(--avatar-filter);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.nav-links a,
.icon-btn {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  padding: 10px 18px;
  cursor: pointer;
  font-size: 15px;
  text-decoration: none;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}

.icon-btn {
  width: 44px;
  padding: 0;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.theme-toggle .theme-icon-sun,
.mobile-toggle .menu-icon-close {
  display: none;
}

.theme-toggle[aria-pressed="true"] .theme-icon-moon,
.mobile-toggle[aria-expanded="true"] .menu-icon-open {
  display: none;
}

.theme-toggle[aria-pressed="true"] .theme-icon-sun,
.mobile-toggle[aria-expanded="true"] .menu-icon-close {
  display: block;
}

.nav-links a:focus-visible,
.icon-btn:focus-visible {
  background: var(--sand);
  border-color: var(--rule-light);
  color: var(--ink);
}

.nav-links a:active,
.icon-btn:active {
  transform: scale(.98);
  background: var(--paper-warm);
}

.nav-links a[aria-current="true"] {
  background: var(--paper-warm);
  border-color: var(--rule-light);
  color: var(--ink);
}

.mobile-toggle {
  display: none;
}

.theme-toggle {
  /* inherits .icon-btn */
}

.nav-links[hidden] {
  display: none !important;
}

.hero {
  min-height: calc(100svh - 132px);
  display: grid;
  align-items: center;
  padding: clamp(48px, 6vw, 84px) 0 76px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr);
  gap: clamp(44px, 6vw, 88px);
  align-items: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 22px;
}

.eyebrow:before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--accent-blue);
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -.028em;
  color: var(--ink);
}

h1 {
  max-width: 940px;
  margin-bottom: 0;
  font-size: clamp(44px, 4.8vw, 70px);
  line-height: 1.06;
  text-wrap: balance;
}

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

/* Inline scope trace: one path morphs from noisy analog to a square wave. */
.signal-trace {
  display: inline-block;
  margin-left: 10px;
  vertical-align: middle;
  color: var(--accent-blue);
  overflow: visible;
}

.trace-path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lead {
  margin: 26px 0 0;
  max-width: 640px;
  color: var(--ink-soft);
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 14px 22px;
  border: 1px solid var(--button-bg);
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--button-text);
  text-decoration: none;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}

.button:after {
  content: "\2192";
  font-size: 14px;
  line-height: 1;
}

.button.internal:after {
  content: "\2192";
}

.button.back:after {
  content: none;
}

.button.back:before {
  content: "\2190";
  font-size: 14px;
  line-height: 1;
}

.button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}

.button:focus-visible {
  background: var(--button-bg-hover);
  border-color: var(--button-bg-hover);
  color: var(--button-text);
  box-shadow: 0 0 0 1px var(--brand-light);
}

.button.secondary:focus-visible {
  background: var(--sand);
  border-color: var(--rule);
  color: var(--ink);
  box-shadow: none;
}

.button:active {
  transform: translateY(0) scale(.985);
}

.button.download:after {
  content: "\2193";
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--rule-light);
}

#about .about-proof {
  grid-column: 2;
  grid-row: 4;
  max-width: 820px;
  margin-top: 0;
  padding-top: clamp(18px, 2.2vw, 24px);
}

.hero .contact-list {
  margin-top: 56px;
}

.proof-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.proof-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.proof-item.proof-text span {
  padding-left: 2px;
}

.project-card-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-card-wrap.featured {
  grid-column: 1 / -1;
}

.project-card-wrap.featured .project-card {
  min-height: auto;
}

.project-card-wrap.featured .project-card picture {
  display: block;
  height: clamp(300px, 32vw, 440px);
  overflow: hidden;
}

.project-card-wrap.featured .project-card picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.project-card-wrap.featured .fx-layer,
.project-card-wrap.featured .fx-sched {
  height: clamp(300px, 32vw, 440px);
}

.project-card picture {
  display: block;
}

.project-card picture img,
.project-card > img {
  width: 100%;
  height: 285px;
  object-fit: cover;
  border-bottom: 1px solid var(--rule-light);
  filter: var(--image-filter);
}

.portrait-card picture,
.hero-img picture,
.visual picture {
  display: block;
  width: 100%;
  height: 100%;
}

.video-embed {
  grid-column: 2;
  margin: 8px 0 0;
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--paper-dark);
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-embed figcaption {
  margin-top: 10px;
  color: var(--ink-mute);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.resume-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.resume-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: 48px;
  padding-bottom: 48px;
}

.resume-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 18px 24px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}

.resume-toolbar h1 {
  margin: 8px 0 0;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.04;
}

.resume-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.resume-frame {
  flex: 1;
  width: 100%;
  min-height: calc(100vh - 280px);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bone);
}


.hero-media {
  position: relative;
  min-height: min(calc(100svh - 240px), 640px);
}

.portrait-card,
.hero-img,
.visual {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--bone);
  padding: 10px;
}

.portrait-card {
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  max-width: 620px;
  height: 100%;
}

.portrait-card:before,
.portrait-card:after,
.hero-img:before,
.hero-img:after,
.visual:before,
.visual:after,
.project-card:before,
.project-card:after {
  pointer-events: none;
}

.portrait-card:before,
.hero-img:before,
.visual:before {
  content: "";
  position: absolute;
  inset: 20px;
  z-index: 2;
  background:
    linear-gradient(var(--ink), var(--ink)) left top / 22px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left top / 1px 22px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right top / 22px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right top / 1px 22px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left bottom / 22px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left bottom / 1px 22px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right bottom / 22px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right bottom / 1px 22px no-repeat;
  opacity: .58;
}

.portrait-card:after,
.hero-img:after,
.visual:after {
  content: attr(data-plate);
  position: absolute;
  left: 22px;
  bottom: 22px;
  z-index: 3;
  padding: 4px 8px;
  border: 1px solid var(--rule-light);
  border-radius: 3px;
  background: color-mix(in oklch, var(--bone) 88%, transparent);
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.portrait-card img,
.hero-img img,
.visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: var(--image-filter);
}

section {
  padding: clamp(48px, 6vw, 72px) 0 clamp(88px, 9vw, 120px);
}

main > section:not(.hero) {
  counter-increment: doc-section;
}

.section-head {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  column-gap: 36px;
  row-gap: 20px;
  align-items: start;
  margin-bottom: 42px;
  border-top: 1px solid var(--rule);
  padding-top: 18px;
}

.section-head:before {
  content: counter(doc-section, upper-roman) ".";
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
  letter-spacing: .08em;
}

.section-head .mono {
  grid-column: 2;
  grid-row: 1;
}

.section-title {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  max-width: 880px;
  font-size: clamp(34px, 4.2vw, 58px);
  line-height: 1.04;
  text-wrap: balance;
}

.standfirst {
  grid-column: 2;
  grid-row: 3;
  margin: 2px 0 0;
  max-width: 660px;
  color: var(--ink-soft);
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.6;
}

.about-head {
  row-gap: clamp(18px, 2vw, 24px);
  margin-bottom: 0;
  padding-bottom: clamp(32px, 4vw, 48px);
}

.about-head .about-copy {
  grid-column: 2;
  grid-row: 3;
  margin: 0;
}

.about-copy {
  color: var(--ink-soft);
  max-width: 820px;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.45;
  text-wrap: pretty;
}

#about .skill-marquee {
  margin-top: 0;
}

.skill-marquee {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--paper-warm);
}

.skill-track {
  display: flex;
  width: max-content;
  animation: skill-scroll 30s linear infinite;
}

.skill-set {
  display: flex;
  flex: 0 0 auto;
}

.skill-set span {
  min-height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 0 clamp(24px, 4vw, 58px);
  border-right: 1px solid var(--rule-light);
  color: var(--ink);
  font-size: clamp(17px, 1.8vw, 24px);
  line-height: 1;
}

.skill-set span:before {
  content: "/";
  margin-right: 18px;
  color: var(--accent-blue);
}

@keyframes skill-scroll {
  to {
    transform: translateX(-50%);
  }
}

.role {
  position: relative;
  display: grid;
  grid-template-columns: minmax(168px, 200px) minmax(0, 1fr);
  gap: 28px;
  padding: 32px 0;
  border-bottom: 1px solid var(--rule-light);
}

.role-meta {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 4px;
  align-content: start;
}

/* Field-record spine: a vertical rule threads through each logo, bridging
   the gap into the next role so the timeline reads as one continuous line. */
.role-meta:before {
  content: "";
  position: absolute;
  left: 21px;
  top: 3px;
  bottom: -65px;
  width: 1px;
  background: var(--rule);
}

.role:last-child .role-meta:before {
  bottom: auto;
  height: 32px;
}

.logo-mark {
  position: relative;
  z-index: 1;
  grid-row: span 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-mark img[src*="hacker-fab"] {
  transform: scale(1.12);
}

.role time,
.role .org {
  color: var(--ink-faint);
}

.role time {
  align-self: end;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .02em;
  line-height: 1.25;
}

.role .org {
  align-self: start;
  color: var(--ink);
  line-height: 1.25;
}

.role h3 {
  margin: 0 0 8px;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.08;
}

.role p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.58;
}

.role-details {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.role-details li {
  color: var(--ink-soft);
  line-height: 1.58;
}

.role-detail-title {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.2;
  letter-spacing: -.01em;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  counter-reset: work-card;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 510px;
  overflow: hidden;
  border: 1px solid var(--rule-light);
  border-radius: var(--radius);
  background: var(--bone);
  box-shadow: none;
  text-decoration: none;
  transition: transform .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
  counter-increment: work-card;
}

.project-card:before {
  content: "0" counter(work-card);
  position: absolute;
  top: 22px;
  left: 22px;
  z-index: 4;
  min-width: 0;
  min-height: 0;
  display: block;
  padding: 5px 7px;
  border: 1px solid var(--rule-light);
  border-radius: 4px;
  background: color-mix(in oklch, var(--bone) 86%, transparent);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
}

.project-card:after {
  content: "\2192";
  position: absolute;
  right: 22px;
  bottom: 22px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--ink);
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}

.project-card img {
  width: 100%;
  height: 285px;
  object-fit: cover;
  border-bottom: 1px solid var(--rule-light);
  filter: var(--image-filter);
}

.project-copy {
  padding: 24px 26px 32px;
}

.project-copy .mono {
  display: block;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule-light);
}

.project-card h3 {
  margin: 14px 0 12px;
  padding-right: 28px;
  font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1.08;
}

.project-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-right: 34px;
}

.metric-row span {
  border: 1px solid var(--rule-light);
  border-radius: 6px;
  padding: 8px 11px;
  color: var(--ink-mute);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}

.project-card:focus-visible {
  border-color: var(--brand-light);
  background: var(--bone);
  transform: translateY(-3px);
}

.project-card:focus-visible:after {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: var(--button-text);
}

.project-card:active {
  transform: translateY(-1px) scale(.995);
}

.page-main {
  padding: 64px 0 72px;
}

.page-main > .project-hero,
.page-main > .project-writeup {
  padding: 0;
}

.project-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(24px, 3.5vw, 44px);
}

.project-hero > div > .mono {
  display: block;
  margin-bottom: clamp(10px, 1.5vw, 14px);
}

.project-hero h1 {
  font-size: clamp(44px, 6vw, 84px);
  margin-bottom: clamp(10px, 1.6vw, 14px);
  line-height: 1.08;
  text-wrap: wrap;
}

h1:has(.char) {
  text-wrap: wrap;
}

.project-hero h1 .char {
  vertical-align: top;
}

.project-hero .metric-row {
  padding-right: 0;
}

.project-hero .lead {
  max-width: 760px;
}

.hero-img,
.visual {
  margin-top: 48px;
}

.hero-img {
  min-height: 520px;
}

.hero-img img,
.visual img {
  max-height: 680px;
}

.project-writeup {
  max-width: 940px;
  margin: clamp(36px, 5vw, 56px) auto 0;
}

.writeup-section {
  display: grid;
  grid-template-columns: minmax(150px, .28fr) minmax(0, 1fr);
  gap: clamp(14px, 2.5vw, 32px);
  padding: 22px 0;
  border-top: 1px solid var(--rule-light);
}

.project-writeup .writeup-section:first-child {
  padding-top: 14px;
  border-top-color: var(--rule);
}

.writeup-section h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1.05;
  letter-spacing: -.015em;
}

.writeup-section p {
  grid-column: 2;
  margin: 0;
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1.64;
}

.writeup-section p + p {
  margin-top: 0.75em;
}

.next-links {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  margin-top: 56px;
}

.contact-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.contact-method {
  position: relative;
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 4px 12px;
  min-height: 68px;
  padding: 15px 18px 16px 0;
  color: var(--ink);
  text-decoration: none;
  border-right: 1px solid var(--rule-light);
  transition: color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
}

.contact-method + .contact-method {
  padding-left: 18px;
}

.contact-method:last-child {
  border-right: 0;
}

.contact-method:focus-visible {
  color: var(--accent-blue);
  background: color-mix(in oklch, var(--paper-warm) 70%, transparent);
}

.contact-method:active {
  transform: scale(.99);
  background: var(--paper-warm);
}

.contact-method svg {
  grid-row: 1 / span 2;
  width: 18px;
  height: 18px;
  color: var(--accent-blue);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-method span {
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-method strong {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.1;
  font-weight: 400;
}

.site-footer {
  position: relative;
  margin-top: 0;
  padding: 0 0 54px;
  color: var(--ink-faint);
  font-size: 14px;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--rule-light);
  padding-top: 22px;
}

.footer-row:after {
  content: "FIN.";
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
}

.footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
}

.footer-row a {
  color: var(--ink-soft);
  text-decoration: none;
}

.footer-row a:hover,
.footer-row a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
}

.char {
  display: inline-block;
  opacity: 0;
  transform: translateY(.28em);
  animation: rise .24s var(--ease) forwards;
  animation-delay: calc(var(--i) * 12ms);
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  50% { opacity: .35; }
}

.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;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  transform: translateY(-140%);
  transition: transform .18s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--accent-blue);
  outline-offset: 4px;
}

/* Boot sequence: first visit only; [data-boot] is set by an inline head
   script so the overlay covers the page from first paint. */
.boot {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--paper);
}

:root[data-boot="1"] .boot {
  display: flex;
}

:root[data-boot="1"] body {
  overflow: hidden;
}

:root[data-boot="1"] .char {
  animation-play-state: paused;
}

.boot.done {
  opacity: 0;
  transition: opacity .3s var(--ease);
}

.boot-log {
  display: grid;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.boot-log span {
  opacity: 0;
}

.boot.run .boot-log span {
  animation: boot-line .01s steps(1) forwards;
  animation-delay: calc(var(--bl) * .3s);
}

.boot-cursor {
  display: inline-block;
  width: 8px;
  height: 13px;
  margin-left: 10px;
  vertical-align: -2px;
  background: var(--accent-blue);
  animation: cursor-blink .9s steps(1) infinite;
}

@keyframes boot-line {
  to { opacity: 1; }
}

@keyframes cursor-blink {
  50% { opacity: 0; }
}

/* Address rail: memory-map navigation, shown only when the viewport
   leaves enough free margin beside the shell. */
.address-rail {
  display: none;
}

/* Project card hover effects: one decorative overlay per card, driven by
   the .fx-on class (added by JS on hover / keyboard focus, once per entry). */
.fx-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 285px;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity .22s var(--ease);
}

.project-card.fx-on .fx-layer {
  opacity: 1;
}

.fx-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid var(--rule-light);
  border-radius: 4px;
  background: color-mix(in oklch, var(--bone) 88%, transparent);
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Card 01 - impedance matcher: VSWR readout converging on target. */
.fx-vswr {
  left: 22px;
  bottom: 16px;
  color: var(--accent-text);
}

/* Card 02 - RTOS vehicle: labeled rate-monotonic scheduler trace. */
.fx-sched {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 285px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  opacity: 0;
  transition: opacity .22s var(--ease);
}

.project-card.fx-on .fx-sched {
  opacity: 1;
}

.fx-sched-bar {
  display: flex;
  align-items: flex-end;
  width: 100%;
  padding-top: 18px;
  background: color-mix(in oklch, var(--bone) 86%, transparent);
  border-top: 1px solid var(--rule-light);
}

.fx-sched-bar i {
  position: relative;
  height: 4px;
  background: color-mix(in oklch, var(--stone) 42%, transparent);
}

.fx-sched-bar i:nth-child(odd) {
  background: color-mix(in oklch, var(--accent-blue) 32%, transparent);
}

.fx-sched-bar i:before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--stone);
  transform: scaleX(0);
  transform-origin: left;
}

.fx-sched-bar i:nth-child(odd):before {
  background: var(--accent-blue);
}

.fx-sched-bar i:after {
  content: attr(data-task);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  letter-spacing: .1em;
  opacity: 0;
  white-space: nowrap;
}

.fx-sched-bar i:nth-child(1) { flex: 1.4; }
.fx-sched-bar i:nth-child(2) { flex: 1; }
.fx-sched-bar i:nth-child(3) { flex: 1.2; }
.fx-sched-bar i:nth-child(4) { flex: 2; }

.project-card.fx-on .fx-sched-bar i:before {
  animation: fx-fill .4s var(--ease) forwards;
}

.project-card.fx-on .fx-sched-bar i:after {
  animation: fx-fade .3s var(--ease) forwards;
}

.project-card.fx-on .fx-sched-bar i:nth-child(2):before,
.project-card.fx-on .fx-sched-bar i:nth-child(2):after { animation-delay: .4s; }
.project-card.fx-on .fx-sched-bar i:nth-child(3):before,
.project-card.fx-on .fx-sched-bar i:nth-child(3):after { animation-delay: .8s; }
.project-card.fx-on .fx-sched-bar i:nth-child(4):before,
.project-card.fx-on .fx-sched-bar i:nth-child(4):after { animation-delay: 1.2s; }

/* Card 03 - trash robot: CV bounding box snapping onto the target. */
.fx-cvbox {
  position: absolute;
  left: 29%;
  top: 12%;
  width: 38%;
  height: 74%;
  border: 1px dashed var(--brand-light);
  border-radius: 3px;
}

.fx-cvbox:before,
.fx-cvbox:after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
}

.fx-cvbox:before {
  top: -1px;
  left: -1px;
  border-top: 1px solid var(--brand-light);
  border-left: 1px solid var(--brand-light);
}

.fx-cvbox:after {
  bottom: -1px;
  right: -1px;
  border-bottom: 1px solid var(--brand-light);
  border-right: 1px solid var(--brand-light);
}

.project-card.fx-on .fx-cvbox {
  animation: fx-snap .2s var(--ease) forwards;
}

.fx-cvlabel {
  position: absolute;
  top: -1px;
  left: -1px;
  transform: translateY(-100%);
  padding: 4px 7px;
  border: 1px solid var(--rule-light);
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  background: color-mix(in oklch, var(--bone) 88%, transparent);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Card 04 - Kirby companion: display bring-up scan sweeping the full plate. */
.project-card[data-fx="scan"] .fx-layer {
  overflow: hidden;
  transition: none;
}

.fx-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: -90px;
  height: 90px;
  opacity: 0;
  background: linear-gradient(
    to bottom,
    transparent,
    color-mix(in oklch, var(--brand-light) 14%, transparent) 55%,
    color-mix(in oklch, var(--brand-light) 34%, transparent)
  );
}

.fx-scan:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    color-mix(in oklch, var(--brand-light) 35%, transparent),
    var(--brand-light) 12%,
    color-mix(in oklch, var(--bone) 45%, var(--brand-light)) 50%,
    var(--brand-light) 88%,
    color-mix(in oklch, var(--brand-light) 35%, transparent)
  );
  box-shadow:
    0 0 6px var(--brand-light),
    0 0 18px color-mix(in oklch, var(--brand-light) 55%, transparent),
    0 3px 22px color-mix(in oklch, var(--brand-light) 35%, transparent);
}

.project-card.fx-on .fx-scan {
  animation: fx-scan-sweep .9s cubic-bezier(.3, 0, .4, 1) forwards;
}

@keyframes fx-scan-sweep {
  0% {
    top: -90px;
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

@keyframes fx-fill {
  to { transform: scaleX(1); }
}

@keyframes fx-fade {
  to { opacity: 1; }
}

@keyframes fx-snap {
  from { transform: translate(14px, -10px); }
  to { transform: translate(0, 0); }
}

/* PCB figure photos in project writeups. */
.writeup-section .visual {
  grid-column: 2;
  margin: clamp(20px, 3vw, 28px) 0 0;
}

.pcb-figure img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.pcb-viewer {
  grid-column: 2;
  margin: clamp(20px, 3vw, 28px) 0 0;
  border: 1px solid var(--rule);
  background: var(--bone);
  overflow: hidden;
}

.pcb-viewer-frame {
  position: relative;
  min-height: clamp(360px, 52vw, 560px);
  overflow: hidden;
  background: var(--paper-dark);
}

.pcb-viewer-frame kicanvas-embed {
  display: block;
  width: 100%;
  min-height: clamp(360px, 52vw, 560px);
}

.pcb-viewer figcaption {
  margin: 0;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--rule-light);
  color: var(--ink-mute);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pcb-viewer figcaption a {
  color: var(--accent-blue);
  text-decoration: none;
}

.pcb-viewer figcaption a:hover {
  text-decoration: underline;
}

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover,
  .icon-btn:hover {
    background: var(--sand);
    border-color: var(--rule-light);
    color: var(--ink);
  }

  .button:hover {
    background: var(--button-bg-hover);
    border-color: var(--button-bg-hover);
    color: var(--button-text);
    transform: translateY(-1px);
    box-shadow: 0 0 0 1px var(--brand-light);
  }

  .button.secondary:hover {
    background: var(--sand);
    border-color: var(--rule);
    color: var(--ink);
    box-shadow: none;
  }

  .project-card:hover {
    border-color: var(--brand-light);
    background: var(--bone);
    transform: translateY(-3px);
  }

  .project-card:hover:after {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: var(--button-text);
  }

  .contact-method:hover {
    color: var(--accent-blue);
    background: color-mix(in oklch, var(--paper-warm) 70%, transparent);
  }
}

@media (min-width: 1680px) {
  .address-rail {
    position: fixed;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .address-rail a {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 5px 10px;
    border-left: 1px solid var(--rule-light);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink-faint);
    transition: color .18s var(--ease), border-color .18s var(--ease);
  }

  .address-rail a:hover,
  .address-rail a:focus-visible {
    color: var(--ink);
  }

  .address-rail a[aria-current="true"] {
    color: var(--ink);
    border-left-color: var(--accent-blue);
  }

  .address-rail a[aria-current="true"] .rail-hex {
    color: var(--accent-text);
  }
}

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

  .char {
    opacity: 1;
    transform: none;
  }

  .pulse-dot,
  .boot-cursor {
    animation: none !important;
    opacity: 1;
  }

  .fx-scan {
    display: none;
  }

  .skill-marquee {
    overflow: visible;
  }

  .skill-track {
    width: auto;
    animation: none !important;
  }

  .skill-set {
    flex-wrap: wrap;
  }

  .skill-set[aria-hidden="true"] {
    display: none;
  }
}

@media (max-width: 1080px) {
  :root {
    --page-gutter: 80px;
  }

  .meta-strip {
    font-size: 10px;
  }

  .meta-strip-inner {
    grid-template-columns: 1fr auto;
    gap: 12px;
    min-height: 28px;
    padding: 6px 0;
  }

  .meta-strip-inner .meta-strip-secondary,
  .meta-strip-inner > span:nth-child(2) {
    display: none;
  }

  .meta-strip-inner span:last-child,
  .meta-strip-priority {
    justify-self: end;
    text-align: right;
  }
}

@media (max-width: 900px) {
  :root {
    --header-offset: 124px;
  }

  section {
    padding: clamp(40px, 6vw, 56px) 0 clamp(64px, 8vw, 88px);
  }

  .hero {
    min-height: auto;
    padding: clamp(32px, 5vw, 56px) 0 48px;
  }

  .hero-grid,
  .project-hero,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    gap: clamp(28px, 5vw, 40px);
  }

  .hero-media {
    min-height: auto;
    order: -1;
    margin-bottom: clamp(16px, 3vw, 28px);
  }

  .portrait-card {
    position: relative;
    right: auto;
    top: auto;
    width: min(100%, 440px);
    max-width: 440px;
    margin: 0 auto;
    height: auto;
    aspect-ratio: 1;
    max-height: none;
  }

  .portrait-card picture {
    display: block;
    height: 100%;
  }

  .portrait-card img {
    height: 100%;
    min-height: 0;
  }

  .hero-actions {
    flex-direction: column;
    gap: 10px;
  }

  .hero-actions .button {
    width: 100%;
    min-width: 0;
    padding-inline: 14px;
    font-size: 14px;
  }

  .section-head {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 14px;
    margin-bottom: 32px;
  }

  .section-head:before,
  .section-head .mono,
  .section-title,
  .standfirst,
  .about-head .about-copy,
  .about-head .about-proof,
  #about .about-proof {
    grid-column: 1;
  }

  .section-head:before {
    grid-row: 1;
  }

  .section-head .mono {
    grid-row: 1;
    padding-left: 42px;
  }

  .section-title {
    grid-row: 2;
    font-size: clamp(30px, 6.5vw, 44px);
  }

  .standfirst {
    grid-row: 3;
  }

  .about-head .about-copy {
    grid-row: 3;
    font-size: clamp(18px, 4.2vw, 24px);
  }

  .about-head .about-proof {
    grid-row: 4;
  }

  .about-head {
    padding-bottom: clamp(24px, 4vw, 36px);
  }

  .role {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .role-meta {
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 12px;
  }

  .role-meta:before,
  .role:last-child .role-meta:before {
    display: none;
  }

  .logo-mark {
    width: 44px;
    height: 44px;
  }

  .mobile-toggle {
    display: inline-flex;
  }

  .nav {
    position: relative;
    gap: 8px;
    min-height: 56px;
  }

  .nav-links {
    margin-left: 0;
  }

  .nav-tools {
    margin-left: auto;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 40;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px;
    border: 1px solid var(--rule);
    border-radius: 14px;
    background: var(--bone);
    box-shadow: var(--shadow-card);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    min-height: 48px;
    justify-content: flex-start;
  }

  .project-writeup {
    margin-top: clamp(28px, 4.5vw, 40px);
  }

  .writeup-section {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 20px 0;
  }

  .project-writeup .writeup-section:first-child {
    padding-top: 12px;
  }

  .writeup-section h2,
  .writeup-section p,
  .writeup-section > *,
  .writeup-section .visual,
  .writeup-section .video-embed,
  .writeup-section .pcb-viewer {
    grid-column: 1;
  }

  .contact-list {
    grid-template-columns: 1fr;
  }

  .contact-method,
  .contact-method + .contact-method {
    padding-left: 0;
    border-right: 0;
  }

  .contact-method + .contact-method {
    border-top: 1px solid var(--rule-light);
  }

  .page-main {
    padding: 56px 0 56px;
  }

  .project-hero h1 {
    font-size: clamp(36px, 8vw, 56px);
  }

  .projects-grid {
    gap: 20px;
  }

  .project-card {
    min-height: auto;
  }

  .project-card-wrap.featured .project-card picture {
    height: clamp(220px, 45vw, 340px);
  }

  .project-card-wrap.featured .fx-layer,
  .project-card-wrap.featured .fx-sched {
    height: clamp(220px, 45vw, 340px);
  }

  .role-detail-title {
    font-size: clamp(16px, 3.8vw, 19px);
  }
}

@media (max-width: 560px) {
  :root {
    --page-gutter: 56px;
    --header-offset: 112px;
  }

  .meta-strip-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
  }

  .meta-strip-inner .meta-strip-secondary,
  .meta-strip-inner > span:nth-child(2) {
    display: none;
  }

  .meta-strip-inner span:first-child,
  .meta-strip-priority {
    display: block;
  }

  .meta-strip-priority {
    flex-shrink: 0;
    text-align: right;
    white-space: nowrap;
    font-size: 10px;
    line-height: 1.3;
  }

  .brand {
    font-size: 15px;
    gap: 10px;
  }

  .brand span {
    display: inline;
    max-width: 9.5rem;
  }

  .nav {
    gap: 4px;
    min-height: 52px;
  }

  .icon-btn {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .icon-btn svg {
    width: 18px;
    height: 18px;
  }

  h1 {
    font-size: clamp(34px, 9.5vw, 48px);
    line-height: 1.12;
    letter-spacing: -.018em;
    text-wrap: pretty;
  }

  .signal-trace {
    display: block;
    margin: 10px 0 0;
  }

  .lead {
    font-size: clamp(17px, 4.6vw, 20px);
    line-height: 1.55;
  }

  section {
    padding: 52px 0;
  }

  .hero {
    padding-top: 24px;
    padding-bottom: 36px;
  }

  .hero-media {
    margin-bottom: 16px;
  }

  .portrait-card {
    width: 100%;
    max-width: none;
    aspect-ratio: 1;
  }

  .hero-proof {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
  }

  .proof-item {
    max-width: 100%;
  }

  .project-card-wrap.featured .project-card picture {
    height: clamp(200px, 52vw, 300px);
  }

  .project-card-wrap.featured .fx-layer,
  .project-card-wrap.featured .fx-sched {
    height: clamp(200px, 52vw, 300px);
  }

  .video-embed,
  .pcb-viewer {
    grid-column: 1;
  }

  .resume-toolbar {
    align-items: start;
  }

  .resume-actions {
    width: 100%;
  }

  .resume-actions .button,
  .next-links .button {
    width: 100%;
  }

  .section-head {
    grid-template-columns: 1fr;
    row-gap: 16px;
    margin-bottom: 28px;
  }

  .about-head {
    row-gap: 14px;
    margin-bottom: 0;
    padding-bottom: 28px;
  }

  .section-head:before,
  .section-head .mono,
  .section-title,
  .standfirst,
  .about-head .about-copy,
  .about-head .about-proof,
  #about .about-proof {
    grid-column: 1;
  }

  .section-head:before {
    grid-row: 1;
  }

  .section-head .mono {
    grid-row: 1;
    padding-left: 42px;
  }

  .section-title {
    grid-row: 2;
    font-size: clamp(30px, 8.5vw, 42px);
    line-height: 1.1;
  }

  .standfirst {
    grid-row: 3;
  }

  .about-head .about-copy {
    grid-row: 3;
  }

  .about-head .about-proof {
    grid-row: 4;
  }

  .about-copy {
    font-size: clamp(19px, 5.4vw, 26px);
    line-height: 1.42;
  }

  .role {
    padding: 26px 0;
  }

  .role-meta {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .logo-mark {
    width: 44px;
    height: 44px;
  }

  .skill-track {
    animation-duration: 24s;
  }

  .skill-set span {
    min-height: 58px;
    padding: 0 24px;
    font-size: 18px;
  }

  .project-card {
    min-height: auto;
  }

  .project-card img {
    height: 200px;
  }

  .fx-layer,
  .fx-sched {
    height: 200px;
  }

  .project-copy {
    padding: 20px;
  }

  .project-card h3 {
    font-size: clamp(22px, 6vw, 28px);
  }

  .metric-row {
    padding-right: 0;
  }

  .metric-row span {
    font-size: 11px;
    padding: 6px 9px;
  }

  .project-hero h1 {
    font-size: clamp(32px, 9vw, 44px);
  }

  .page-main {
    padding: 48px 0 44px;
  }

  .project-writeup {
    margin-top: clamp(24px, 5vw, 32px);
  }

  .writeup-section {
    padding: 16px 0;
  }

  .project-writeup .writeup-section:first-child {
    padding-top: 12px;
  }

  .writeup-section h2 {
    font-size: 24px;
  }

  .writeup-section p {
    font-size: 17px;
    line-height: 1.58;
  }

  .next-links {
    flex-direction: column;
    gap: 10px;
  }

  .contact-method {
    grid-template-columns: 18px minmax(0, 1fr);
    min-height: 64px;
    padding: 14px 0;
  }

  .contact-method strong {
    grid-column: 2;
    font-size: 16px;
  }

  .contact-method span {
    font-size: 12px;
  }

  .footer-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  .brand span {
    display: none;
  }

  .meta-strip-priority {
    font-size: 9px;
  }
}
