/* jamesdollah.com
   "Monochrome record": black and white, set like a well-made race report.
   Type, figures and hairlines only; colour arrives later through photographs.
   Order comes from size and two tones of grey, never from an accent colour.
   Headings and big figures are set in Archivo (saved in the site); reading text
   is the visitor's system font (San Francisco on Apple devices).
   Nothing is loaded from other companies. */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/Archivo-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #0b0b0c;
  --grey: #737378;
  --hair: #e4e4e6;
  --panel: #f5f5f6;
  --track: #ececee;

  --font: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", "Archivo", sans-serif;
  --display: "Archivo", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --max: 1440px;
  --g: clamp(16px, 4vw, 56px);
  --gap: 20px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  /* Fine film grain for the dark surfaces, drawn in the page itself. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 .09 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --nav: 52px;

  --s3: clamp(24px, 2.4vw, 30px);
  --s4: clamp(32px, 3.2vw, 40px);
  --s5: clamp(48px, 4.8vw, 60px);
  --s6: clamp(64px, 6.4vw, 80px);
  --s7: clamp(80px, 9vw, 120px);
}

/* The one dark surface: results and the footer. */
.on-ink,
.foot {
  --paper: #0b0b0c;
  --ink: #f4f4f5;
  --grey: #8e8e93;
  --hair: rgba(255, 255, 255, 0.14);
  --track: rgba(255, 255, 255, 0.14);
  --panel: #161618;
  background: var(--grain) var(--paper);
  color: var(--ink);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(16px, 0.96rem + 0.2vw, 18px);
  line-height: 1.55;
  letter-spacing: -0.011em;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, figure, blockquote, dl, dd { margin: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--ink); color: var(--paper); }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--g);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
}
.skip:focus { top: 12px; }

/* ---------- Type ---------- */

.hero__name,
.display,
.h2,
.split__num,
.tally strong,
.contents__fig,
.contents__name,
.local__title,
.index__name {
  font-family: var(--display);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.display {
  font-size: clamp(60px, 1.6rem + 9.4vw, 168px);
  font-weight: 800;
  font-stretch: 72%;
  line-height: 0.9;
  letter-spacing: -0.03em;
}
.h2 {
  font-size: clamp(28px, 1.2rem + 2.4vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.lede {
  font-size: clamp(20px, 1.05rem + 0.9vw, 30px);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.022em;
  text-wrap: pretty;
}
.label {
  display: block;
  margin-bottom: 12px;
  color: var(--grey);
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.stop { color: inherit; }

/* Headlines break into evenly sized lines instead of leaving one word alone. */
h1, h2, h3, .display, .h2 { text-wrap: balance; }

/* The site's voice: a sentence starts in ink and finishes in grey. */
.hero__lede,
.opener .lede,
.note blockquote p { color: var(--grey); }
.hi { color: var(--ink); }

.more {
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.24em;
  text-decoration-color: var(--grey);
  transition: text-decoration-color 0.2s var(--ease);
}
.more:hover { text-decoration-color: currentColor; }

.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { opacity: 0.84; }
.btn:active { transform: scale(0.98); }

/* Gaps James must check: a dashed outline, removed once the gap is filled. */
.check {
  outline: 1.5px dashed #a1a1a6;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Global bar ---------- */

.head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
}
/* A blurred bar traps fixed children inside itself, which would squash the open phone menu to the bar's height. */
.head:has(.nav-mobile[open]) {
  background: var(--paper);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
/* On chapter pages the chapter bar sticks instead. */
body:has(.local) .head { position: relative; }

.head__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav);
}
.mark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.012em;
}

.nav ol {
  display: flex;
  gap: clamp(18px, 2.6vw, 36px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav a {
  display: block;
  padding-block: 12px;
  color: var(--grey);
  font-size: 14px;
  transition: color 0.2s var(--ease);
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--ink); }
.nav small,
.nav-mobile small { display: none; }

/* Phone menu: a full-screen white sheet; the two lines turn into a cross. */
.nav-mobile { display: none; }
.nav-mobile summary {
  display: grid;
  place-items: center;
  width: 48px;
  height: var(--nav);
  margin-right: -14px;
  list-style: none;
  cursor: pointer;
}
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile summary > span:last-child {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.burger { position: relative; width: 18px; height: 12px; }
.burger i {
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.35s var(--ease), top 0.35s var(--ease);
}
.burger i:first-child { top: 2px; }
.burger i:last-child { top: 8.5px; }
.nav-mobile[open] .burger i { top: 5.25px; }
.nav-mobile[open] .burger i:first-child { transform: rotate(45deg); }
.nav-mobile[open] .burger i:last-child { transform: rotate(-45deg); }

.nav-mobile ol {
  position: fixed;
  inset: var(--nav) 0 0;
  z-index: 39;
  margin: 0;
  padding: 12px var(--g) 48px;
  list-style: none;
  background: var(--paper);
  overflow-y: auto;
}
.nav-mobile li { border-bottom: 1px solid var(--hair); }
.nav-mobile ol a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 16px 0;
  font-family: var(--display);
  font-size: 34px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.035em;
}
.nav-mobile ol small {
  display: inline;
  min-width: 1.6em;
  color: var(--grey);
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: 0;
}
.nav-mobile ol a[aria-current="page"] { color: var(--grey); }
.nav-mobile[open] li { animation: menu-in 0.5s var(--ease) both; }
.nav-mobile[open] li:nth-child(2) { animation-delay: 0.03s; }
.nav-mobile[open] li:nth-child(3) { animation-delay: 0.06s; }
.nav-mobile[open] li:nth-child(4) { animation-delay: 0.09s; }
.nav-mobile[open] li:nth-child(5) { animation-delay: 0.12s; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } }
body:has(.nav-mobile[open]) { overflow: hidden; }

/* ---------- Chapter bar (chapter pages) ---------- */

.local {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  box-shadow: inset 0 -1px 0 #e4e4e6;
}
.local__row {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 56px;
}
.local__title {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  flex: none;
  font-size: 20px;
  letter-spacing: -0.03em;
}
.local ul {
  display: flex;
  gap: 26px;
  min-width: 0;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.local ul::-webkit-scrollbar { display: none; }
.local ul a {
  display: block;
  padding-block: 16px;
  color: var(--grey);
  font-size: 14px;
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}
.local ul a:hover,
.local ul a.is-on { color: var(--ink); }

/* ---------- Home: hero ---------- */

.hero { padding: var(--s5) 0 var(--s6); }
.hero__now {
  margin-bottom: var(--s5);
  color: var(--grey);
  font-size: 14px;
}
.hero__now .more { color: var(--ink); }
/* Text links beside buttons are as easy to hit as the buttons. */
.hero__ctas .more { display: inline-flex; align-items: center; min-height: 44px; }
/* A small live dot: this chapter is still being written. */
.pulse {
  position: relative;
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 10px;
  vertical-align: 1px;
  border-radius: 50%;
  background: var(--ink);
}
.pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--ink);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  from { transform: scale(1); opacity: 0.45; }
  to { transform: scale(3.2); opacity: 0; }
}

/* The name fills the width of the page, in heavy condensed type like a kit number or a fixture poster. */
.hero__name {
  margin-left: -0.04em;
  font-size: min(19.1vw, 278px);
  font-weight: 800;
  font-stretch: 72%;
  line-height: 0.84;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
/* The one entrance: each word of the name rises into place on arrival. */
.hero__name .w {
  display: inline-block;
  clip-path: inset(-40% -10% -0.08em -10%);
}
.hero__name .w > span {
  display: inline-block;
  animation: rise 1.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero__name .w + .w > span { animation-delay: 0.09s; }
@keyframes rise { from { transform: translateY(105%); } }

.hero__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  margin-top: var(--s5);
}
.hero__text { grid-column: 1 / span 7; }
.hero__grid .meta { grid-column: 9 / -1; align-self: end; grid-template-columns: 1fr 1fr; }
.hero__lede {
  max-width: 26ch;
  font-size: clamp(22px, 1.1rem + 1.25vw, 36px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.025em;
  text-wrap: pretty;
}
.hero__ctas {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: var(--s4);
}

/* Facts: label then value, on hairlines. */
.meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 var(--gap);
}
.meta div {
  padding: 14px 0 16px;
  border-top: 1px solid var(--hair);
}
.meta dt { color: var(--grey); font-size: 13px; line-height: 1.4; }
.meta dd { margin-top: 4px; font-size: 15px; line-height: 1.4; text-wrap: pretty; }

/* ---------- Home: contents ---------- */

.contents ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.contents a {
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: start;
  column-gap: 12px;
  height: 100%;
  padding: 18px 0 8px;
  border-top: 1px solid var(--ink);
}
.contents__no { color: var(--grey); font-size: 14px; line-height: 28px; }
.contents__name {
  font-size: clamp(22px, 1rem + 0.8vw, 28px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.contents__when { grid-column: 2; margin-top: 2px; color: var(--grey); font-size: 14px; }
.contents__fig {
  grid-column: 1 / -1;
  margin-top: var(--s5);
  font-size: clamp(56px, 1.8rem + 4.4vw, 108px);
  font-weight: 750;
  font-stretch: 75%;
  line-height: 0.9;
  letter-spacing: -0.025em;
}
.contents__what { grid-column: 1 / -1; margin-top: 10px; color: var(--grey); font-size: 14px; line-height: 1.4; }
.contents a:hover .contents__name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.14em; }

/* ---------- Sections ---------- */

.section { padding-block: var(--s7); }
.section__head { margin-bottom: var(--s5); }
.section__head .h2 { max-width: 16ch; }

/* ---------- How I work ---------- */

.note {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  padding-top: 18px;
  border-top: 1px solid var(--hair);
}
.note .label { grid-column: 1 / -1; }
.note blockquote { grid-column: 1 / span 8; align-self: end; margin: 0; }
.note blockquote p {
  font-family: var(--display);
  font-size: clamp(32px, 1rem + 3.4vw, 76px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: pretty;
}
.note__photo { grid-column: 9 / -1; align-self: start; }

/* ---------- Chapter opener ---------- */

.opener { padding-block: var(--s6); }
.opener__num { margin-bottom: var(--s4); color: var(--grey); font-size: 14px; }
.opener__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--s4) var(--gap);
  align-items: start;
  margin-top: var(--s4);
}
.opener__grid > .lede { grid-column: 1 / 8; }
.opener__grid > .photo { grid-column: 9 / -1; }
@media (max-width: 900px) {
  .opener__grid > .lede,
  .opener__grid > .photo { grid-column: 1 / -1; }
}
.opener .lede {
  max-width: 30ch;
  font-size: clamp(22px, 1.1rem + 1.25vw, 36px);
  line-height: 1.18;
  letter-spacing: -0.025em;
}
.opener .meta { margin-top: var(--s5); }

/* ---------- Stories (chapter pages) ---------- */

.section.wrap + .section.wrap { padding-top: 0; }
.story {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  padding-top: 20px;
  border-top: 1px solid var(--hair);
}
.story__side { grid-column: 1 / span 4; }
.story__side > * { position: sticky; }
.story__side .label { top: 76px; }
.story__side .h2 { top: 104px; max-width: 12ch; }
.story__body {
  grid-column: 6 / -1;
  display: grid;
  gap: var(--s4);
  align-content: start;
  min-width: 0;
}
.story__body .lede { max-width: 32ch; }

.points {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--hair);
}
.points li {
  max-width: 62ch;
  padding: 14px 0 15px;
  border-top: 1px solid var(--hair);
  text-wrap: pretty;
}

/* Short facts, set like a spec sheet. */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0 var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.facts li {
  padding: 10px 0 11px;
  border-top: 1px solid var(--hair);
  font-size: 15px;
}

/* ---------- Results: the split sheet ---------- */

.splits { border-bottom: 1px solid var(--hair); }
.split { padding: 20px 0 clamp(28px, 3vw, 40px); border-top: 1px solid var(--hair); }
.split__what { color: var(--grey); font-size: 14px; line-height: 1.4; }
.split__row {
  display: grid;
  grid-template-columns: auto minmax(40px, 1fr) auto;
  align-items: end;
  gap: clamp(14px, 2vw, 28px);
  margin-top: 18px;
}
.split__from,
.split__to { display: flex; flex-direction: column; }
.split__num {
  font-size: clamp(52px, 1.6rem + 5.6vw, 136px);
  font-weight: 750;
  font-stretch: 75%;
  line-height: 0.88;
  letter-spacing: -0.025em;
  white-space: nowrap;
}
.split__from .split__num {
  color: var(--grey);
  font-size: clamp(26px, 1rem + 1.8vw, 48px);
}
.split__unit { margin-top: 10px; color: var(--grey); font-size: 14px; line-height: 1.35; }
.split__to .split__unit { text-align: right; }
.split__track {
  position: relative;
  align-self: center;
  height: 1px;
  margin-bottom: 26px;
  background: var(--track);
}
.split__track i {
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform-origin: left;
  transition: transform 1.2s var(--ease) 0.15s;
}
.split__track i::after {
  content: "";
  position: absolute;
  right: -3px;
  top: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}
.js .split:not(.is-in) .split__track i { transform: scaleX(0); }
.split__note { margin-top: 16px; color: var(--grey); font-size: 14px; }

/* Inside a story the figures sit a size smaller. */
.story .split { padding-bottom: 0; }
.story .split__num { font-size: clamp(40px, 1.2rem + 3.6vw, 84px); }
.story .split__from .split__num { font-size: clamp(24px, 0.9rem + 1.4vw, 40px); }

.tally {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap);
}
.tally p {
  padding-top: 18px;
  border-top: 1px solid var(--hair);
  color: var(--grey);
  font-size: 15px;
  line-height: 1.4;
  text-wrap: pretty;
}
.tally strong {
  display: block;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: clamp(32px, 1.2rem + 2.2vw, 60px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.splits + .tally { margin-top: var(--s6); }

/* ---------- Career at a glance ---------- */

.course__years,
.course a {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.1fr);
  gap: var(--gap);
}
.course__years { padding-bottom: 10px; }
.yrs {
  grid-column: -2 / -1;
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  color: var(--grey);
  font-size: 12px;
}
.yrs span:nth-child(4n+2), .yrs span:nth-child(4n+3), .yrs span:nth-child(4n+4) { visibility: hidden; }
.yrs span:last-child { visibility: visible; justify-self: end; }

.course {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--hair);
}
.course li { border-top: 1px solid var(--hair); }
.course li:first-child { border-top-color: var(--ink); }
.course a { align-items: center; padding: 22px 0; }
.course__when { color: var(--grey); font-size: 14px; }
.course__role {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.course a:hover .course__role { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.course__role small {
  display: block;
  margin-top: 2px;
  color: var(--grey);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
}
.course__what { color: var(--grey); font-size: 14px; line-height: 1.45; text-wrap: pretty; }

.bar {
  position: relative;
  height: 3px;
  background: var(--track);
}
.bar span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--s) / 16 * 100%);
  width: calc(var(--l) / 16 * 100%);
  min-width: 4px;
  background: var(--ink);
  transform-origin: left;
  transition: transform 1.2s var(--ease);
}
.js .course:not(.is-in) .bar span { transform: scaleX(0); }
.course li:nth-child(2) .bar span { transition-delay: 0.06s; }
.course li:nth-child(3) .bar span { transition-delay: 0.12s; }
.course li:nth-child(4) .bar span { transition-delay: 0.18s; }
.course li:nth-child(5) .bar span { transition-delay: 0.24s; }
.course li:nth-child(6) .bar span { transition-delay: 0.3s; }

/* ---------- Campaigns: an index on hairlines ---------- */

.index {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--hair);
}
.index li { border-top: 1px solid var(--hair); }
.index li:first-child { border-top-color: var(--ink); }
.index a {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 3fr) auto;
  align-items: baseline;
  gap: var(--gap);
  padding: clamp(18px, 2vw, 26px) 0;
}
.index__name {
  font-size: clamp(22px, 1rem + 1.1vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.index__kind { color: var(--grey); font-size: 15px; }
.index__result { font-size: 15px; }
.index__more { color: var(--grey); font-size: 14px; transition: color 0.2s var(--ease); }
.index a:hover .index__more { color: var(--ink); }
.index__name { transition: transform 0.45s var(--ease); }
.index a:hover .index__name { transform: translateX(14px); }

/* ---------- Photos (a quiet frame until the photo arrives) ---------- */

.photo {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 14px;
  min-height: 140px;
  border-radius: 4px;
  background:
    var(--grain),
    radial-gradient(120% 90% at 20% 10%, #2a2a2e 0%, #121214 55%, #0b0b0c 100%);
}
.on-ink .photo { background: var(--grain), radial-gradient(120% 90% at 20% 10%, #232327 0%, #141416 60%, #111113 100%); }
.photo--portrait { aspect-ratio: 4 / 5; }
.photo--wide { aspect-ratio: 3 / 2; }
.photo--square { aspect-ratio: 1; }
/* The real photo sits on top: drop the file in and it simply appears. */
.photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--img, none) center / cover no-repeat;
}
.photo[hidden] { display: none; }
.photo__note {
  position: relative;
  max-width: 34ch;
  color: #a1a1a6;
  font-size: 12px;
  line-height: 1.45;
}
.photo .check { outline-offset: 4px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }

/* ---------- Next chapter ---------- */

.next.wrap { display: block; padding-block: var(--s6) var(--s7); }
.next .label { margin-bottom: 14px; padding-top: 20px; border-top: 1px solid var(--ink); }
.next .display {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}
.next .display::after {
  content: "\2192" / "";
  font-weight: 400;
  transition: transform 0.35s var(--ease);
}
.next:hover .display::after { transform: translateX(12px); }

/* ---------- Footer ---------- */

.foot { padding: var(--s7) 0 var(--s4); }
.foot__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
}
.foot .h2 {
  grid-column: 1 / span 6;
  font-size: clamp(64px, 1.6rem + 9vw, 176px);
  font-weight: 800;
  font-stretch: 72%;
  line-height: 0.88;
  letter-spacing: -0.03em;
}
.foot__links {
  grid-column: 8 / -1;
  align-self: end;
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--hair);
}
.foot__links li { border-top: 1px solid var(--hair); }
.foot__links a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  font-size: 18px;
}
.foot__links a span { color: var(--grey); font-size: 15px; text-align: right; transition: color 0.2s var(--ease); }
.foot__links a:hover span { color: var(--ink); }
.foot__base {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: var(--s7);
  color: var(--grey);
  font-size: 13px;
}

/* ---------- Motion: content settles into place, once ---------- */

.js :is(.story, .index li, .split, .tally p, .contents li) {
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.js :is(.story, .index li, .split, .tally p, .contents li):not(.is-in) {
  opacity: 0;
  transform: translateY(8px);
}
.contents li:nth-child(2) { transition-delay: 0.06s; }
.contents li:nth-child(3) { transition-delay: 0.12s; }
.contents li:nth-child(4) { transition-delay: 0.18s; }

/* ---------- Narrower screens ---------- */

@media (max-width: 1100px) {
  .course__years,
  .course a { grid-template-columns: 7rem minmax(0, 1fr) minmax(0, 1fr); }
  .course__what { display: none; }
  .index a { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 6px; }
  .index__name { grid-column: 1 / -1; }
  .index__more { display: none; }
  .hero__grid .meta { grid-column: 8 / -1; }
}

@media (max-width: 900px) {
  .nav { display: none; }
  .nav-mobile { display: block; }
  .contents ol { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s5); }
  .hero__grid,
  .note,
  .story,
  .foot__grid { grid-template-columns: minmax(0, 1fr); }
  .hero__text,
  .hero__grid .meta,
  .note .label,
  .note blockquote,
  .note__photo,
  .story__side,
  .story__body,
  .foot .h2,
  .foot__links { grid-column: 1; }
  .hero__grid { row-gap: var(--s5); }
  .note__photo { max-width: 360px; margin-top: var(--s3); }
  .story { row-gap: var(--s3); }
  .story__side > * { position: static; }
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .local__title { font-size: 18px; }
  .local__row { gap: 20px; }
  .local ul { gap: 20px; mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .foot__links { margin-top: var(--s4); }
}

@media (max-width: 600px) {
  .contents ol { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .contents a { padding-bottom: var(--s4); border-top-color: var(--hair); }
  .contents li:first-child a { border-top-color: var(--ink); }
  .contents__fig { margin-top: var(--s3); }
  .hero__ctas { gap: 20px; }
  .pair { grid-template-columns: 1fr; }
  .index a { grid-template-columns: minmax(0, 1fr); row-gap: 4px; }
  .course__years { display: none; }
  .course a { grid-template-columns: 1fr; gap: 4px; padding: 20px 0; }
  .course .bar { order: 9; margin-top: 12px; }
  .split__row { grid-template-columns: auto minmax(24px, 1fr) auto; gap: 12px; }
  .split__unit { font-size: 13px; }
  .foot__links a { flex-direction: column; gap: 2px; }
  .foot__links a span { text-align: left; }
  .foot__base { flex-direction: column; gap: 4px; }
}

/* ---------- Continuous corners (where the browser supports them) ---------- */

@supports (corner-shape: squircle) {
  .btn,
  .skip,
  .photo { corner-shape: squircle; }
}

/* ---------- Page-to-page transitions ---------- */
/* A soft cross-fade between pages. Off for reduced motion.
   Do not name the top bar for the transition: that would trap the full-screen phone menu inside the bar. */

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.28s;
    animation-timing-function: var(--ease);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .js :is(.story, .index li, .split, .tally p, .contents li):not(.is-in) { opacity: 1; transform: none; }
  .js .split:not(.is-in) .split__track i,
  .js .course:not(.is-in) .bar span { transform: none; }
  .pulse::after { display: none; }
  .hero__name .w > span { animation: none; }
}
