@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f7f6f2;
  --ink: #252821;
  --muted: #6a6b63;
  --accent: #526a56;
  --accent-soft: color-mix(in srgb, var(--accent) 18%, var(--paper));
  --line: #d9d9cf;
  --team-ink: #494e43;
  --separator: #989b90;
  --code-paper: #eaeae2;
  --dog-visibility: none;
  --sans: "DM Sans", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); color: var(--ink); }
a { color: inherit; text-underline-offset: 5px; }
a:hover { color: var(--accent); }
:where(a, button):focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
main:focus { outline: none; }
p, h1, h2, h3 { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
.shell { width: min(1120px, calc(100% - 96px)); margin-inline: auto; }
.accent { color: var(--accent); }
.skip-link {
  position: absolute;
  top: -100px;
  left: 24px;
  z-index: 2;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--paper);
}
.skip-link:focus { top: 12px; }
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 115px;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 16px; text-decoration: none; font-weight: 550; font-size: 15px; letter-spacing: -.3px; }

.site-nav { display: flex; align-items: center; gap: 32px; }
.site-nav a { position: relative; padding-block: 12px; color: var(--muted); text-decoration: none; font-size: 14px; }
.site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"]::after { content: ""; position: absolute; inset-inline: 0; bottom: 4px; height: 2px; background: var(--accent); }
.site-nav a:hover { color: var(--accent); }
.eyebrow { display: flex; align-items: center; gap: 12px; font-size: 10px; letter-spacing: 1.8px; font-weight: 600; line-height: 1.5; }
.tiny-rule { display: block; width: 24px; height: 2px; background: var(--accent); }
h1 { font-family: var(--serif); font-weight: 400; letter-spacing: -4px; line-height: .95; }
.arrow { flex: none; vertical-align: middle; }
.career-hero { position: relative; padding-block: 78px 65px; }
.career-hero h1 { font-size: clamp(86px, 10vw, 136px); }
.experience { margin-bottom: 64px; }
.section-label { display: flex; align-items: center; justify-content: space-between; padding-block: 16px; border-bottom: 1px solid var(--line); }
.section-label h2, .section-label > span { font-size: 10px; font-weight: 500; letter-spacing: 1.7px; }
.section-label h2 { color: var(--accent); }
.section-label > span { color: var(--muted); }
.career-list { list-style: none; margin: 0; padding: 0; }
.career-entry { display: grid; grid-template-columns: 185px 355px 1fr; gap: 20px; padding-block: 35px 37px; border-bottom: 1px solid var(--line); }
.entry-date { display: flex; align-items: center; align-self: start; gap: 11px; padding-top: 7px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); letter-spacing: .3px; white-space: nowrap; }
.entry-dot { width: 5px; height: 5px; border: 1px solid #8c8f80; border-radius: 50%; }
.career-entry:first-child .entry-dot { border-color: var(--accent); background: var(--accent); }
.entry-company h3 { font-size: 28px; font-weight: 500; letter-spacing: -.9px; line-height: 1.35; }
.entry-company h3 a { display: inline-flex; gap: 12px; align-items: center; text-decoration: none; }
.entry-company .arrow { color: var(--muted); width: 13px; height: 13px; }
.entry-company a:hover .arrow { color: var(--accent); }
.company-context { margin-top: 4px; font-size: 12px; color: var(--muted); }
.job-title { font-weight: 500; font-size: 16px; letter-spacing: -.2px; padding-top: 3px; }
.team-list { margin: 17px 0 0; padding: 0; list-style: none; }
.team-list li { display: flex; flex-wrap: wrap; column-gap: 12px; row-gap: 0; align-items: baseline; margin-top: 5px; font-size: 12px; }
.team-name { color: var(--team-ink); }
.contribution { color: var(--muted); }
.contribution::before { content: "/"; padding-right: 12px; color: var(--separator); }
.site-footer { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px 55px; border-top: 1px solid var(--line); padding-block: 30px 38px; }
.footer-name { font-size: 13px; font-weight: 550; text-decoration: none; }
.footer-signoff p { margin-top: 5px; color: var(--muted); font-size: 10px; }
.footer-elsewhere { display: flex; gap: 25px; }
.footer-elsewhere a { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; text-decoration: none; }
.footer-elsewhere .arrow { height: 11px; width: 11px; }
.copyright { font-size: 11px; color: var(--muted); }
.footer-controls { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 24px; }
.footer-controls:not(:has(button:not([hidden]))) { display: none; }
.footer-controls button {
  min-height: 44px;
  padding: 10px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 11px var(--sans);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.footer-controls button:hover { color: var(--accent); }
.home-hero { position: relative; padding-block: 75px 205px; min-height: 790px; }
.home-hero h1 { margin-top: 38px; font-size: clamp(112px, 12vw, 172px); letter-spacing: -5px; }
.home-intro { margin-top: 32px; font-size: 20px; color: var(--muted); }
.text-link { display: inline-block; margin-top: 25px; padding-block: 9px; text-decoration: underline; font-size: 13px; }
.writing { padding-block: 0 60px; }
.writing h2 { font-family: var(--serif); font-size: 40px; font-weight: 400; }
.writing ul { list-style: none; padding: 0; }
.writing li { display: flex; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); padding-block: 18px; }
.writing time { color: var(--muted); font-size: 13px; }
.prose { max-width: 720px; padding-block: 80px; }
.prose h1, .not-found h1 { font-size: clamp(56px, 8vw, 90px); margin-block: 25px 40px; letter-spacing: -2px; }
.prose p, .prose pre { margin-top: 24px; }
.prose pre { overflow-x: auto; padding: 20px; background: var(--code-paper); }
.not-found { min-height: 65vh; padding-block: 80px; }
.not-found > p:not(.eyebrow) { color: var(--muted); }

@media (min-width: 1600px) {
  .home-hero { min-height: calc(100svh - 240px); }
}

@media (max-width: 1100px) {
  .career-entry { grid-template-columns: 145px 260px 1fr; gap: 16px; }
  .team-list li { display: block; margin-top: 10px; }
  .contribution { display: block; }
  .contribution::before { display: none; }
}

@media (max-width: 760px) {
  .shell { width: calc(100% - 48px); }
  .site-header { min-height: 92px; }
  .brand { gap: 9px; font-size: 13px; }
  .dog-mark { --dog-size: 36px; }
  .site-nav { gap: 22px; }
  .site-nav a { font-size: 12px; }
  .career-hero { padding-block: 50px 192px; }
  .career-hero h1 { font-size: 104px; }
  .experience { margin-bottom: 38px; }
  .career-entry { grid-template-columns: 115px 1fr; row-gap: 18px; padding-block: 29px; }
  .entry-date { font-size: 11px; padding-top: 5px; gap: 8px; }
  .entry-company h3 { font-size: 24px; }
  .entry-details { grid-column: 2; }
  .job-title { font-size: 15px; }
  .team-list { margin-top: 13px; }
  .team-list li { font-size: 12px; }
  .company-context { font-size: 11px; }
  .site-footer { grid-template-columns: 1fr auto; gap: 25px 12px; padding-block: 26px 30px; }
  .footer-elsewhere { gap: 17px; }
  .copyright { grid-column: 2; grid-row: 1; }
  .footer-controls { grid-column: 2; grid-row: 2; gap: 18px; }
  .home-hero { padding-block: 50px 205px; min-height: 760px; }
  .home-hero h1 { font-size: 118px; margin-top: 35px; }
  .home-intro { font-size: 18px; margin-top: 25px; }
}

@media (max-width: 400px) {
  .shell { width: calc(100% - 36px); }
  .brand > span:not(.dog-mark) { display: none; }
  .career-entry { grid-template-columns: 94px 1fr; gap: 14px; }
  .entry-date { font-size: 10px; letter-spacing: 0; }
  .entry-company h3 { font-size: 22px; }
  .job-title { font-size: 14px; }
  .career-hero h1 { font-size: 92px; }
  .home-hero h1 { font-size: 104px; }
  .section-label > span { font-size: 9px; }
}

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

@media print {
  body { background: white; color: black; }
  .shell { width: 100%; }
  .site-header, .site-footer, .skip-link, .dog-playground { display: none; }
  .career-hero { padding-block: 0 25px; }
  .career-hero h1 { font-size: 72px; }
  .career-entry { break-inside: avoid; padding-block: 20px; }
  .entry-company .arrow { display: none; }
}

/* Dog uses a six-column, four-row atlas, with no animation dependencies. */
.dog-sprite {
  --dog-size: 128px;
  --dog-frame: 0;
  --dog-row: 3;
  display: block;
  width: var(--dog-size);
  height: var(--dog-size);
  flex: none;
  background-image: url("../dog/dog-sprites.png");
  background-repeat: no-repeat;
  background-size: calc(var(--dog-size) * 6) calc(var(--dog-size) * 4);
  background-position: calc(var(--dog-size) * var(--dog-frame) * -1) calc(var(--dog-size) * var(--dog-row) * -1);
  image-rendering: pixelated;
  filter: var(--dog-visibility);
}
.dog-mark { --dog-size: 44px; }
.dog-playground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  height: 180px;
  contain: layout;
}
.dog-scene { position: absolute; inset: 0 0 44px; pointer-events: none; overflow: hidden; }
.dog-character { position: absolute; left: 0; top: 0; will-change: transform; }
.dog-ball {
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 12px;
  background: var(--accent);
  box-shadow: inset 3px 3px #8b9d87;
  clip-path: polygon(25% 0, 75% 0, 75% 17%, 100% 17%, 100% 83%, 75% 83%, 75% 100%, 25% 100%, 25% 83%, 0 83%, 0 17%, 25% 17%);
}
.career-hero .dog-playground { left: 48%; bottom: 13px; height: 172px; }

@media (max-width: 760px) {
  .dog-mark { --dog-size: 36px; }
  .dog-character { --dog-size: 104px; }
  .dog-playground { height: 156px; bottom: 10px; }
  .career-hero .dog-playground { left: 0; bottom: 5px; height: 156px; }
}

@media (prefers-reduced-motion: reduce) {
  .dog-toggle { display: none; }
  .dog-character { will-change: auto; }
}

@media print {
  .dog-playground { display: none; }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #171b18;
  --ink: #e7e9df;
  --muted: #b1b8aa;
  --accent: #a4b89d;
  --line: #384037;
  --team-ink: #cad0c4;
  --separator: #7b8777;
  --code-paper: #252c26;
  --dog-visibility: drop-shadow(1px 0 0 #b5c4a180) drop-shadow(-1px 0 0 #b5c4a180) drop-shadow(0 -1px 0 #b5c4a180) drop-shadow(0 1px 0 #b5c4a180);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #171b18;
    --ink: #e7e9df;
    --muted: #b1b8aa;
    --accent: #a4b89d;
    --line: #384037;
    --team-ink: #cad0c4;
    --separator: #7b8777;
    --code-paper: #252c26;
    --dog-visibility: drop-shadow(1px 0 0 #b5c4a180) drop-shadow(-1px 0 0 #b5c4a180) drop-shadow(0 -1px 0 #b5c4a180) drop-shadow(0 1px 0 #b5c4a180);
  }
}

@media print {
  :root, :root[data-theme] {
    color-scheme: light;
    --paper: white;
    --ink: black;
    --muted: #444;
    --team-ink: #444;
    --accent: #526a56;
    --line: #ccc;
    --dog-visibility: none;
  }
  body { background: white; color: black; }
}
