:root {
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.3125rem;
  --step-2: 1.35rem;
  --step-3: 2rem;
  --step-4: clamp(3rem, 6vw, 5.6rem);
  --lede: 1.3rem;

  --gutter: 2.5rem;
  --page: 1240px;

  /* Route grid: date, rail, body, sources */
  --col-when: 10rem;
  --col-rail: 2.5rem;
  --col-body: 38rem;
  --col-sources: 13rem;
  --col-gap: 1.25rem;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  line-height: 1.6;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

.page {
  max-width: var(--page);
  margin-inline: auto;
}

/* Introduction */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 17rem);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  padding: 4rem var(--gutter) 3rem;
}

.intro h1 {
  font-size: var(--step-4);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.tagline {
  margin-top: 0.75rem;
  font-size: var(--step-1);
  color: var(--slate);
  font-weight: 500;
}

.lede {
  margin-top: clamp(2rem, 4vw, 3rem);
  max-width: 24em;
  font-size: var(--lede);
  line-height: 1.5;
  color: var(--slate);
  font-weight: 400;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.summary {
  margin-top: 1.5rem;
  max-width: 36em;
  color: var(--ink);
  text-wrap: pretty;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 2.25rem;
}

.portrait img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 3px;
  background: var(--shoal);
}

.portrait figcaption {
  margin-top: 0.625rem;
  font-size: var(--step--1);
  color: var(--slate);
}

.projects, .journey, .also, .contact, .site-foot {
  margin-inline: var(--gutter);
}

@media (max-width: 850px) {
  :root { --gutter: 1.5rem; }
}

/* The route */

.journey {
  position: relative;
  padding-block: clamp(3rem, 6vw, 5rem) 1rem;
  border-top: 1px solid var(--rule);
}

.route-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  clip-path: inset(0 0 0 0);
}

.route-line path {
  fill: none;
  stroke: var(--route);
  stroke-width: 2;
  stroke-linecap: round;
}

.route-line .is-undated {
  stroke-dasharray: 2 7;
}

.journey.is-drawing .route-line {
  clip-path: inset(0 0 100% 0);
}

.journey.is-drawn .route-line {
  transition: clip-path 2.2s cubic-bezier(0.45, 0, 0.2, 1);
}

.route-head,
.stop {
  display: grid;
  grid-template-columns: var(--col-when) var(--col-rail) minmax(0, var(--col-body)) minmax(0, var(--col-sources));
  column-gap: var(--col-gap);
  grid-template-areas: "when rail body sources";
}

.route-head {
  padding-bottom: 2.5rem;
}

.route-head > * {
  grid-column: body / sources-end;
}

.route-head h2 {
  font-size: var(--step-3);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.route-head p {
  margin-top: 0.75rem;
  max-width: 34em;
  color: var(--slate);
}

.route-head--earlier {
  padding-top: 1.5rem;
}

.stop {
  padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.stop-when {
  grid-area: when;
  text-align: right;
  font-size: 1rem;
  line-height: 1.8rem;
  color: var(--slate);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stop-field {
  display: block;
  font-size: var(--step--1);
}

.stop-rail {
  grid-area: rail;
  position: relative;
}

/* Straight fallback line until the script draws the path */
.stop-rail::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--route);
}

.route--earlier .stop-rail::before {
  background: repeating-linear-gradient(var(--route) 0 2px, transparent 2px 9px);
}

.has-route .stop-rail::before {
  display: none;
}

.stop-marker {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: calc(0.9rem - 7px);
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  border: 2px solid var(--route);
  background: var(--marker-fill);
}

.route--earlier .stop-marker {
  width: 11px;
  height: 11px;
  margin-left: -5.5px;
  top: calc(0.9rem - 5.5px);
}

/* Current position: the walker from the Subtle Path mark */
.is-current .stop-marker {
  width: 18px;
  height: 18px;
  margin-left: -9px;
  top: calc(0.9rem - 9px);
  background: var(--route);
  border-color: var(--route);
  box-shadow: 0 0 0 5px var(--paper);
}

.stop-walker {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: calc(0.9rem - 9px - 36px);
  width: 21px;
  height: 36px;
  margin-left: -11px;
  color: var(--ink);
}

.stop-body {
  grid-area: body;
  max-width: 38rem;
}

.stop-body h3 {
  font-size: var(--step-2);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.stop-role {
  margin-top: 0.15rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate);
}

.stop-body h3 + p {
  margin-top: 0.5rem;
}

.stop-body p + p {
  margin-top: 0.75rem;
}

.stop-body .stop-role + p {
  margin-top: 0.875rem;
}

.stop-sources {
  grid-area: sources;
  padding-top: 0.35rem;
  font-size: var(--step--1);
  line-height: 1.45;
  color: var(--slate);
}

.stop-sources p {
  font-weight: 600;
  color: var(--slate);
}

.stop-sources ul {
  margin-top: 0.375rem;
  display: grid;
  gap: 0.5rem;
  padding-left: 0.875rem;
  border-left: 1px solid var(--rule);
}

.stop-sources li span {
  display: block;
}

/* Also: service and education */

.also {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem clamp(1.5rem, 4vw, 3rem);
  padding-block: clamp(3rem, 6vw, 4.5rem);
  border-top: 1px solid var(--rule);
}

.also h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate);
}

.also h3 {
  margin-top: 0.5rem;
  font-size: var(--step-1);
  font-weight: 500;
  line-height: 1.5;
  color: var(--slate);
}

.also p {
  margin-top: 0.375rem;
  max-width: 28em;
}

.also .meta {
  color: var(--slate);
  font-size: 1rem;
}

/* Contact */

.contact {
  padding-block: clamp(3.5rem, 8vw, 6rem);
  border-top: 1px solid var(--rule);
}

.contact h2 {
  font-size: var(--step-3);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.contact p {
  margin-top: 1rem;
  max-width: 34em;
}

.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--rule);
  font-size: var(--step--1);
  color: var(--slate);
}

/* Error page */

.lost {
  padding-block: clamp(4rem, 12vw, 9rem);
  max-width: 34rem;
}

.lost h1 {
  font-size: var(--step-3);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.lost p {
  margin-top: 1rem;
}

/* Medium screens: sources move under each entry */

@media (max-width: 68rem) {
  .route-head,
  .stop {
    grid-template-columns: var(--col-when) var(--col-rail) minmax(0, 1fr);
    grid-template-areas:
      "when rail body"
      "when rail sources";
  }

  .route-head > * {
    grid-column: body;
  }

  .stop-sources {
    padding-top: 1rem;
    max-width: 38rem;
  }

  .stop-sources ul {
    border-left: 0;
    padding-left: 0;
  }
}

@media (max-width: 52rem) {
  .intro {
    grid-template-columns: minmax(0, 1fr);
  }

  .portrait {
    grid-row: 1;
    width: 7.5rem;
  }

  .portrait figcaption {
    display: none;
  }

  .also {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Small screens: the date joins the entry, the rail hugs the edge */

@media (max-width: 40rem) {
  :root {
    --col-rail: 1.5rem;
    --col-gap: 0.875rem;
  }

  .route-head,
  .stop {
    grid-template-columns: var(--col-rail) minmax(0, 1fr);
    grid-template-areas:
      "rail when"
      "rail body"
      "rail sources";
  }

  .stop-when {
    text-align: left;
    line-height: 1.5rem;
  }

  .stop-marker {
    top: calc(0.75rem - 7px);
  }

  .is-current .stop-marker {
    top: calc(0.75rem - 9px);
  }

  .stop-walker {
    top: calc(0.75rem - 9px - 36px);
  }

  .route--earlier .stop-marker {
    top: calc(0.75rem - 5.5px);
  }

  .stop-body h3 {
    margin-top: 0.125rem;
  }

  .masthead {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .journey.is-drawn .route-line {
    transition: none;
  }
}

/* Print: a compact one-column résumé */

@media print {
  :root {
    --paper: #fff;
    --ink: #000;
    --slate: #3a3a3a;
    --route: #000;
    --rule: #bbb;
    --mark-filter: none;
  }

  @page {
    margin: 0.6in 0.7in;
  }

  body {
    font-size: 9.5pt;
    line-height: 1.4;
  }

  .skip,
  .masthead,
  .actions,
  .route-line,
  .stop-rail,
  .route-head p,
  .stop-sources > p,
  .contact,
  .portrait {
    display: none !important;
  }

  .page {
    padding: 0;
    max-width: none;
  }

  .projects, .journey, .also, .contact, .site-foot {
    margin-inline: 0;
  }

  .intro,
  .route-head,
  .stop {
    display: block;
    padding: 0;
  }

  .intro h1 {
    font-size: 22pt;
  }

  .tagline {
    margin-top: 2pt;
    font-size: 11pt;
  }

  .lede {
    margin-top: 8pt;
    max-width: none;
    font-size: 11.5pt;
  }

  .summary {
    margin-top: 6pt;
    max-width: none;
  }

  .journey {
    padding: 10pt 0 0;
  }

  .route-head h2 {
    font-size: 13pt;
    margin-bottom: 6pt;
  }

  .route-head--earlier {
    padding-top: 4pt;
  }

  .route-head {
    break-after: avoid;
  }

  .stop {
    padding-bottom: 9pt;
    break-inside: avoid;
  }

  .stop-when {
    text-align: left;
    line-height: 1.3;
    font-size: 8.5pt;
  }

  .stop-body {
    max-width: none;
  }

  .stop-body h3 {
    display: inline;
    font-size: 11pt;
  }

  .stop-role {
    display: inline;
    margin-left: 6pt;
    font-size: 9.5pt;
  }

  .stop-body h3 + p,
  .stop-body .stop-role + p,
  .stop-body p + p {
    margin-top: 3pt;
  }

  .stop-sources {
    padding-top: 3pt;
    font-size: 8pt;
  }

  .stop-sources ul {
    display: block;
    margin: 0;
    border: 0;
    padding: 0;
  }

  .stop-sources li,
  .stop-sources li span {
    display: inline;
  }

  .stop-sources li + li::before {
    content: "; ";
  }

  .stop-sources li span::before {
    content: ", ";
  }

  .stop-sources a::after {
    content: " (" attr(href) ")";
    word-break: break-all;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  .also {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8pt 0;
    gap: 8pt 18pt;
  }

  .also h3 {
    font-size: 10.5pt;
    margin-top: 2pt;
  }

  .also h2,
  .also .meta {
    font-size: 9pt;
  }

  .site-foot {
    padding: 6pt 0 0;
    font-size: 8pt;
  }
}

/* Home: the studio leads, the maker follows the work */

.intro--studio {
  display: block;
  padding-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-bottom: 0;
}

.intro--studio .lede {
  margin-top: 1.25rem;
}

.maker {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: start;
  margin-inline: var(--gutter);
  padding-block: clamp(3rem, 6vw, 4.5rem);
  border-top: 1px solid var(--rule);
}

.maker-portrait img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 3px;
  background: var(--shoal);
}

.maker h2 {
  font-size: var(--step-1);
  font-weight: 500;
}

.maker p {
  margin-top: 0.75rem;
  max-width: 44em;
  text-wrap: pretty;
}

.maker .actions {
  margin-top: 1.25rem;
}

@media (max-width: 30rem) {
  .maker {
    grid-template-columns: minmax(0, 1fr);
  }

  .maker-portrait {
    width: 6rem;
  }
}

