:root {
  color-scheme: light;
  --bg: #f3f0e7;
  --bg-raised: #faf8f3;
  --bg-band: #e9ddcf;
  --ink: #1c1d17;
  --muted: #5c5952;
  --line: rgb(28 29 23 / 14%);
  --accent: #9a3f12;
  --header-h: 4.5rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 5rem;
  --font-sans: "Manrope", sans-serif;
  --font-display: "Onest", "Manrope", sans-serif;
  --font-serif: "Source Serif 4", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141512;
  --bg-raised: #1c1e19;
  --bg-band: #241c16;
  --ink: #ece7dc;
  --muted: #b1ab9f;
  --line: rgb(236 231 220 / 16%);
  --accent: #e39a62;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.02rem;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:hover { color: var(--accent); }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip {
  position: absolute; left: 0.75rem; top: 0.75rem; z-index: 80;
  transform: translateY(-150%); background: var(--ink); color: var(--bg); padding: 0.4rem 0.7rem;
}
.skip:focus { transform: none; }

.wrap { width: min(68rem, calc(100% - 2.5rem)); margin-inline: auto; }
.kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
h1, h2, h3 { font-family: var(--font-serif); font-weight: 500; letter-spacing: -0.03em; }
h1 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.03em;
  font-size: clamp(2.15rem, 4.2vw, 3.25rem);
  line-height: 1.15;
  margin: var(--space-3) 0 0;
  max-width: 18em;
}
h2 { font-family: var(--font-display); font-size: clamp(1.55rem, 2.5vw, 2.05rem); line-height: 1.22; margin: 0 0 var(--space-4); max-width: 20em; }
h3 { font-family: var(--font-sans); font-size: 1.05rem; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 var(--space-2); }
p { margin: var(--space-4) 0 0; }
.kicker + h1,
.kicker + h2 { margin-top: var(--space-4); }
.wrap > h2,
.prose h2 { margin-top: var(--space-7); }
.lead { font-size: 1.12rem; line-height: 1.6; color: var(--muted); max-width: 42rem; margin-top: var(--space-4); }
.prose > p,
.section .wrap > p,
.page-top .wrap > p { max-width: 65ch; }
.subtitle {
  margin-top: 0.85rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.note { margin-top: 0.9rem; color: var(--muted); font-size: 0.92rem; max-width: 46rem; }
.muted { color: var(--muted); }

.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-bar { height: 100%; display: flex; align-items: center; justify-content: flex-start; gap: 1.5rem; }
.brand { flex: 0 0 auto; }
.brand img { width: 2.4rem; height: 2.4rem; border-radius: 50%; object-fit: cover; }
.desk-nav, .header-tools, .langs, .actions, .footer-contact, .related-links { display: flex; align-items: center; gap: 0.45rem; }
.desk-nav { gap: 1.15rem; flex: 0 0 auto; margin-left: auto; white-space: nowrap; }
.header-tools { flex: 0 0 auto; margin-left: 1rem; }
.desk-nav a, .site-footer a { text-decoration: none; }
.desk-nav a { color: var(--muted); font-size: 0.92rem; }
.desk-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35rem;
}

.btn, .langs a, .menu-toggle, .theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; color: var(--ink); background: transparent;
  border: 1px solid var(--line); min-height: 2.35rem; padding: 0.35rem 0.75rem;
  text-decoration: none; cursor: pointer;
}
.btn:hover, .langs a:hover { border-color: var(--ink); color: var(--ink); }
.btn-solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-solid:hover { opacity: 0.88; color: var(--bg); }
.langs a { min-height: 2.35rem; display: inline-flex; align-items: center; padding-inline: 0.55rem; font-size: 0.75rem; letter-spacing: 0.06em; }
.langs a[aria-current="true"] { border-color: var(--ink); background: var(--bg-raised); }

.hero { padding: var(--space-7) 0 var(--space-6); }
.hero-grid, .split { display: grid; gap: var(--space-6); }
.hero-card {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: var(--space-5);
  align-items: start;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  padding: var(--space-5);
}
.hero-card-facts {
  grid-template-columns: 1fr;
  gap: 0;
  padding: var(--space-4) var(--space-5);
}
.hero-fact {
  display: grid;
  grid-template-columns: 6.75rem minmax(0, 1fr);
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4) 0;
  border-top: 1px solid var(--line);
}
.hero-fact:first-child { border-top: 0; }
.hero-fact p { margin: 0; line-height: 1.45; }
.hero-fact-media {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 3.25rem;
}
.hero-fact-logos { gap: 0.85rem; flex-wrap: wrap; }
.hero-portrait {
  width: 4.75rem;
  height: 4.75rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
}
.hero-card:not(.hero-card-facts) .hero-portrait {
  width: 6.5rem;
  height: 6.5rem;
}
.hero-fact-logos img {
  width: auto;
  height: 2rem;
  max-width: 2.75rem;
  object-fit: contain;
  display: block;
}
.hero-card ul, .plain { margin: 0; padding: 0; list-style: none; }
.hero-card li, .plain li { padding: var(--space-3) 0; border-top: 1px solid var(--line); }
.hero-card li:first-child, .plain li:first-child { border-top: 0; padding-top: 0; }
.actions { margin-top: var(--space-6); flex-wrap: wrap; gap: var(--space-3); }
.cookie-bar .actions { margin-top: 0; }

.section { padding: var(--space-8) 0; border-top: 1px solid var(--line); }
main > :nth-child(odd) { background: var(--bg-band); }
main > :nth-child(even) { background: var(--bg); }
main > :nth-child(odd) .card,
main > :nth-child(odd) .hero-card { background: var(--bg-raised); }
.page-top { border-top: 0; padding-top: var(--space-7); }
.cards { display: grid; gap: var(--space-4); margin-top: var(--space-6); }
.card {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--line); background: var(--bg-raised); padding: 1.25rem 1.35rem 1.4rem;
}
.card p, .card-static p { color: var(--muted); }
.card:hover { border-color: var(--ink); color: inherit; }
.metrics, .stack-list { display: grid; gap: var(--space-5); margin: var(--space-6) 0 0; }
.stack-cols {
  display: grid;
  gap: var(--space-5);
  margin: var(--space-6) 0 0;
}
.stack-cols .stack-list { margin: 0; }
.metrics > div, .stack-list > div { border-top: 1px solid var(--line); padding-top: var(--space-4); }
.metrics dt, .stack-list dt, .project-meta dt { color: var(--muted); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.stack-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
}
.stack-logos li {
  position: relative;
  padding: 0;
  border: 0;
  cursor: default;
}
.stack-logos img {
  width: 1.85rem;
  height: 1.85rem;
  display: block;
  object-fit: contain;
}
.stack-logos li[data-label]::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.45rem);
  transform: translateX(-50%) translateY(0.15rem);
  padding: 0.28rem 0.5rem;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--ink);
  font-size: 0.72rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
  z-index: 5;
}
.stack-logos li[data-label]:hover::after,
.stack-logos li[data-label]:focus-within::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
html[data-theme="dark"] .stack-logos img[alt="GitHub"],
html[data-theme="dark"] .stack-logos img[alt="Cursor"],
html[data-theme="dark"] .stack-logos img[alt="TikTok"] { filter: invert(1); }
.metric { font-family: var(--font-display); font-size: 2rem; line-height: 1.1; margin: 0.2rem 0; letter-spacing: -0.03em; }
.steps, .timeline { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.steps li {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-5) 0;
  border-top: 1px solid var(--line);
}
.timeline li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
  padding: var(--space-5) 0;
  border-top: 1px solid var(--line);
}
.timeline li > * { min-width: 0; }
.timeline li .kicker { letter-spacing: 0.06em; }
.steps span { font-family: var(--font-mono); color: var(--accent); font-size: 0.82rem; padding-top: 0.15rem; }
.fit { display: grid; gap: var(--space-4); margin: var(--space-6) 0 0; padding: 0; list-style: none; }
.fit li { border-left: 2px solid var(--accent); padding: 0.2rem 0 0.2rem var(--space-4); }
.faq { padding: var(--space-5) 0; border-top: 1px solid var(--line); }
.stack { display: grid; gap: 0; }
.stack > article { padding: var(--space-5) 0; border-top: 1px solid var(--line); }
.stack > article:first-child { border-top: 0; padding-top: 0; }
.faq p { color: var(--muted); }
.faq-cta { margin-top: var(--space-4); }
.faq-cta .btn { color: var(--bg); }
.prose h2 { margin-top: 1.45rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: 0.4rem; color: var(--muted); font-size: 0.85rem; margin-bottom: var(--space-5); }
.crumbs a { color: var(--muted); }
.project { padding: var(--space-6) 0; border-top: 1px solid var(--line); }
.project-list { margin-top: var(--space-6); }
.project-meta { display: grid; gap: 0.7rem; margin: 0.8rem 0 0; }
.project-meta dd { margin: 0.2rem 0 0; }
.related { margin-top: var(--space-8); }
.related h2 { margin-top: 0; }
.related-links { flex-wrap: wrap; gap: var(--space-4) var(--space-5); margin-top: var(--space-4); }
.related-links a { text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 0.1rem; }
.cta-band { padding: var(--space-2) 0; }
.cta-band .btn { margin-top: 2.5rem; }
.form { display: grid; gap: var(--space-5); align-content: start; }
.form label { display: grid; gap: 0.3rem; font-size: 0.92rem; }
.field {
  width: 100%; min-height: 2.7rem; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--ink); padding: 0.55rem 0; font: inherit; border-radius: 0;
}
textarea.field { min-height: 7.5rem; resize: vertical; }
.field:focus { outline: none; border-bottom-color: var(--ink); }
.check { grid-template-columns: auto 1fr; align-items: start; }
.form-note { margin: 0; padding: 0.7rem 0.8rem; background: var(--bg-raised); border: 1px solid var(--line); }
.form-bad { box-shadow: inset 3px 0 0 var(--accent); }
.form-ok { box-shadow: inset 3px 0 0 #1e6a45; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.site-footer {
  --ink: #f4f0e8;
  --muted: #d2cbc0;
  --line: rgb(244 240 232 / 18%);
  --bg: #3c3833;
  border-top: 0;
  background: #3c3833;
  color: var(--ink);
  padding: var(--space-8) 0 var(--space-5);
}
html[data-theme="dark"] .site-footer { background: #34322d; --bg: #34322d; }
.site-footer .btn-solid { background: #f4f0e8; color: #3c3833; border-color: #f4f0e8; }
.site-footer .btn-solid:hover { color: #3c3833; opacity: 0.92; }
.footer-grid { display: grid; gap: var(--space-7); }
.footer-mark { display: inline-flex; align-items: flex-start; gap: 0.75rem; text-decoration: none; }
.footer-mark .kicker { line-height: 1.15; }
.footer-mark img { width: 2.5rem; height: 2.5rem; border-radius: 50%; object-fit: cover; object-position: center 18%; }
.footer-role {
  margin: var(--space-4) 0 0;
  max-width: 16em;
  font-family: var(--font-serif);
  font-size: 1.45rem;
  line-height: 1.25;
}
.footer-brand .muted { max-width: 28ch; }
.footer-brand .btn { margin-top: 2.5rem; margin-bottom: 0.5rem; }
.footer-col { display: grid; align-content: start; gap: 0.65rem; }
.footer-col .kicker { margin-bottom: 0.35rem; line-height: 1.15; }
.footer-col a { text-decoration: none; overflow-wrap: anywhere; }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}
.footer-base p { margin: 0; }
.footer-base a { color: var(--muted); text-decoration: none; }

.mobile-nav[hidden] { display: none !important; }
.mobile-nav {
  position: fixed; inset: 0; z-index: 50; background: var(--bg);
  display: flex; flex-direction: column; padding: 5rem 1.5rem 2rem; gap: 0;
}
.mobile-nav a { font-family: var(--font-serif); font-size: 1.85rem; text-decoration: none; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.menu-close { position: absolute; top: 0.75rem; right: 1rem; }
.menu-toggle { display: inline-flex; }
body.menu-open { overflow: hidden; }

@media (min-width: 800px) {
  .wrap { width: min(68rem, calc(100% - 4rem)); }
  .section { padding: var(--space-9) 0; }
  .page-top { padding-top: var(--space-8); }
  .hero { padding: var(--space-8) 0 var(--space-7); }
  .hero-grid { grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.72fr); gap: var(--space-7); align-items: start; }
  .split { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--space-7); align-items: start; }
  .about-intro { grid-template-columns: minmax(0, 1.45fr) minmax(16rem, 0.7fr); }
  .cards, .cards-tight { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-5); }
  .metrics { grid-template-columns: 1fr 1fr; gap: var(--space-6) var(--space-7); }
  .stack-cols {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6) var(--space-7);
    align-items: start;
  }
  .project-meta { grid-template-columns: 1fr 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-7) var(--space-6); align-items: start; }
  .timeline li {
    grid-template-columns: 14rem minmax(0, 1fr);
    column-gap: var(--space-6);
    row-gap: var(--space-2);
  }
  .timeline li > .kicker { grid-column: 1; grid-row: 1 / span 2; }
  .timeline li > h3,
  .timeline li > p:not(.kicker) { grid-column: 2; }
}

@media (min-width: 1100px) {
  .menu-toggle { display: none; }
  .footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: clamp(2.75rem, 4vw, 4.5rem);
  }
  .footer-brand,
  .footer-col { flex: 0 1 auto; min-width: 0; }
}
@media (max-width: 1099px) {
  .desk-nav { display: none; }
  .header-tools { margin-left: auto; }
}

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

@media print {
  .site-header, .site-footer, .actions, .btn, .mobile-nav, .cookie-banner, .to-top { display: none !important; }
  body { background: white; color: black; }
  a { text-decoration: none; }
}

.media-block { margin-top: 1.6rem; }
.canva-item { margin-top: 1rem; }
.canva-frame {
  position: relative;
  width: 100%;
  height: 0;
  margin-top: 0.55rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-raised);
}
.canva-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.reel-strip, .post-grid, .strava-host {
  display: grid;
  gap: 0.8rem;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}
.post-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.strava-links { margin-bottom: 0.8rem; }
html[data-embeds="granted"] .embed-note { display: none; }
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  border-top: 1px solid var(--line);
  background: var(--bg-raised);
  padding: 0.8rem 0;
}
.cookie-banner[hidden] { display: none !important; }
.to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 46;
  min-height: 2.5rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.to-top.is-visible { opacity: 1; visibility: visible; pointer-events: auto; }
.to-top:hover { border-color: var(--ink); color: var(--ink); }
body:has(#cookie-banner:not([hidden])) .to-top { bottom: 7.5rem; }
.cookie-bar { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: end; justify-content: space-between; }

@media (min-width: 800px) {
  .post-grid, .strava-host { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .reel-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 799px) {
  .reel-strip { display: flex; overflow-x: auto; }
  .reel-strip li { flex: 0 0 min(14rem, 72vw); }
  .wrap { width: min(68rem, calc(100% - 2rem)); }
  .hero-fact {
    grid-template-columns: 5.25rem minmax(0, 1fr);
    gap: var(--space-3);
  }
  .hero-portrait { width: 4rem; height: 4rem; }
  .hero-fact-logos img {
    height: 1.7rem;
    max-width: 2.35rem;
  }
  .langs a { padding-inline: 0.4rem; min-height: 2.2rem; }
  .header-bar { gap: 0.75rem; }
}
@media (max-width: 360px) {
  .hero-fact {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    align-items: start;
  }
  .hero-fact-media { min-height: 0; }
  .brand img { width: 2.1rem; height: 2.1rem; }
}
