:root {
  color-scheme: light;
  --paper: #f7f4ed;
  --panel: #fffdf8;
  --ink: #202722;
  --muted: #515b53;
  --line: #d7d7ca;
  --accent: #a83824;
  --forest: #20362d;
  --display: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.65 var(--sans); }
a { color: inherit; }
p, h1, h2, h3, figure { margin: 0; }
ul { padding: 0; }
:focus-visible { outline: 3px solid #be5036; outline-offset: 5px; }
[id] { scroll-margin-top: 2rem; }

.shell { width: min(1160px, calc(100% - 96px)); margin-inline: auto; }
.skip { position: absolute; top: -5rem; left: 1rem; z-index: 2; background: var(--panel); padding: .65rem 1rem; }
.skip:focus { top: 1rem; }
.top { min-height: 83px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.wordmark { font: 700 1.65rem/1 var(--display); letter-spacing: -.07em; text-decoration: none; }
.wordmark span, h1 span { color: var(--accent); }
.top nav { display: flex; align-items: center; flex-wrap: wrap; column-gap: clamp(1rem, 4vw, 2.75rem); }
.top nav a { font-size: .94rem; font-weight: 600; text-decoration: none; padding-block: .4rem; }
.top nav a:hover, .text-link:hover, .footer a:hover { color: var(--accent); }

.hero { display: grid; grid-template-columns: minmax(0, 1.52fr) minmax(0, 1fr); align-items: center; gap: clamp(2.1rem, 5vw, 5rem); padding-block: clamp(4.5rem, 8vw, 6.5rem); }
.label { color: var(--muted); font: 700 .72rem/1.55 var(--mono); letter-spacing: .095em; text-transform: uppercase; }
.label span { padding-inline: .35rem; color: var(--accent); }
h1, h2 { font-family: var(--display); font-weight: 400; }
h1 { margin-block: 1.35rem 1.55rem; font-size: clamp(3rem, 7.25vw, 6.4rem); line-height: .98; letter-spacing: -.076em; }
.lede { max-width: 48ch; font-size: clamp(1.04rem, 1.45vw, 1.24rem); color: var(--muted); line-height: 1.65; }
.print-contact { display: none; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1.15rem 1.65rem; margin-top: 2rem; }
.button { display: inline-flex; gap: 1rem; align-items: center; padding: .75rem 1.15rem; background: var(--forest); color: var(--panel); border-radius: 3px; font-size: .9rem; font-weight: 650; text-decoration: none; }
.button:hover { background: #354f40; }
.text-link { font-size: .9rem; font-weight: 650; text-decoration: none; }
.text-link span { padding-left: .2rem; }

.system-card {
  background-color: var(--forest);
  background-image: radial-gradient(#6f8d7c70 1px, transparent 1px);
  background-size: 18px 18px;
  color: #f8f5e9;
  padding: clamp(1.15rem, 2.5vw, 2rem);
  border-radius: 5px;
  box-shadow: 9px 9px 0 #dcded0;
}
.system-card figcaption { display: flex; align-items: center; gap: .65rem; font-weight: 650; font-size: .9rem; }
.signal { background: #e8b893; border-radius: 50%; width: .52rem; height: .52rem; }
.flow { display: flex; flex-direction: column; align-items: center; width: min(100%, 300px); margin: 2.3rem auto 1.8rem; }
.node { background: #2a4337; border: 1px solid #8ca495; border-radius: 3px; padding: .63rem .8rem; width: 100%; text-align: center; font-size: .8rem; }
.node-primary { background: #dfe8ce; border-color: #dfe8ce; color: #20362d; font-weight: 750; }
.node-group { display: grid; gap: .65rem; width: 100%; padding: .65rem; border: 1px dashed #9db09d; border-radius: 4px; }
.node-note { color: #f0c6a1; font-size: .84rem; text-align: center; }
.connector { width: 1px; height: 1.3rem; background: #9db09d; position: relative; }
.connector::after { content: ""; position: absolute; bottom: 1px; left: -2px; width: 4px; height: 4px; border: solid #9db09d; border-width: 0 1px 1px 0; rotate: 45deg; }
.diagram-link { display: inline-flex; gap: .4rem; color: #f8f5e9; font-size: .78rem; text-underline-offset: .23rem; }
.diagram-link:hover { color: #f0c6a1; }

.section { border-top: 1px solid var(--line); padding-block: clamp(3.1rem, 7vw, 6rem); }
.section-head { margin-bottom: clamp(1.45rem, 3.5vw, 2.65rem); }
h2 { font-size: clamp(2.55rem, 5.8vw, 4.4rem); letter-spacing: -.059em; line-height: 1.12; margin-top: .45rem; }
.project { display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem; border: 1px solid var(--line); background: var(--panel); border-radius: 5px; padding: clamp(1.3rem, 3.15vw, 2.4rem); }
.project-main { min-width: 0; }
.project h3 { margin-block: .7rem .75rem; font: 400 clamp(1.65rem, 3.1vw, 2.35rem)/1.13 var(--display); letter-spacing: -.028em; }
.project p:not(.label, .metric) { max-width: 67ch; color: var(--muted); }
.featured { display: grid; grid-template-columns: minmax(0, 2.9fr) minmax(0, 1fr); align-items: start; border-top: 3px solid var(--forest); }
.project-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.15rem; margin-top: 1.15rem; }
.personal { background: #eef0e5; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: .15rem 0 0; list-style: none; }
.featured .tags { justify-content: flex-end; }
.tags li { border: 1px solid #c4cbbd; padding: .25rem .55rem; border-radius: 3px; font: .73rem/1.6 var(--mono); color: #3d5144; }
.metric { border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .7rem; padding-top: 1rem; }
.metric strong { font: 400 clamp(2.2rem, 4.5vw, 3.25rem)/1 var(--display); color: var(--accent); letter-spacing: -.05em; }
.metric span { color: var(--muted); font-size: .86rem; }
details { margin-top: .95rem; }
summary { width: fit-content; cursor: pointer; color: var(--forest); font-weight: 700; font-size: .88rem; }
summary:hover { color: var(--accent); }
details p { margin-top: .6rem; }

.skill-catalog { margin-top: clamp(2.4rem, 5vw, 4.3rem); }
.skill-catalog > h3 { font: 400 clamp(1.8rem, 3.8vw, 2.8rem)/1.15 var(--display); letter-spacing: -.035em; }
.section-intro { margin-top: .65rem; color: var(--muted); max-width: 66ch; }
.skill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.15rem; margin-top: 1.5rem; }
.skill-group { border: 1px solid var(--line); border-radius: 5px; padding: clamp(1.25rem, 2.8vw, 2rem); background: var(--panel); }
.skill-group h4 { margin: 0 0 .75rem; font: 400 1.45rem/1.2 var(--display); letter-spacing: -.015em; }
.skill-group dl { margin: 0; }
.skill-group dl div { border-top: 1px solid var(--line); padding-block: .62rem; }
.skill-group dl div:last-child { padding-bottom: 0; }
.skill-group dt { color: var(--forest); font-weight: 700; }
#ai-tooling code { font-family: var(--mono); font-size: .83em; overflow-wrap: anywhere; }
.skill-group dd { margin: .15rem 0 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }

.experience-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem clamp(1.7rem, 6vw, 5.5rem); }
.experience-grid article { border-top: 1px solid var(--line); padding-top: 1.15rem; }
.experience-grid h3 { font: 400 clamp(1.6rem, 3.5vw, 2.3rem)/1.15 var(--display); letter-spacing: -.035em; }
.job-title { margin-top: .32rem; font-size: .9rem; font-weight: 720; }
.experience-grid article p:last-child { margin-top: .8rem; color: var(--muted); max-width: 50ch; }
.credentials { display: grid; grid-template-columns: 1fr 1fr; gap: .95rem 1.8rem; margin: 2.15rem 0 0; padding: 1.15rem 0 0; border-top: 1px solid var(--line); }
.credentials dt { font: 700 .73rem/1.5 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.credentials dd { margin: .3rem 0 0; font-size: .9rem; }

.contact { background: var(--forest); color: #f8f5e9; }
.contact-inner { padding-block: clamp(2.6rem, 7.5vw, 5rem); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.45rem 3.2rem; }
.contact p { color: #dbe2d5; margin-top: .85rem; }
.contact-links { display: grid; gap: .65rem; }
.contact-links a { font-weight: 650; text-decoration-color: #a2b2a4; text-underline-offset: .25em; overflow-wrap: anywhere; }
.contact-links a:hover { color: #f0c6a1; }
.contact-links span { margin-left: .45rem; }
.footer { padding-block: 1.15rem; display: flex; flex-wrap: wrap; gap: .55rem 1.2rem; justify-content: space-between; color: var(--muted); font-size: .8rem; }
.footer a { text-decoration: none; }

@media (max-width: 900px) {
  .shell { width: calc(100% - 64px); }
  .hero { gap: 2rem; }
}

@media (max-width: 740px) {
  .hero, .featured, .contact-inner { grid-template-columns: 1fr; }
  .hero { gap: 2.6rem; padding-block: 3.7rem 4rem; }
  h1 { font-size: clamp(3rem, 11.25vw, 5rem); }
  .system-card { max-width: 530px; }
  .featured .tags { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .shell { width: calc(100% - 36px); }
  .top { min-height: 65px; }
  .top nav { column-gap: .7rem; }
  .top nav a { font-size: .83rem; }
  .project-grid, .skill-grid, .experience-grid, .credentials { grid-template-columns: 1fr; }
}

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

@page { size: A4; margin: 13mm 15mm; }

@media print {
  body { background: white; font: 10pt/1.35 var(--sans); print-color-adjust: exact; }
  .shell { width: 100%; }
  .top, .skip, .hero-actions, .system-card, .contact, .footer, .tags, details { display: none; }
  .hero { display: block; padding: 0 0 10pt; }
  h1 { margin-block: 5pt 7pt; font-size: 39pt; letter-spacing: -.055em; }
  h1 br { display: none; }
  .lede { max-width: 74ch; font-size: 10.5pt; line-height: 1.4; }
  .print-contact { display: flex; gap: 7pt; margin-top: 7pt; color: var(--forest); }
  .section { padding-block: 9pt 0; }
  .section-head { margin-bottom: 7pt; }
  h2 { margin: 0; font-size: 26pt; }
  .project, .skill-group, .experience-grid article { break-inside: avoid; }
  .project { padding: 8pt 10pt; gap: 6pt; background: white; font-size: 9.25pt; }
  .featured { display: block; }
  .featured p:not(.label, .metric) { max-width: none; }
  .project-grid, .skill-grid, .experience-grid, .credentials { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-grid, .skill-grid { gap: 8pt; margin-top: 8pt; }
  .label { font-size: 7.5pt; }
  .project h3 { margin: 3pt 0; font-size: 14pt; }
  .metric { padding-top: 5pt; }
  .metric strong { font-size: 20pt; }
  .metric span { font-size: 8.5pt; }
  #ai-tooling { break-before: page; border-top: 0; padding-top: 0; }
  .skill-catalog { margin-top: 12pt; }
  .skill-catalog > h3 { font-size: 17pt; }
  .section-intro { margin-top: 4pt; }
  .skill-group { padding: 6pt 8pt; background: white; }
  .skill-group h4 { margin-bottom: 4pt; font-size: 12pt; }
  .skill-group dl div { padding-block: 1.5pt; }
  .skill-group dt { font-size: 9pt; line-height: 1.15; }
  .skill-group dd { margin-top: 0; font-size: 8pt; line-height: 1.2; }
  .experience { margin-top: 8pt; }
  .experience h2 { font-size: 21pt; }
  .experience-grid article { padding-top: 5pt; }
  .experience-grid h3 { font-size: 14pt; }
  .experience-grid p { font-size: 8.5pt; }
  .experience-grid article p:last-child { display: none; }
  .credentials { margin-top: 7pt; padding-top: 5pt; gap: 6pt; }
  .credentials dd { margin-top: 2pt; font-size: 8pt; }
}
