  :root {
  --paper: #EDEFF1;      /* cool drafting-paper gray */
  --sheet: #F7F8F9;      /* a touch lighter, for the title block */
  --ink: #1E2328;        /* graphite */
  --steel: #5B6670;      /* secondary text */
  --rule: #BFC6CD;       /* drawing lines */
  --blue: #1F4FA8;       /* machinist's layout fluid: links and focus only */
  --measure: 68ch;
  --font: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 1.0625rem; line-height: 1.55;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.wrap { width: min(1120px, 100% - 3rem); margin-inline: auto; }

/* ---------- masthead ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap;
  padding-block: 1.5rem; border-bottom: 1px solid var(--rule);
}
.topbar h1 { margin: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: 0.01em; }
.topbar nav { display: flex; gap: 1.5rem; font-size: 0.98rem; }

.hero { padding-block: clamp(3rem, 9vw, 7rem) clamp(2.5rem, 6vw, 4.5rem); }
.tagline {
  margin: 0; font-weight: 800; line-height: 0.94; letter-spacing: -0.015em;
  font-size: clamp(2.7rem, 9.2vw, 7.4rem);
  font-variation-settings: "wdth" 125;
}
.tagline span { display: block; }
/* the three lines step in like a stepped dimension stack */
.tagline span:nth-child(2) { padding-left: 0.9em; }
.tagline span:nth-child(3) { padding-left: 1.8em; }
.intro { max-width: 56ch; margin: 2.25rem 0 0; font-size: 1.15rem; color: var(--ink); }
.intro .quiet { color: var(--steel); }

/* project index: the four builds, by photo */
.index { list-style: none; margin: clamp(2.5rem, 6vw, 4rem) 0 0; padding: 0;
         display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.index a { display: block; color: var(--ink); text-decoration: none; }
.index img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; border: 1px solid var(--rule); }
.index .name { display: block; margin-top: 0.6rem; font-weight: 650; line-height: 1.25; }
.index .when { display: block; color: var(--steel); font-size: 0.92rem; }
.index a:hover .name { color: var(--blue); }

/* ---------- projects ---------- */
.project { padding-block: clamp(3rem, 7vw, 5.5rem); border-top: 1px solid var(--rule); scroll-margin-top: 1rem; }
.project h2 {
  margin: 0 0 1.75rem; font-weight: 750; line-height: 1.05; letter-spacing: -0.01em;
  font-size: clamp(1.8rem, 3.6vw, 2.75rem); font-variation-settings: "wdth" 112; max-width: 22ch;
}

/* gallery rows: each figure's flex-grow is its aspect ratio, so a row's photos share one height */
.row { display: flex; gap: 0.75rem; }
.row + .row { margin-top: 0.75rem; }
.row figure { flex: var(--r) 1 0; min-width: 0; margin: 0; }
figure a { display: block; cursor: zoom-in; }
figure img { width: 100%; border: 1px solid var(--rule); background: var(--sheet); }
figcaption { margin-top: 0.45rem; font-size: 0.9rem; color: var(--steel); }

/* expo: one tall photo beside a stacked pair */
.split { display: grid; grid-template-columns: 1.37fr 1fr; gap: 0.75rem; align-items: stretch; }
.split > figure { margin: 0; display: flex; flex-direction: column; }
.split > figure a { flex: 1; }
.split > figure img { height: 100%; object-fit: cover; }
.split .stack { display: flex; flex-direction: column; gap: 0.75rem; }
.split .stack figure { margin: 0; }

.details { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: clamp(2rem, 5vw, 4rem);
           margin-top: 2.25rem; align-items: start; }
.story { max-width: var(--measure); }
.story h3 { margin: 1.6rem 0 0.35rem; font-size: 1.02rem; font-weight: 700; }
.story h3:first-child { margin-top: 0; }
.story p { margin: 0; }
.story ul { margin: 0; padding-left: 1.15rem; }
.story li + li { margin-top: 0.3rem; }
.story .note { color: var(--steel); }

/* title block: the corner box of an engineering drawing, holding the project's metadata */
.titleblock { margin: 0; border: 1.5px solid var(--ink); background: var(--sheet);
              display: grid; grid-template-columns: 1fr 1fr; }
.titleblock div { padding: 0.6rem 0.8rem 0.7rem; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.titleblock div:nth-child(2n) { border-right: 0; }
.titleblock .wide { grid-column: 1 / -1; border-right: 0; }
.titleblock div:last-child { border-bottom: 0; }
.titleblock dt { font-size: 0.78rem; color: var(--steel); letter-spacing: 0.02em; }
.titleblock dd { margin: 0.1rem 0 0; font-weight: 600; line-height: 1.3; }
.titleblock .fig dd { font-size: 1.65rem; font-weight: 750; line-height: 1.1; font-variation-settings: "wdth" 112; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--rule); padding-block: 2.5rem 3rem; color: var(--steel); font-size: 0.95rem;
         display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- photo viewer ---------- */
dialog { border: 0; padding: 0; background: transparent; max-width: min(1400px, 94vw); max-height: 94vh; }
dialog::backdrop { background: rgba(30, 35, 40, 0.88); }
dialog img { max-width: 100%; max-height: 84vh; width: auto; margin-inline: auto; border: 0; }
dialog p { margin: 0.75rem 0 0; color: #E4E8EB; text-align: center; font-size: 0.98rem; }
dialog button {
  position: fixed; top: 1rem; right: 1rem; font: inherit; font-weight: 650; color: var(--ink);
  background: var(--paper); border: 0; padding: 0.5rem 0.9rem; cursor: pointer;
}

/* ---------- small screens ---------- */
@media (max-width: 800px) {
  .index { grid-template-columns: repeat(2, 1fr); }
  .details { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .split .stack { flex-direction: row; }
  .split .stack figure { flex: 1; }
}
@media (max-width: 560px) {
  .wrap { width: min(1120px, 100% - 2rem); }
  .tagline span:nth-child(2) { padding-left: 0.5em; }
  .tagline span:nth-child(3) { padding-left: 1em; }
  .row { flex-wrap: wrap; }
  .row figure { flex: 1 1 calc(50% - 0.375rem); }
  .row figure:only-child { flex-basis: 100%; }
}

/* ---------- shared by both sections ---------- */
.topbar h1 a { color: inherit; text-decoration: none; }
.pdf { display: inline-flex; align-items: center; gap: 0.4rem; }
.pdf svg { flex: none; }
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* ---------- resume ---------- */
.resume { padding-block: clamp(3rem, 9vw, 6rem) clamp(3rem, 7vw, 5rem); }
.r-head { display: flex; justify-content: space-between; align-items: end; gap: 1.75rem 2rem; flex-wrap: wrap;
          padding-bottom: clamp(2.25rem, 5vw, 3.5rem); }
.r-head h2 { margin: 0; font-weight: 800; line-height: 0.94; letter-spacing: -0.015em;
             font-size: clamp(2.7rem, 9.2vw, 7.4rem); font-variation-settings: "wdth" 125; }
.r-head .lede { max-width: 56ch; margin: 1.5rem 0 0; font-size: 1.15rem; }
.r-head .reach { margin: 0.6rem 0 0; color: var(--steel); display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.btn { display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.75rem 1.15rem;
       background: var(--ink); color: var(--paper); border: 1.5px solid var(--ink);
       font-weight: 650; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--blue); border-color: var(--blue); }

/* each section reads like a callout: number and label on the left, content on the right */
.r-sec { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1rem clamp(1.5rem, 4vw, 3.5rem);
         padding-block: clamp(1.75rem, 4vw, 2.5rem); border-top: 1px solid var(--rule); }
.r-sec > h3 { margin: 0; font-size: 0.8rem; font-weight: 650; letter-spacing: 0.09em; text-transform: uppercase; color: var(--steel); }
.r-sec > h3 span { display: block; margin-bottom: 0.15rem; font-size: 1.7rem; font-weight: 750; letter-spacing: 0;
                   color: var(--ink); font-variation-settings: "wdth" 112; font-variant-numeric: tabular-nums; }
.entry + .entry { margin-top: 1.75rem; }
.entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.15rem 1.5rem; flex-wrap: wrap; }
.entry h4 { margin: 0; font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.entry .when { color: var(--steel); font-size: 0.95rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry .sub { margin: 0.1rem 0 0; color: var(--steel); }
.entry ul { margin: 0.55rem 0 0; padding-left: 1.15rem; max-width: var(--measure); }
.entry li + li { margin-top: 0.3rem; }
.entry .more { display: inline-block; margin-top: 0.55rem; font-size: 0.95rem; }
.facts { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 0.4rem 1.25rem; margin: 0.75rem 0 0; max-width: 80ch; }
.facts dt { color: var(--steel); font-size: 0.95rem; }
.facts dd { margin: 0; }
.titleblock.skills dd { font-weight: 500; }
.r-end { margin: 0; padding-top: 2rem; border-top: 1px solid var(--rule); }

@media (max-width: 800px) {
  .r-sec { grid-template-columns: 1fr; }
  .r-sec > h3 { display: flex; align-items: baseline; gap: 0.6rem; }
  .r-sec > h3 span { display: inline; font-size: 1.15rem; margin: 0; }
}
@media (max-width: 560px) {
  .facts { grid-template-columns: 1fr; gap: 0.1rem; }
  .facts dd + dt { margin-top: 0.5rem; }
  .titleblock.skills { grid-template-columns: 1fr; }
  .titleblock.skills div { border-right: 0; }
  .titleblock.skills div:nth-last-child(2) { border-bottom: 1px solid var(--rule); }
}

/* printing the page gives a clean resume */
@media print {
  @page { margin: 0.6in; }
  body { background: #fff; font-size: 10.5pt; }
  .topbar nav, .sheets, .btn, .r-end, footer { display: none !important; }
  .topbar { padding-block: 0 0.5rem; }
  .resume { padding-block: 1rem 0; }
  .r-head h2 { font-size: 2.4rem; }
  .r-sec { break-inside: avoid; padding-block: 0.9rem; grid-template-columns: 8rem 1fr; }
  .entry .more { display: none; }
  .titleblock { background: #fff; }
}

/* ---------- option B: drawing-sheet tabs ---------- */
.topbar { border-bottom: 0; padding-bottom: 1.1rem; }
.sheets { display: flex; align-items: flex-end; gap: 0.4rem; border-bottom: 1px solid var(--ink); }
.sheets a:not(.pdf) {
  display: block; min-width: 9.5rem; padding: 0.5rem 1.1rem 0.6rem; margin-bottom: -1px;
  border: 1px solid var(--rule); border-bottom-color: var(--ink); border-top-width: 3px;
  background: #E2E6E9; color: var(--steel); text-decoration: none; font-weight: 650; line-height: 1.2;
}
.sheets small { display: block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; }
.sheets a:not(.pdf):hover { color: var(--blue); background: var(--sheet); }
.sheets a[aria-current] { background: var(--paper); color: var(--ink); border-color: var(--ink); border-top-color: var(--ink);
                          border-bottom-color: var(--paper); view-transition-name: sheet-on; }
.sheets .pdf { margin-left: auto; align-self: center; padding-bottom: 0.35rem; font-weight: 600; }
@media (max-width: 560px) {
  .sheets a:not(.pdf) { min-width: 0; flex: 1; padding-inline: 0.75rem; }
  .sheets .long { display: none; }
}

