/* ------------------------------------------------------------
   Kyle Campbell – portfolio styles
   ------------------------------------------------------------ */

/* ---------- Tokens ---------- */
:root {
  /* Backgrounds */
  --bg-light: #ffffff;

  /* Text */
  --text: #0f1f1a;
  --text-muted: #5a6b64;
  --text-on-dark: #f6f8f6;

  /* Accent */
  /* Brand green is 3.2:1 on white, so small text and fills use strong */
  --accent: #549e79;
  --accent-strong: #437e61;
  --accent-deep: #386a52;

  /* Hero band: dark ground and the sage that reads on it */
  --deep: #1c4534;
  --sage: #9bd3b4;

  /* Rules & surfaces */
  --rule: #d3dad6;
  --rule-strong: rgba(0, 0, 0, 0.4);
  --tint: #edf1ee;
  --placeholder: #e4e9e6;

  /* Type */
  --font: "Fira Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Merriweather", Georgia, "Times New Roman", serif;
  --fs-body: 1.0625rem; /* 17px */
  --lh-body: 1.55;
  --fs-h1: clamp(2.6rem, 6vw, 5.5rem);
  --fs-h2: clamp(2rem, 4.2vw, 4.5rem);
  --fs-h3: 1rem;
  --fs-small: 0.9375rem; /* 15px */
  --fs-caption: 0.875rem;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg-light);
}
img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}
h1,
h2,
h3,
p,
ul,
dl,
figure,
blockquote {
  margin: 0;
}
ul {
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--accent-strong);
  color: #fff;
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Type ---------- */
h1 {
  font-size: var(--fs-h1);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 14ch;
}
h2 {
  font-size: var(--fs-h2);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.015em;
  max-width: 22ch;
}
h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.3;
  color: var(--accent-strong);
}
p {
  max-width: 62ch;
}
strong {
  font-weight: 600;
}

/* ------------------------------------------------------------
   HOME
   ------------------------------------------------------------ */

/* ---------- Home tokens ---------- */
.home {
  --shell: 1140px;
  --edge: 32px;

  --rail-w: 239px;
  --rail-rule: 48px;
  --rail-gap: 96px;

  /* Vertical rhythm: stepped at breakpoints, not fluid */
  --v-hero: 64px; /* hero band padding, and the stack inside it */
  --v-block: 64px; /* rail and feed padding inside the body band */
  --v-section: 128px; /* between feed sections */
  --v-card: 64px; /* card to the rule between cards, and rule to card */
  --v-closer: 64px; /* above and below the Let's talk text */
  --v-rail: 32px; /* 900-and-below rail rhythm */
  --v-feed-end: 128px;

  --content-max: 670px;

  --fs-display: clamp(2.25rem, calc(13vw - 45.6px), 6.9375rem);

  /* Hero band: height, the width of the sentence, and its size */
  --hero-h: 542px; /* 670 band less its 64 top and bottom */
  /* Left column of the band. The sentence is whatever is left of the shell,
     so it lines up with the feed's divider */
  --hero-gutter: calc(var(--rail-w) + var(--rail-rule));
  --fs-hero: 3rem;

  /* Rail portrait: square, so one value is width and height */
  --portrait: var(--rail-w);

  --ink: #08170f;
  --ink-40: color-mix(in srgb, var(--ink) 40%, transparent);
  --ink-70: color-mix(in srgb, var(--ink) 70%, transparent);
  --ink-80: color-mix(in srgb, var(--ink) 80%, transparent);
  --warm: #faf8f5;

  --rule-hero: rgb(0 0 0 / 0.25);

  font-family: var(--serif);
  font-weight: 300;
}
.home h1,
.home h2,
.home h3,
.home .rail__greet,
.home .cta,
.home .rail__nav a,
.home .site-foot__nav a,
.home .topbar__menu a,
.home .job__years,
.home .job__org {
  font-family: var(--font);
}

/* ---------- Shell ---------- */
.home .shell {
  width: min(var(--shell), 100% - var(--edge) * 2);
  margin-inline: auto;
}

/* ---------- Mobile bar ---------- */
.home .topbar {
  display: none;
}
.home .topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 50px;
  padding-inline: var(--edge);
}
.home .topbar__toggle {
  width: 44px; /* tap target */
  height: 44px;
  position: relative;
  margin-right: -10px;
}
.home .topbar__bar,
.home .topbar__bar::before,
.home .topbar__bar::after {
  content: "";
  position: absolute;
  left: 10px;
  width: 24px;
  height: 2px;
  background: var(--ink);
  transition:
    transform 160ms ease,
    top 160ms ease,
    background-color 160ms ease;
}
.home .topbar__bar {
  top: 21px;
}
.home .topbar__bar::before {
  top: -7px;
  left: 0;
}
.home .topbar__bar::after {
  top: 7px;
  left: 0;
}
.home .topbar__menu {
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border-top: 1px solid var(--ink-40);
}
.home .topbar__menu.is-open {
  display: flex;
}
.home .topbar__menu a {
  justify-content: flex-end;
  padding: 12px var(--edge);
  text-align: right;
  border-bottom: 1px solid var(--ink-40);
}
.home .topbar__menu a:not(.contact-link) {
  font-weight: 600;
  text-decoration: none;
}
.home .topbar__menu a:last-child {
  border-bottom: 0;
}

.home .topbar__toggle[aria-expanded="true"] .topbar__bar {
  background: transparent;
}
.home .topbar__toggle[aria-expanded="true"] .topbar__bar::before {
  top: 0;
  transform: rotate(45deg);
}
.home .topbar__toggle[aria-expanded="true"] .topbar__bar::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ---------- Hero ---------- */

/* Dark band. Two layers, as drawn: a flat ground with a vertical wash from
   black down to sage over it */
.home .hero-band {
  padding-block: var(--v-hero);
  background-color: var(--deep);
  background-image: linear-gradient(
    180deg,
    rgb(0 0 0 / 0.2) 0%,
    rgb(155 211 180 / 0.08) 100%
  );
  border-bottom: 1px solid var(--rule-hero);
  color: #fff;
  position: relative; /* holds the northern lights canvas */
}

/* Northern lights. script.js adds the canvas, so without it the band is the
   plain wash above. It is drawn small and stretched to fit, which is where
   the softness comes from. Starts clear and script.js sets its strength, so
   it fades in and never pops on load */
.home .hero__aurora {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1200ms ease;
}

/* Mark top left, details bottom left, the line bottom right. The middle row
   takes the slack, so the band keeps its height without a fixed one */
.home .hero-band__inner {
  position: relative; /* lifts the content over the lights */
  display: grid;
  grid-template-columns: var(--hero-gutter) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: var(--hero-h);
}
.home .hero__mark {
  grid-column: 1;
  grid-row: 1;
  max-width: none;
}
.home .hero__mark-name,
.home .hero__mark-sub {
  display: block;
  font-family: var(--font);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.home .hero__mark-name {
  margin-bottom: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.21;
  color: var(--sage);
}
.home .hero__mark-sub {
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.2;
  color: #fff;
}

/* Merriweather, not the display face — this is a sentence, not a name */
/* Shared heading treatment. The case study carries class="home case", so
   anything set here reaches it too — hero-only styling goes in the rule
   below, keyed to a band the case study does not have */
.home h1 {
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  max-width: none;
  color: var(--ink);
}
.home h1 .accent {
  color: var(--accent);
}

/* The hero sentence: serif, light, set against the dark band */
.home .hero-band h1 {
  grid-column: 2;
  grid-row: 3;
  align-self: end;
  justify-self: end;
  width: 100%;
  font-family: var(--serif);
  font-size: var(--fs-hero);
  font-weight: 300;
  line-height: 1.25;
  text-align: right;
  color: #fff;
}
.home .hero-band h1 .accent {
  color: var(--sage);
}

.home .hero__meta {
  grid-column: 1;
  grid-row: 3;
  align-self: end;
  display: grid;
  gap: 32px;
  text-align: left;
}
.home .hero__meta .meta__label {
  color: var(--sage);
}
.home .hero__meta .meta__value {
  margin-top: 8px;
  font-size: 1.3125rem;
  line-height: 1.24;
  color: #fff;
  max-width: none;
}

/* ---------- Body band ---------- */
.home .body-band {
  background: var(--warm);
}
.home .split {
  position: relative;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  column-gap: var(--rail-gap);
}
/* The divider hangs off the band, not the rail. The rail pins and so stops
   spanning the full height; the line has to keep spanning it */
.home .split::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--rail-w) + var(--rail-rule));
  border-left: 1px solid var(--rule-strong);
}

.home .rail {
  padding-block: var(--v-block);
}

/* Square, the full width of the rail. The image is taken out of flow so the
   figure can be sized by its neighbour instead of by the photo, the same way
   the About Me media works */
.home .rail__portrait {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--placeholder);
  aspect-ratio: 1;
  width: var(--portrait);
}
.home .rail__portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Rules above and below, 8 clear of the word on each side */
.home .rail__greet {
  margin-top: 32px;
  padding-block: 8px;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  font-size: 1.625rem;
  font-weight: 800;
  line-height: 1.04;
  color: var(--accent);
  max-width: none;
}
.home .rail__blurb {
  margin-top: 16px;
}
.home .rail__blurb p + p {
  margin-top: 16px;
}
/* Innsbruck and the German only appear on the narrow layout */
.home .blurb--narrow {
  display: none;
}

.home .rail__nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 32px;
}
.home .rail__nav a:not(.contact-link) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}
.home .rail__nav a:not(.contact-link):hover {
  color: var(--accent-strong);
}

/* Contact sits outside the rule above so the shared black can't beat the
   green. It still needs that rule's layout, and the arrow needs a size: the
   symbol has no intrinsic one, so unsized it renders at the 300x150 default */
.home .rail__nav .contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent-strong);
}
.home .rail__nav .contact-link:hover {
  color: var(--accent-deep);
}
.home .rail__nav .contact-link svg,
.home .topbar__menu .contact-link svg {
  flex: none;
  width: 16px;
  height: 16px;
}
.home .topbar__menu .contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent-strong);
}

/* The rail travels and pins as one block, then folds the portrait away.
   The fold is load-bearing, not decoration: the rail is 939 tall with the
   portrait and 668 without. Pinned whole at full height the navigation sits
   below the fold and can never be scrolled to, so the rail only pins once
   the folded version is known to fit. That test is a measurement in
   script.js, not a height here: a window is shorter than the screen it is
   on, and a guessed number gets that wrong on the machines people use.
   Desktop only; below 901 the rail dissolves into the band's own grid and
   the nav pins on its own. */
@media (min-width: 901px) {
  .home:not(.case) .rail--can-stick {
    position: sticky;
    top: 0;
    align-self: start;
  }
  /* An explicit height, because an aspect-ratio one has nothing to animate */
  .home:not(.case) .rail__portrait {
    aspect-ratio: auto;
    height: var(--portrait);
    transition:
      height 1600ms ease,
      opacity 420ms ease 640ms;
  }
  .home:not(.case) .rail__greet {
    transition: margin-top 1600ms ease;
  }
  .home:not(.case) .rail--compact .rail__portrait {
    height: 0;
    opacity: 0;
  }
  .home:not(.case) .rail--compact .rail__greet {
    margin-top: 0;
  }
}

/* ---------- Feed ---------- */
.home .feed {
  padding-block: var(--v-block) var(--v-feed-end);
}
.home .feed > * + * {
  margin-top: var(--v-section);
}

/* ---------- Work cards ---------- */
.home .work {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  padding: 16px;
}
.home .works {
  display: grid;
  gap: var(--v-card);
}
.home .work-divider {
  border: 0;
  border-top: 1px solid var(--rule-strong);
  margin: 0;
}

.home .work__media {
  overflow: hidden;
  background: var(--placeholder);
}
.home .work__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Not published yet */
.home .work--soon .work__media img {
  opacity: 0.35;
}

.home .work h2 {
  margin-top: 8px;
  font-size: clamp(1.75rem, 2.78vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  max-width: none;
}
.home .work__blurb {
  margin-top: 16px;
  max-width: none;
}
.home .work__blurb + p {
  margin-top: 16px;
}
.home .work .tags {
  margin-top: 16px;
}
.home .work .cta {
  margin-top: 32px;
}

.home .work--soon h2,
.home .work--soon .work__blurb {
  color: var(--ink-70);
}

/* ---------- Labels ---------- */
.home .eyebrow,
.home .meta__label,
.home .topbar__mark,
.home .tag {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  max-width: none;
}

/* ---------- Tags ---------- */

/* 70% keeps the text at 6.7:1 and the border at 4.2:1 on --warm */
.home .tags {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  opacity: 0.7;
}
.home .tag {
  padding: 4px 6px;
  border: 1px solid var(--ink-80);
  border-radius: 1px;
}

/* ---------- CTA ---------- */
.home .cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(100%, 353px);
  min-height: 54px;
  padding: 16px 24px;
  background: var(--bg-light);
  border: 1px solid var(--ink);
  text-decoration: none;
}
.home .cta svg {
  flex: none;
  width: 24px;
  height: 24px;
}
.home .cta:not(.cta--soon):hover {
  background: var(--ink);
  color: var(--text-on-dark);
}
.home .cta--soon {
  border-style: dashed;
  background: none;
  border-color: var(--ink-70);
  color: var(--ink-70);
}

/* ---------- Feed sections ---------- */
.home .feed__head {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule-strong);
  font-size: clamp(1.75rem, 2.78vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  max-width: none;
}
.home .feed__lede {
  margin-top: 32px;
  max-width: var(--content-max);
}

/* ---------- Principles ---------- */
.home .tenets {
  margin-top: 32px;
  display: grid;
  gap: 32px;
}
.home .tenet__title {
  font-size: 1.3125rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
  max-width: none;
}
.home .tenet__body {
  margin-top: 8px;
  max-width: var(--content-max);
}

/* ---------- About ---------- */
.home .about {
  display: grid;
  grid-template-columns: minmax(0, 462px) minmax(200px, 1fr);
  gap: 32px;
  align-items: stretch;
  margin-top: 32px;
}
.home .about__text > * + * {
  margin-top: 16px;
}

.home .about__media {
  position: relative;
  overflow: hidden;
}
.home .about__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left 32%;
}

/* ---------- Jobs ---------- */

/* Subgrid: the years column fits the longest date */
.home .jobs {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 32px;
  margin-top: 64px;
  max-width: 628px;
  border-top: 1px solid var(--rule-strong);
}
.home .job {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  row-gap: 8px;
  padding-block: 16px;
  border-bottom: 1px solid var(--rule-strong);
}
.home .job__years {
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text-muted);
}
.home .job__org {
  font-weight: 500;
}
.home .job__what {
  grid-column: 2;
  color: var(--text-muted);
}

/* ---------- Closer ---------- */
.home .closer {
  background: var(--bg-light);
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  padding-block: var(--v-closer);
}
.home .closer__inner {
  display: flex;
  align-items: center;
  gap: 32px;
}
.home .closer h2 {
  flex: none;
  font-size: var(--fs-display);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  max-width: none;
  color: var(--accent);
}
.home .closer p {
  max-width: 400px;
}

/* ---------- Footer ---------- */
.home .site-foot {
  padding-block: 64px;
  background: var(--warm);
}
.home .site-foot__inner {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: flex-start;
}
.home .site-foot__note {
  max-width: 239px;
  font-size: var(--fs-small);
  color: var(--text-muted);
}
.home .site-foot__nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  text-align: right;
}
.home .site-foot__nav a {
  font-size: var(--fs-small);
  font-weight: 600;
  text-decoration: none;
}
.home .site-foot__nav a:hover {
  color: var(--accent-strong);
}

/* ---------- Flags ---------- */

/* Flag emoji for Chrome and Edge on Windows */
@font-face {
  font-family: "Twemoji Country Flags";
  src: url("https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1/dist/TwemojiCountryFlags.woff2")
    format("woff2");
  unicode-range:
    U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E,
    U+E0073-E0074, U+E0077, U+E007F;
  font-display: swap;
}
.home .flag {
  font-family:
    "Apple Color Emoji", "Noto Color Emoji", "Twemoji Country Flags", sans-serif;
}

/* ---------- Home: tablet, 900 and below ---------- */
@media (max-width: 900px) {
  .home {
    --edge: 24px;

    --rail-w: 137px;
    --rail-rule: 24px;
    --rail-gap: 48px;

    --content-max: 520px;

    --v-block: 32px;
    --v-section: 96px;
    --v-feed-end: 96px;
    --v-rail: 24px;

    /* 219 at 720 leaves the drawn 453 for the sentence */
    --hero-gutter: 219px;
    --portrait: 211px;
  }

  /* The band keeps its 670, but the mark and details move in to the edge */
  .home .hero__meta {
    gap: 32px;
  }

  /* The rail dissolves so the navigation can hold column one on its own
     while the intro takes column two */
  .home .split {
    grid-template-rows: auto 1fr;
  }
  .home .rail {
    display: contents;
  }

  .home .rail__nav {
    grid-column: 1;
    grid-row: 1 / -1;
    position: sticky;
    top: var(--v-rail);
    align-self: start;
    margin-top: var(--v-rail);
    background: none;
  }

  /* Portrait beside the whole blurb, matching its height */
  .home .rail__intro {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: var(--portrait) minmax(0, 1fr);
    /* The gap sets the drop below the rule, so the portrait and the text
       start on the same line. A margin on the text alone would offset it */
    gap: 16px;
    padding-top: var(--v-block);
    padding-bottom: 64px;
    border-bottom: 1px solid var(--rule-strong);
  }
  .home .rail__greet {
    grid-column: 1 / -1;
    margin-top: 0;
    border-top: 0;
  }
  /* Height comes from the text beside it, not from the photo */
  .home .rail__portrait {
    grid-column: 1;
    grid-row: 2;
    position: relative;
    width: auto;
    aspect-ratio: auto;
    align-self: stretch;
  }
  .home .rail__blurb {
    grid-column: 2;
    grid-row: 2;
    margin-top: 0;
    max-width: var(--content-max);
  }

  .home .feed {
    grid-column: 2;
    grid-row: 2;
    padding-block: 64px var(--v-feed-end);
  }

  .home .work {
    grid-template-columns: minmax(270px, 2fr) minmax(0, 1fr);
    gap: 24px;
    padding: 0;
  }
  .home .about {
    grid-template-columns: minmax(270px, 2fr) minmax(0, 1fr);
    gap: 24px;
  }
}

/* ---------- Home: large mobile, 475 to 719 ---------- */
@media (max-width: 719px) {
  .home {
    --edge: 16px;

    --v-hero: 32px;
    --v-section: 64px;
    --v-card: 48px;
    --v-feed-end: 64px;

    /* 388 band less its 32 top and bottom */
    --hero-h: 324px;
    /* 36 at 500, easing to 24 by 320 so the sentence never fills the band */
    --fs-hero: clamp(1.5rem, calc(6.67vw + 2.7px), 2.25rem);

    --portrait: 84px;
  }

  .home .topbar {
    display: block;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--warm);
    border-bottom: 1px solid var(--ink);
  }
  .home [id] {
    scroll-margin-top: 64px; /* clears the 50px bar */
  }

  /* The mark is in the sticky bar, and the details go to make room */
  .home .hero__mark,
  .home .hero__meta {
    display: none;
  }
  .home .hero-band__inner {
    grid-template-columns: minmax(0, 1fr);
  }
  .home .hero-band h1 {
    grid-column: 1;
    width: min(100%, 452px);
  }

  .home .split {
    grid-template-columns: minmax(0, 1fr);
  }
  .home .split::before {
    content: none;
  }
  .home .rail__nav {
    display: none;
  }

  /* Portrait beside the first paragraph only; the second runs full width
     underneath and names Innsbruck and the German */
  .home .rail__intro {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: var(--portrait) minmax(0, 1fr);
  }
  .home .rail__blurb {
    display: contents;
  }
  .home .rail__blurb > :first-child {
    grid-column: 2;
    grid-row: 2;
    margin-top: 0;
  }
  .home .blurb--wide {
    display: none;
  }
  /* row-gap already carries the 16, so no margin on top of it */
  .home .blurb--narrow {
    display: block;
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 0;
    max-width: var(--content-max);
  }
  .home .feed {
    grid-column: 1;
    grid-row: 2;
    padding-block: 64px var(--v-feed-end);
  }

  .home .cta {
    width: 100%;
  }
  .home .about__media {
    min-height: 0;
  }

  .home .closer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .home .site-foot {
    padding-block: 48px;
  }
  .home .site-foot__inner {
    gap: 24px;
  }
}

/* ---------- Home: narrow phones, 475 and below ---------- */
@media (max-width: 475px) {
  .home {
    --card-media-h: 200px;
  }

  .home .work {
    grid-template-columns: minmax(0, 1fr);
  }
  .home .work__media {
    order: -1;
    height: var(--card-media-h);
  }

  .home .about {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 16px;
  }

  .home .jobs {
    grid-template-columns: minmax(0, 1fr);
  }
  .home .job {
    grid-template-columns: minmax(0, 1fr) max-content;
    column-gap: 16px;
    row-gap: 4px;
  }
  .home .job__org {
    grid-column: 1;
    grid-row: 1;
  }
  .home .job__years {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .home .job__what {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .home .site-foot__inner {
    flex-direction: column;
    gap: 16px;
  }
  .home .site-foot__nav {
    align-items: flex-start;
    text-align: left;
  }
}

/* ------------------------------------------------------------
   CASE STUDY
   ------------------------------------------------------------ */

/* Case studies are class="home case" */

/* ---------- Case tokens ---------- */
.case {
  --hero-drop: 96px;
  --hero-bleed: clamp(0px, (100vw - var(--shell)) / 2 - 32px, 320px);
  --radius: 3px;
}

/* ---------- Hero ---------- */
.case .case-hero {
  position: relative;
  z-index: 1;
  padding-block: var(--v-hero);
  background: var(--bg-light);
  border-bottom: 1px solid var(--rule-hero);
}
.case .case-hero__inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}
.case .case-hero__text > * + * {
  margin-top: 32px;
}
.case .case-hero__text > h1 + * {
  margin-top: 16px;
}

.case h1 {
  font-size: clamp(2.5rem, 6.2vw, 6rem);
  line-height: 1.05;
}
.case h1 .accent {
  white-space: nowrap;
}
.case .case-hero__lede {
  font-size: 1.3125rem;
  line-height: 1.4;
  max-width: 36ch;
  color: var(--ink);
}

.case .case-hero__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--rule-strong);
}
.case .case-hero__meta dd {
  margin: 0;
}
.case .meta__value {
  font-size: 1.125rem;
}

.case .case-hero__art {
  position: relative;
}
.case .case-hero__art img {
  position: absolute;
  right: calc(var(--hero-bleed) * -1);
  bottom: calc(-1 * (var(--v-hero) + var(--hero-drop)));
  width: calc(100% + var(--hero-bleed));
  height: calc(100% + var(--v-hero) * 2 + var(--hero-drop) - 32px);
  max-width: none;
  object-fit: contain;
  object-position: right bottom;
}

/* ---------- Rail ---------- */

/* No portrait here, so the whole rail sticks as one block rather than the
   navigation parking under something */
.case .rail__inner {
  position: sticky;
  top: var(--v-block);
}

.case .toc__back {
  margin-bottom: 16px;
}
.case .toc__back svg {
  flex: none;
  width: 22px;
  height: 22px;
}
.case .toc__group {
  margin-top: 16px;
  color: var(--text-muted);
}

.case .toc a {
  position: relative;
}
.case .toc a[aria-current] {
  color: var(--accent-strong);
}
.case .toc a[aria-current]::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 12px;
  bottom: 12px;
  border-left: 2px solid var(--accent);
}

/* ---------- Frames ---------- */
.case .frame > * + * {
  margin-top: 32px;
}
.case .frame > * + .feed__head {
  margin-top: 16px;
}
.case .feed > .frame--sub {
  margin-top: 64px;
}
.case .frame > h3 + * {
  margin-top: 16px;
}
.case .frame > p + p {
  margin-top: 16px;
}

.case .frame > .tags {
  flex-direction: row;
}

.case .case-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  align-items: start;
}
.case .case-cols > * > * + * {
  margin-top: 16px;
}
.case .case-cols > * > h3 + * {
  margin-top: 8px;
}

/* ---------- Lists ---------- */
.case .list {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
  max-width: var(--content-max);
}
.case .list li {
  position: relative;
  padding-left: 24px;
}
.case .list li::before {
  content: "–";
  position: absolute;
  left: 0;
  font-family: var(--font);
  font-weight: 600;
  color: var(--accent-strong);
}
.case .list--num {
  counter-reset: step;
  gap: 16px;
}
.case .list--num li {
  counter-increment: step;
  padding-left: 32px;
}
.case .list--num li::before {
  content: counter(step, decimal-leading-zero);
}

/* ---------- Steps ---------- */
.case .steps {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 32px;
  max-width: var(--content-max);
  border-top: 1px solid var(--rule-strong);
}
.case .steps > div {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: baseline;
  padding-block: 16px;
  border-bottom: 1px solid var(--rule-strong);
}
.case .steps dt {
  color: var(--text-muted);
}
.case .steps dd {
  margin: 0;
}

/* ---------- Screens ---------- */
.case .shots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}
.case .shot img {
  width: 100%;
  border: 1px solid var(--rule);
  background: var(--bg-light);
  object-fit: cover;
  object-position: top;
  border-radius: var(--radius);
}
.case .shots--phone img {
  aspect-ratio: 860 / 1864;
}
.case .shots--plate img {
  aspect-ratio: 2 / 3;
}

.case .figure img {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.case .pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  align-items: start;
}

/* Toggled by script.js through aria-expanded */
.case .zoom {
  position: relative;
  display: block;
  width: 100%;
  cursor: zoom-in;
}
.case .zoom[aria-expanded="true"] {
  cursor: zoom-out;
}
.case .pair > :has(.zoom[aria-expanded="true"]) {
  grid-column: 1 / -1;
}
.case .zoom__icon {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--bg-light);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
}
.case .zoom__icon svg {
  width: 16px;
  height: 16px;
}
.case .zoom:hover .zoom__icon {
  background: var(--ink);
  color: var(--text-on-dark);
}
.case .zoom__less,
.case .zoom[aria-expanded="true"] .zoom__more {
  display: none;
}
.case .zoom[aria-expanded="true"] .zoom__less {
  display: block;
}

.case .shot figcaption,
.case .figure figcaption,
.case .footnote {
  margin-top: 8px;
  font-family: var(--font);
  font-size: var(--fs-caption);
  line-height: 1.4;
  color: var(--text-muted);
  max-width: none;
}

/* ---------- Notes ---------- */
.case .notes {
  display: grid;
  gap: 16px;
}
.case .notes li {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}
.case .notes img {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-light);
}
.case .notes p {
  font-size: var(--fs-small);
}
.case .notes--lead p {
  font-size: inherit;
}
.case .notes--lead li {
  align-items: start;
}
.case .notes .note--wide {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.case .notes .note--wide img {
  max-width: none;
}
.case .notes li:has(.zoom[aria-expanded="true"]) {
  grid-template-columns: minmax(0, 1fr);
}

/* ---------- More panels ---------- */
.case .frame > .more + .more {
  margin-top: 0;
}
.case .more {
  border-bottom: 1px solid var(--rule-strong);
}
.case .more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding-block: 16px;
  font-family: var(--font);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.case .more > summary::-webkit-details-marker {
  display: none;
}
.case .more__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
}
.case .more__icon svg {
  width: 16px;
  height: 16px;
}
.case .more > summary:hover {
  color: var(--accent-strong);
}
.case .more > summary:hover .more__icon {
  border-color: var(--accent-strong);
  color: var(--accent-strong);
}
.case .more[open] .more__icon {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--text-on-dark);
}
.case .more__minus,
.case .more[open] .more__plus {
  display: none;
}
.case .more[open] .more__minus {
  display: block;
}
.case .more__body {
  padding: 8px 0 32px;
}
.case .more__body > * + * {
  margin-top: 16px;
}
.case .more__body > .shots,
.case .more__body > .pair,
.case .more__body > .figure {
  margin-top: 32px;
}
.case .more__body > :first-child {
  margin-top: 0;
}
.case .more__body > .steps > :last-child {
  border-bottom: 0;
}

/* ---------- Numbers ---------- */
.case .numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}
.case .numbers__n {
  display: block;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule-strong);
  font-family: var(--font);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}
.case .numbers__label {
  display: block;
  margin-top: 16px;
  font-size: var(--fs-small);
}

/* ---------- Chart ---------- */
.case .chart {
  padding: 24px;
  background: var(--bg-light);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.case .chart__title {
  font-family: var(--font);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}
.case .chart__list {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}
.case .chart__label {
  display: block;
  font-family: var(--font);
  font-size: var(--fs-small);
  color: var(--text-muted);
}
.case .chart__track {
  position: relative;
  display: block;
  height: 24px;
  margin-top: 8px;
  background: var(--tint);
  border-radius: 2px;
}
.case .chart__bar {
  position: absolute;
  inset-block: 0;
  left: 0;
  width: calc(var(--value) * 1%);
  min-width: 2px;
  background: var(--text-muted);
  border-radius: 2px;
}
.case .chart__bar--key {
  background: var(--accent-strong);
}
.case .chart__value {
  position: absolute;
  top: 50%;
  left: calc(var(--value) * 1% + 8px);
  transform: translateY(-50%);
  font-family: var(--font);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

/* ---------- Duo ---------- */

/* Each img sets --ar (width / height), so both come out the same height */
.case .duo__row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.case .duo__row > img {
  flex: var(--ar, 1) 1 0;
  min-width: 0;
}

/* ---------- Key terms ---------- */
.case .terms-label {
  color: var(--accent-strong);
}
.case .frame > p + .terms-label {
  margin-top: 32px;
}
.case .frame > .terms-label + p {
  margin-top: 8px;
}

/* ---------- Closing image ---------- */
.case .case-end {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 32px;
  align-items: center;
}
.case .case-end > div > * + * {
  margin-top: 16px;
}
.case .case-end img {
  width: 100%;
  max-width: 320px;
  margin-inline: auto;
}

/* ---------- Case: desktop, 901 and up ---------- */
@media (min-width: 901px) {
  .case .case-hero {
    --v-hero: 96px;
  }
  .case .feed {
    padding-top: calc(var(--hero-drop) + 32px);
  }
  .case .rail__nav {
    margin-top: 0;
  }
}

@media (min-width: 1600px) {
  .case {
    --hero-drop: 128px;
  }
}

@media (min-width: 720px) {
  .case .frame {
    scroll-margin-top: 32px;
  }
}

/* ---------- Case: tablet, 900 and below ---------- */
@media (max-width: 900px) {
  .case .rail__inner {
    display: contents;
  }
  .case .feed {
    grid-row: 1 / -1;
  }

  .case .case-hero {
    padding-top: 0;
  }
  .case .case-hero__inner {
    grid-template-columns: minmax(0, 1fr);
  }
  .case .case-hero__art {
    order: -1;
    margin-inline: calc(var(--edge) * -1);
  }
  .case .case-hero__art img {
    position: static;
    width: 100%;
    height: auto;
  }

  .case .notes li {
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 24px;
  }
}

/* ---------- Case: large mobile, 719 and below ---------- */
@media (max-width: 719px) {
  .case .case-hero__meta {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding-top: 24px;
  }
  .case .case-cols {
    grid-template-columns: minmax(0, 1fr);
  }

  .case .shots {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: clamp(176px, 44%, 256px);
    gap: 16px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--edge);
    margin-inline: calc(var(--edge) * -1);
    padding-inline: var(--edge);
    padding-bottom: 16px;
    scrollbar-width: thin;
  }
  .case .shot {
    scroll-snap-align: start;
  }

  .case .numbers__n {
    font-size: 2rem;
  }
}

/* ---------- Case: narrow phones, 475 and below ---------- */
@media (max-width: 475px) {
  .case .pair,
  .case .numbers {
    grid-template-columns: minmax(0, 1fr);
  }
  .case .numbers {
    gap: 16px;
  }

  .case .steps,
  .case .steps > div {
    grid-template-columns: minmax(0, 1fr);
  }
  .case .steps > div {
    row-gap: 8px;
  }

  .case .notes li {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .case .zoom {
    pointer-events: none;
  }
  .case .zoom__icon {
    display: none;
  }
  .case .notes img {
    max-width: 320px;
  }

  .case .case-end {
    grid-template-columns: minmax(0, 1fr);
  }
  .case .case-end img {
    max-width: 240px;
  }
}
