/* Theme fonts: Lora for headings, Spectral for body text, DM Sans for interface labels, system stack for buttons. */
:root {
  --brand-brown: #B45A37;
  --brand-brown-hover: #9A4D2F;
  --brand-charcoal: #23272A;
  --neutral-stone-50: #FAF7F4;
  --neutral-stone-200: #E8E2DB;
  --neutral-taupe: #867365;
  --accent-gold: #F5C781;
  --text-primary: #000;
  --text-secondary: #666;
  --text-muted: #6B6B6B;
  --border-default: #E5E1DC;
  --font-display: "Lora", Georgia, serif;
  --font-body: "Spectral", Georgia, serif;
  --font-system: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --font-ui: "DM Sans", var(--font-system);
  --text-display-sm: 500 24px/1.3 var(--font-display);
  --text-body-md: 400 18px/1.5 var(--font-body);
  --text-body-sm: 400 16px/1.5 var(--font-body);
  --text-body-xs: 400 14px/1.5 var(--font-ui);
  --shadow-sm: 0 1px 2px rgba(26, 26, 26, 0.05);
  --shadow-xl: 0 24px 48px rgba(26, 26, 26, 0.16);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --pad: clamp(20px, 4vw, 64px);
  --section: clamp(96px, 12vw, 180px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 96px; }
body.home {
  margin: 0;
  background: var(--neutral-stone-50);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body.home img { max-width: 100%; }
body.home a { color: inherit; text-decoration: none; }
body.home a:hover { color: var(--brand-brown); }
body.home ::selection { background: var(--brand-brown); color: #fff; }
body.home :focus-visible { outline: 2px solid var(--brand-brown); outline-offset: 3px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.icon { width: 1.15em; height: 1.15em; display: block; flex: none; }

.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: 96px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  column-gap: clamp(12px, 2vw, 28px); align-items: center; padding: 0 var(--pad);
  background: rgba(250, 247, 244, 0.82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.site-menu { display: contents; }
.nav { grid-column: 1; grid-row: 1; }
.brand { grid-column: 2; grid-row: 1; }
.tools { grid-column: 3; grid-row: 1; }
.nav, .tools { display: flex; align-items: center; gap: clamp(12px, 1.6vw, 22px); min-width: 0; }
.nav-toggle {
  display: none; width: 44px; height: 44px; margin-right: -10px; padding: 0;
  border: 0; background: transparent; color: inherit; cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle:hover { color: var(--brand-brown); }
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block; width: 22px; height: 2px; border-radius: 1px; background: currentColor;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }
.tools { justify-content: flex-end; }
.nav a, .tools a, .lang-switch a {
  font-family: var(--font-ui); font-size: clamp(14px, 1.2vw, 17px); white-space: nowrap;
}
.brand { font-family: var(--font-display); font-size: clamp(18px, 2vw, 26px); letter-spacing: 0.02em; white-space: nowrap; }
.brand-logo { display: block; width: 151px; height: auto; }
.site-header .lang-full { display: none; }
.site-header .lang-switch { display: flex; gap: 10px; }
.site-header .lang-switch a[aria-current="true"] { color: var(--brand-brown); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; border: 1px solid transparent; background: transparent;
  color: inherit; font-family: var(--font-system); font-size: 14px; line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { color: inherit; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-md { min-height: 40px; padding: 0 18px; }
.btn-lg { min-height: 44px; padding: 0 22px; font-size: 16px; }
.btn-sm { min-height: 36px; padding: 0 14px; }
.btn-brand { background: var(--brand-brown); color: #fff; }
.btn-brand:hover { background: var(--brand-brown-hover); color: #fff; }
.btn-outline { border-color: var(--brand-brown); color: var(--brand-brown); }
.btn-outline:hover { background: var(--brand-brown); color: #fff; }
.btn.is-on, .chip.is-on { background: var(--brand-brown); border-color: var(--brand-brown); color: #fff; }
.btn .icon { width: 18px; height: 18px; }
/* Themed pages set `a { color }` later and would paint button labels black. */
body.home a.btn-brand,
body.page a.btn-brand,
body.resume a.btn-brand,
body.home a.btn-brand:hover,
body.page a.btn-brand:hover,
body.resume a.btn-brand:hover { color: #fff; }
body.home a.btn-outline,
body.page a.btn-outline,
body.resume a.btn-outline { color: var(--brand-brown); }
body.home a.btn-outline:hover,
body.page a.btn-outline:hover,
body.resume a.btn-outline:hover { color: #fff; }

.hero {
  position: relative; min-height: 100vh; display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 1fr);
  gap: 24px; padding: 150px var(--pad) 0; overflow: hidden; background: var(--neutral-stone-50);
}
.hero-copy { display: flex; flex-direction: column; justify-content: flex-end; gap: 28px; padding-bottom: 64px; position: relative; z-index: 2; }
.hero h1 {
  margin: 0; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(56px, 9.5vw, 148px); line-height: 0.9; letter-spacing: -0.02em;
}
.line-mask { display: block; overflow: hidden; padding-bottom: 0.08em; }
.line { display: inline-block; }
.hero-role { margin: 0; font: var(--text-display-sm); font-weight: 400; color: var(--brand-brown); }
.hero-lead { margin: 0; max-width: 420px; font: var(--text-body-sm); color: var(--text-secondary); text-wrap: pretty; }
.hero-photo { position: relative; align-self: end; height: min(700px, 82vh); min-height: 420px; }
.hero-photo-bg {
  position: absolute; left: 8%; right: 8%; bottom: 0; height: 86%;
  border-radius: 12px 12px 0 0; background: var(--neutral-stone-200);
}
.hero-photo img {
  position: relative; display: block; width: 100%; height: 100%;
  object-fit: contain; object-position: bottom center; transform-origin: 50% 100%;
}

.band { padding: var(--section) var(--pad); }
.band-tight { padding: 0 var(--pad) var(--section); background: #fff; }
.wrap { max-width: 1200px; margin: 0 auto; }
.about { background: #fff; }
.about-grid, .jobs-grid, .stack-grid, .blog-grid, .contact-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 48px;
}
.kicker { font: var(--text-body-xs); text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-secondary); }
.about-lead {
  margin: 0; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(28px, 3.2vw, 48px); line-height: 1.2; text-wrap: pretty;
}
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 32px; border-top: 1px solid var(--border-default); padding-top: 32px; margin-top: 48px;
}
.stat-num { display: block; font-family: var(--font-display); font-weight: 400; font-size: 56px; line-height: 1; }
.stat-label { display: block; margin-top: 6px; font: var(--text-body-xs); color: var(--text-secondary); }
.frame { border-radius: 12px; overflow: hidden; background: var(--neutral-stone-200); }
.workspace { aspect-ratio: 16/9; position: relative; }
.workspace img { position: absolute; left: 0; top: -10%; width: 100%; height: 120%; object-fit: cover; }

.services { background: var(--brand-charcoal); color: #fff; }
.services a:hover { color: var(--accent-gold); }
.section-head, .row-head {
  display: flex; justify-content: space-between; align-items: end; gap: 32px; flex-wrap: wrap;
}
.section-title {
  margin: 0; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(40px, 5vw, 72px); line-height: 1;
}
.section-lead { margin: 0; max-width: 420px; font: var(--text-body-sm); }
.services .section-lead { color: rgba(255, 255, 255, 0.72); }
.float {
  position: fixed; left: 0; top: 0; width: 300px; aspect-ratio: 4/3; border-radius: 12px;
  overflow: hidden; pointer-events: none; z-index: 40; opacity: 0; box-shadow: var(--shadow-xl);
}
.float img { width: 100%; height: 100%; object-fit: cover; display: block; }
.service { border-top: 1px solid rgba(255, 255, 255, 0.16); }
.service summary {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) 28px; gap: 24px;
  align-items: baseline; padding: 28px 0; cursor: pointer; list-style: none;
}
.service summary::-webkit-details-marker { display: none; }
.service summary:hover { color: var(--accent-gold); }
.service-num { font: var(--text-body-xs); color: rgba(255, 255, 255, 0.56); }
.service-title { font-family: var(--font-display); font-size: clamp(24px, 2.6vw, 38px); line-height: 1.15; }
.service-sign { font-family: var(--font-display); font-size: 28px; line-height: 1; text-align: center; }
.service-sign::before { content: "+"; }
.service[open] .service-sign::before { content: "−"; }
.service-body {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 32px; padding: 0 0 28px 88px;
}
.service-body p { margin: 0; font: var(--text-body-sm); color: rgba(255, 255, 255, 0.78); text-wrap: pretty; }
.service-proof { font: var(--text-body-xs) !important; color: var(--accent-gold) !important; }
.services-list { margin-top: 64px; border-bottom: 1px solid rgba(255, 255, 255, 0.16); }

.stack { background: #fff; }
.stack-intro { display: flex; flex-direction: column; gap: 20px; align-self: start; }
.stack-intro p { margin: 0; font: var(--text-body-sm); color: var(--text-secondary); max-width: 340px; }
.stack-group {
  display: grid; grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 16px 24px; padding: 28px 0; border-top: 1px solid var(--border-default);
}
.stack-name { font-family: var(--font-display); font-size: 20px; line-height: 1.3; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  padding: 7px 14px; border: 1px solid #D8D2CB; border-radius: 999px;
  font: var(--text-body-xs); color: #000;
}
.pill:hover { border-color: var(--brand-brown); color: var(--brand-brown); }

.featured { background: var(--neutral-stone-50); }
.hpin {
  min-height: 100vh; box-sizing: border-box; padding: 140px 0 64px;
  display: flex; flex-direction: column; justify-content: center; gap: 48px; overflow: hidden;
}
.htrack {
  display: flex; gap: 40px; width: max-content; padding: 0 var(--pad); will-change: transform;
}
.featured-card { width: clamp(300px, 34vw, 520px); flex: none; display: flex; flex-direction: column; gap: 16px; }
.card-media { aspect-ratio: 16/10; border-radius: 12px; overflow: hidden; background: var(--neutral-stone-200); }
.card-media img, .card-media video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.7s var(--ease-standard); background: #111;
}
.featured-card:hover .card-media img, .featured-card:hover .card-media video,
.cat-card:hover .card-media img, .cat-card:hover .card-media video { transform: scale(1.05); }
.card-title { margin: 16px 0 0; font: var(--text-display-sm); font-weight: 400; }
.card-text { margin: 8px 0 0; font: var(--text-body-sm); color: var(--text-secondary); text-wrap: pretty; }
.card-meta {
  display: flex; justify-content: space-between; gap: 16px;
  font: var(--text-body-xs); color: var(--text-secondary);
  border-top: 1px solid var(--border-default); padding-top: 12px;
}
.card-meta a { color: var(--brand-brown); white-space: nowrap; }

.catalog { background: #fff; }
.catalog [hidden] { display: none !important; }
.catalog-head { margin-bottom: 32px; }
.catalog-intro { margin: 16px 0 0; max-width: 560px; font: var(--text-body-sm); color: var(--text-secondary); text-wrap: pretty; }
.tabs, .filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
  border-top: 1px solid var(--border-default); padding-top: 24px; margin-top: 24px;
}
.search input {
  width: min(280px, 100%); height: 40px; padding: 0 14px;
  border: 1px solid var(--border-default); border-radius: 999px;
  background: #fff; font: var(--text-body-sm); color: inherit;
}
.cat-count { display: block; margin: 18px 0; font: var(--text-body-xs); color: var(--text-muted); }
.cat-item { scroll-margin-top: 120px; }
.cat-row.is-linked {
  margin-inline: -16px;
  padding-inline: 16px;
  background: var(--neutral-stone-50);
  box-shadow: inset 3px 0 0 var(--brand-brown);
}
.cat-card.is-linked { position: relative; z-index: 1; }
.cat-card.is-linked::before {
  content: "";
  position: absolute; z-index: -1; inset: -16px -12px;
  border-radius: 16px; background: var(--neutral-stone-50);
  box-shadow: inset 3px 0 0 var(--brand-brown);
}
.cat-rows { display: flex; flex-direction: column; border-top: 1px solid var(--border-default); }
.cat-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) minmax(0, 140px);
  gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--border-default); align-items: baseline;
}
.cat-title { font-family: var(--font-display); font-size: 22px; line-height: 1.25; }
.cat-tag, .cat-stack { display: block; margin-top: 4px; font: var(--text-body-xs); color: var(--text-muted); }
.cat-sum { margin: 0; font: var(--text-body-sm); color: var(--text-secondary); text-wrap: pretty; }
.cat-links { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; font: var(--text-body-xs); }
.cat-links a { color: var(--brand-brown); }
.badge {
  padding: 3px 10px; border-radius: 999px; background: var(--neutral-stone-50); color: var(--text-secondary);
}
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 48px 32px; }
.cat-card { display: flex; flex-direction: column; gap: 14px; }
.cat-empty { padding: 48px 0; display: flex; flex-direction: column; gap: 8px; }
.cat-empty strong { font: var(--text-display-sm); font-weight: 400; }
.cat-empty span { font: var(--text-body-sm); color: var(--text-secondary); }
.more-wrap { display: flex; justify-content: center; margin-top: 28px; }

.jobs { background: var(--neutral-taupe); color: #fff; }
.job {
  display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  gap: 24px; padding: 28px 0; border-top: 1px solid rgba(255, 255, 255, 0.28);
}
.job-dates { font: var(--text-body-xs); color: rgba(255, 255, 255, 0.85); }
.job-title { display: block; font: var(--text-display-sm); font-weight: 400; }
.job-company { display: block; margin-top: 6px; font: var(--text-body-xs); color: rgba(255, 255, 255, 0.85); }
.job p { margin: 12px 0 0; font: var(--text-body-sm); text-wrap: pretty; }

.blog { background: var(--neutral-stone-50); }
.blog-intro { display: flex; flex-direction: column; gap: 20px; align-self: start; }
.blog-intro p { margin: 0; max-width: 320px; font: var(--text-body-sm); color: var(--text-secondary); }
.blog-all { font: var(--text-body-sm); color: var(--brand-brown); }
.post {
  display: grid; grid-template-columns: minmax(0, 130px) minmax(0, 1fr); gap: 24px;
  padding: 28px 0; border-top: 1px solid var(--border-default); color: inherit;
}
.post:hover { color: var(--brand-brown); }
.post time { font: var(--text-body-xs); color: var(--text-muted); padding-top: 6px; }
.post h2, .post h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(20px, 2vw, 26px); line-height: 1.25; }
.post p { margin: 10px 0 0; font: var(--text-body-sm); color: var(--text-secondary); text-wrap: pretty; }
.post-tags { display: block; margin-top: 10px; font: var(--text-body-xs); color: var(--text-muted); }

.contact { background: #fff; }
.contact-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: clamp(48px, 8vw, 120px); }
.contact-copy { display: flex; flex-direction: column; gap: 28px; }
.contact-copy p { margin: 0; max-width: 440px; font: var(--text-body-md); color: var(--text-secondary); text-wrap: pretty; }
.contact-links { display: flex; flex-direction: column; gap: 14px; font: var(--text-body-md); }
.contact-github {
  display: inline-flex; align-items: center; gap: 14px; width: max-content; max-width: 100%;
  color: inherit;
}
.contact-github:hover { color: inherit; }
.brand-mark {
  display: grid; place-items: center; width: 48px; height: 48px; flex: none;
  border-radius: 12px; background: #181717; color: #fff;
  transition: background .2s var(--ease-standard);
}
.brand-mark .icon { width: 26px; height: 26px; }
.contact-github:hover .brand-mark { background: var(--brand-brown); }
.contact-github-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.contact-github-name {
  font-family: var(--font-display); font-weight: 500; font-size: 18px; line-height: 1.15; color: #000;
}
.contact-github:hover .contact-github-name { color: var(--brand-brown); }
.contact-github-url { font-size: 14px; line-height: 1.3; color: var(--text-secondary); overflow-wrap: anywhere; }
.contact-photo { aspect-ratio: 3/2; }
.contact-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.contact-card {
  background: var(--neutral-stone-50); border-radius: 12px; padding: clamp(28px, 4vw, 56px);
  display: flex; flex-direction: column; gap: 28px; align-self: start;
}
.contact-form, .contact-sent { display: flex; flex-direction: column; gap: 28px; }
.contact-form[hidden], .contact-sent[hidden] { display: none; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field label { font-size: 14px; font-weight: 500; }
.field label span { color: #B42318; }
.field input, .field select, .field textarea {
  width: 100%; border: 0; border-bottom: 1px solid #D8D2CB; border-radius: 0;
  padding: 8px 0; font: var(--text-body-sm); color: #000; background: transparent;
}
.field textarea { resize: vertical; min-height: 96px; }
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #666 50%), linear-gradient(135deg, #666 50%, transparent 50%);
  background-position: calc(100% - 10px) 55%, calc(100% - 4px) 55%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
.field select:has(option[value=""]:checked) { color: var(--text-muted); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-muted); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-bottom: 2px solid var(--brand-brown);
}
.field.is-error input, .field.is-error textarea { border-bottom-color: #B42318; }
.field-error { margin: 0; font-size: 12px; line-height: 1.4; color: #B42318; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 28px; }
.form-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.turnstile { display: flex; flex-direction: column; gap: 8px; width: 100%; min-width: 0; }
.turnstile .cf-turnstile { min-height: 65px; }
.hp {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.contact-card .contact-thanks {
  margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 38px; line-height: 1.1;
}
.contact-card .contact-sent p { margin: 0; font: var(--text-body-md); color: var(--text-secondary); }
.contact-card .contact-sent .contact-thanks { color: #000; }
.contact-note { font: var(--text-body-xs) !important; color: var(--text-muted); }
.contact-toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; flex-direction: column; gap: 4px;
  max-width: 340px; padding: 16px 20px; background: #fff; border-radius: 12px; box-shadow: var(--shadow-xl);
}
.contact-toast[hidden] { display: none; }
.contact-toast strong { font-family: var(--font-display); font-weight: 500; font-size: 16px; }
.contact-toast span { font: var(--text-body-xs); color: var(--text-secondary); }

.site-footer {
  background: var(--brand-charcoal); color: #fff;
  padding: 64px var(--pad) 32px; display: flex; flex-direction: column; gap: 48px;
}
.site-footer a:hover { color: var(--accent-gold); }
.footer-photo { aspect-ratio: 21/9; }
.footer-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; }
.footer-row, .footer-meta { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.footer-name { font-family: var(--font-display); font-size: clamp(40px, 7vw, 104px); line-height: 0.95; }
.footer-links { display: flex; gap: 28px; flex-wrap: wrap; font: var(--text-body-sm); }
.footer-links a { display: inline-flex; align-items: center; gap: 8px; }
.footer-links .icon { width: 18px; height: 18px; }
.footer-links .icon-telegram,
.footer-links a:hover .icon-telegram { color: #26A5E4; }
.footer-meta { align-items: center; border-top: 1px solid rgba(255, 255, 255, 0.16); padding-top: 20px; font: var(--text-body-xs); color: rgba(255, 255, 255, 0.72); }

@media (max-width: 899px) {
  html { scroll-padding-top: 80px; }
  body.nav-open { overflow: hidden; }
  .site-header {
    height: auto; display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start;
    gap: 0 12px; padding-top: 8px; padding-bottom: 8px;
  }
  .site-header.is-open {
    bottom: 0; overflow-y: auto;
    background: var(--neutral-stone-50);
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .brand { order: 1; margin-right: auto; font-size: 18px; }
  .brand-logo { width: 132px; }
  .nav-toggle { order: 2; display: inline-flex; }
  .site-menu {
    display: none; order: 3; flex: 1 0 100%; flex-direction: column;
    margin-top: 8px; padding: 4px 0 32px;
    border-top: 1px solid var(--border-default);
  }
  .site-header.is-open .site-menu { display: flex; }
  .nav, .tools { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; width: 100%; }
  .nav a, .tools > a:not(.btn) {
    min-height: 52px; display: flex; align-items: center;
    border-bottom: 1px solid var(--border-default);
    font-family: var(--font-display); font-size: 22px; font-weight: 400;
    letter-spacing: -0.01em; white-space: normal;
  }
  .nav a:hover, .tools > a:not(.btn):hover { color: var(--brand-brown); }
  .site-header .lang-switch { width: 100%; gap: 20px; padding: 18px 0 6px; }
  .site-header .lang-switch a { font-size: 16px; }
  .tools .btn-brand { width: 100%; margin-top: 16px; min-height: 48px; }
  .site-header.is-open .nav-toggle-bars { background: transparent; }
  .site-header.is-open .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
  .site-header.is-open .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 96px; }
  .hero-photo { height: 420px; min-height: 0; }
  .about-grid, .jobs-grid, .stack-grid, .blog-grid, .service-body, .stack-group, .job, .post {
    grid-template-columns: 1fr;
  }
  .service-body { padding-left: 0; }
  .hpin { min-height: 0; padding-top: 120px; }
  .htrack { width: auto; max-width: 100%; overflow-x: auto; }
  .featured-card { width: min(78vw, 420px); }
  .cat-row { grid-template-columns: 1fr; }
  .cat-links { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .card-media img, .card-media video { transition: none; }
  .featured-card:hover .card-media img, .featured-card:hover .card-media video,
  .cat-card:hover .card-media img, .cat-card:hover .card-media video { transform: none; }
}

/* Resume sheet, matching Resume.dc.html. Content stays in the Markdown files. */
body.resume {
  margin: 0; background: var(--neutral-stone-50); color: #000;
  font-family: var(--font-body); -webkit-font-smoothing: antialiased;
}
body.resume a { color: var(--brand-brown); text-decoration: none; }
body.resume a:hover { color: var(--brand-brown-hover); }
body.resume ::selection { background: var(--brand-brown); color: #fff; }
body.resume :focus-visible { outline: 2px solid var(--brand-brown); outline-offset: 3px; }
.resume-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  padding: 16px var(--pad); background: rgba(250, 247, 244, 0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.resume-bar-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.resume-bar .lang-switch { display: flex; gap: 10px; }
.resume-bar .lang-full { display: none; }
.resume-bar .lang-switch a { font-family: var(--font-ui); font-size: 15px; color: #000; }
.resume-bar .lang-switch a[aria-current="true"] { color: var(--brand-brown); }
.resume-sheet {
  width: min(820px, calc(100% - 32px)); margin: 8px auto 48px;
  background: #fff; border-radius: 12px; padding: clamp(28px, 4vw, 48px);
  box-shadow: var(--shadow-sm);
}
.resume-sheet .resume-header {
  display: flex; gap: 28px; align-items: center;
  padding-bottom: 22px; border-bottom: 1px solid var(--border-default);
}
.resume-sheet .resume-photo {
  width: 112px; height: 136px; flex: none; object-fit: cover; object-position: center top;
  border-radius: 8px; border: 0; box-shadow: none;
}
.resume-sheet .resume-header-text { min-width: 0; }
.resume-sheet .resume-name {
  margin: 0; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(34px, 5vw, 46px); line-height: 1; color: #000;
}
.resume-sheet .resume-role { margin: 8px 0 0; font-size: 18px; line-height: 1.35; color: var(--brand-brown); }
.resume-sheet .resume-stats { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 10px; }
.resume-sheet .resume-stat { display: flex; gap: 6px; align-items: baseline; }
.resume-sheet .resume-stat-num { font-family: var(--font-display); font-weight: 500; font-size: 18px; color: var(--brand-brown); line-height: 1; }
.resume-sheet .resume-stat-label { font-size: 14px; color: var(--text-secondary); }
.resume-sheet .resume-contacts {
  display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px;
  padding: 0; border: 0; font-size: 14px; color: var(--text-secondary);
}
.resume-sheet .resume-contacts a { display: inline-flex; align-items: center; gap: 6px; }
.resume-sheet .resume-contacts .icon { width: 16px; height: 16px; }
.resume-sheet .resume-contacts .icon-github,
.resume-sheet .resume-contacts a:hover .icon-github { color: #181717; }
.resume-sheet .resume-contacts .icon-telegram,
.resume-sheet .resume-contacts a:hover .icon-telegram { color: #26A5E4; }
.resume-sheet .resume-contacts span { color: var(--text-secondary); }
.resume-sheet h2 {
  margin: 28px 0 10px; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(24px, 3vw, 28px); line-height: 1.2; color: #000;
}
.resume-sheet h3, .resume-sheet h4 { margin: 0 0 6px; font-weight: 500; font-size: 15px; color: #000; }
.resume-sheet p, .resume-sheet li { margin: 0 0 8px; font-size: 15px; line-height: 1.5; }
.resume-sheet ul { margin: 0 0 8px; padding-left: 18px; }
.resume-sheet .resume-skills { display: flex; flex-direction: column; gap: 4px; }
.resume-sheet .resume-skill-group .post-tags {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none;
}
.resume-sheet .post-tag {
  font-family: var(--font-body); font-size: 13px; line-height: 1.4; letter-spacing: 0; text-transform: none;
  color: var(--text-secondary); background: var(--neutral-stone-50);
  border: 1px solid var(--border-default); border-radius: 999px; padding: 3px 10px;
}
.resume-sheet .resume-job { margin: 0; padding: 14px 0; border-top: 1px solid var(--border-default); }
.resume-sheet .resume-job-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 8px;
}
.resume-sheet .resume-job-title { font-family: var(--font-display); font-weight: 500; font-size: 18px; }
.resume-sheet .resume-job-company { margin-top: 2px; font-size: 15px; color: #000; }
.resume-sheet .resume-job-dates { color: var(--text-secondary); font-size: 14px; white-space: nowrap; }
.resume-sheet .resume-job-stack { margin-top: 8px; color: var(--text-secondary); font-size: 14px; }
.resume-sheet .resume-job-sub { margin-top: 12px; padding: 0; border: 0; }
.resume-sheet .resume-projects { padding-left: 18px; }
@media (max-width: 640px) {
  .resume-sheet .resume-header { align-items: flex-start; }
  .resume-sheet .resume-job-head { flex-wrap: wrap; }
  .resume-sheet .resume-job-dates { white-space: normal; }
}
@media print {
  body.resume { background: #fff; }
  .resume-bar { display: none !important; }
  .resume-sheet { width: auto; margin: 0; padding: 0; border-radius: 0; box-shadow: none; }
  .resume-sheet .resume-header, .resume-sheet .resume-job, .resume-sheet h2 { break-inside: avoid; }
  /* Keep headings with what follows and skill groups whole. */
  .resume-sheet h2, .resume-sheet h3, .resume-sheet h4, .resume-sheet .resume-subhead { break-after: avoid; }
  .resume-sheet .resume-skill-group, .resume-sheet li { break-inside: avoid; }
  .resume-sheet p, .resume-sheet li { orphans: 3; widows: 3; }
}
@page { size: A4; margin: 14mm 14mm 16mm; }

/* Blog posts and product pages share the homepage shell. */
body.page {
  margin: 0; background: var(--neutral-stone-50); color: var(--text-primary);
  font-family: var(--font-body); -webkit-font-smoothing: antialiased;
}
body.page img { max-width: 100%; }
body.page a { color: inherit; text-decoration: none; }
body.page a:hover { color: var(--brand-brown); }
body.page ::selection { background: var(--brand-brown); color: #fff; }
body.page :focus-visible { outline: 2px solid var(--brand-brown); outline-offset: 3px; }
body.page .posts-index { padding-top: calc(72px + clamp(48px, 8vw, 96px)); }

.article {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 132px 0 96px;
}
.article-back { font: var(--text-body-sm); font-family: var(--font-ui); color: var(--brand-brown); }
.article-back:hover { color: var(--brand-brown-hover); }
.article time { display: block; margin-top: 28px; }
.article h1 {
  margin: 12px 0 0; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(36px, 5vw, 56px); line-height: 1.05; letter-spacing: -0.02em;
}
.article-sum { margin: 16px 0 0; font: var(--text-body-md); color: var(--text-secondary); text-wrap: pretty; }
.article-repo { margin: 12px 0 0; font: var(--text-body-sm); }
.article-repo a { display: inline-flex; align-items: center; gap: 8px; color: var(--brand-brown); }
.article-repo .icon { width: 18px; height: 18px; }
.article-repo .icon-github,
.article-repo a:hover .icon-github { color: #181717; }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.article-tags li {
  font: var(--text-body-xs); color: var(--text-secondary);
  background: #fff; border: 1px solid var(--border-default); border-radius: 999px; padding: 3px 10px;
}
.article-body { margin-top: 36px; padding-top: 8px; border-top: 1px solid var(--border-default); }
.article-body h2 {
  margin: 36px 0 12px; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(26px, 3vw, 32px); line-height: 1.2;
}
.article-body h3 { margin: 28px 0 8px; font-family: var(--font-display); font-weight: 500; font-size: 20px; }
.article-body p, .article-body li { font-size: 17px; line-height: 1.65; }
.article-body p { margin: 0 0 14px; }
.article-body ul, .article-body ol { margin: 0 0 16px; padding-left: 22px; }
.article-body li { margin-bottom: 8px; }
body.page .article-body a { color: var(--brand-brown); text-decoration: underline; text-underline-offset: 3px; }
body.page .article-body a:hover { color: var(--brand-brown-hover); }
.article-body strong { font-weight: 600; }
.article-body em { color: var(--text-secondary); }
.article-body code {
  font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 0.9em;
  background: var(--neutral-stone-200); border-radius: 4px; padding: 0.1em 0.35em;
}
.article-body pre {
  background: #fff; border: 1px solid var(--border-default); border-radius: 12px;
  padding: 18px 20px; overflow-x: auto; margin: 0 0 18px;
}
.article-body pre code { background: none; padding: 0; }
.article-body blockquote {
  margin: 18px 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--brand-brown); color: var(--text-secondary);
}
.article-body table { width: 100%; border-collapse: collapse; margin: 8px 0 22px; font-size: 15px; }
.article-body th, .article-body td {
  padding: 10px 12px; border-bottom: 1px solid var(--border-default); text-align: left; vertical-align: top;
}
.article-body th { font-weight: 500; }
.article-body img { height: auto; }
.article-cover { margin: 32px 0 0; }
.article-cover img { display: block; width: 100%; height: auto; border-radius: 16px; }
.article-body p img { display: inline-block; vertical-align: middle; margin: 0 6px 12px 0; }
.article-body li input[type="checkbox"] { margin-right: 8px; accent-color: var(--brand-brown); }
.article-body ul:has(li input[type="checkbox"]) { list-style: none; padding-left: 0; }
.article-more { margin-top: 56px; }
.article-more h2 {
  margin: 0 0 8px; font-family: var(--font-display); font-weight: 400; font-size: clamp(28px, 3vw, 40px);
}

.article-body .mermaid {
  background: #fff; border: 1px solid var(--border-default); border-radius: 12px;
  padding: 20px; margin: 0 0 20px; overflow: hidden; text-align: center;
}
.article-body .mermaid svg { max-width: 100%; width: 100%; height: auto; margin: 0 auto; }
.article-body .mermaid.is-zoomable { cursor: zoom-in; position: relative; }
.article-body .mermaid.is-zoomable:hover,
.article-body .mermaid.is-zoomable:focus-visible { border-color: var(--brand-brown); outline: none; }
.article-body .mermaid.is-zoomable::after {
  content: "⤢"; position: absolute; top: 10px; right: 12px; width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border-default); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center; font-size: 14px; opacity: 0;
}
.article-body .mermaid.is-zoomable:hover::after,
.article-body .mermaid.is-zoomable:focus-visible::after { opacity: 1; }
body.diagram-modal-open { overflow: hidden; }
.diagram-modal-backdrop {
  position: fixed; inset: 0; z-index: 200; background: rgba(26, 26, 26, 0.46);
  opacity: 0; pointer-events: none;
}
.diagram-modal-backdrop.is-open { opacity: 1; pointer-events: auto; }
.diagram-modal {
  position: fixed; inset: 4vh 4vw; z-index: 201; background: #fff; border-radius: 16px;
  display: flex; flex-direction: column; box-shadow: var(--shadow-xl);
  opacity: 0; pointer-events: none; overflow: hidden;
}
.diagram-modal.is-open { opacity: 1; pointer-events: auto; }
.diagram-modal-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  border-bottom: 1px solid var(--border-default); flex: none;
}
.diagram-modal-toolbar button {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-default);
  background: #fff; color: #000; font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-family: inherit; padding: 0;
}
.diagram-modal-toolbar button:hover { border-color: var(--brand-brown); color: var(--brand-brown); }
.diagram-modal-zoom { font: var(--text-body-xs); color: var(--text-secondary); min-width: 48px; text-align: center; }
#diagramModalClose { margin-left: auto; font-size: 22px; }
.diagram-modal-viewport { flex: 1; overflow: auto; padding: 40px; cursor: grab; }
.diagram-modal-stage { display: inline-block; transform-origin: top left; }
.diagram-modal-stage svg { display: block; }

.voly-arch {
  background: #fff; border: 1px solid var(--border-default); border-radius: 12px;
  padding: 36px 28px; margin: 24px 0 32px; text-align: center;
}
.voly-arch > * { margin: 0; }
.voly-arch > * + * { margin-top: 20px; }
.voly-arch-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(22px, 3vw, 28px); }
.voly-arch-sub { color: var(--text-secondary); font-size: 14px; }
.voly-arch-layer {
  max-width: 520px; margin-left: auto; margin-right: auto;
  background: var(--neutral-stone-50); border: 1px solid var(--border-default);
  border-radius: 12px; padding: 16px 20px;
}
.voly-arch-layer--core { background: #fff; border-color: var(--brand-brown); }
.voly-arch-name { font-weight: 500; font-size: 16px; }
.voly-arch-desc { margin-top: 4px; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.voly-arch-arrow { color: var(--neutral-taupe); font-size: 20px; line-height: 1; }
.voly-arch-row { display: flex; gap: 16px; max-width: 720px; margin-left: auto; margin-right: auto; }
.voly-arch-row .voly-arch-layer { flex: 1; max-width: none; margin: 0; }
.voly-arch-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 720px; margin-left: auto; margin-right: auto; }
.voly-arch-card {
  background: var(--neutral-stone-50); border: 1px solid var(--border-default); border-radius: 12px; padding: 20px 14px;
}
.voly-arch-card svg { width: 28px; height: 28px; color: var(--brand-brown); margin-bottom: 10px; }
.voly-arch-card-title { font-weight: 500; font-size: 14px; line-height: 1.3; }
.voly-arch-card-sub { margin-top: 4px; font-size: 12px; color: var(--text-secondary); }

.prod-page { width: min(1040px, calc(100% - 40px)); margin: 0 auto; padding: 132px 0 72px; }
.prod-hero { text-align: center; max-width: 720px; margin: 0 auto; }
.prod-hero .case-tag {
  margin: 12px 0 0; font: var(--text-body-xs); text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--brand-brown);
}
.prod-logo { width: 96px; height: 96px; margin-bottom: 8px; }
.prod-hero h1 {
  margin: 10px 0 0; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(44px, 6vw, 72px); line-height: 0.98; letter-spacing: -0.02em;
}
.prod-lead { margin: 16px auto 0; max-width: 560px; font: var(--text-body-md); color: var(--text-secondary); text-wrap: pretty; }
.prod-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }
.prod-note { margin: 16px 0 0; font: var(--text-body-xs); color: var(--text-muted); }
.prod-section { margin-top: 80px; }
.prod-section h2 {
  margin: 0 0 20px; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15;
}
.prod-text { margin: 0 0 20px; max-width: 680px; font: var(--text-body-md); color: var(--text-secondary); text-wrap: pretty; }
.prod-text a { color: var(--text-primary); text-decoration: underline; text-underline-offset: 3px; }
.prod-text a:hover { text-decoration-thickness: 2px; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.prod-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.prod-card { background: #fff; border: 1px solid var(--border-default); border-radius: 12px; padding: 22px; }
.prod-card h3 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 500; font-size: 18px; }
.prod-card p { margin: 0; font: var(--text-body-sm); color: var(--text-secondary); }
.prod-split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; }
.prod-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.prod-steps li { counter-increment: step; position: relative; padding-left: 52px; margin-bottom: 24px; }
.prod-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border-default); color: var(--brand-brown);
  font-family: var(--font-display); display: grid; place-items: center;
}
.prod-steps strong { display: block; font-weight: 500; margin-bottom: 4px; }
.prod-steps span { color: var(--text-secondary); font: var(--text-body-sm); }
.prod-shot { margin: 0; }
.prod-shot img { display: block; width: 100%; height: auto; border-radius: 12px; }
.prod-shot--narrow img { max-width: 300px; }
.prod-shot--fade img {
  -webkit-mask-image: linear-gradient(#000 78%, transparent);
  mask-image: linear-gradient(#000 78%, transparent);
}
.prod-list { margin: 0; padding-left: 22px; max-width: 720px; }
.prod-list li { margin-bottom: 10px; font: var(--text-body-md); }
.prod-final {
  margin-top: 80px; text-align: center; padding: clamp(32px, 5vw, 56px) 24px;
  background: #fff; border-radius: 12px;
}
.prod-final p { margin: 0 0 20px; font: var(--text-body-md); }
.prod-foot { margin-top: 28px; text-align: center; font: var(--text-body-xs); color: var(--text-muted); }
.prod-foot a { color: var(--brand-brown); }

@media (max-width: 800px) {
  .prod-grid--two { grid-template-columns: 1fr; }
  .prod-split, .voly-arch-row, .voly-arch-cards { grid-template-columns: 1fr; display: flex; flex-direction: column; }
  .voly-arch { padding: 24px 16px; }
  .diagram-modal { inset: 2vh 2vw; }
  .diagram-modal-viewport { padding: 20px; }
}

/* Interface controls use DM Sans, not the reading face. */
.chip, .tabs button, .filters button, .search input, .field input, .field select, .field textarea, .field label,
.diagram-modal-toolbar button { font-family: var(--font-ui); }

/* Resume certificates: nested course list and a thumbnail grid that opens the full image. */
.resume-sheet .resume-sublist { margin: 6px 0 0; }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 18px; }
.cert { display: block; border: 1px solid var(--border-default); border-radius: 8px; overflow: hidden; background: #fff; transition: border-color .2s var(--ease-standard); }
.cert:hover { border-color: var(--brand-brown); }
.cert img { display: block; width: 100%; height: auto; }
@media print { .cert-grid { display: none; } }
.resume-sheet .resume-subhead { margin: 24px 0 0; }
.cert-grid { align-items: start; }

/* Certificate lightbox. */
.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: transparent; color: #fff;
}
.lightbox::backdrop { background: rgba(10, 10, 10, 0.86); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox-figure { margin: 0; max-width: min(1100px, calc(100vw - 140px)); pointer-events: none; text-align: center; }
.lightbox-figure img { display: block; max-width: 100%; max-height: calc(100vh - 120px); margin: 0 auto; border-radius: 6px; background: #fff; pointer-events: auto; }
.lightbox-figure figcaption { margin-top: 12px; font: var(--text-body-xs); color: rgba(255, 255, 255, 0.8); }
.lightbox-btn {
  position: absolute; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 999px; background: rgba(0, 0, 0, 0.35);
  color: #fff; font: 400 26px/1 var(--font-system); cursor: pointer;
}
.lightbox-btn:hover { border-color: #fff; }
.lightbox-btn[hidden] { display: none; }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .lightbox-figure { max-width: calc(100vw - 24px); }
  .lightbox-prev, .lightbox-next { top: auto; bottom: 20px; transform: none; }
}
@media print { .lightbox { display: none !important; } }
/* Equal tiles: landscape certificates and portrait documents fit inside without stretching the row. */
.cert { aspect-ratio: 4 / 3; }
.cert-grid-portrait .cert { aspect-ratio: 1 / 1.414; }
.cert img { height: 100%; object-fit: contain; }

/* Mega navigation */
.mega-menu { position:static; }
.mega-menu > summary { display:flex; align-items:center; gap:8px; min-height:44px; padding:8px 0; cursor:pointer; list-style:none; font:400 clamp(14px,1.2vw,17px)/1.3 var(--font-ui); }
.mega-menu > summary::-webkit-details-marker { display:none; }
.mega-menu > summary::marker { content:""; }
.mega-menu > summary svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.5; transition:transform .18s ease; }
.mega-menu[open] > summary { color:var(--brand-brown); }
.mega-menu[open] > summary svg { transform:rotate(180deg); }
.mega-menu > summary:focus-visible { outline:2px solid var(--brand-brown); outline-offset:5px; border-radius:4px; }
.site-header.has-mega { background:var(--neutral-stone-50); }
.mega-panel { position:absolute; top:calc(100% - 6px); left:var(--pad); right:var(--pad); max-width:1240px; margin:0 auto; display:grid; grid-template-columns:1fr 1.15fr 1.15fr; gap:28px; padding:32px; border:1px solid var(--border-default); border-radius:20px; background:var(--neutral-stone-50); box-shadow:0 24px 60px #23272a18; max-height:calc(100dvh - 120px); overflow-y:auto; }
.mega-intro { padding:16px 12px 8px 0; }
.mega-eyebrow { display:block; font:400 11px/1.5 var(--font-ui); letter-spacing:.12em; text-transform:uppercase; color:var(--neutral-taupe); }
.mega-intro h2 { font:400 clamp(26px,2.2vw,34px)/1.2 var(--font-display); margin:20px 0 16px; letter-spacing:-.025em; }
.mega-intro p { max-width:260px; font:400 16px/1.55 var(--font-body); color:var(--text-secondary); margin:0 0 28px; }
.nav a.mega-text-link { display:inline-flex; align-items:center; gap:24px; color:var(--brand-brown); font:500 14px/1.4 var(--font-ui); white-space:normal; }
.mega-link-list { display:flex; flex-direction:column; justify-content:center; }
.mega-link-list > a { display:flex; align-items:center; gap:14px; padding:20px 10px; border-bottom:1px solid var(--border-default); white-space:normal; }
.mega-link-list > a:last-child { border-bottom:0; }
.mega-link-number { font:12px var(--font-ui); color:var(--neutral-taupe); align-self:flex-start; padding-top:4px; }
.mega-link-list strong { display:block; font:400 23px/1.2 var(--font-display); margin-bottom:6px; }
.mega-link-list small { display:block; font:13px/1.4 var(--font-ui); color:var(--text-secondary); }
.mega-arrow { margin-left:auto; font-size:20px; color:var(--brand-brown); }
.nav a.mega-feature { display:flex; flex-direction:column; align-items:stretch; padding:24px; border:1px solid transparent; border-radius:14px; background:var(--neutral-stone-200); white-space:normal; text-decoration:none; min-width:0; transition:transform .18s ease,border-color .18s ease; }
.nav a.mega-feature:hover { transform:translateY(-3px); border-color:var(--neutral-taupe); color:inherit; }
.mega-feature h3 { margin:20px 0 10px; font:400 27px/1.2 var(--font-display); letter-spacing:-.02em; }
.mega-feature p { margin:0 0 24px; font:14px/1.5 var(--font-ui); color:var(--text-secondary); }
.mega-feature-icon { display:block; width:70px; height:70px; margin:26px 0 0; fill:none; stroke:var(--brand-brown); stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.mega-feature-cta { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:auto; padding-top:14px; border-top:1px solid #86736530; font:500 13px/1.4 var(--font-ui); color:var(--brand-brown); }
.nav a.mega-feature-dark { background:var(--brand-charcoal); color:var(--neutral-stone-50); }
.nav a.mega-feature-dark:hover { color:var(--neutral-stone-50); }
.mega-feature-dark .mega-eyebrow,.mega-feature-dark p { color:#faf7f4a6; }
.mega-feature-dark .mega-feature-cta { color:var(--neutral-stone-50); border-color:#faf7f430; }
.mega-feature-dark .mega-feature-icon { stroke:var(--accent-gold); }
.nav a.mega-feature-check { background:#eee4da; }
.nav a.mega-feature-report { background:#f0ece6; }
.mega-report-visual { display:block; height:95px; margin:20px 0 0; overflow:hidden; border-bottom:1px solid var(--border-default); }
.mega-report-visual img { display:block; width:102px; height:auto; margin:8px auto 0; border-radius:3px; transform:rotate(-7deg); box-shadow:0 4px 16px #23272a20; }
.mega-panel-bottom { grid-column:1/-1; display:flex; align-items:center; justify-content:space-between; gap:24px; border-top:1px solid var(--border-default); padding:20px 0 0; font:13px/1.5 var(--font-ui); color:var(--text-secondary); }
.mega-panel-bottom a { font-size:13px; color:var(--brand-brown); }
.mega-backdrop { position:fixed; inset:96px 0 0; z-index:45; background:#23272a33; backdrop-filter:blur(3px); -webkit-backdrop-filter:blur(3px); }
.mega-backdrop[hidden] { display:none; }
@media(max-width:1099px) and (min-width:900px) { .mega-panel { gap:20px; padding:24px; } .mega-feature h3 { font-size:23px; } .nav a.mega-feature { padding:20px; } .mega-intro h2 { font-size:27px; } }
@media(max-width:899px) {
 .mega-menu { width:100%; border-bottom:1px solid var(--border-default); }
 .mega-menu > summary { justify-content:space-between; min-height:64px; padding:16px 0; font:400 25px/1.3 var(--font-display); }
 .mega-menu > summary svg { width:20px; height:20px; }
 .mega-panel { position:static; display:grid; grid-template-columns:1fr; gap:16px; margin:0 0 20px; padding:0; border:0; border-radius:0; box-shadow:none; max-height:none; overflow:visible; }
 .mega-intro { padding:12px 0; }
 .mega-intro h2 { font-size:28px; margin:12px 0; }
 .mega-intro p { max-width:none; margin-bottom:16px; }
 .nav a.mega-text-link { min-height:36px; border:0; font:500 14px var(--font-ui); }
 .mega-link-list > a { padding:16px 0; min-height:0; }
 .mega-link-list strong { font-size:23px; }
 .nav a.mega-feature { min-height:0; padding:22px; border:1px solid transparent; }
 .mega-feature h3 { font-size:28px; }
 .mega-feature-icon { width:56px; height:56px; margin-top:20px; }
 .mega-panel-bottom { display:block; padding:16px 0 0; }
 .mega-panel-bottom > span { display:block; }
 .mega-panel-bottom a { border:0; font:500 14px var(--font-ui); min-height:44px; }
 .mega-backdrop { display:none!important; }
}
@media(prefers-reduced-motion:reduce) { .mega-menu > summary svg,.nav a.mega-feature { transition:none; } .nav a.mega-feature:hover { transform:none; } }

/* Explicit links between portfolio projects and publications. */
.project-materials { border-top: 1px solid var(--border-default); padding-top: 12px; font: var(--text-body-xs); min-width: 0; }
.cat-row > .project-materials { grid-column: 2 / -1; margin-top: -10px; }
.project-materials summary { cursor: pointer; color: var(--brand-brown); }
.project-materials summary > span { margin-left: 6px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.project-materials ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.project-materials a { display: block; line-height: 1.5; overflow-wrap: anywhere; }
.project-materials a:hover { color: var(--brand-brown); }
.project-materials small { display: block; color: var(--text-muted); margin-top: 3px; }
.article-projects { margin: 48px 0; padding: 24px; background: var(--neutral-stone-50); border: 1px solid var(--border-default); }
.article-projects h2 { font-family: var(--font-display); font-size: 24px; font-weight: 400; margin: 0 0 16px; }
.article-projects > a { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 0; border-top: 1px solid var(--border-default); }
.article-projects strong { font-family: var(--font-display); font-size: 21px; font-weight: 400; }
.article-projects small { display: block; color: var(--text-secondary); font: var(--text-body-sm); margin-top: 5px; }
.article-projects > a:hover strong { color: var(--brand-brown); }
@media (max-width: 700px) { .cat-row > .project-materials { grid-column: 1 / -1; margin-top: 0; } .article-projects { padding: 20px; } }

.article-shot { margin: 28px 0; }
.article-shot a { display: block; cursor: zoom-in; border-radius: 12px; }
.article-shot img { display: block; width: 100%; height: auto; border-radius: 12px; }
.article-shot a:focus-visible { outline: 2px solid var(--brand-brown); outline-offset: 4px; }
.article-shot figcaption { margin-top: 10px; color: var(--text-secondary); font: var(--text-body-xs); line-height: 1.5; }

.article-shot--phone { max-width: 360px; margin-left: auto; margin-right: auto; }
