:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --surface: #111419;
  --surface-2: #171b21;
  --text: #f2f4ef;
  --muted: #969d96;
  --line: #2a302f;
  --accent: #b9ff66;
  --accent-2: #7ee7ff;
  --max: 1180px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5ef;
  --surface: #ffffff;
  --surface-2: #eaede5;
  --text: #171a18;
  --muted: #5f6861;
  --line: #cfd5ce;
  --accent: #3f7800;
  --accent-2: #007087;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  transition: background-color 180ms ease, color 180ms ease;
}
a { color: inherit; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 10; padding: .7rem 1rem; background: var(--accent); color: var(--bg); }
.skip-link:focus { top: 1rem; }
.site-header, main, footer { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.site-header {
  min-height: 82px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .7rem; width: fit-content; text-decoration: none; font: 500 .8rem "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--accent); color: var(--accent); }
nav { display: flex; gap: 2rem; }
nav a { color: var(--muted); font: 400 .82rem "DM Mono", monospace; text-decoration: none; }
nav a:hover, nav a:focus-visible { color: var(--accent); }
.theme-toggle { justify-self: end; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; }
.theme-toggle:hover { border-color: var(--accent); }
.theme-icon { width: 16px; height: 16px; border: 2px solid currentColor; border-radius: 50%; box-shadow: -6px -5px 0 -4px currentColor, 6px 5px 0 -4px currentColor; }

.intro { min-height: 650px; display: flex; flex-direction: column; justify-content: center; padding: 7rem 0 6rem; border-bottom: 1px solid var(--line); }
.intro-kicker, .section-label, .eyebrow { font: 400 .75rem "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.intro-kicker { display: flex; align-items: center; gap: .65rem; color: var(--muted); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 14%, transparent); }
.intro h1 { max-width: 1000px; margin: 2.1rem 0 2rem; font-size: clamp(3.2rem, 7.1vw, 6.9rem); font-weight: 500; line-height: .98; letter-spacing: -.065em; }
.intro h1 em { color: var(--accent); font-style: normal; }
.intro-copy { max-width: 720px; margin: 0; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.intro-tagline { max-width: 850px; margin: 0 0 1.5rem; color: var(--text); font-size: clamp(1.125rem, 2vw, 1.375rem); line-height: 1.6; }
.intro-meta { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 2.8rem; }
.intro-meta span, .project-row li { border: 1px solid var(--line); padding: .35rem .7rem; color: var(--muted); font: 400 .72rem "DM Mono", monospace; }

.featured, .projects, .about { padding: 7rem 0; border-bottom: 1px solid var(--line); }
.section-label { display: flex; gap: .8rem; color: var(--muted); margin-bottom: 2.5rem; }
.section-label span { color: var(--accent); }
.featured-post { position: relative; display: grid; grid-template-columns: 88px 1.25fr .75fr; gap: 2.5rem; min-height: 390px; padding: 3.4rem; border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.featured-post::after { content: ""; position: absolute; right: -130px; bottom: -180px; width: 420px; height: 420px; border: 1px solid color-mix(in srgb, var(--accent-2) 24%, transparent); border-radius: 50%; box-shadow: 0 0 80px color-mix(in srgb, var(--accent-2) 7%, transparent); }
.post-number { color: var(--line); font: 300 3.5rem "DM Mono", monospace; writing-mode: vertical-rl; }
.eyebrow { color: var(--accent-2); margin: 0 0 1.2rem; }
.featured h2 { max-width: 640px; margin: 0 0 1.3rem; font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 500; line-height: 1.1; letter-spacing: -.04em; }
.featured-content > p:not(.eyebrow) { max-width: 620px; color: var(--muted); }
.text-link { display: inline-block; margin-top: 1.1rem; color: var(--accent); text-underline-offset: 5px; text-decoration-thickness: 1px; }
.featured-code { align-self: center; z-index: 1; min-width: 260px; padding: 2rem; background: var(--bg); border-left: 2px solid var(--accent); color: var(--text); font: 400 .82rem/1.9 "DM Mono", monospace; transform: rotate(1deg); }
.featured-code .indent { padding-left: 1.5rem; }
.code-muted { color: var(--accent-2); }.code-keyword { color: var(--accent); }.code-comment { color: var(--muted); }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-left: 1px solid var(--line); margin-top: 1.5rem; }
.post-card { min-height: 300px; display: flex; flex-direction: column; padding: 2rem; border-right: 1px solid var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.post-card h3 { margin: .6rem 0 1rem; font-size: 1.45rem; line-height: 1.25; letter-spacing: -.025em; }
.post-card h3 a { text-decoration: none; }.post-card h3 a:hover { color: var(--accent); }
.post-card > p:not(.eyebrow) { color: var(--muted); }
.card-footer { display: flex; justify-content: space-between; margin-top: auto; padding-top: 1.5rem; color: var(--muted); font: 400 .72rem "DM Mono", monospace; }

.projects-heading { display: grid; grid-template-columns: 1.3fr .7fr; align-items: end; gap: 3rem; margin-bottom: 3rem; }
.projects-heading h2, .about h2 { margin: 0; font-size: clamp(2.4rem, 5vw, 4.8rem); line-height: 1; letter-spacing: -.055em; font-weight: 500; }
.projects-heading p { color: var(--muted); margin: 0; }
.project-list { border-top: 1px solid var(--line); }
.project-row { display: grid; grid-template-columns: 70px 1fr .8fr; gap: 2rem; align-items: center; padding: 2.2rem 0; border-bottom: 1px solid var(--line); transition: padding 180ms ease, background-color 180ms ease; }
.project-row:hover { padding-inline: 1rem; background: var(--surface); }
.project-index { color: var(--accent); font: 400 .9rem "DM Mono", monospace; }
.project-row h3 { margin: 0 0 .4rem; font-size: 1.4rem; }.project-row p { margin: 0; color: var(--muted); max-width: 620px; }
.project-row ul { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem; list-style: none; margin: 0; padding: 0; }

.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 6rem; }
.about-copy { align-self: end; color: var(--muted); font-size: 1.08rem; }.about-copy p:last-child { margin-bottom: 0; }
.youtube-callout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; margin-top: 3rem; padding: clamp(1.35rem, 4vw, 2.5rem); border: 1px solid var(--line); background: var(--surface); }
.youtube-callout .eyebrow { margin-bottom: .75rem; font-size: .875rem; }
.youtube-callout h3 { margin: 0 0 .75rem; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 500; line-height: 1.2; }
.youtube-callout p:last-child { margin: 0; color: var(--muted); }
.youtube-callout .text-link { margin: 0; }
.article-samples { padding: 5rem 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); }
.article-samples article { scroll-margin-top: 1rem; background: var(--bg); padding: 2.5rem; }
.article-samples h2 { margin: 0 0 1rem; font-size: 1.5rem; line-height: 1.25; }.article-samples p { margin: 0; color: var(--muted); }
footer { min-height: 150px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font: 400 .75rem "DM Mono", monospace; }
footer a { color: var(--text); text-underline-offset: 5px; }

@media (max-width: 840px) {
  .site-header { grid-template-columns: 1fr auto; }.site-header nav { display: none; }
  .intro { min-height: auto; padding-block: 6rem; }.intro h1 { font-size: clamp(3rem, 12vw, 5rem); }
  .featured, .projects, .about { padding-block: 5rem; }
  .featured-post { grid-template-columns: 1fr; padding: 2rem; }.post-number { display: none; }.featured-code { width: 100%; transform: none; }
  .post-grid { grid-template-columns: 1fr; }.post-card { min-height: 240px; }
  .projects-heading, .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .project-row { grid-template-columns: 42px 1fr; }.project-row ul { grid-column: 2; justify-content: flex-start; }
  .article-samples { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .site-header, main, footer { width: min(calc(100% - 28px), var(--max)); }
  .site-header { min-height: 70px; }.brand > span:last-child { display: none; }
  .intro { padding-block: 4.5rem; }.intro h1 { letter-spacing: -.055em; }
  .featured-post, .post-card, .article-samples article { padding: 1.35rem; }.featured-code { min-width: 0; padding: 1.25rem; }
  .project-row { gap: 1rem; }.project-row:hover { padding-inline: .5rem; }
  footer { flex-direction: column; justify-content: center; align-items: flex-start; gap: .8rem; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

nav a { font-size: .875rem; }
.resume-intro { padding: 4.5rem 0 3rem; border-bottom: 1px solid var(--line); }
.resume-intro h1 { font-size: clamp(3rem, 7vw, 6rem); font-weight: 500; line-height: 1.1; letter-spacing: -.055em; margin: 1rem 0; }
.resume-intro > p { max-width: 780px; color: var(--muted); font-size: 1.15rem; }
.resume-contact { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; }
.resume-contact a { color: var(--accent); overflow-wrap: anywhere; }
.resume-section { padding: 3rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 220px 1fr; gap: 3rem; }
.resume-section > h2 { font-size: 1.5rem; margin: 0; font-weight: 500; }
.resume-item + .resume-item { margin-top: 2.5rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.resume-item h3 { font-size: 1.25rem; margin: 0 0 .5rem; }
.resume-item p { margin: .5rem 0; }
.resume-item li { margin: .6rem 0; }
.resume-item ul { padding-left: 1.3rem; }
.resume-details { color: var(--muted); }
.resume-item .eyebrow { font-size: .8125rem; line-height: 1.7; }
nav a[aria-current="page"] { color: var(--accent); }
@media (max-width: 840px) {
  .site-header nav { display: flex; grid-row: 2; grid-column: 1 / -1; flex-wrap: wrap; gap: 1rem 1.5rem; padding: 1rem 0; }
  .site-header { padding-top: .75rem; }
  .resume-section { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media print {
  .site-header, footer, .skip-link { display: none; }
  :root { --bg: #fff; --text: #111; --muted: #444; --line: #ccc; --accent: #234600; color-scheme: light; }
  main { width: 100%; }
  .resume-intro { padding: 0 0 1rem; }
  .resume-section { padding: 1rem 0; grid-template-columns: 150px 1fr; gap: 1rem; }
  .resume-item { break-inside: avoid; }
}

/* Field note article pages */
.post-main { max-width: 800px; padding-bottom: 4rem; }
.post-heading { padding: 3rem 0 2rem; border-bottom: 1px solid var(--line); }
.post-heading .eyebrow { margin-top: 2.5rem; font-size: .875rem; }
.post-heading h1 { font-size: clamp(2.3rem, 6vw, 4.4rem); line-height: 1.1; letter-spacing: -.045em; font-weight: 500; margin: 1rem 0 1.5rem; overflow-wrap: anywhere; }
.post-date, .post-origin { color: var(--muted); font-size: .875rem; }
.post-deck { font-size: 1.2rem; }
.post-body { padding-top: 1rem; font-size: 1.0625rem; line-height: 1.85; }
.post-body h2 { margin-top: 2.5rem; font-size: 1.65rem; line-height: 1.3; }
.post-body a { color: var(--accent); text-underline-offset: 4px; }
.post-body code { font-family: "DM Mono", monospace; font-size: .9em; overflow-wrap: anywhere; }
.post-body pre { max-width: 100%; overflow-x: auto; padding: 1.3rem; background: var(--surface); border: 1px solid var(--line); line-height: 1.65; }
.post-body pre code { overflow-wrap: normal; font-size: .875rem; }
.post-reference { border-top: 1px solid var(--line); padding-top: 1.5rem; font-size: .875rem; color: var(--muted); }
.post-back { margin-top: 2rem; }
.featured .eyebrow { line-height: 1.6; font-size: .875rem; }
.card-footer { font-size: .875rem; gap: .5rem; flex-wrap: wrap; }
