@font-face {
  font-family: "Bodoni Moda";
  src: url("/fonts/bodoni-moda-opsz.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bodoni Moda";
  src: url("/fonts/bodoni-moda-opsz-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f4f0e8;
  --paper-deep: #ebe5d9;
  --ink: #161310;
  --muted: #736a5e;
  --line: rgb(22 19 16 / 14%);
  --accent: #d2381c;
  --serif: "Bodoni Moda", "Bodoni 72", Didot, Georgia, serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section-gap: clamp(2rem, 5vw, 4.5rem);
  --label: 500 .6875rem/1.2 var(--sans);
  --tracking: .14em;
  --opsz: 11;
}

/* Bodoni Moda at its text optical size keeps hairlines sturdy; Instrument Sans has no opsz axis and ignores it.
   !important because every `font:` shorthand would otherwise reset the variation settings. */
*, ::before, ::after { font-variation-settings: "opsz" var(--opsz) !important; }

* { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background: var(--paper);
  font: 400 1rem/1.65 var(--sans);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--ink); color: var(--paper); }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
img { display: block; max-width: 100%; height: auto; }
button, summary { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
/* No focus rings or tap flashes anywhere: a deliberate design choice for this portfolio. */
*, ::before, ::after { -webkit-tap-highlight-color: transparent; }
:focus, :focus-visible { outline: none; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: absolute; z-index: 5; top: .5rem; left: .5rem; background: var(--paper); padding: .5rem .75rem; }

/* Shell: artwork left, signature, navigation and contact right */
.site {
  display: grid;
  grid-template-areas: "head" "menu" "art";
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: var(--section-gap);
  width: min(1180px, calc(100% - 2 * var(--gutter)));
  margin: clamp(1.25rem, 4vw, 3.5rem) auto;
}
main { grid-area: art; min-width: 0; }
.rail { display: contents; }
.masthead { grid-area: head; }
.menu { grid-area: menu; }
.menu-toggle { display: none; }
.site-foot { display: none; }
.signature { display: block; width: fit-content; }
.signature .logo { display: block; width: 197px; max-width: 100%; height: auto; color: var(--ink); transition: opacity .3s; }

nav {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: space-between;
  margin-top: 1.5rem;
  border-block: 1px solid var(--line);
}
nav a {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: .25rem .25rem;
  text-decoration: none;
  font: 500 1.125rem/1 var(--serif);
  --opsz: 6;
  letter-spacing: .01em;
  transition: color .3s;
}
nav a::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--ease-out);
}
nav a[aria-current] { font-style: italic; font-weight: 600; }
nav a[aria-current]::after { transform: scaleX(1); background: var(--accent); }

address {
  display: flex;
  flex-direction: column;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8125rem;
  font-style: normal;
  line-height: 1.75;
}
address strong { margin-bottom: .5rem; color: var(--ink); font: var(--label); letter-spacing: var(--tracking); text-transform: uppercase; }
address .address-break { margin-top: .875rem; }
address a { color: var(--ink); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .45s var(--ease-out); }

.eyebrow { display: flex; gap: .75rem; margin: 0 0 1.25rem; color: var(--muted); font: var(--label); letter-spacing: var(--tracking); text-transform: uppercase; }
.eyebrow span { display: flex; align-items: center; gap: .75rem; color: var(--accent); }
.eyebrow span::before { content: ""; width: 1.5rem; height: 1px; background: var(--line); }

/* Page header for the gallery pages: one compact line, headline left, section and count right */
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1.5rem; margin-bottom: clamp(1.25rem, 3vw, 2rem); padding-bottom: .9rem; border-bottom: 1px solid var(--line); }
.page-head h1 { margin: 0; font: 400 clamp(2rem, 4.2vw, 2.875rem)/1.05 var(--serif); letter-spacing: -.01em; }
.page-head .eyebrow { margin: 0; }

/* Portrait entrance */
.portraits { display: grid; gap: 1rem; justify-items: start; align-items: start; }
.portraits figure { min-width: 0; max-width: 100%; margin: 0; overflow: hidden; background: var(--paper-deep); }
.portraits img { transform-origin: var(--focus, 50% 40%); }

/* Phone start page: the menu-layer list, on paper, between the portrait and the two photographs. */
.home-nav { display: flex; flex-direction: column; width: 100%; margin: .5rem 0; border-top: 1px solid var(--line); counter-reset: item; }
.home-nav a {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  padding: .4rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  font: 400 clamp(2.5rem, 12vw, 3.5rem)/1.1 var(--serif);
}
.home-nav a::before {
  content: "0" counter(item);
  counter-increment: item;
  flex: none;
  width: 2.1rem;
  margin-right: -.35rem;
  color: var(--muted);
  font: 500 1.0625rem/1 var(--sans);
  letter-spacing: .04em;
}
.home-nav a:active { color: var(--accent); }
.home-nav a:active::before { color: var(--accent); }
.portraits figure:nth-child(1) { --focus: 48% 30%; }
.portraits figure:nth-child(2) { --focus: 62% 35%; }
.portraits figure:nth-child(3) { --focus: 85% 95%; } /* keeps the printed caption in frame */

/* Vitae */
.vitae { max-width: 46rem; }
.vitae-head h1 { display: flex; flex-direction: column; margin: 0; font-family: var(--serif); font-weight: 400; }
.vitae-name {
  font-size: clamp(2.5rem, 7vw, 4.75rem);
  line-height: .95;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.vitae-alias {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: .9rem;
  color: var(--accent);
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.1;
}
.vitae-alias::before { content: ""; width: 2.5rem; height: 1px; background: currentColor; }

.vitae-text { margin-top: clamp(2.25rem, 5vw, 3.5rem); }
.vitae-text p { margin: 0 0 1.25rem; hyphens: auto; hyphenate-limit-chars: 10 4 4; text-wrap: pretty; }
.vitae-text .lede {
  margin-bottom: 2rem;
  font: 500 clamp(1.125rem, 2vw, 1.375rem)/1.55 var(--serif);
  hyphens: manual;
}
.vitae-text .lede::first-letter {
  float: left;
  margin: .08em .1em 0 0;
  font-size: 4.1em;
  line-height: .78;
  font-style: italic;
}
.pullquote {
  margin: 2.5rem 0;
  padding: 1.75rem 0;
  border-block: 1px solid var(--line);
  font: italic 500 clamp(2rem, 5vw, 3.25rem)/1 var(--serif);
  letter-spacing: -.01em;
}
.pullquote span {
  display: block;
  margin-top: .75rem;
  color: var(--muted);
  font: var(--label);
  font-style: normal;
  letter-spacing: var(--tracking);
  text-transform: uppercase;
}

.timeline { margin-top: clamp(3.5rem, 8vw, 6rem); --year-col: 4.75rem; --rail-col: 1.75rem; }
.timeline h2 {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 2.5rem;
  font: italic 500 clamp(1.5rem, 3vw, 2rem)/1 var(--serif);
}
.timeline h2 i { flex: 1; height: 1px; background: var(--line); }
.timeline ol { position: relative; margin: 0; padding: 0; list-style: none; }
.timeline ol::before,
.timeline ol::after {
  content: "";
  position: absolute;
  top: .9rem;
  bottom: .9rem;
  left: calc(var(--year-col) + var(--rail-col) / 2);
  width: 1px;
  z-index: 0;
  background: var(--line);
}
.timeline ol::after { background: var(--accent); transform: scaleY(var(--fill, 0)); transform-origin: top; }
.timeline li {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--year-col) var(--rail-col) minmax(0, 1fr);
  align-items: baseline;
  padding-block: .55rem;
}
.timeline-text::before {
  content: "";
  position: absolute;
  top: calc(.5lh - 4.5px);
  left: calc(var(--rail-col) / -2 - 4.5px);
  z-index: 1;
  width: 9px;
  height: 9px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  transition: background .4s, border-color .4s, transform .5s var(--ease-out);
}
.is-repeat .timeline-text::before { top: calc(.5lh - 2.5px); left: calc(var(--rail-col) / -2 - 2.5px); width: 5px; height: 5px; background: var(--ink); }
.timeline li.is-reached .timeline-text::before { background: var(--accent); border-color: var(--accent); }
.timeline-year {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  font: italic 500 1.625rem/1 var(--serif);
  font-variant-numeric: lining-nums;
  letter-spacing: -.01em;
}
.timeline-year span { display: block; }
.timeline-year small { display: block; margin-top: .3rem; color: var(--muted); font: 400 .75rem/1 var(--sans); font-style: normal; letter-spacing: .04em; }
.is-repeat .timeline-year { visibility: hidden; }
.timeline-text { position: relative; grid-column: 3; grid-row: 1; margin: 0; text-wrap: pretty; }

@media (min-width: 34rem) {
  .portraits:has(figure ~ figure) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .portraits:has(figure ~ figure) :is(figure, img) { width: 100%; }
  /* Start page trio: the portrait column keeps its height, the two stacked photographs share the
     wider right column and are stretched (with a few pixels of cover cropping) into one block. */
  .portraits:has(figure ~ figure ~ figure) { grid-template-columns: .656fr .74fr; align-items: stretch; }
  .portraits:has(figure ~ figure ~ figure) figure:first-child { grid-row: span 2; }
  .portraits:has(figure ~ figure ~ figure) img { height: 100%; object-fit: cover; }
  /* Between phone and desktop the photographs stay one block; the page list follows below it. */
  .home-nav { grid-column: 1 / -1; order: 1; }
  .timeline { --year-col: 7.5rem; --rail-col: 3rem; }
  .timeline li { padding-block: .9rem; }
  .timeline-year { font-size: 2.25rem; }
  .timeline-year small { font-size: .8125rem; }
  .timeline-text { font-size: 1.0625rem; }
}

@media (min-width: 52rem) {
  .home-nav { display: none; }
  .site {
    grid-template: "art rail" / minmax(0, 1fr) 12.5rem;
    column-gap: clamp(2.5rem, 6vw, 5.5rem);
  }
  /* Logo, menu and contact form one column that stays put, so page changes start and end in the same place. */
  .rail { grid-area: rail; display: flex; flex-direction: column; }
  .menu { display: contents; }
  .masthead { position: relative; }
  .signature { margin-left: auto; }
  nav {
    grid-template-columns: 1fr;
    justify-items: end;
    justify-content: stretch;
    gap: .15rem;
    margin-top: 3rem;
    border: 0;
  }
  nav a {
    display: flex;
    align-items: center;
    gap: .8rem;
    min-height: 2.5rem;
    padding: 0;
    font-size: 1.625rem;
  }
  nav a::after { position: static; order: -1; width: 2.75rem; height: 1px; transform-origin: right; }
  nav a[aria-current]::after { height: 2px; }
  address { margin-top: 3rem; padding-top: 1.5rem; text-align: right; align-items: flex-end; }
  .vitae-text p:not(.lede) { font-size: .9375rem; }
  .vitae-text { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; }
  .vitae-text .lede, .pullquote { grid-column: 1 / -1; }
}

@media (min-width: 52rem) and (min-height: 40rem) {
  .rail { position: sticky; top: clamp(1.25rem, 4vw, 3.5rem); view-transition-name: rail; }
  nav a[aria-current]::after { view-transition-name: nav-mark; }
}

/* Phones: slim sticky bar with logo and burger; the menu and contact open as a full-screen layer.
   Without JavaScript the inline menu above the content stays as it is. */
@media (width < 52rem) {
  /* Phone screens render Bodoni lighter than desktop: smallest optical size and a heavier cut. */
  :root { --opsz: 6; }
  .page-head h1, .vitae-name, .pullquote, .timeline h2 { font-weight: 500; }
  .page-head { row-gap: .9rem; margin-bottom: 1rem; padding-bottom: .9rem; }
  .page-head h1 { flex-basis: 100%; font-size: 1.875rem; line-height: 1.1; }
  .vitae-head .eyebrow { margin-bottom: .75rem; }

  .js .site { grid-template-areas: "head" "art" "foot"; row-gap: 1.25rem; margin-top: 0; }
  /* The contact block also closes every page, as before the menu layer existed. */
  .js .site-foot { display: flex; grid-area: foot; margin-top: .75rem; font-size: .9375rem; line-height: 1.7; }
  .js .site-foot strong { font-size: .75rem; }
  .js .masthead {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-inline: calc(-1 * var(--gutter));
    padding: calc(.75rem + env(safe-area-inset-top)) var(--gutter) .75rem;
    background: rgb(244 240 232 / 88%);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: background-color .4s, color .4s;
  }
  .js .signature .logo { width: 178px; transition: color .4s; }
  .js .menu-toggle {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-right: -11px;
    padding: 0;
    border: 0;
    background: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform .2s var(--ease-out), border-color .4s;
  }
  .js .menu-toggle:active { transform: scale(.92); }
  /* Two heavy bars, the lower one shorter: a nod to the bold half of the THEOGRAFX mark. */
  .menu-icon { position: relative; width: 26px; height: 12px; }
  .menu-icon i {
    position: absolute;
    right: 0;
    height: 3px;
    background: currentColor;
    transition: top .25s .2s var(--ease-out), transform .3s var(--ease-out), width .3s var(--ease-out), background-color .4s;
  }
  .menu-icon i:first-child { top: 0; width: 26px; }
  .menu-icon i:last-child { top: 9px; width: 15px; }

  .js .menu {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2.5rem;
    padding: calc(5.5rem + env(safe-area-inset-top)) var(--gutter) calc(1.75rem + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #161310;
    color: #f4f0e8;
    visibility: hidden;
    clip-path: inset(0 0 100% 0);
    transition: clip-path .55s var(--ease-in-out), visibility 0s .55s;
  }
  .js .menu nav { display: flex; flex-direction: column; margin: 0; border: 0; }
  .js .menu nav a {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 1.1rem;
    min-height: 0;
    padding: .4rem 0;
    border-bottom: 1px solid rgb(244 240 232 / 12%);
    font-size: clamp(2.5rem, 12vw, 3.5rem);
    line-height: 1.1;
    opacity: 0;
    transform: translateY(1.5rem);
    transition: opacity .2s, transform .3s var(--ease-in-out);
  }
  .js .menu nav a::before {
    content: "0" counter(item);
    counter-increment: item;
    flex: none;
    width: 2.1rem;
    margin-right: -.35rem;
    color: rgb(244 240 232 / 45%);
    font: 500 1.0625rem/1 var(--sans);
    font-style: normal;
    letter-spacing: .04em;
  }
  .js .menu nav { counter-reset: item; }
  .js .menu nav a::after { display: none; }
  .js .menu nav a[aria-current] { color: var(--accent); }
  .js .menu nav a[aria-current]::before { color: var(--accent); }
  .js .menu address {
    margin: 0;
    padding-top: 1.25rem;
    border-top: 1px solid rgb(244 240 232 / 18%);
    color: rgb(244 240 232 / 58%);
    opacity: 0;
    transition: opacity .2s;
  }
  .js .menu address strong { color: #f4f0e8; }
  .js .menu address a { color: #f4f0e8; }

  .menu-open { overflow: hidden; }
  .menu-open .masthead { background-color: transparent; color: #f4f0e8; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .menu-open .signature .logo { color: #f4f0e8; }
  .menu-open .menu-icon i { top: 4.5px; width: 26px; transition: top .25s var(--ease-out), transform .35s .2s var(--ease-out), background-color .4s; }
  .menu-open .menu-icon i:first-child { transform: rotate(45deg); }
  .menu-open .menu-icon i:last-child { transform: rotate(-45deg); }
  .menu-open .menu { visibility: visible; clip-path: inset(0); transition: clip-path .7s var(--ease-out), visibility 0s; }
  .menu-open .menu nav a { opacity: 1; transform: none; transition: opacity .5s calc(.15s + var(--n) * .07s), transform .8s var(--ease-out) calc(.15s + var(--n) * .07s); }
  .menu-open .menu address { opacity: 1; transition: opacity .6s .5s; }
}

/* Motion: page changes, entrances and scroll-drawn timeline */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; animation-timing-function: ease; }
  ::view-transition-group(nav-mark) { animation-duration: .5s; animation-timing-function: var(--ease-out); }

  .portraits figure { animation: fade-in .9s ease backwards; animation-delay: calc(var(--i) * .12s); }
  .home-nav a { animation: rise-in .8s var(--ease-out) backwards; animation-delay: calc(.15s + var(--n) * .07s); }
  /* A slow breathing zoom inside each fixed frame, out of step from picture to picture. */
  .portraits img { animation: breathe 11s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -3.7s); will-change: transform; }
  .vitae-head h1 > * { animation: rise-in 1s var(--ease-out) backwards; }
  .vitae-alias { animation-delay: .15s !important; }

  @supports (animation-timeline: view()) {
    .timeline li { animation: rise-in linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
    .pullquote { animation: rise-in linear both; animation-timeline: view(); animation-range: entry 0% entry 80%; }
  }
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes breathe { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(1.25rem); } }


/* Hover looks only where a pointer can hover; on touch screens they would stick after a tap. */
@media (hover: hover) {
  .signature:hover .logo { opacity: .65; }
  nav a:hover::after { transform: scaleX(1); }
  address a:hover { background-size: 100% 1px; }
  .timeline li:hover .timeline-text::before { background: var(--accent); border-color: var(--accent); }
  .timeline li:hover .timeline-text::before { transform: scale(1.35); }
  .timeline li:hover .timeline-year { color: var(--accent); }
}
