@font-face {
  font-family: "Geologica";
  src: url("/assets/geologica-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f3f4f1;
  --bg-deep: #e7eae5;
  --surface: #ffffff;
  --surface-soft: #e9ece7;
  --text: #151817;
  --text-strong: #090b0a;
  --muted: #5b625f;
  --muted-strong: #3d4441;
  --line: #cfd4cf;
  --line-strong: #aeb5af;
  --signal: #c84429;
  --signal-strong: #a8321d;
  --signal-ink: #ffffff;
  --code-bg: #111513;
  --code-ink: #eef2ed;
  --page-pad: clamp(1.1rem, 4vw, 4.25rem);
  --max-width: 1380px;
  --radius: 16px;
  --radius-small: 10px;
  --shadow-media: 0 24px 70px rgba(33, 42, 37, 0.12);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: "Geologica", ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 390;
  line-height: 1.62;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: color-mix(in srgb, var(--signal) 28%, white);
  color: var(--text-strong);
}

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

img {
  height: auto;
}

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

button,
summary,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
pre {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--text-strong);
  font-weight: 440;
  letter-spacing: -0.045em;
  line-height: 0.98;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

:where(section, article, footer)[id] {
  scroll-margin-top: 6rem;
}

:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 4px;
}

.page-shell {
  width: min(100%, var(--max-width));
  margin-inline: auto;
  padding-inline: var(--page-pad);
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.75rem;
  left: 0.75rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transform: translateY(-160%);
  border-radius: var(--radius-small);
  background: var(--text-strong);
  color: white;
  padding: 0.65rem 0.9rem;
  font-weight: 580;
  text-decoration: none;
  transition: transform 180ms var(--ease);
}

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

.site-header {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.site-header[data-scrolled="true"] {
  background: rgba(243, 244, 241, 0.92);
  box-shadow: 0 1px 0 rgba(21, 24, 23, 0.1);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(100%, var(--max-width));
  min-height: 72px;
  margin-inline: auto;
  padding-inline: var(--page-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.wordmark {
  min-height: 44px;
  display: inline-flex;
  align-items: baseline;
  gap: 0.7rem;
  text-decoration: none;
}

.wordmark strong {
  font-size: 1rem;
  font-weight: 620;
  letter-spacing: -0.025em;
}

.wordmark span {
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 470;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.15rem);
}

.desktop-nav a,
.contact-links a,
.site-footer a {
  position: relative;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted-strong);
  font-size: 0.88rem;
  font-weight: 520;
  text-decoration: none;
}

.desktop-nav a::after,
.contact-links a::after,
.site-footer a::after,
.text-link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0.45rem;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, currentColor, transparent);
  transform: scaleX(0.55);
  transform-origin: left;
  opacity: 0.38;
  transition: transform 180ms var(--ease), opacity 180ms ease;
}

.desktop-nav a:hover::after,
.desktop-nav a[aria-current="location"]::after,
.desktop-nav a[aria-current="page"]::after,
.contact-links a:hover::after,
.site-footer a:hover::after,
.text-link:hover::after {
  transform: scaleX(1);
  opacity: 0.85;
}

.mobile-menu {
  display: none;
  position: relative;
}

.mobile-menu summary {
  min-width: 64px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 580;
  list-style: none;
}

.mobile-menu summary::-webkit-details-marker {
  display: none;
}

.mobile-menu nav {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  width: min(20rem, calc(100vw - 2rem));
  display: grid;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(33, 42, 37, 0.16);
}

.mobile-menu nav a {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  font-weight: 520;
  text-decoration: none;
}

.mobile-menu nav a:last-child {
  border-bottom: 0;
}

.button {
  max-width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  padding: 0.78rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 590;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  cursor: pointer;
  transition: transform 160ms var(--ease), background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(1px) scale(0.99);
}

.button--primary {
  background: var(--signal);
  color: var(--signal-ink);
}

.button--primary:hover {
  background: var(--signal-strong);
}

.button--secondary {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text-strong);
}

.button--secondary:hover {
  border-color: var(--text-strong);
  background: var(--surface);
}

.button--large {
  min-height: 54px;
  padding-inline: 1.25rem;
}

.text-link {
  position: relative;
  min-height: 44px;
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  color: var(--text-strong);
  font-size: 0.9rem;
  font-weight: 560;
  text-decoration: none;
}

.text-link::after {
  bottom: 0.4rem;
  background: linear-gradient(90deg, var(--signal), transparent);
  transform: scaleX(0.78);
  opacity: 0.8;
}

.hero {
  min-height: min(920px, 100dvh);
  display: flex;
  align-items: center;
  padding: 7.5rem 0 3.5rem;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(28rem, 1.18fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 7.5rem);
}

.hero-copy {
  min-width: 0;
}

.hero-role {
  max-width: 38rem;
  margin-bottom: 1.4rem;
  color: var(--signal-strong);
  font-size: 0.82rem;
  font-weight: 580;
  letter-spacing: 0.015em;
}

.hero h1 {
  max-width: 10ch;
  margin-bottom: 1.45rem;
  font-size: clamp(3.7rem, 7vw, 7.6rem);
  font-weight: 350;
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.hero-summary {
  max-width: 39rem;
  margin-bottom: 1.8rem;
  color: var(--muted-strong);
  font-size: clamp(1.05rem, 1.4vw, 1.22rem);
  line-height: 1.55;
}

.hero-actions,
.project-links,
.contact-actions,
.contact-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.2rem;
}

.hero-proof {
  position: relative;
  min-height: clamp(29rem, 53vw, 42rem);
}

.hero-shot {
  position: absolute;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-media);
  color: var(--text-strong);
  text-decoration: none;
  transition: transform 240ms var(--ease), box-shadow 240ms ease;
}

.hero-shot:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 90px rgba(33, 42, 37, 0.17);
}

.hero-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.hero-shot span {
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  left: 0.85rem;
  min-width: 0;
  display: grid;
  justify-content: start;
  gap: 0.08rem;
  overflow: hidden;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.65rem 0.75rem;
  font-size: 0.72rem;
  backdrop-filter: blur(12px);
}

.hero-shot span strong {
  font-weight: 620;
}

.hero-shot span small {
  min-width: 0;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.25;
}

.hero-shot--primary {
  z-index: 1;
  top: 1.5rem;
  left: 0;
  width: 84%;
  aspect-ratio: 1.8;
}

.hero-shot--secondary {
  z-index: 2;
  right: 0;
  bottom: 1.5rem;
  width: 63%;
  aspect-ratio: 1.55;
}

.facts-strip {
  border-block: 1px solid var(--line);
}

.facts-strip .page-shell {
  min-height: 74px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
}

.facts-strip span {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0.8rem 1.2rem;
  border-right: 1px solid var(--line);
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 510;
}

.facts-strip span:first-child {
  padding-left: 0;
}

.facts-strip span:last-child {
  border-right: 0;
}

.work-section {
  padding: clamp(6rem, 10vw, 10rem) 0;
}

.section-heading {
  max-width: 48rem;
  margin-bottom: clamp(3rem, 6vw, 5.5rem);
}

.section-heading h2,
.resume-section h2 {
  margin-bottom: 0.9rem;
  font-size: clamp(3rem, 6vw, 6.4rem);
  font-weight: 360;
}

.section-heading p,
.supporting-heading p {
  max-width: 43rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.project {
  scroll-margin-top: 6rem;
}

.project--feature,
.project--wide {
  display: grid;
  grid-template-columns: minmax(20rem, 0.78fr) minmax(0, 1.22fr);
  align-items: stretch;
  gap: clamp(2rem, 5vw, 5.5rem);
  padding-block: clamp(3.5rem, 6vw, 6rem);
  border-top: 1px solid var(--line-strong);
}

.project--wide {
  grid-template-columns: minmax(20rem, 0.88fr) minmax(0, 1.12fr);
  margin-top: clamp(3rem, 6vw, 6rem);
  border-bottom: 1px solid var(--line-strong);
}

.project-copy {
  min-width: 0;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  margin-bottom: 1.2rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 540;
  letter-spacing: 0.025em;
}

.project-meta span:first-child {
  color: var(--signal-strong);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.project h3 {
  max-width: 12ch;
  margin-bottom: 1rem;
  font-size: clamp(3rem, 5.5vw, 6.1rem);
  font-weight: 380;
}

.project--tile h3 {
  font-size: clamp(2.35rem, 4vw, 4.2rem);
}

.project-lede {
  max-width: 43rem;
  margin-bottom: 1.6rem;
  color: var(--text-strong);
  font-size: clamp(1.08rem, 1.5vw, 1.27rem);
  line-height: 1.5;
}

.project-specific {
  max-width: 39rem;
  margin-bottom: 1.4rem;
  color: var(--muted-strong);
  font-size: 0.94rem;
}

.project-detail {
  margin-bottom: 1.6rem;
  border-top: 1px solid var(--line);
}

.project-detail > div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 0.95rem;
  border-bottom: 1px solid var(--line);
}

.project-detail strong {
  font-size: 0.76rem;
  font-weight: 610;
}

.project-detail p {
  max-width: 37rem;
  margin-bottom: 0;
  color: var(--muted-strong);
  font-size: 0.88rem;
  line-height: 1.55;
}

.project-media {
  min-height: 22rem;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-soft);
  box-shadow: var(--shadow-media);
  text-decoration: none;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 420ms var(--ease);
}

.project-media:hover img {
  transform: scale(1.012);
}

.project-media--stems {
  min-height: clamp(28rem, 47vw, 40rem);
}

.project-pair {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(1.25rem, 3vw, 2.4rem);
  margin-top: clamp(2rem, 4vw, 4rem);
}

.project--tile {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
}

.project--tile .project-media {
  min-height: 20rem;
  border-radius: 0;
  box-shadow: none;
}

.project--tile .project-copy {
  flex: 1;
  padding: clamp(1.5rem, 3vw, 2.6rem);
}

.project--mastra {
  background: var(--text-strong);
  color: #f2f4f1;
}

.project--mastra h3,
.project--mastra .project-lede,
.project--mastra .text-link {
  color: #ffffff;
}

.project--mastra .project-specific,
.project--mastra .project-meta {
  color: #b9c1bc;
}

.project--mastra .project-meta span:first-child {
  color: #ff8c72;
}

.project--mastra .project-media {
  order: 2;
  min-height: 16rem;
  margin: 0 1rem 1rem;
  border-radius: 11px;
}

.supporting-work {
  padding-top: clamp(5rem, 8vw, 8rem);
}

.supporting-heading {
  max-width: 43rem;
  margin-bottom: 2rem;
}

.supporting-heading h3 {
  margin-bottom: 0.7rem;
  font-size: clamp(2.2rem, 4vw, 4rem);
  font-weight: 390;
}

.supporting-item {
  display: grid;
  grid-template-columns: minmax(12rem, 0.52fr) minmax(0, 1.48fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding-block: clamp(2rem, 4vw, 3.5rem);
  border-top: 1px solid var(--line);
}

.supporting-item:last-child {
  border-bottom: 1px solid var(--line);
}

.supporting-item > img,
.code-sample {
  width: 100%;
  max-height: 17rem;
  overflow: hidden;
  border-radius: var(--radius-small);
  background: var(--surface-soft);
  object-fit: cover;
}

.supporting-item h4 {
  margin-bottom: 0.8rem;
  font-size: clamp(1.8rem, 3.2vw, 3.2rem);
  font-weight: 400;
}

.supporting-item p {
  max-width: 52rem;
  margin-bottom: 0;
  color: var(--muted-strong);
}

.supporting-item .text-link {
  margin-top: 0.8rem;
}

.code-sample {
  display: flex;
  align-items: center;
  min-height: 11rem;
  background: var(--code-bg);
  color: var(--code-ink);
  padding: clamp(1.2rem, 3vw, 2.1rem);
}

.code-sample code {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(0.72rem, 1.2vw, 0.9rem);
  line-height: 1.7;
}

.resume-section {
  padding: clamp(5rem, 9vw, 8.5rem) 0;
  background: var(--surface-soft);
}

.resume-section h2 {
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.resume-list {
  border-top: 1px solid var(--line-strong);
}

.resume-list a {
  display: grid;
  grid-template-columns: minmax(13rem, 0.55fr) minmax(0, 1.45fr);
  gap: clamp(1rem, 4vw, 4rem);
  align-items: center;
  min-height: 7.5rem;
  padding-block: 1.4rem;
  border-bottom: 1px solid var(--line-strong);
  text-decoration: none;
  transition: padding-left 180ms var(--ease), color 180ms ease;
}

.resume-list a:hover {
  padding-left: 0.5rem;
  color: var(--signal-strong);
}

.resume-list span {
  font-size: 0.82rem;
  font-weight: 590;
}

.resume-list strong {
  max-width: 56rem;
  color: inherit;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  font-weight: 420;
  line-height: 1.35;
}

.contact-section {
  padding: clamp(6rem, 11vw, 11rem) 0;
  background: var(--text-strong);
  color: #f3f5f2;
}

.contact-inner h2 {
  max-width: 17ch;
  margin-bottom: 2rem;
  color: #ffffff;
  font-size: clamp(3rem, 6.3vw, 7.2rem);
  font-weight: 350;
  line-height: 0.94;
}

.contact-section .button--secondary {
  border-color: #69726d;
  color: #ffffff;
}

.contact-section .button--secondary:hover {
  border-color: #ffffff;
  background: #202522;
}

.contact-links {
  margin-top: 2rem;
}

.contact-links a {
  color: #d4d9d5;
}

.site-footer {
  padding: 2rem 0;
  background: var(--text-strong);
  color: #aeb6b1;
}

.footer-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
}

.footer-inner strong {
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 590;
}

.footer-inner span,
.footer-inner a {
  font-size: 0.74rem;
}

.footer-inner a {
  color: #d4d9d5;
}

.toast {
  position: fixed;
  z-index: 200;
  right: 1rem;
  bottom: 1rem;
  max-width: min(24rem, calc(100vw - 2rem));
  border-radius: var(--radius-small);
  background: var(--text-strong);
  color: white;
  padding: 0.8rem 1rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
  font-size: 0.85rem;
}

.clipboard-fallback {
  position: fixed;
  top: -9999px;
  left: -9999px;
}

/* Writing index */
.writing-hero {
  padding: clamp(9rem, 14vw, 13rem) 0 clamp(4rem, 7vw, 7rem);
}

.writing-hero h1,
.article-hero h1,
.error-page h1 {
  max-width: 12ch;
  margin-bottom: 1.2rem;
  font-size: clamp(3.2rem, 7vw, 7.5rem);
  font-weight: 350;
  line-height: 0.92;
}

.writing-hero > .page-shell > p,
.article-dek,
.error-page p {
  max-width: 47rem;
  color: var(--muted-strong);
  font-size: clamp(1.04rem, 1.5vw, 1.22rem);
}

.section-block {
  padding: clamp(4rem, 8vw, 8rem) 0;
}

.writing-list {
  border-top: 1px solid var(--line-strong);
}

.writing-card {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) auto;
  align-items: start;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.6rem, 4vw, 3rem) 0;
  border-bottom: 1px solid var(--line-strong);
  text-decoration: none;
}

.writing-card-index {
  color: var(--signal-strong);
  font-size: 0.76rem;
  font-weight: 630;
}

.writing-card h2 {
  max-width: 22ch;
  margin-bottom: 0.8rem;
  font-size: clamp(2rem, 4.2vw, 4.4rem);
  font-weight: 380;
}

.writing-card p {
  max-width: 55rem;
  margin-bottom: 0;
  color: var(--muted-strong);
}

.writing-card-arrow {
  font-size: 1.2rem;
  transition: transform 180ms var(--ease);
}

.writing-card:hover .writing-card-arrow {
  transform: translate(3px, -3px);
}

/* Article */
.article-hero {
  padding: clamp(9rem, 14vw, 13rem) 0 clamp(4rem, 7vw, 6rem);
  border-bottom: 1px solid var(--line);
}

.article-step,
.section-kicker,
.case-overline {
  color: var(--signal-strong);
  font-size: 0.72rem;
  font-weight: 610;
  letter-spacing: 0.04em;
}

.article-hero .section-kicker {
  margin-bottom: 1.2rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin-top: 1.8rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.article-layout {
  display: grid;
  grid-template-columns: 13rem minmax(0, 48rem);
  justify-content: space-between;
  gap: clamp(3rem, 8vw, 8rem);
  padding-top: clamp(3.5rem, 7vw, 6.5rem);
  padding-bottom: clamp(5rem, 10vw, 10rem);
}

.article-toc {
  position: sticky;
  top: 6.5rem;
  align-self: start;
  display: grid;
  gap: 0.25rem;
}

.article-toc strong {
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  font-weight: 620;
}

.article-toc a {
  min-height: 36px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.76rem;
  text-decoration: none;
}

.article-toc a:hover {
  color: var(--text-strong);
}

.article-body {
  min-width: 0;
}

.article-body > section {
  padding-bottom: clamp(3.5rem, 7vw, 6.5rem);
}

.article-body h2 {
  max-width: 21ch;
  margin: 0.6rem 0 1rem;
  font-size: clamp(2.1rem, 4vw, 4rem);
  font-weight: 380;
  line-height: 1.02;
}

.article-body h3 {
  margin: 2rem 0 0.8rem;
  font-size: clamp(1.25rem, 2.4vw, 1.8rem);
  font-weight: 470;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.article-body p,
.article-body li {
  color: var(--muted-strong);
}

.article-body code,
.code-block,
.code-sample {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.article-body :not(pre) > code {
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--text-strong);
  padding: 0.12em 0.32em;
  font-size: 0.9em;
}

.article-body ul,
.article-body ol {
  padding-left: 1.2rem;
}

.article-body li + li {
  margin-top: 0.5rem;
}

.callout {
  margin: 1.5rem 0;
  padding: 1.2rem 1.3rem;
  border-left: 3px solid var(--signal);
  background: var(--surface-soft);
}

.callout strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.87rem;
  font-weight: 620;
}

.callout p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.code-block {
  margin: 1.5rem 0 2rem;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--code-ink);
  box-shadow: 0 20px 55px rgba(25, 31, 28, 0.15);
}

.code-block-header {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.8rem 0.65rem 1rem;
  border-bottom: 1px solid #323a36;
  color: #aeb8b2;
  font-size: 0.72rem;
}

.copy-code {
  min-width: 64px;
  min-height: 36px;
  border: 1px solid #56615b;
  border-radius: 7px;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  font-size: 0.72rem;
}

.copy-code:hover {
  background: #242a27;
}

.code-block pre {
  margin: 0;
  overflow-x: auto;
  padding: clamp(1rem, 3vw, 1.6rem);
}

.code-block code {
  color: inherit;
  font-size: clamp(0.75rem, 1.2vw, 0.88rem);
  line-height: 1.7;
}

.option-grid,
.troubleshooting-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.option-grid article,
.troubleshooting-grid article {
  padding: 1.2rem;
  background: var(--surface);
}

.option-grid h3,
.troubleshooting-grid h3 {
  margin-top: 0;
  font-size: 1rem;
}

.option-grid p,
.troubleshooting-grid p {
  margin-bottom: 0;
  font-size: 0.87rem;
}

.status-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.status-table {
  width: 100%;
  min-width: 42rem;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.status-table th,
.status-table td {
  padding: 0.85rem 0.95rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.status-table th {
  background: var(--surface-soft);
  color: var(--text-strong);
  font-size: 0.72rem;
  font-weight: 610;
}

.status-table td {
  color: var(--muted-strong);
}

.status-table tr:last-child td {
  border-bottom: 0;
}

.article-aside {
  align-self: start;
  border-top: 1px solid var(--line-strong);
  padding-top: 1rem;
}

.article-aside p {
  color: var(--muted);
  font-size: 0.78rem;
}

.article-aside strong {
  color: var(--text-strong);
  font-weight: 610;
}

.article-aside a {
  color: var(--text-strong);
  font-weight: 540;
}

.article-footer-cta {
  padding: clamp(4.5rem, 9vw, 8rem) 0;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.article-footer-cta h2 {
  max-width: 13ch;
  margin-bottom: 1.5rem;
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 370;
}

/* Error page */
.error-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: 8rem 0 4rem;
}

.error-page .page-shell {
  position: relative;
}

.error-code {
  color: var(--signal);
  font-size: clamp(7rem, 22vw, 20rem);
  font-weight: 180;
  letter-spacing: -0.09em;
  line-height: 0.75;
}

.error-page h1 {
  margin-top: 2rem;
}

.error-page .hero-actions {
  margin-top: 1.5rem;
}

@media (max-width: 1040px) {
  .hero-layout {
    grid-template-columns: minmax(0, 0.9fr) minmax(22rem, 1.1fr);
    gap: 2.5rem;
  }

  .project--feature,
  .project--wide {
    grid-template-columns: minmax(18rem, 0.85fr) minmax(0, 1.15fr);
  }

  .project-pair {
    grid-template-columns: 1fr;
  }

  .project--tile {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(18rem, 0.9fr);
  }

  .project--tile .project-media {
    min-height: 24rem;
  }

  .project--mastra .project-media {
    order: initial;
    margin: 1rem 1rem 1rem 0;
  }
}

@media (min-width: 781px) {
  .project--feature > .project-media,
  .project--wide > .project-media {
    align-self: center;
    min-height: 0;
    aspect-ratio: 1272 / 706;
  }

  .project--tile .project-media {
    align-self: center;
    min-height: 0;
    aspect-ratio: 8 / 5;
  }

  .project-media img {
    object-fit: contain;
  }
}

@media (max-width: 780px) {
  .desktop-nav {
    display: none;
  }

  .mobile-menu {
    display: block;
  }

  .wordmark span {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 7.2rem 0 3.5rem;
  }

  .hero-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero h1 {
    max-width: 9ch;
    font-size: clamp(3.4rem, 13vw, 5.4rem);
  }

  .hero-proof {
    min-height: 29rem;
  }

  .facts-strip .page-shell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0;
  }

  .facts-strip span {
    padding-left: var(--page-pad);
    border-bottom: 1px solid var(--line);
  }

  .facts-strip span:nth-child(2n) {
    border-right: 0;
  }

  .facts-strip span:nth-child(n + 3) {
    border-bottom: 0;
  }

  .project--feature,
  .project--wide,
  .project--tile {
    grid-template-columns: 1fr;
  }

  .project--feature,
  .project--wide {
    gap: 2rem;
  }

  .project--feature .project-media,
  .project--wide .project-media {
    grid-row: 1;
  }

  .project--tile .project-media {
    min-height: 20rem;
  }

  .project--mastra .project-media {
    order: 2;
    margin: 0 1rem 1rem;
  }

  .supporting-item {
    grid-template-columns: minmax(9rem, 0.6fr) minmax(0, 1.4fr);
    gap: 1.25rem;
  }

  .resume-list a {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

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

  .footer-inner span {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-toc {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
  }

  .article-toc strong {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  :root {
    --page-pad: 1rem;
  }

  .header-inner {
    min-height: 64px;
  }

  .hero {
    padding-top: 6rem;
  }

  .hero-role {
    margin-bottom: 1rem;
    font-size: 0.74rem;
  }

  .hero h1 {
    margin-bottom: 1rem;
    font-size: clamp(3.25rem, 15.2vw, 4.4rem);
  }

  .hero-summary {
    font-size: 1rem;
  }

  .hero-actions {
    align-items: stretch;
  }

  .hero-actions .button {
    flex: 1 0 100%;
  }

  .hero-proof {
    min-height: 20rem;
  }

  .hero-shot--primary {
    top: 0;
    width: 94%;
  }

  .hero-shot--secondary {
    bottom: 0;
    width: 68%;
  }

  .hero-shot span {
    right: 0.45rem;
    bottom: 0.45rem;
    left: 0.45rem;
    padding: 0.48rem 0.55rem;
    font-size: 0.62rem;
  }

  .facts-strip span {
    font-size: 0.7rem;
  }

  .work-section {
    padding-block: 5.5rem;
  }

  .section-heading h2,
  .resume-section h2 {
    font-size: clamp(3rem, 15vw, 4.4rem);
  }

  .project h3,
  .project--tile h3 {
    font-size: clamp(2.7rem, 13vw, 4rem);
  }

  .project-detail > div {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .project-media--stems,
  .project--tile .project-media,
  .project-media {
    min-height: 15rem;
  }

  .project--tile .project-copy {
    padding: 1.3rem 1rem 1.6rem;
  }

  .supporting-item {
    grid-template-columns: 1fr;
  }

  .supporting-item > img,
  .code-sample {
    max-height: none;
    min-height: 10rem;
  }

  .contact-inner h2 {
    font-size: clamp(3rem, 14vw, 4.6rem);
  }

  .contact-actions {
    display: grid;
  }

  .contact-actions .button {
    width: 100%;
  }

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

  .footer-inner span {
    grid-column: auto;
    grid-row: auto;
  }

  .footer-inner a {
    justify-self: start;
  }

  .writing-hero h1,
  .article-hero h1,
  .error-page h1 {
    font-size: clamp(3rem, 14vw, 4.8rem);
  }

  .writing-card {
    grid-template-columns: 2.5rem minmax(0, 1fr);
  }

  .writing-card-arrow {
    display: none;
  }

  .article-toc {
    grid-template-columns: 1fr;
  }

  .option-grid,
  .troubleshooting-grid {
    grid-template-columns: 1fr;
  }

  .code-block {
    margin-inline: calc(var(--page-pad) * -1);
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
