:root, :root[data-theme="light"] {
  --body: Georgia, "Times New Roman", serif;
  --mono: var(--body);
  --paper: #f7efdf;
  --ink: #27211b;
  --heading: var(--ink);
  --muted: #5f5347;
  --red: #852724;
  --paper-wash: rgb(250 242 226 / 69%);
  --rule: #a99a86;
  --panel: rgb(255 248 232 / 48%);
  --gutter: clamp(1.1rem, 4.2vw, 4rem);
  --notebook-filter: brightness(1.075) saturate(.8);
  --notebook-edge: radial-gradient(ellipse 73% 72% at center, #000 64%, transparent 100%);
  --notebook-blend: multiply;
}

:root[data-theme="dark"] {
  --notebook-filter: brightness(.8) saturate(.78);
  --notebook-edge: none;
  --notebook-blend: normal;
  --heading: var(--ink);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --notebook-filter: brightness(.8) saturate(.78);
    --notebook-edge: none;
    --notebook-blend: normal;
    --heading: var(--ink);
  }
}

html { scroll-padding-top: 1rem; }
body { font: 1.125rem/1.58 var(--body); }
body :is(h1,h2,h3) { color: var(--heading); font-family: var(--display); font-weight: 400; }
.shell { max-width: 1400px; padding-inline: var(--gutter); }
.masthead {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .8rem clamp(.8rem, 2vw, 1.5rem);
  padding: .95rem 0 1rem;
  border-bottom: 1px solid var(--rule);
}
.masthead .brand {
  position: relative;
  justify-self: start;
  color: var(--heading);
  font: 400 clamp(1.6rem, 3.3vw, 2.65rem)/1.1 var(--display);
  white-space: nowrap;
}
.masthead .brand::after {
  content: "";
  position: absolute;
  inset: 100% 0 auto;
  border-bottom: 2px solid var(--red);
  border-radius: 100% 20% 70% 30%;
  transform: rotate(-.65deg);
}
.masthead nav {
  justify-content: flex-end;
  gap: clamp(.8rem, 3.3vw, 2.6rem);
  font: clamp(.95rem, 1.9vw, 1.26rem)/1.3 var(--body);
}
.masthead nav a[aria-current="page"] { color: var(--red); text-decoration: underline; }
.site-footer { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1.5rem; color: var(--muted); }
.site-footer a { margin-left: auto; }
.masthead .theme-picker {
  position: relative;
  justify-self: end;
  border: 0;
  margin: 0;
  padding: 0;
}
.masthead .theme-picker::after {
  content: "";
  position: absolute;
  right: .85rem;
  top: calc(50% - .25rem);
  width: .42rem;
  height: .42rem;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  transform: rotate(45deg);
  pointer-events: none;
}
.masthead .theme-picker select {
  appearance: none;
  min-height: 44px;
  padding: .45rem 1.85rem .45rem .75rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font: 1rem/1.2 var(--body);
}
.masthead .theme-picker select:hover { border-color: var(--red); }
.breadcrumb { color: var(--muted); }
.page-heading {
  display: block;
  min-height: 0;
  padding-top: clamp(1.9rem, 4vw, 3.6rem);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.7rem;
}
.page-heading h1, .typed-title { font: 400 clamp(2.65rem, 6.1vw, 5rem)/1.08 var(--display); }
.page-heading h1 { margin-bottom: .75rem; }
.page-heading .lead, .landing-lead { font: clamp(1.18rem, 2.3vw, 1.52rem)/1.45 var(--body); max-width: 60ch; }
.eyebrow, .story-label, .tag, .timeline .date, .curriculum-kind { color: var(--red); }
.page-content :is(h2,h3), .andromeda-story :is(h1,h2), .sample-hero h2 { font-family: var(--display); font-weight: 400; }
.page-content h2 { font-size: clamp(1.7rem, 3.3vw, 2.7rem); line-height: 1.15; }
.page-content h3 { font-size: clamp(1.35rem, 2.5vw, 1.9rem); line-height: 1.18; }
.page-content p, .consulting-folio p, .andromeda-story p { font: 1.125rem/1.6 var(--body); }
.page-content :is(.project-link,.course,.people li) { background: var(--panel); border-color: var(--rule); }
.project-link:hover, .course:hover { border-color: var(--red); }
.page-content .project-link h2 { margin-bottom: .5rem; }
.button-link, .course-status { color: var(--red); font: bold 1rem/1.45 var(--body); }
.button-link { border-color: var(--red); }
.course-status { display: inline-block; padding: 8px 0; }
.timeline .date { font-weight: bold; font-size: .9rem; }
.page-content > section[id] { scroll-margin-top: 1rem; }
.page-content .feature-divider {
  width: 50%;
  margin: 2.5rem auto;
  border: 0;
  border-top: 2px solid var(--red);
}
.architecture-plate img { filter: none; mix-blend-mode: normal; }
.consulting-folio { margin-top: 1.5rem; }
.consulting-intro h1, .andromeda-story h1 { line-height: 1.04; }
.andromeda-story .standfirst { font: 1.3rem/1.45 var(--body); color: var(--heading); }

@media (max-width: 920px) {
  .masthead { grid-template-columns: minmax(0, 1fr) auto; }
  .masthead nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: .4rem 1rem;
  }
  .masthead .theme-picker { grid-column: 2; grid-row: 1; }
}

@media (max-width: 400px) {
  .masthead .brand { font-size: 1.4rem; }
  .site-footer a { margin-left: 0; }
}

.page-heading.with-portrait {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 22rem);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4rem);
}
.about-portrait {
  display: block;
  width: 100%;
  height: auto;
}
@media (max-width: 640px) {
  .page-heading.with-portrait { grid-template-columns: minmax(0, 1fr); }
  .about-portrait { max-width: min(75%, 16rem); }
}
