/* Palette: espresso ink + muted green, with a page-specific panel tint */
:root {
  --ink: #2A221D;        /* espresso: headings and name */
  --text: #54493F;       /* warm gray-brown: body copy */
  --muted: #7C7066;      /* captions */
  --green: #55624F;      /* muted green: labels, active state, title block */
  --green-soft: #B9C1B0; /* light green: inner rules */
  --rule: #E4DED6;       /* warm hairlines */
  --tint: #E2EADC;       /* page color (overridden per page): Home = sage */
  --tint-line: rgba(42,34,29,.14);
  --offwhite: #F4F2EE;   /* Braun warm off-white */
  --radius: 4px;         /* one corner radius for panels and controls */
  --lean: 15deg;         /* one lean angle for every trapezoid (mark, chips, composition) */
}
body[data-page="soft"]  { --tint: #F6D6D2; }  /* oxblood rose: burgundy leather and the red plaid */
body[data-page="bus"]   { --tint: #F7E7BE; }  /* butter yellow of the production Bus */
body[data-page="cobra"] { --tint: #F3D5BD; }  /* cognac leather of the Cobra seats */
body[data-page="ev911"] { --tint: #CCDFEE; }  /* steel blue: Graphite and the blue prototype */

body { color: var(--ink); }
header, .section, .meta-grid, .next, footer, .expertise-item, .experience-item, .decision, .decisions { border-color: var(--rule); }
h1, h2, .section h2, .about-heading, .project-title, .experience-company { color: var(--ink); }
.hero p, .intro, .section-intro, .result { color: var(--ink); }
.body-copy, .about-copy, .expertise-item p, .experience-item p, .project-description, .decision p, .experience-role, .project-meta { color: var(--text); }
.caption, figure figcaption, .project-number { color: var(--muted); }
.eyebrow, .kicker, .section-label, .project-link { color: var(--green); }
nav a.active { color: var(--green); }
nav a:hover, .footer-links a:hover, .next a:hover, .back:hover { opacity: 1; color: var(--green); }
.contact-links a { border-bottom-color: var(--green); }

/* Name mark: name framed in a thin green rectangle */
.name .mark { white-space: nowrap; display: inline-block; border: 1.5px solid var(--green); padding: 9px 14px 8px; line-height: 1; }

/* Title block: the meta row framed like a drawing title block */
.meta-grid { gap: 0; padding: 0; margin-bottom: 70px; border-top: 1.5px solid var(--green); border-bottom: 1.5px solid var(--green); }
.meta-grid > div { padding: 16px 20px 18px; border-left: 1px solid var(--green-soft); }
.meta-grid > div:first-child { border-left: 0; padding-left: 0; }
.meta-label { color: var(--green); }
.meta-value { color: var(--ink); }

/* Page-color bands: one full-width section per page */
.band-tint { background: var(--tint); border-top: 0; box-shadow: 0 0 0 100vmax var(--tint); clip-path: inset(0 -100vmax); }
.band-tint + .section { border-top: 0; }
.band-tint .section-label { color: var(--ink); }
.band-tint .expertise-item, .band-tint .decision, .band-tint .decisions { border-color: var(--tint-line); }

/* Key grid on a panel */
.decisions.panel { border-top: 0; padding: 6px clamp(18px, 3vw, 36px); }
.decisions.panel .decision { border-color: var(--tint-line); }
.decisions.panel .decision:nth-last-child(-n+2) { border-bottom: 0; }

/* Panels: documents and diagrams presented on the page color */
.panel { background: var(--tint); padding: clamp(18px, 3vw, 40px); border-radius: var(--radius); }
.image-full.panel img { max-height: none; object-fit: contain; }
.image-trio.docs.panel { gap: 20px; }
.image-trio.docs.panel img { background: transparent; padding: 0; }

/* Varied layout trial: one large image beside a smaller one */
.image-pair.asym { grid-template-columns: 2fr 1fr; }
.image-pair.asym figure:first-child img { aspect-ratio: 4/3; height: auto; }
.image-pair.asym figure:last-child img { aspect-ratio: 2/3; height: auto; }

@media (max-width: 800px) {
  .meta-grid > div:nth-child(odd) { border-left: 0; padding-left: 0; }
  .image-pair.asym { grid-template-columns: 1fr; }
  .image-pair.asym figure:last-child img { aspect-ratio: 4/3; }
}

/* Mid-century mark and motif */
.name a, .name { display: inline-flex; align-items: center; gap: 12px; }
.name .logo { display: block; flex: none; }
.mcm-hero { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) clamp(220px, 26vw, 340px); gap: clamp(32px, 6vw, 90px); align-items: center; }
.mcm-hero .hero-text { max-width: 900px; }
.mcm-comp { width: 100%; height: auto; display: block; }
.chip { display: inline-block; vertical-align: -1px; margin-right: 10px; }
.kicker .chip { vertical-align: -1px; }
@media (max-width: 800px) {
  .mcm-hero { grid-template-columns: 1fr; }
  .mcm-comp { width: 180px; order: -1; margin-bottom: 8px; }
  .name .logo { width: 28px; height: 32px; }
  .name .mark { font-size: 13px; padding: 7px 10px 6px; }
  header { flex-wrap: wrap; row-gap: 14px; }
  nav { width: 100%; flex-wrap: wrap; justify-content: flex-start; gap: 10px 18px; }
}

/* Braun warm off-white: Home contact section and every footer, full width */
.band-offwhite, footer { background: var(--offwhite); box-shadow: 0 0 0 100vmax var(--offwhite); clip-path: inset(0 -100vmax); }
.band-offwhite { border-top: 0; }
footer { border-top: 0; }
.band-offwhite + footer { margin-top: 0; }

/* Precise controls: outlined rounded-rectangle buttons */
.contact-links { gap: 12px; }
.contact-links a { border: 1px solid var(--ink); border-radius: var(--radius); padding: 13px 18px 12px; line-height: 1; transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.contact-links a:hover { opacity: 1; background: var(--green); border-color: var(--green); color: #fff; }
.contact-links a:focus-visible, nav a:focus-visible, .footer-links a:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

/* Fixed header: stays at the top on desktop, compacts after scrolling; on phones it hides while reading down and returns on scroll up */
header { position: sticky; top: 0; z-index: 50; background: #fff; box-shadow: 0 0 0 100vmax #fff; clip-path: inset(0 -100vmax); transition: padding .25s ease, transform .3s ease; }
header.is-compact { padding-top: 12px; padding-bottom: 12px; }
header.is-compact .name .logo { width: 30px; height: 34px; }
header.is-compact .name .mark { padding: 7px 12px 6px; }
html { scroll-padding-top: 96px; }
@media (max-width: 800px) {
  header.is-hidden { transform: translateY(-100%); }
  html { scroll-padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) { header { transition: none; } }

/* Name as the home link */
.name a .mark { transition: color .2s ease, border-color .2s ease; }
.name a:hover .mark { color: var(--green); }
.name a:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }

/* Calmer type scale: display, heading, lead, body, small (+ label) */
h1 { font-size: clamp(40px, 5vw, 64px); line-height: 1.05; letter-spacing: -.03em; }
.section h2, .about-heading { font-size: clamp(28px, 2.6vw, 38px); line-height: 1.12; letter-spacing: -.02em; }
.hero p, .intro, .section-intro, .result { font-size: clamp(19px, 1.7vw, 23px); line-height: 1.55; letter-spacing: -.005em; }
.project-title { font-size: clamp(21px, 1.8vw, 24px); }
.body-copy, .about-copy { font-size: 17px; line-height: 1.75; }
.decision p, .expertise-item p, .experience-item p, .project-description, .meta-value { font-size: 16px; line-height: 1.65; }
.decision h3, .expertise-item h3 { font-size: 17px; }
.experience-company { font-size: 20px; }
.caption, figure figcaption { font-size: 13px; line-height: 1.6; color: #5E544B; }
.section-label, .kicker, .eyebrow, .meta-label { font-size: 12px; letter-spacing: .16em; }

/* One spacing scale */
.section { padding: 88px 0; }
.section-label { margin-bottom: 40px; }
.image-full { margin: 48px 0 16px; }
.image-pair, .image-trio, .image-quad, .decisions { margin-top: 48px; }
.grid-caption, figure figcaption { margin-top: 14px; }
@media (max-width: 800px) { .section { padding: 64px 0; } .section-label { margin-bottom: 28px; } }
.result { font-size: clamp(23px, 2.3vw, 31px); line-height: 1.45; }

/* Five-step sequence row */
.image-quad.five { grid-template-columns: repeat(5, 1fr); gap: 20px; }
@media (max-width: 800px) { .image-quad.five { grid-template-columns: repeat(2, 1fr); } }

/* Captions sit under their own image and never spill into the next block */
.image-pair, .image-trio, .image-quad { align-items: start; }
.image-pair img, .image-trio img, .image-quad img { height: auto; }
.image-pair + .image-pair, .image-pair + .image-quad, .image-quad + .image-pair { margin-top: 40px; }

/* Name spaced wide, echoing the resume header */
.name .mark { letter-spacing: .18em; font-size: 18px; padding-right: calc(14px - .18em); }
header.is-compact .name .mark { padding-right: calc(12px - .18em); }
@media (max-width: 800px) {
  .name .mark { font-size: 12px; letter-spacing: .14em; padding-right: calc(10px - .14em); }
}

/* Recognition: two featured honors, then a short press list */
.recog-featured { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-bottom: 56px; }
.recog-item { border-top: 1.5px solid var(--green); padding-top: 22px; }
.recog-year, .recog-y { font-size: 12px; letter-spacing: .16em; color: var(--muted); }
.recog-item h3 { font-size: clamp(23px, 2.3vw, 31px); line-height: 1.25; color: var(--ink); margin: 12px 0 12px; font-weight: 700; letter-spacing: -.01em; }
.recog-item p { font-size: 17px; line-height: 1.65; color: var(--text); margin: 0 0 18px; max-width: 520px; }
.recog-link { display: inline-block; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--green); text-decoration: none; margin-right: 22px; }
.recog-link:hover { color: var(--ink); }
.recog-list { list-style: none; margin: 0; padding: 0; }
.recog-row { display: grid; grid-template-columns: 96px minmax(0, 1.1fr) minmax(0, 1.7fr) 110px; gap: 24px; align-items: baseline; padding: 18px 0; border-top: 1px solid var(--rule); }
.recog-row:last-child { border-bottom: 0; }
.recog-t { font-size: 17px; font-weight: 700; color: var(--ink); }
.recog-d { font-size: 16px; line-height: 1.6; color: var(--text); }
.recog-l { text-align: right; white-space: nowrap; }
.recog-l .recog-link { margin-right: 0; }
@media (max-width: 800px) {
  .recog-featured { grid-template-columns: 1fr; gap: 36px; margin-bottom: 40px; }
  .recog-row { grid-template-columns: 1fr; gap: 6px; }
  .recog-l { text-align: left; }
}
.hero-image:has(+ .hero-caption) { margin-bottom: 0; }
.hero-caption { margin: 14px 0 74px; }
.hero-caption a { color: inherit; text-decoration: underline; text-decoration-color: var(--green-soft); text-underline-offset: 3px; }
.hero-caption a:hover { color: var(--green); }

/* Photo viewer for linked images */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(42,34,29,.88); display: flex; align-items: center; justify-content: center; padding: 48px 24px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.35); cursor: default; }
.lightbox-close { position: absolute; top: 16px; right: 20px; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.5); border-radius: var(--radius); background: transparent; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.lightbox-close:hover { border-color: #fff; }
html.lightbox-open { overflow: hidden; }
