:root {
  --paper: #f3f0e8;
  --paper-deep: #e9e4d9;
  --ink: #272621;
  --muted: #69655c;
  --rule: rgba(39, 38, 33, 0.18);
  --faint-rule: rgba(39, 38, 33, 0.08);
  --shadow: 5px 6px 0 rgba(39, 38, 33, 0.14);
  --serif: Georgia, "Times New Roman", serif;
  --mono: "Courier New", Courier, monospace;
  --sans: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 7rem; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--faint-rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--faint-rule) 1px, transparent 1px);
  background-size: 26px 26px;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { background: var(--ink); color: var(--paper); }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: .7rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font: 700 .8rem var(--mono);
  text-transform: uppercase;
}
.skip-link:focus { top: 1rem; }

.reading-progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 80; }
.reading-progress span { display: block; width: 0; height: 100%; background: var(--ink); }

.site-header {
  position: sticky;
  top: 1rem;
  z-index: 50;
  width: min(1180px, calc(100% - 2rem));
  min-height: 72px;
  margin: 1rem auto 0;
  padding: .8rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--rule);
  background: rgba(243, 240, 232, .94);
  box-shadow: 0 3px 8px rgba(39, 38, 33, .09);
  backdrop-filter: blur(12px);
}

.monogram {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  text-decoration: none;
  font: italic 700 .85rem var(--serif);
  transform: rotate(-5deg);
}

nav { display: flex; align-items: center; gap: clamp(.8rem, 2.4vw, 2.1rem); }
nav a {
  text-decoration: none;
  font: 700 .75rem var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
}
nav a:hover, nav a:focus-visible { border-color: currentColor; }
.menu-button { display: none; }

main, footer { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; }
.ruled-section { padding: clamp(5rem, 10vw, 9rem) clamp(1rem, 3vw, 2.5rem); border-bottom: 2px solid var(--ink); }

.eyebrow, .section-number, .card-label, .kicker, .entry-meta, .margin-note, .project-subtitle, figcaption {
  margin: 0;
  font-family: var(--mono);
  font-size: .76rem;
  line-height: 1.45;
  letter-spacing: .06em;
  text-transform: uppercase;
}

h1, h2, h3, h4, p { margin-top: 0; }
h1 {
  margin: 2rem 0 2.3rem;
  font-size: clamp(4.7rem, 12vw, 10rem);
  line-height: .78;
  letter-spacing: -.065em;
  font-weight: 500;
}
h1 em { display: inline-block; font-weight: 400; transform: translateX(.2em) rotate(-2deg); }
h2 { margin-bottom: 0; font-size: clamp(2.8rem, 6vw, 5rem); line-height: .98; letter-spacing: -.045em; font-weight: 500; }
h3 { font-size: clamp(1.6rem, 3vw, 2.35rem); line-height: 1.08; font-weight: 500; }
h4 { font-size: 1.25rem; line-height: 1.2; }

.hero {
  min-height: calc(100vh - 7rem);
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}
.hero-note { max-width: 720px; font-size: clamp(1.2rem, 2.1vw, 1.55rem); line-height: 1.55; }
.hero-actions, .resume-actions, .contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.4rem; }
.charcoal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 48px;
  padding: .75rem 1.2rem;
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
  text-decoration: none;
  font: 700 .78rem var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: transform .2s ease, box-shadow .2s ease;
}
.charcoal-button:hover, .charcoal-button:focus-visible { transform: translate(3px, 3px); box-shadow: 2px 3px 0 rgba(39, 38, 33, .14); }
.text-link { font-style: italic; text-underline-offset: .25em; }
.hero-facts { margin: 4rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); }
.hero-facts div { padding: 1rem .75rem 0 0; }
.hero-facts dt { font: .68rem var(--mono); text-transform: uppercase; }
.hero-facts dd { margin: .25rem 0 0; font-style: italic; }
.hero-sketch { margin: 0; align-self: end; transform: rotate(1.5deg); }
.hero-sketch img { width: min(100%, 480px); margin-inline: auto; mix-blend-mode: multiply; filter: grayscale(1) contrast(1.1); }
.hero-sketch figcaption { margin-top: .8rem; text-align: center; transform: rotate(-1.5deg); }

.section-heading { display: flex; justify-content: space-between; gap: 2rem; align-items: end; margin-bottom: clamp(3rem, 7vw, 6rem); padding-bottom: 2rem; border-bottom: 1px dashed var(--rule); }
.section-number { margin-bottom: 1.1rem; }
.margin-note { max-width: 180px; text-align: right; color: var(--muted); }

.about-layout { display: grid; grid-template-columns: 1.45fr .7fr; gap: clamp(2.5rem, 7vw, 7rem); align-items: start; }
.prose p { max-width: 76ch; }
.prose .lede { font-size: clamp(1.35rem, 2.5vw, 1.8rem); line-height: 1.5; }
.paper-card { padding: 2rem; background: rgba(249, 247, 241, .84); border: 1px solid var(--ink); box-shadow: var(--shadow); }
.identity-card { position: sticky; top: 7rem; transform: rotate(1deg); }
.identity-card h3 { margin-top: 1rem; }
.identity-card hr { margin: 2rem 0; border: 0; border-top: 1px dashed var(--rule); }
.small { color: var(--muted); font-size: .95rem; }
.scribble-list { padding-left: 1.1rem; }
.scribble-list li { margin-bottom: .4rem; }

.resume-actions { justify-content: flex-end; }
.experience-list { display: grid; gap: 5rem; }
.experience-entry { display: grid; grid-template-columns: minmax(260px, .8fr) 1.2fr; gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.experience-entry.reverse figure { order: 2; }
.experience-entry figure { margin: 0; }
.experience-entry figure::after { content: ""; display: block; width: 75%; margin: -.9rem auto 0; border-bottom: 2px solid rgba(39,38,33,.28); filter: blur(1px); }
.experience-entry img { aspect-ratio: 4 / 3; object-fit: contain; mix-blend-mode: multiply; filter: grayscale(1) contrast(1.06); }
.entry-meta { color: var(--muted); }
.experience-entry .kicker { margin: .75rem 0; }
.experience-entry h3 { margin-bottom: 1.25rem; }
.tags { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.5rem; }
.tags span { padding: .35rem .6rem; border: 1px solid var(--rule); font: .68rem var(--mono); text-transform: uppercase; }

.goals-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; margin-bottom: 5rem; }
.roadmap { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.roadmap li { display: grid; grid-template-columns: 130px 1fr; gap: 2rem; padding: 2.5rem 0; border-bottom: 1px solid var(--rule); }
.roadmap-index { font: italic 2.5rem var(--serif); }
.roadmap h3 { margin: .55rem 0 1rem; }
.roadmap p:last-child { max-width: 70ch; margin-bottom: 0; }

.project-heading { align-items: end; }
.project-subtitle { max-width: 240px; text-align: right; }
.project-hero { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.project-art { margin: 0; }
.project-art img { width: 100%; mix-blend-mode: multiply; filter: grayscale(1) contrast(1.06); }
.project-art figcaption { margin-top: 1rem; }
.project-summary .lede { font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.35; }
.project-facts { margin-top: 2.5rem; border-top: 1px solid var(--ink); }
.project-facts div { display: grid; grid-template-columns: 115px 1fr; gap: 1rem; padding: .75rem 0; border-bottom: 1px dashed var(--rule); }
.project-facts dt { font: .72rem var(--mono); text-transform: uppercase; }
.project-facts dd { margin: 0; }

.system-diagram { margin: 6rem 0; padding: 2rem; background: rgba(249, 247, 241, .75); border: 1px solid var(--ink); box-shadow: var(--shadow); overflow-x: auto; }
.system-diagram svg { display: block; min-width: 780px; }
.diagram-lines path { fill: none; stroke: var(--ink); stroke-width: 2; marker-end: url(#arrow); }
.diagram-node rect { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.diagram-node text { font: 16px var(--mono); text-anchor: middle; fill: var(--ink); }
.diagram-node .diagram-main { font: italic 28px var(--serif); text-transform: none; }
.system-diagram figcaption { margin-top: 1rem; }

.case-study { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.case-study article { padding: clamp(2rem, 5vw, 4rem); background: var(--paper); }
.case-number { margin-bottom: 1rem; font: italic 3rem var(--serif); }
.case-study h3 { margin-bottom: 2rem; }
.skills h2 { margin-bottom: 4rem; }
.skill-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); }
.skill-grid div { min-height: 190px; padding: 1.5rem; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); background: rgba(249,247,241,.62); }
.skill-grid h3 { font-size: 1.4rem; }
.skill-grid p { margin-bottom: 0; }

.contact-layout { display: grid; grid-template-columns: 1.3fr .7fr; gap: 4rem; align-items: end; }
.contact-layout h2 { max-width: 800px; }
.contact-layout p { margin: 2rem 0 0; max-width: 700px; }
.contact-actions { align-items: flex-start; flex-direction: column; }
footer { padding: 2rem 1rem 4rem; display: flex; justify-content: space-between; gap: 1rem; font: .72rem var(--mono); text-transform: uppercase; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px dashed var(--ink); outline-offset: 4px; }

@media (max-width: 860px) {
  body { font-size: 17px; }
  .site-header { top: .5rem; }
  .menu-button { display: inline-flex; align-items: center; gap: .5rem; border: 0; background: transparent; color: var(--ink); font: 700 .75rem var(--mono); text-transform: uppercase; cursor: pointer; }
  nav { position: absolute; top: calc(100% + .5rem); left: 0; right: 0; display: none; padding: 1.25rem; background: var(--paper); border: 1px solid var(--ink); box-shadow: var(--shadow); }
  nav[data-open="true"] { display: grid; gap: 1rem; }
  nav a { padding: .55rem 0; font-size: .9rem; }
  .hero { grid-template-columns: 1fr; padding-top: 6rem; }
  .hero-sketch { max-width: 430px; margin-inline: auto; }
  .about-layout, .goals-intro, .project-hero, .contact-layout { grid-template-columns: 1fr; }
  .identity-card { position: static; max-width: 560px; }
  .experience-entry, .experience-entry.reverse { grid-template-columns: 1fr; gap: 1.5rem; }
  .experience-entry.reverse figure { order: initial; }
  .experience-entry figure { max-width: 560px; }
  .case-study { grid-template-columns: 1fr; }
  .skill-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  body { background-size: 22px 22px; }
  main, footer, .site-header { width: min(100% - 1rem, 1180px); }
  .ruled-section { padding-inline: .55rem; }
  h1 { font-size: clamp(4rem, 23vw, 7rem); }
  .section-heading { align-items: start; flex-direction: column; }
  .margin-note, .project-subtitle { max-width: none; text-align: left; }
  .hero-facts { grid-template-columns: 1fr; }
  .hero-facts div { padding: .8rem 0; border-bottom: 1px dashed var(--rule); }
  .resume-actions { justify-content: flex-start; }
  .roadmap li { grid-template-columns: 55px 1fr; gap: 1rem; }
  .roadmap-index { font-size: 1.7rem; }
  .system-diagram { padding: 1rem; }
  .skill-grid { grid-template-columns: 1fr; }
  .skill-grid div { min-height: 0; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  .site-header, .reading-progress, .hero-actions, .resume-actions, .contact-actions { display: none !important; }
  body { background: white; color: black; }
  main { width: 100%; }
  .ruled-section { break-inside: avoid; padding: 2rem 0; }
}
