:root {
  --ink: #151515;
  --paper: #f7f3ea;
  --panel: #fffaf0;
  --muted: #625d55;
  --red: #e23d28;
  --teal: #0f6b63;
  --yellow: #f1b51c;
  --blue: #315f9f;
  --green: #2f7d42;
  --line: var(--ink);
  --shadow: var(--ink);
  --page-max: 1120px;
  --hatch-light: rgb(21 21 21 / 0.16);
  --hatch-medium: rgb(21 21 21 / 0.24);
  --hatch-cross: rgb(21 21 21 / 0.18);
}

[data-theme="dark"] {
  --ink: #f6efe3;
  --paper: #11100e;
  --panel: #1b1916;
  --muted: #b7ad9f;
  --red: #ff5a43;
  --teal: #4fb3a8;
  --yellow: #f3c94d;
  --blue: #78a6e8;
  --green: #70b879;
  --line: var(--ink);
  --shadow: var(--ink);
  --hatch-light: rgb(246 239 227 / 0.18);
  --hatch-medium: rgb(246 239 227 / 0.24);
  --hatch-cross: rgb(246 239 227 / 0.18);
}

* {
  box-sizing: border-box;
}

[x-cloak] {
  display: none !important;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
.display-heading {
  max-width: 980px;
  font-size: clamp(48px, 8vw, 104px);
  line-height: 0.92;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2 {
  font-size: clamp(32px, 5vw, 60px);
  line-height: 0.98;
  letter-spacing: 0;
  text-transform: uppercase;
}

h3 {
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: 0;
}

.site-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);
}

.wrap {
  width: min(var(--page-max), calc(100% - 32px));
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 24px;
  border-bottom: 3px solid var(--line);
  background: var(--panel);
}

.brand,
.nav,
.eyebrow,
.button,
.icon-button,
.badge,
.status,
.label,
.footer-label {
  font-weight: 900;
  text-transform: uppercase;
}

.brand {
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 14px;
}

.nav a[aria-current="page"] {
  color: var(--red);
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.icon-button,
.button {
  border: 3px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

.icon-button {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  box-shadow: 5px 5px 0 var(--shadow);
  font-size: 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 14px;
  box-shadow: 5px 5px 0 var(--shadow);
}

.button.primary {
  background: var(--red);
  color: #fffaf0;
}

[data-theme="dark"] .button.primary {
  color: #11100e;
}

.button.tertiary {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

.button:active,
.icon-button:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--shadow);
}

.button:focus,
.icon-button:focus,
input:focus,
select:focus,
textarea:focus,
summary:focus {
  outline: 4px solid var(--yellow);
  outline-offset: 0;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--teal);
  font-size: 14px;
}

.dek,
.muted {
  color: var(--muted);
}

.dek {
  max-width: 760px;
  font-size: 21px;
  line-height: 1.35;
}

.section {
  padding-block: 42px;
  border-bottom: 3px solid var(--line);
}

.intro-section {
  padding-block: 52px 34px;
  border-bottom: 3px solid var(--line);
}

.panel {
  border: 3px solid var(--line);
  background: var(--panel);
}

.badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 5px 8px;
  border: 2px solid var(--line);
  background: var(--yellow);
  color: #151515;
  font-size: 12px;
}

.badge.red {
  background: var(--red);
  color: #fffaf0;
}

.badge.teal {
  background: var(--teal);
  color: #fffaf0;
}

.badge.blue {
  background: var(--blue);
  color: #fffaf0;
}

.status {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 4px 8px 4px 0;
  border: 2px solid var(--line);
  background: var(--panel);
  font-size: 11px;
}

.status::before {
  content: "";
  align-self: stretch;
  width: 7px;
  min-height: 14px;
  margin-right: 8px;
  background: var(--teal);
}

.status.is-live::before {
  background: var(--green);
}

.status.review::before {
  background: var(--blue);
}

.tag {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 5px 8px;
  border: 2px solid var(--line);
  background: var(--paper);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.tag.red {
  background: var(--red);
  color: #fffaf0;
}

.tag.blue {
  background: var(--blue);
  color: #fffaf0;
}

.tag.green {
  background: var(--green);
  color: #fffaf0;
}

.tag.yellow {
  background: var(--yellow);
  color: #151515;
}

.badge.green {
  background: var(--green);
  color: #fffaf0;
}

.badge.yellow {
  background: var(--yellow);
  color: #151515;
}

.hatch-light {
  background-image: repeating-linear-gradient(
    135deg,
    var(--hatch-light) 0 2px,
    transparent 2px 14px
  );
}

.hatch-medium {
  background-image: repeating-linear-gradient(
    135deg,
    var(--hatch-medium) 0 3px,
    transparent 3px 12px
  );
}

.crosshatch {
  background-image:
    repeating-linear-gradient(45deg, var(--hatch-cross) 0 2px, transparent 2px 12px),
    repeating-linear-gradient(135deg, var(--hatch-cross) 0 2px, transparent 2px 12px);
}

.flash-stack {
  display: grid;
  gap: 10px;
  padding-block: 16px;
}

.flash {
  border: 3px solid var(--line);
  background: var(--panel);
  padding: 12px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  --timeline-period-col: clamp(76px, 10vw, 112px);
  --timeline-marker-col: 52px;
  --timeline-marker-half: 26px;
  --timeline-gap: 14px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--timeline-period-col) + var(--timeline-gap) + var(--timeline-marker-half) - 3px);
  width: 6px;
  border-left: 3px solid var(--line);
  border-right: 3px solid var(--line);
  background: var(--yellow);
}

.timeline-period-group {
  position: relative;
  display: grid;
  grid-template-columns: var(--timeline-period-col) var(--timeline-marker-col) minmax(0, 1fr);
  gap: var(--timeline-gap);
  min-width: 0;
  padding: 0 0 24px;
}

.timeline-period-group + .timeline-period-group {
  padding-top: 32px;
  border-top: 3px solid var(--line);
}

.timeline-period-label {
  position: sticky;
  top: 96px;
  align-self: start;
  padding-top: 18px;
  color: var(--teal);
  font-size: clamp(44px, 5.8vw, 82px);
  font-weight: 900;
  line-height: 0.82;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.timeline-events {
  display: grid;
  grid-column: 2 / 4;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

.event {
  position: relative;
  display: grid;
  grid-template-columns: var(--timeline-marker-col) minmax(0, 1fr);
  gap: var(--timeline-gap);
  min-width: 0;
  min-height: 190px;
}

.marker {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  padding-top: 14px;
}

.marker::before {
  content: "";
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow: 5px 5px 0 var(--shadow);
}

.event.current .marker::before {
  background: var(--red);
}

.event.current .event-card {
  border-left-width: 12px;
}

.event-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 18px;
  min-width: 0;
  padding: 18px;
  border: 3px solid var(--line);
  background: var(--panel);
}

.event-card h2 {
  margin-bottom: 10px;
  font-size: clamp(32px, 5vw, 56px);
  overflow-wrap: break-word;
  word-break: break-word;
}

.event-card > div {
  min-width: 0;
}

.event-summary {
  color: var(--muted);
  font-size: 18px;
}

.carousel-shell {
  border: 3px solid var(--line);
  background: var(--panel);
}

.carousel-shell.unframed {
  border: 0;
  background: transparent;
}

.carousel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 3px solid var(--line);
}

.carousel-head h2 {
  margin-bottom: 0;
}

.github-carousel .carousel-head {
  width: min(var(--page-max), calc(100% - 32px));
  margin-inline: auto;
  padding: 0 0 18px;
  border-bottom: 0;
}

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

.github-carousel-viewport {
  position: relative;
  overflow-x: auto;
  overflow-y: visible;
  padding: 28px 0 34px;
  background:
    linear-gradient(90deg, var(--panel) 0, transparent 12%),
    linear-gradient(270deg, var(--panel) 0, transparent 12%);
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.github-carousel-wrap {
  width: 100%;
  margin: 0;
}

.github-carousel-viewport::-webkit-scrollbar {
  display: none;
}

.github-carousel-track {
  display: flex;
  gap: 22px;
  padding-inline: max(24px, calc((100% - min(720px, calc(100% - 96px))) / 2));
}

.github-slide {
  flex: 0 0 min(720px, calc(100% - 96px));
  min-height: 360px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 20px;
  padding: 24px;
  border: 3px solid var(--line);
  background: var(--paper);
  opacity: 0.5;
  transform: scale(0.94);
  scroll-snap-align: center;
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.github-slide.is-active {
  opacity: 1;
  transform: scale(1);
  box-shadow: 10px 10px 0 var(--shadow);
}

.github-slide h3 {
  margin-bottom: 12px;
  font-size: clamp(48px, 8vw, 86px);
  line-height: 0.88;
  text-transform: uppercase;
}

.github-slide p {
  max-width: 560px;
  color: var(--muted);
  font-size: 20px;
}

.github-slide-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.count {
  color: var(--teal);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 16px 18px;
}

.event-meta,
.tags,
.actions,
.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.event-meta {
  margin-bottom: 12px;
}

.tags,
.metrics,
.actions {
  margin-top: 14px;
}

.metric {
  min-width: 118px;
  padding: 10px;
  border: 2px solid var(--line);
  background: var(--paper);
}

.metric-value {
  display: block;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
}

.media {
  position: relative;
  min-height: 230px;
  border: 3px solid var(--line);
  background:
    linear-gradient(135deg, rgb(21 21 21 / 0.12) 25%, transparent 25%) 0 0 / 24px 24px,
    linear-gradient(135deg, transparent 75%, rgb(21 21 21 / 0.12) 75%) 0 0 / 24px 24px,
    var(--paper);
  display: grid;
  place-items: center;
}

[data-theme="dark"] .media {
  background:
    linear-gradient(135deg, rgb(246 239 227 / 0.14) 25%, transparent 25%) 0 0 / 24px 24px,
    linear-gradient(135deg, transparent 75%, rgb(246 239 227 / 0.14) 75%) 0 0 / 24px 24px,
    var(--paper);
}

.media-mark {
  padding: 7px 9px;
  border: 3px solid var(--line);
  background: var(--yellow);
  color: #151515;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.project-artifact {
  min-height: 100%;
}

.portrait-media {
  aspect-ratio: 1 / 1;
  min-height: 280px;
}

figure {
  margin: 0;
}

figcaption {
  padding: 12px 14px;
  border-top: 3px solid var(--line);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.home-hero {
  padding-block: 56px 42px;
  border-bottom: 3px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: stretch;
}

.hero-copy {
  display: grid;
  align-content: center;
}

.hero-actions {
  margin-top: 22px;
}

.hero-proof {
  display: grid;
  grid-template-rows: minmax(220px, 1fr) auto;
  min-height: 100%;
}

.hero-artifact {
  min-height: 260px;
  border: 0;
  border-bottom: 3px solid var(--line);
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.proof-grid .metric {
  border-width: 0;
  border-top: 2px solid var(--line);
}

.proof-grid .metric:nth-child(odd) {
  border-right: 2px solid var(--line);
}

.split-section,
.section-head,
.evidence-grid,
.card-grid {
  display: grid;
  gap: 18px;
}

.split-section,
.section-head {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  align-items: end;
}

.section-head {
  margin-bottom: 18px;
}

.section-head-stack {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  justify-items: start;
}

.section-head-stack .dek {
  margin: 0;
}

.section-head .button {
  justify-self: end;
}

.card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-card,
.post-row,
.callout {
  border: 3px solid var(--line);
  background: var(--panel);
}

.project-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 330px;
}

.project-head,
.project-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  padding: 16px;
}

.project-head {
  border-bottom: 3px solid var(--line);
}

.project-head h3 {
  min-width: 0;
  margin-bottom: 0;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.project-body {
  padding: 18px;
}

.project-body p,
.post-row p,
.callout p {
  color: var(--muted);
}

.project-foot {
  border-top: 3px solid var(--line);
  justify-content: flex-start;
}

.evidence-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.callout {
  padding: 20px;
  border-left-width: 12px;
}

.accent-callout {
  background:
    repeating-linear-gradient(135deg, var(--hatch-light) 0 2px, transparent 2px 14px),
    var(--panel);
}

.post-list {
  border-top: 3px solid var(--line);
}

.post-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) minmax(160px, auto);
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-top: 0;
}

.post-row + .post-row {
  border-top: 3px solid var(--line);
}

.post-row h3 {
  margin-bottom: 4px;
  font-size: 24px;
  line-height: 1.05;
}

.post-meta-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.article-wrap {
  max-width: 860px;
}

.article-header {
  padding-bottom: 24px;
  border-bottom: 3px solid var(--line);
}

.article-header h1 {
  margin-bottom: 18px;
}

.article-body {
  padding-block: 28px;
}

.article-body > * + * {
  margin-top: 18px;
}

.article-body .article-heading {
  margin-top: 36px;
  text-transform: uppercase;
}

.article-body .article-h1 {
  font-size: clamp(36px, 6vw, 72px);
}

.article-body .article-h2 {
  font-size: clamp(28px, 4vw, 44px);
}

.article-body .article-paragraph,
.article-body .article-list {
  color: var(--muted);
  font-size: 18px;
}

.article-body .article-figure {
  margin-inline: 0;
  border: 3px solid var(--line);
  background: var(--panel);
}

.article-body .article-image {
  display: block;
  width: 100%;
  height: auto;
}

.article-body .article-code-block,
.article-body .article-table {
  overflow-x: auto;
  border: 3px solid var(--line);
  background: var(--panel);
}

.article-body .article-code-block {
  padding: 16px;
}

.meta {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.about-hero {
  padding-block: 56px 42px;
  border-bottom: 3px solid var(--line);
}

.about-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 40px;
  align-items: end;
}

.profile-figure {
  position: relative;
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow: 10px 10px 0 var(--shadow);
}

.profile-figure .media {
  border: 0;
}

.profile-figure figcaption {
  color: var(--muted);
}

.about-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.education-grid {
  display: grid;
  gap: 18px;
}

.capability-stack {
  border: 3px solid var(--line);
  background: var(--panel);
}

.capability-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.35fr) minmax(180px, 0.55fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.capability-row + .capability-row {
  border-top: 3px solid var(--line);
}

.capability-heading {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.capability-heading h3 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1;
  text-transform: uppercase;
}

.capability-row p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.capability-tags {
  justify-content: flex-end;
}

.skill-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 3px solid var(--line);
  background: var(--yellow);
  color: #151515;
  font-size: 24px;
  box-shadow: 4px 4px 0 var(--shadow);
}

.skill-icon.red {
  background: var(--red);
  color: #fffaf0;
}

.skill-icon.blue {
  background: var(--blue);
  color: #fffaf0;
}

.skill-icon.green {
  background: var(--green);
  color: #fffaf0;
}

.skill-icon.yellow {
  background: var(--yellow);
  color: #151515;
}

.badge-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.education-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-card {
  border: 3px solid var(--line);
  background: var(--panel);
}

.compact-card h3 {
  margin-bottom: 10px;
  font-size: 24px;
  line-height: 1;
  text-transform: uppercase;
}

.compact-card {
  min-height: 190px;
  padding: 16px;
  border-top-width: 12px;
}

.compact-card:nth-child(1) {
  border-top-color: var(--red);
}

.compact-card:nth-child(2) {
  border-top-color: var(--teal);
}

.compact-card:nth-child(3) {
  border-top-color: var(--yellow);
}

.compact-card p {
  color: var(--muted);
}

.about-row {
  grid-template-columns: 160px minmax(0, 1fr) minmax(220px, 320px);
}

.about-org {
  margin-bottom: 8px;
  color: var(--teal);
  font-weight: 900;
  text-transform: uppercase;
}

.about-close {
  max-width: 900px;
}

.photo-hero {
  padding-block: 56px;
  border-bottom: 3px solid var(--line);
}

.photo-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.92fr);
  gap: 40px;
  align-items: end;
}

.photo-hero .hero-copy {
  align-content: center;
}

.photo-hero h1 {
  margin-bottom: 18px;
}

.photo-hero .dek {
  max-width: 540px;
  margin-bottom: 0;
}

/* archive ledger */
.photo-ledger {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 30px;
  border: 3px solid var(--line);
  background: var(--panel);
}

.photo-ledger-cell {
  padding: 12px 14px;
  border-right: 3px solid var(--line);
}

.photo-ledger-cell:last-child {
  border-right: 0;
}

.ledger-key {
  display: block;
  margin-bottom: 4px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.ledger-val {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.ledger-val.sm {
  font-size: 14px;
  line-height: 1.25;
}

/* feature frame */
.photo-feature {
  position: relative;
  margin: 0;
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow: 10px 10px 0 var(--shadow);
}

.feature-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #151515;
}

.feature-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.feature-media .media-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.feature-tab {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  padding: 6px 10px;
  border-right: 3px solid var(--line);
  border-bottom: 3px solid var(--line);
  background: var(--red);
  color: #fffaf0;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

[data-theme="dark"] .feature-tab {
  color: #11100e;
}

.photo-feature figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-top: 3px solid var(--line);
  color: var(--muted);
}

/* index / contact sheet */
.photo-index-head {
  align-items: end;
}

.photo-index-head .section-count {
  justify-self: end;
}

.section-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.index-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 3px solid var(--line);
  border-left: 3px solid var(--line);
}

.frame {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
  border-right: 3px solid var(--line);
  border-bottom: 3px solid var(--line);
  background: var(--panel);
}

.frame.w4 {
  grid-column: span 4;
}

.frame.w3 {
  grid-column: span 3;
}

.frame.w2 {
  grid-column: span 2;
}

.frame-open {
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.frame-open:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: -4px;
}

.frame-media {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 300px;
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg, rgb(21 21 21 / 0.08) 0 2px, transparent 2px 18px),
    var(--paper);
}

[data-theme="dark"] .frame-media {
  background:
    repeating-linear-gradient(135deg, rgb(246 239 227 / 0.07) 0 2px, transparent 2px 18px),
    var(--panel);
}

.frame-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 240ms ease;
}

.frame-open:hover .frame-media img {
  transform: scale(1.035);
}

.frame-media .media-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.frame.is-placeholder .media-mark {
  background: var(--panel);
}

[data-theme="dark"] .frame.is-placeholder .media-mark {
  background: var(--paper);
  color: var(--ink);
}

.frame-index {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  min-width: 38px;
  padding: 6px 9px;
  border-right: 3px solid var(--line);
  border-bottom: 3px solid var(--line);
  background: var(--yellow);
  color: #151515;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.frame-index.red {
  background: var(--red);
  color: #fffaf0;
}

.frame-index.blue {
  background: var(--blue);
  color: #fffaf0;
}

.frame-index.teal {
  background: var(--teal);
  color: #fffaf0;
}

.frame-index.green {
  background: var(--green);
  color: #fffaf0;
}

[data-theme="dark"] .frame-index.red,
[data-theme="dark"] .frame-index.blue,
[data-theme="dark"] .frame-index.teal,
[data-theme="dark"] .frame-index.green {
  color: #11100e;
}

.frame-ratio {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  padding: 3px 7px;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.frame-media::after {
  content: "";
  position: absolute;
  inset: 14px;
  pointer-events: none;
  background:
    linear-gradient(var(--line), var(--line)) left top / 22px 3px no-repeat,
    linear-gradient(var(--line), var(--line)) left top / 3px 22px no-repeat,
    linear-gradient(var(--line), var(--line)) right bottom / 22px 3px no-repeat,
    linear-gradient(var(--line), var(--line)) right bottom / 3px 22px no-repeat;
  opacity: 0;
  transition: inset 240ms ease, opacity 240ms ease;
}

.frame-open:hover .frame-media::after {
  inset: 10px;
  opacity: 0.9;
}

.frame-caption {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-top: 3px solid var(--line);
  background: var(--panel);
}

.frame-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.frame-title {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.frame-summary {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-transform: none;
}

.frame-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.frame-sep {
  width: 4px;
  height: 4px;
  background: currentColor;
}

@media (max-width: 900px) {
  .photo-ledger {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-ledger-cell:nth-child(2) {
    border-right: 0;
  }

  .photo-ledger-cell:nth-child(1),
  .photo-ledger-cell:nth-child(2) {
    border-bottom: 3px solid var(--line);
  }

  .photo-index-head .section-count {
    justify-self: start;
  }

  .index-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .frame.w4,
  .frame.w3,
  .frame.w2 {
    grid-column: span 2;
  }

  .frame-media {
    min-height: 220px;
  }
}

@media (max-width: 560px) {
  .index-grid {
    grid-template-columns: 1fr;
  }

  .frame.w4,
  .frame.w3,
  .frame.w2 {
    grid-column: span 1;
  }
}

.linktree-hero {
  padding-block: 46px;
  border-bottom: 3px solid var(--line);
}

.linktree-shell {
  max-width: 760px;
}

.linktree-profile {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}

.linktree-profile h1 {
  margin-bottom: 10px;
  font-size: clamp(42px, 8vw, 76px);
}

.linktree-avatar {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border: 3px solid var(--line);
  background: var(--red);
  color: #fffaf0;
  box-shadow: 7px 7px 0 var(--shadow);
  font-size: 42px;
}

.linktree-primary,
.linktree-groups,
.link-list {
  display: grid;
  gap: 14px;
}

.link-card,
.link-row {
  border: 3px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
}

.link-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 92px;
  padding: 14px;
  box-shadow: 5px 5px 0 var(--shadow);
}

.link-card:hover,
.link-row:hover {
  background:
    repeating-linear-gradient(135deg, var(--hatch-light) 0 2px, transparent 2px 14px),
    var(--panel);
}

.link-card:active,
.link-row:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--shadow);
}

.link-card:focus,
.link-row:focus {
  outline: 4px solid var(--yellow);
  outline-offset: 0;
}

.link-icon,
.link-row-icon {
  display: grid;
  place-items: center;
  border: 3px solid var(--line);
  background: var(--yellow);
  color: #151515;
}

.link-icon {
  width: 54px;
  height: 54px;
  font-size: 28px;
}

.link-copy {
  display: grid;
  gap: 4px;
}

.link-title,
.link-group h2,
.link-row {
  font-weight: 900;
  text-transform: uppercase;
}

.link-title {
  font-size: 20px;
}

.link-summary {
  color: var(--muted);
  font-size: 14px;
}

.linktree-groups {
  max-width: 760px;
}

.link-group {
  border: 3px solid var(--line);
  background: var(--panel);
}

.link-group h2 {
  margin: 0;
  padding: 14px;
  border-bottom: 3px solid var(--line);
  font-size: 22px;
}

.link-list {
  gap: 0;
}

.link-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 0;
  box-shadow: none;
}

.link-row + .link-row {
  border-top: 3px solid var(--line);
}

.link-row-icon {
  width: 42px;
  height: 42px;
  font-size: 22px;
}

.link-arrow {
  justify-self: end;
  color: var(--teal);
  font-size: 22px;
}

.linktree-close {
  max-width: 760px;
}

.research-section {
  padding-top: 36px;
}

.research-title {
  margin-bottom: 0;
  font-size: clamp(34px, 6vw, 72px);
}

.research-list {
  border-top: 3px solid var(--line);
  margin-top: 28px;
}

.research-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) minmax(150px, auto);
  gap: 18px;
  align-items: start;
  padding: 18px;
  border: 3px solid var(--line);
  border-top: 0;
  background: var(--panel);
}

.research-year,
.research-journal,
.research-authors {
  font-weight: 900;
  text-transform: uppercase;
}

.research-year,
.research-journal {
  color: var(--teal);
}

.research-main h3 {
  margin-bottom: 8px;
  font-size: clamp(28px, 4vw, 44px);
  text-transform: uppercase;
}

.research-main p {
  color: var(--muted);
}

.research-authors {
  font-size: 12px;
}

.research-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.photo-dialog {
  width: min(1180px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 3px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--shadow);
  overflow: hidden;
}

.photo-dialog[open] {
  display: flex;
  flex-direction: column;
}

.photo-modal-shell {
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  min-height: 0;
}

.photo-dialog::backdrop {
  background: rgb(21 21 21 / 0.72);
}

.photo-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 3px solid var(--line);
}

.photo-modal-head h2 {
  margin-bottom: 0;
  font-size: clamp(34px, 6vw, 64px);
}

.photo-carousel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  min-height: 0;
}

.photo-slide-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  border-right: 3px solid var(--line);
  background: var(--paper);
}

.photo-modal-media {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg, var(--hatch-light) 0 2px, transparent 2px 18px),
    var(--paper);
}

.photo-modal-media::before {
  content: "";
  position: absolute;
  inset: 20px;
  pointer-events: none;
  z-index: 1;
}

.photo-modal-media img {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  object-fit: contain;
  background: #151515;
  transform-origin: center center;
  transition: transform 80ms ease-out;
  will-change: transform;
}

.photo-zoom-bar {
  position: absolute;
  z-index: 2;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow: 4px 4px 0 var(--shadow);
}

.photo-zoom-bar .ti {
  font-size: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}

.photo-zoom-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 140px;
  height: 6px;
  background: var(--line);
  outline: none;
  cursor: pointer;
  border-radius: 0;
}

.photo-zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  background: var(--ink);
  border: 3px solid var(--panel);
  outline: 3px solid var(--ink);
  cursor: pointer;
  border-radius: 0;
}

.photo-zoom-slider::-moz-range-thumb {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  background: var(--ink);
  border: 3px solid var(--panel);
  outline: 3px solid var(--ink);
  cursor: pointer;
  border-radius: 0;
}

.photo-zoom-slider:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 4px;
}

.photo-modal-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 18px;
  border-top: 3px solid var(--line);
  background: var(--panel);
}

.photo-modal-copy h3 {
  margin-block: 10px 8px;
  font-size: clamp(28px, 4vw, 44px);
  text-transform: uppercase;
}

.photo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.exif-panel {
  padding: 18px;
  background: var(--panel);
  overflow-y: auto;
}

.exif-panel dl {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 3px solid var(--line);
}

.exif-panel dl div {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 3px solid var(--line);
}

.exif-panel dt {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.exif-panel dd {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.photo-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.dot {
  width: 44px;
  height: 18px;
  border: 3px solid var(--line);
  background: var(--panel);
  cursor: pointer;
}

.dot.is-active {
  background: var(--red);
}

.dot:focus {
  outline: 4px solid var(--yellow);
  outline-offset: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 8px 10px;
  border: 3px solid var(--line);
  background: var(--yellow);
  color: #151515;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

dialog.drawer {
  width: min(420px, calc(100vw - 32px));
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

dialog.drawer::backdrop {
  background: rgb(21 21 21 / 0.58);
}

.drawer-inner {
  height: 100%;
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow: -10px 0 0 var(--shadow);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.drawer-head,
.drawer-body,
.drawer-foot {
  padding: 18px;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 3px solid var(--line);
}

.drawer-body {
  overflow: auto;
}

.drawer-foot {
  border-top: 3px solid var(--line);
}

.drawer-nav {
  display: grid;
  gap: 10px;
}

.drawer-nav a {
  display: block;
  padding: 12px;
  border: 2px solid var(--line);
  background: var(--paper);
}

.site-footer {
  border-top: 3px solid var(--line);
  background: var(--panel);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding-block: 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
  }

  .desktop-nav {
    display: none;
  }

  dialog.drawer {
    width: 100vw;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .section-head .button {
    justify-self: start;
  }

  /* Reduce section padding on small screens */
  .section {
    padding-block: 28px;
  }

  .intro-section {
    padding-block: 32px 22px;
  }

  /* Tighten dek font on small screens */
  .dek {
    font-size: 18px;
  }

  /* home: hero */
  .home-hero {
    padding-block: 32px 24px;
  }

  .hero-actions {
    margin-top: 16px;
  }

  /* home: post-row — keep meta date inline as a small label above content */
  .post-row {
    gap: 10px;
  }

  .post-row .meta {
    font-size: 11px;
  }

  /* projects: github carousel — one full-width card at a time */
  .github-slide {
    flex: 0 0 100%;
    min-height: 0;
  }

  .github-carousel-track {
    gap: 0;
    padding-inline: 16px;
  }

  .github-carousel-viewport {
    background: none;
  }

  .github-slide h3 {
    font-size: clamp(28px, 8vw, 44px);
    line-height: 0.92;
  }

  /* projects: carousel controls stack when narrow */
  .carousel-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* about: hero */
  .about-hero {
    padding-block: 32px 24px;
  }

  /* about: capability-row needs breathing room when stacked */
  .capability-row {
    gap: 12px;
    padding: 14px;
  }

  /* photography: hero */
  .photo-hero {
    padding-block: 32px;
  }

  /* photography: dialog full-screen on mobile */
  .photo-dialog {
    width: 100vw;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    box-shadow: none;
  }

  /* photography: modal stacked — limit exif panel height so it doesn't dominate */
  .exif-panel {
    max-height: 240px;
    overflow-y: auto;
    border-top: 3px solid var(--line);
  }

  /* photography: zoom bar narrower */
  .photo-zoom-slider {
    width: 100px;
  }

  /* photography: modal copy */
  .photo-modal-copy {
    gap: 12px;
    padding: 14px;
  }

  .photo-modal-head {
    padding: 14px;
  }

  .photo-modal-head h2 {
    font-size: clamp(28px, 8vw, 44px);
  }

  /* cv: QR block can't float absolutely on narrow screen, remove it */
  .cv-qr-block {
    position: static;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
  }

  /* cv: download button + page */
  .cv-page {
    padding-block: 24px;
  }

  .cv-download {
    margin-bottom: 16px;
  }

  /* linktree: tighten hero */
  .linktree-hero {
    padding-block: 28px;
  }

  /* research: section title */
  .research-title {
    font-size: clamp(28px, 8vw, 52px);
  }

  /* research: row year — inline before content, not a tall column */
  .research-row {
    gap: 10px;
  }

  /* research: article titles are long scientific names — scale down */
  .research-main h3 {
    font-size: clamp(20px, 5.5vw, 28px);
    hyphens: auto;
  }
}

@media (max-width: 900px) {
  .hero-grid,
  .about-hero-grid,
  .photo-hero-grid,
  .research-hero-grid,
  .split-section,
  .section-head,
  .evidence-grid,
  .card-grid,
  .capability-row,
  .education-grid,
  .photo-proof,
  .photo-grid,
  .post-row,
  .about-row,
  .research-row,
  .link-card {
    grid-template-columns: 1fr;
  }

  .research-actions {
    justify-content: flex-start;
  }

  .capability-tags {
    justify-content: flex-start;
  }

  .link-card .badge {
    justify-self: start;
  }

  .linktree-profile {
    grid-template-columns: 1fr;
  }

  .photo-carousel,
  .photo-modal-copy {
    grid-template-columns: 1fr;
  }

  .photo-slide-panel {
    border-right: 0;
    border-bottom: 3px solid var(--line);
  }

  .photo-controls {
    justify-content: flex-start;
  }

  .photo-dialog {
    width: calc(100vw - 20px);
  }

  .post-meta-stack {
    justify-content: flex-start;
  }

  .timeline::before {
    left: 17px;
  }

  .timeline-period-group {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
  }

  .timeline-period-label {
    grid-column: 2;
    position: static;
    padding-top: 0;
    font-size: 30px;
    line-height: 1;
    writing-mode: horizontal-tb;
  }

  .timeline-events {
    grid-column: 1 / 3;
  }

  .event {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
  }

  .marker {
    padding-top: 8px;
  }

  .event-card {
    grid-column: 2;
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 12px;
  }

  .event-card h2 {
    font-size: clamp(20px, 6vw, 30px);
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
  }

  .event-card .event-meta {
    display: none;
  }

  .event-card .tags {
    display: none;
  }

  .project-artifact {
    display: none;
  }
}

@media (min-width: 761px) {
  .mobile-only {
    display: none;
  }
}

/* Ensure phone-specific overrides win over the 900px block above */
@media (max-width: 760px) {
  .photo-dialog {
    width: 100vw;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    box-shadow: none;
  }
}
