/* Self-hosted fonts ------------------------------------------------------- */
/* Jost — display typeface (indestructible type*, SIL OFL) */
@font-face { font-family: 'Jost'; font-style: normal; font-weight: 400; font-display: optional; src: url('/fonts/jost-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Jost'; font-style: normal; font-weight: 400; font-display: optional; src: url('/fonts/jost-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Jost'; font-style: normal; font-weight: 400; font-display: optional; src: url('/fonts/jost-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Jost'; font-style: normal; font-weight: 500; font-display: optional; src: url('/fonts/jost-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Jost'; font-style: normal; font-weight: 500; font-display: optional; src: url('/fonts/jost-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Jost'; font-style: normal; font-weight: 500; font-display: optional; src: url('/fonts/jost-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Jost'; font-style: normal; font-weight: 600; font-display: optional; src: url('/fonts/jost-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Jost'; font-style: normal; font-weight: 600; font-display: optional; src: url('/fonts/jost-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Jost'; font-style: normal; font-weight: 600; font-display: optional; src: url('/fonts/jost-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Karla — body typeface (Jonny Pinhorn, SIL OFL) */
@font-face { font-family: 'Karla'; font-style: italic; font-weight: 400; font-display: optional; src: url('/fonts/karla-italic-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Karla'; font-style: italic; font-weight: 400; font-display: optional; src: url('/fonts/karla-italic-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Karla'; font-style: normal; font-weight: 400; font-display: optional; src: url('/fonts/karla-normal-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Karla'; font-style: normal; font-weight: 400; font-display: optional; src: url('/fonts/karla-normal-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Karla'; font-style: normal; font-weight: 500; font-display: optional; src: url('/fonts/karla-normal-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Karla'; font-style: normal; font-weight: 500; font-display: optional; src: url('/fonts/karla-normal-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Karla'; font-style: normal; font-weight: 700; font-display: optional; src: url('/fonts/karla-normal-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Karla'; font-style: normal; font-weight: 700; font-display: optional; src: url('/fonts/karla-normal-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Design tokens ---------------------------------------------------------- */
:root {
  --oat: #efe9df;
  --linen: #f7f3ec;
  --walnut: #5b3a24;
  --walnut-dark: #3b2517;
  --moss: #5f6b45;
  --brass: #b08a3e;
  --ink: #2a221c;
  --muted: #6e6258;
  --rule: #d9cfc0;
  --display: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  --body: "Karla", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
html[data-theme="dark"] {
  --oat: #1a1814;
  --linen: #242018;
  --walnut: #c4b07a;
  --walnut-dark: #d4c08a;
  --moss: #8aaec4;
  --brass: #c4a050;
  --ink: #ece7dd;
  --muted: #b0a8a0;
  --rule: #302820;
  color-scheme: dark;
}
html[data-theme="dark"] body {
  background-image:
    repeating-linear-gradient(0deg, rgba(196,176,122,.03) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(90deg, rgba(196,176,122,.025) 0 2px, transparent 2px 6px);
}
/* Foundation ------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--oat);
  background-image:
    repeating-linear-gradient(0deg, rgba(91,58,36,.035) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(90deg, rgba(91,58,36,.03) 0 2px, transparent 2px 6px);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--walnut); text-decoration-color: var(--brass); text-underline-offset: 3px; }
a:hover { color: var(--moss); }
a:focus-visible { outline: 2px solid var(--walnut); outline-offset: 3px; border-radius: 2px; }
/* Shared site shell ------------------------------------------------------ */
.skip { position: absolute; left: 16px; top: -60px; z-index: 10; padding: 10px 16px; background: var(--walnut); color: var(--linen); border-radius: 4px; font: 500 1rem var(--display); text-decoration: none; }
.skip:focus { top: 12px; }
.skip:focus-visible { outline-color: var(--walnut-dark); }
main:focus { outline: none; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 24px; }
:root { --header-h: 88px; }
@media (max-width: 620px) { :root { --header-h: 170px; } }
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: var(--oat); border-bottom: 1px solid var(--rule); }
body > .wrap { padding-top: var(--header-h); }
#main { scroll-margin-top: var(--header-h); }
@media print { .site-header { position: static; } }
header.top { display: flex; justify-content: space-between; align-items: center; padding: 28px 0; gap: 18px; flex-wrap: wrap; }
.mark { margin: 0; font: 600 1.35rem var(--display); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.mark a { color: var(--walnut-dark); text-decoration: none; }
nav { display: flex; gap: 18px; flex-wrap: wrap; }
nav a { font: 500 .95rem var(--display); color: var(--muted); text-decoration: none; letter-spacing: .04em; border-bottom: 2px solid transparent; padding-bottom: 1px; }
nav a:hover { color: var(--walnut); }
nav a[aria-current="page"] { color: var(--walnut); border-bottom-color: var(--walnut); }
footer { padding: 36px 0 44px; border-top: 1px solid var(--rule); color: var(--muted); font-size: .9rem; display: flex; flex-direction: column; gap: 16px; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.footer-meta { padding-top: 16px; border-top: 1px dashed var(--rule); }
.social-links { display: flex; gap: 14px; align-items: center; }
.social-links a { color: var(--muted); display: flex; transition: color .15s; }
.social-links a:hover { color: var(--ink); }
.back-to-top { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font: 500 .85rem var(--display); letter-spacing: .06em; text-transform: uppercase; }
.back-to-top:hover { color: var(--walnut); }
.back-to-top svg { transition: transform .15s; }
.back-to-top:hover svg { transform: translateY(-2px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media print { .back-to-top { display: none; } }

/* Homepage --------------------------------------------------------------- */
.hero { padding: 48px 0 40px; border-bottom: 6px solid var(--walnut); }
.hero h1 { font: 500 clamp(2.6rem, 6vw, 4rem)/1.02 var(--display); letter-spacing: -.01em; margin: 0 0 18px; color: var(--walnut-dark); text-wrap: balance; }
.hero p.lede { margin: 0; max-width: 52ch; color: var(--ink); font-size: 1.12rem; }
.cv { display: inline-flex; align-items: center; gap: 10px; margin-top: 26px; padding: 12px 22px; background: var(--walnut); color: var(--linen); border-radius: 4px; text-decoration: none; font: 500 1rem var(--display); letter-spacing: .04em; box-shadow: inset 0 -3px 0 var(--brass); }
.cv:hover { background: var(--walnut-dark); color: var(--linen); }
.cv small { font: 400 .85rem var(--body); opacity: .75; }
.home section { padding: 64px 0 8px; }
.home h2 { font: 500 .85rem var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--moss); margin: 0 0 24px; display: flex; align-items: center; gap: 14px; }
.home h2::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.about p { max-width: 62ch; margin: 0 0 14px; }
.job { background: var(--linen); border: 1px solid var(--rule); border-left: 6px solid var(--walnut); border-radius: 4px; padding: 26px 28px; }
.job-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.job-head h3 { font: 600 1.35rem var(--display); margin: 0; color: var(--walnut-dark); }
.dates { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .95rem; white-space: nowrap; }
.ladder { list-style: none; padding: 0; margin: 16px 0 18px; display: grid; gap: 6px; }
.ladder li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.ladder li span:first-child { display: flex; align-items: center; gap: 10px; }
.ladder li span:first-child::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--rule); flex: none; }
.ladder li.now span:first-child { font-weight: 700; }
.ladder li.now span:first-child::before { background: var(--brass); }
.job ul.pts { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.job ul.pts li::marker { color: var(--brass); }
.earlier { margin: 28px 0 0; padding: 0; list-style: none; display: grid; }
.earlier li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.earlier li:first-child { border-top: 1px solid var(--rule); }
.earlier b { font-weight: 700; }
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.skill { background: var(--linen); border: 1px solid var(--rule); border-radius: 4px; padding: 18px 20px; }
.skill h3 { font: 600 1rem var(--display); margin: 0 0 6px; color: var(--walnut-dark); letter-spacing: .02em; }
.skill p { margin: 0; color: var(--muted); font-size: .98rem; }
.edu { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.edu h3 { font: 600 1.15rem var(--display); margin: 0; color: var(--walnut-dark); }
.contact { margin: 72px 0 0; background: var(--moss); color: var(--linen); border-radius: 6px; padding: 40px 36px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.contact h2 { color: #efe8d6; margin-bottom: 10px; }
.contact h2::after { background: rgba(247,243,236,.25); }
.contact p { margin: 0; font-size: 1.15rem; max-width: 40ch; }
.contact .links { display: grid; gap: 10px; }
.contact a { color: var(--linen); text-decoration-color: var(--brass); font: 500 1.05rem var(--display); }
.contact a:hover { color: #efe8d6; }
.contact a:focus-visible { outline-color: var(--linen); }
.contact .qr { display: grid; grid-template-columns: 88px minmax(0, 10ch); gap: 12px; align-items: center; margin-top: 8px; text-decoration: none; font-size: .9rem; line-height: 1.25; }
.contact .qr img { width: 88px; height: 88px; border-radius: 4px; }

/* Interior content pages ------------------------------------------------- */
.interior .wrap { max-width: 800px; }
.interior main { padding: 56px 0 72px; }
.interior h1 { margin: 0 0 20px; color: var(--walnut-dark); font: 500 clamp(2.5rem, 7vw, 4rem)/1.05 var(--display); }
.interior h2 { margin: 42px 0 12px; color: var(--moss); font: 500 1.05rem var(--display); letter-spacing: .12em; text-transform: uppercase; }
.interior p { max-width: 67ch; margin: 0 0 18px; }
.interior .lede { color: var(--muted); font-size: 1.2rem; }
/* In Markdown pages, a > blockquote is drawn as a card. */
.interior main blockquote { margin: 28px 0; padding: 24px; background: var(--linen); border: 1px solid var(--rule); border-left: 6px solid var(--walnut); border-radius: 4px; }
.interior main blockquote > :first-child { margin-top: 0; }
.interior main blockquote > :last-child { margin-bottom: 0; }
.interior .page-note { margin-top: 48px; font-size: .9rem; color: var(--muted); }

/* Error page ------------------------------------------------------------- */
.not-found main { padding: 72px 0 24px; }
.not-found h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: 16px; }
.not-found p { margin-bottom: 12px; color: var(--muted); }
.hamsters { margin: 28px 0 8px; }
.hamster { margin: 0; padding: 28px 24px 22px; background: var(--linen); border: 1px solid var(--rule); border-left: 6px solid var(--walnut); border-radius: 4px; display: flex; align-items: center; gap: 28px; }
.hamster[hidden] { display: none; }
.hamster svg { flex: none; width: 200px; height: auto; }
.hamster figcaption { color: var(--ink); font-size: 1.1rem; max-width: 34ch; }
.hamster figcaption b { display: block; font: 500 1.35rem var(--display); color: var(--walnut-dark); margin-bottom: 4px; }
.not-found-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 22px; }
.not-found-actions .cv { margin-top: 0; }
.next-hamster { background: none; border: 1px solid var(--walnut); color: var(--walnut); border-radius: 4px; padding: 11px 20px; font: 500 1rem var(--display); letter-spacing: .04em; cursor: pointer; }
.next-hamster[hidden] { display: none; }
.next-hamster:hover { background: var(--walnut); color: var(--linen); }
.next-hamster:focus-visible { outline: 2px solid var(--walnut); outline-offset: 3px; }
@media (max-width: 620px) { .hamster { flex-direction: column; text-align: center; gap: 12px; } .hamster svg { width: 180px; } }

/* Responsive and print --------------------------------------------------- */
@media (max-width: 620px) { header.top { align-items: flex-start; flex-direction: column; } nav { gap: 12px; } }
@media (max-width: 720px) {
  .hero { padding: 24px 0 32px; }
  .skills { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; padding: 30px 24px; }
  .contact .qr { display: none; }
  .job { padding: 22px 20px; }
  .home section { padding-top: 52px; }
}
@media (max-width: 620px) { .interior main { padding-top: 40px; } }
@media print { .contact .qr { display: grid; } }

/* Theme toggle ------------------------------------------------------------ */
.theme-toggle { position: fixed; top: 10px; right: 14px; z-index: 101; background: none; border: none; cursor: pointer; padding: 4px; color: var(--muted); display: flex; align-items: center; }
.theme-toggle:hover { color: var(--walnut); }
.theme-toggle:focus-visible { outline: 2px solid var(--walnut); outline-offset: 2px; border-radius: 2px; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
@media print { .theme-toggle { display: none; } }

/* View transitions -------------------------------------------------------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 120ms ease-out both fade-out; }
::view-transition-new(root) { animation: 120ms ease-in both fade-in; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
