/* Tyler Lumpkin portfolio: one design system for every page.
   Tokens, type, grid, header, project bar, footer and the shared components.
   The dispenser walkthrough adds dispenser.css; the boat's two diagrams add boat.css. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: optional;
  src: url(assets/fonts/inter-latin.woff2) format("woff2-variations");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: optional;
  src: url(assets/fonts/jetbrains-mono-latin.woff2) format("woff2-variations");
}

/* Fonts are preloaded and use font-display: optional, so a page never reflows when they arrive; on a slow
   first visit it renders in these fallbacks, sized to the web fonts' metrics, and later pages use the cache. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  size-adjust: 107.06%;
  ascent-override: 90.49%;
  descent-override: 22.56%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "JetBrains Mono Fallback";
  src: local("Consolas");
  size-adjust: 111.7%;
  ascent-override: 91.3%;
  descent-override: 26.9%;
  line-gap-override: 0%;
}

/* ---------- Tokens ---------- */

:root {
  /* surface */
  --bg: #0e0f10;
  --surface: #151718;
  --plate: #e9e9e3;
  --line: #2a2d2e;
  --line-strong: #3c4041;
  /* text */
  --ink: #ecebe4;
  --ink-2: #c3c6c0;
  --muted: #9a9d98;
  /* accent: interaction and progress only */
  --accent: #c7d6b0;
  /* type */
  --sans: "Inter", "Inter Fallback", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "JetBrains Mono Fallback", Consolas, monospace;
  /* layout */
  --max: 1320px;
  --margin: 56px;
  --gutter: 24px;
  --header: 64px;
  --bar: 48px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  /* where sticky things sit below the fixed chrome */
  --sticky-top: calc(var(--header) + 32px);
  --anchor-top: calc(var(--header) + 24px);
  color-scheme: dark;
}
.project-page {
  --sticky-top: calc(var(--bar) + 32px);
  --anchor-top: calc(var(--bar) + 24px);
}
@media (max-width: 900px) {
  :root { --margin: 32px; }
}
@media (max-width: 700px) {
  :root { --margin: 20px; }
}

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

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* Smooth only for in-page jumps the visitor starts; a deep link on load lands at once. */
html:focus-within { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
}
h1, h2, h3, h4, p, figure, dl, dd, ol, ul, blockquote { margin: 0; }
ol, ul { padding: 0; }
h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 480;
  text-wrap: balance;
}
p, li, dd, figcaption, td { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[id] { scroll-margin-top: var(--anchor-top); }
::selection { background: var(--accent); color: var(--bg); }

a, button, summary, select {
  transition: color 150ms, background-color 150ms, border-color 150ms;
}
a:focus-visible, button:focus-visible, summary:focus-visible,
select:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  width: min(var(--max), 100% - 2 * var(--margin));
  margin-inline: auto;
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--bg);
}
.skip:focus { top: 12px; }

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

.display {
  font-size: clamp(72px, 9.5vw, 152px);
  line-height: .92;
  font-weight: 450;
  letter-spacing: -.045em;
}
.page-title {
  font-size: clamp(48px, 5.4vw, 84px);
  line-height: 1;
  font-weight: 450;
  letter-spacing: -.04em;
}
h2, .h2 {
  font-size: clamp(28px, 2.6vw, 40px);
  line-height: 1.1;
  font-weight: 480;
  letter-spacing: -.03em;
}
h3, .h3 {
  font-size: 20px;
  line-height: 1.25;
  font-weight: 550;
  letter-spacing: -.015em;
}
.lead {
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.5;
  letter-spacing: -.01em;
  color: var(--ink-2);
  max-width: 40ch;
}
.small, figcaption { font-size: 14px; line-height: 1.5; }
.label {
  font: 500 12px/1.4 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.data {
  font: 400 14px/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  .display { font-size: 64px; }
  .page-title { font-size: 40px; }
  h2, .h2 { font-size: 26px; }
  h3, .h3 { font-size: 18px; }
  .lead { font-size: 17px; }
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 50;
  height: var(--header);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  view-transition-name: site-header;
}
.home-page .site-header {
  position: sticky;
  top: 0;
  background: rgb(14 15 16 / .78);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}
.identity {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 550;
  letter-spacing: -.01em;
}
.nav-desktop { display: flex; gap: 32px; }
.nav-desktop a, .nav-mobile nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  color: var(--ink-2);
}
.nav-desktop a, .bar-sections a { min-width: 44px; justify-content: center; }
.nav-desktop a:hover, .nav-mobile nav a:hover, .identity:hover { color: var(--accent); }
.mobile-actions { display: none; }
.mobile-work {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  font-size: 14px;
  color: var(--ink-2);
}
.mobile-work:hover { color: var(--accent); }
.nav-mobile { position: relative; }
.nav-mobile summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  justify-content: flex-end;
  font-size: 14px;
  color: var(--ink);
  list-style: none;
  cursor: pointer;
}
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile nav {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  display: grid;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
}
.nav-mobile nav a { border-bottom: 1px solid var(--line); }
.nav-mobile nav a:last-child { border-bottom: 0; }
@media (max-width: 700px) {
  .nav-desktop { display: none; }
  .mobile-actions { display: flex; align-items: center; gap: 12px; }
}

/* ---------- Project bar ---------- */

.project-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--bar);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.bar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
  font-size: 14px;
}
.bar-back, .bar-next, .bar-sections a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
  color: var(--ink-2);
}
.bar-back:hover, .bar-next:hover, .bar-sections a:hover { color: var(--accent); }
.bar-title {
  color: var(--ink);
  font-weight: 550;
  white-space: nowrap;
}
.bar-sections {
  display: flex;
  gap: 24px;
  margin-left: 24px;
  min-width: 0;
  overflow: hidden;
}
.bar-sections a {
  position: relative;
  height: var(--bar);
  color: var(--muted);
}
.bar-sections a[aria-current] { color: var(--ink); }
.bar-sections a[aria-current]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}
.bar-next { margin-left: auto; }
.bar-select { display: none; margin-left: auto; position: relative; }
.bar-select select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  max-width: 160px;
  padding: 0 24px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
.bar-select::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -5px;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.bar-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(var(--reading, 0));
  transform-origin: left;
  pointer-events: none;
}
@media (max-width: 1100px) {
  .bar-sections { gap: 16px; margin-left: 8px; }
}
@media (max-width: 900px) {
  .bar-sections, .bar-next { display: none; }
  .bar-select { display: block; }
}
@media (max-width: 700px) {
  .bar-inner { gap: 16px; }
  .bar-title { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .bar-select select { max-width: 132px; }
}

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

.section {
  padding-block: 112px;
  border-top: 1px solid var(--line);
}
/* Land a section's heading just under the sticky chrome, not its top padding. */
.section[id] { scroll-margin-top: calc(var(--anchor-top) - 112px); }
@media (max-width: 700px) {
  .section[id] { scroll-margin-top: calc(var(--anchor-top) - 72px); }
}
.section-head {
  grid-column: 1 / 5;
  align-self: start;
  position: sticky;
  top: var(--sticky-top);
}
.section-head .tag { margin-top: 12px; }
.section-body {
  grid-column: 5 / 13;
  min-width: 0;
  display: grid;
  gap: 48px;
  align-content: start;
}
.section-body > * { min-width: 0; }
.section-full { grid-column: 1 / -1; min-width: 0; }
.section-body + .section-full { margin-top: 72px; }
@media (max-width: 900px) {
  .section-head { grid-column: 1 / -1; position: static; margin-bottom: 32px; }
  .section-body { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .section { padding-block: 72px; }
  .section-body { gap: 32px; }
}

/* ---------- Project hero ---------- */

.hero-project { padding-top: 72px; }
.hero-title {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: end;
  row-gap: 24px;
}
.hero-title h1 { grid-column: 1 / 8; }
.hero-title .lead { grid-column: 8 / 13; }
.hero-media { margin-top: 48px; }
.hero-media .well { aspect-ratio: 16 / 9; }
@media (max-width: 900px) {
  .hero-title h1, .hero-title .lead { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .hero-project { padding-top: 48px; }
  .hero-media { margin-top: 32px; }
}

/* ---------- Spec strip ---------- */

.spec {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px var(--gutter);
  margin-top: 48px;
  padding-block: 24px;
  border-block: 1px solid var(--line);
}
.spec dt {
  font: 500 12px/1.4 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.spec dd {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}
.spec dd .tag { margin-top: 8px; }
@media (max-width: 700px) {
  .spec { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 32px; }
}

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

.tag {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  font: 500 12px/1.4 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  vertical-align: middle;
}
.tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

/* ---------- Prose and lists ---------- */

.prose { max-width: 62ch; color: var(--ink-2); }
.prose p + p { margin-top: 16px; }
.prose a, .link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
}
.prose a:hover, .link:hover { color: var(--accent); text-decoration-color: var(--accent); }
.link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }
.list-plain { list-style: none; border-top: 1px solid var(--line); max-width: 62ch; }
.list-plain li {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}
ol.list-plain { counter-reset: item; }
ol.list-plain li::before {
  counter-increment: item;
  content: counter(item, decimal-leading-zero);
  flex: none;
  width: 32px;
  padding-top: 4px;
  font: 400 14px/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.source-line { font-size: 14px; color: var(--muted); }

/* ---------- Tables ---------- */

.table-wrap {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--line);
}
.table-wrap.is-clipped {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}
.table th, .table td {
  padding: 12px 16px 12px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.table th:first-child, .table td:first-child { padding-left: 16px; }
.table thead th {
  background: var(--surface);
  font: 500 12px/1.4 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.table tr { height: 44px; }
.table tbody th { color: var(--ink); font-weight: 400; }
.table td { color: var(--ink-2); }
.table .num, .table code, .table .data {
  font: 400 14px/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
}
.table .num { white-space: nowrap; }
.table .tag { margin-left: 8px; }
.table-kv tbody th { width: 38%; }
.table-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px var(--gutter);
  align-items: start;
}
.table-pair h3 { margin-bottom: 16px; }
.table-note { margin-top: 12px; }
@media (max-width: 1100px) {
  .table-pair { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .table th, .table td { padding-right: 12px; }
  .table th:first-child, .table td:first-child { padding-left: 12px; }
  /* Three- and four-column tables become one block per row, so nothing scrolls sideways on a phone. */
  .table-wide, .table-wide tbody { display: block; }
  .table-wide thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .table-wide tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 16px;
    height: auto;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
  }
  .table-wide th, .table-wide td,
  .table-wide th:first-child, .table-wide td:first-child { padding: 0; border: 0; }
  .table-wide tbody th { grid-column: 1; grid-row: 1; font-size: 16px; font-weight: 550; }
  .table-wide td { grid-column: 1 / -1; }
  .table-wide td.num:not([data-label]) { grid-column: 2; grid-row: 1; align-self: baseline; color: var(--muted); }
  .table-wide td[data-label] { display: grid; grid-template-columns: 104px minmax(0, 1fr); column-gap: 12px; align-items: baseline; }
  .table-wide td[data-label]::before {
    content: attr(data-label);
    font: 500 12px/1.4 var(--mono);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
  }
}

/* ---------- Figures ---------- */

.figure { min-width: 0; }
.well {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface);
  border: 0;
  padding: 0;
}
.well.r43 { aspect-ratio: 4 / 3; }
.well.r11 { aspect-ratio: 1 / 1; }
.well > img, .well > video, .well > picture, .well > picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.well.contain > img, .well.contain > picture > img { object-fit: contain; }
.well.plate { background: var(--plate); }
.well.plate img { mix-blend-mode: multiply; }
.figure figcaption {
  margin-top: 12px;
  color: var(--muted);
}
.figure figcaption .tag { margin-left: 8px; }
button.well { cursor: zoom-in; }
button.well:focus-visible { outline-offset: 3px; }
.figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px var(--gutter);
  align-items: start;
}
.figure-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .figure-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .figure-grid, .figure-grid.three { grid-template-columns: 1fr; }
}

/* Videos sit in clipped wells, so their focus ring is drawn inside the frame. */
.well > video:focus, .well > video:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Images fade in once when they finish decoding (site.js adds the classes). */
img.will-fade { opacity: 0; transition: opacity 200ms linear; }
img.will-fade.is-loaded { opacity: 1; }

/* ---------- Lightbox ---------- */

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}
.lightbox::backdrop { background: rgb(14 15 16 / .94); }
.lightbox[open] {
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
}
.lightbox-stage {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 24px 72px 0;
}
.lightbox-stage img {
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
}
.lightbox-stage img.on-plate { background: var(--plate); }
.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(var(--max), 100% - 2 * var(--margin));
  padding-block: 12px 16px;
  font-size: 14px;
  color: var(--ink-2);
}
.lightbox-count { font: 400 14px/1.5 var(--mono); color: var(--muted); }
.lightbox-buttons { display: flex; gap: 8px; }
.lightbox button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
.lightbox button:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 700px) {
  .lightbox-stage { padding: 16px 0 0; }
  .lightbox-stage img { max-width: 100vw; }
  .lightbox-bar { flex-wrap: wrap; }
}

/* ---------- Stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr));
  gap: 32px var(--gutter);
  padding-block: 32px;
  border-block: 1px solid var(--line);
}
.stats dt {
  font: 500 12px/1.4 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.stats dd { margin-top: 12px; }
.stat-value {
  display: block;
  color: var(--ink);
  font-size: clamp(40px, 4.4vw, 64px);
  line-height: 1;
  font-weight: 450;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.stat-unit {
  display: inline-block;
  white-space: nowrap;
  margin-left: 8px;
  font: 400 14px/1.5 var(--mono);
  letter-spacing: 0;
  color: var(--ink-2);
}
.stats .tag { margin-top: 16px; }
.stats + .source-line { margin-top: 16px; }
.spec + .stats { margin-top: 0; border-top: 0; }
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--bg);
  font-size: 15px;
  font-weight: 550;
}
.button:hover { background: var(--accent); }
.text-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  color: var(--ink);
  border-bottom: 1px solid var(--line-strong);
}
.text-action:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Sources ---------- */

.sources { padding-block: 48px; border-top: 1px solid var(--line); }
.sources summary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--ink);
  font-size: 14px;
  list-style: none;
  cursor: pointer;
}
.sources summary::-webkit-details-marker { display: none; }
.sources summary::after { content: "+"; font: 400 14px/1 var(--mono); color: var(--muted); }
.sources details[open] summary::after { content: "\2212"; }
.sources summary:hover { color: var(--accent); }
.sources-body {
  display: grid;
  gap: 16px;
  max-width: 78ch;
  padding-top: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.sources-body ul { padding-left: 16px; display: grid; gap: 8px; }
.sources-body a {
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
}
.sources-body a:hover { color: var(--accent); }

/* ---------- Next project ---------- */

.next { border-top: 1px solid var(--line); }
.next-link {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: center;
  padding-block: 72px;
}
.next-text { grid-column: 1 / 8; }
.next-text .page-title { margin-top: 16px; transition: color 150ms; }
.next-link:hover .page-title { color: var(--accent); }
.next-thumb { grid-column: 8 / 13; }
.next-thumb .well { aspect-ratio: 16 / 10; }
.next-thumb img { transition: transform 500ms var(--ease); }
.next-link:hover .next-thumb img { transform: scale(1.02); }
.next-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  font-size: 14px;
}
.next-row a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); }
.next-row a:hover { color: var(--accent); }
@media (max-width: 700px) {
  .next-link { padding-block: 48px; row-gap: 24px; }
  .next-text, .next-thumb { grid-column: 1 / -1; }
  .next-thumb { order: -1; }
}

/* ---------- Contact ---------- */

.contact { padding-block: 72px; border-top: 1px solid var(--line); }
.contact h2 {
  font-size: clamp(48px, 5.4vw, 84px);
  line-height: 1;
  font-weight: 450;
  letter-spacing: -.04em;
  margin-bottom: 24px;
}
.contact .lead { color: var(--ink); }
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin-top: 24px;
  font-size: 15px;
}
.contact-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-strong);
}
.contact-links a:hover { color: var(--accent); border-color: var(--accent); }
.home-page .contact { padding-block: 112px; }
@media (max-width: 700px) {
  .contact h2 { font-size: 40px; }
  .home-page .contact { padding-block: 72px; }
}

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

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 12px 24px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
.site-footer a:hover { color: var(--accent); }

/* ---------- Home ---------- */

.home-intro { position: relative; }
.hero {
  position: relative;
  isolation: isolate;
  height: calc(100svh - var(--header));
  min-height: 640px;
  max-height: 1080px;
  overflow: hidden;
}
.hero-photo {
  position: absolute;
  inset: 0 0 0 40%;
  z-index: -1;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 32%);
  mask-image: linear-gradient(90deg, transparent, #000 32%);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 52% 57%; }
.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg), transparent 28%);
}
.hero-copy {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 72px;
}
.hero-copy .display { margin-top: 24px; }
.hero-copy .lead { margin-top: 32px; max-width: 30ch; color: var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; margin-top: 32px; }
.hero-availability { position: absolute; left: 0; right: 0; bottom: 24px; }
/* Between phone and desktop the copy column is wide relative to the photo, so the photo starts further
   right and keeps its subject clear of the name. */
@media (min-width: 701px) and (max-width: 1100px) {
  .hero-photo { inset: 0 0 0 52%; }
  .hero-photo img { object-position: 62% 57%; }
  .hero-copy .display { font-size: clamp(56px, 7.4vw, 84px); }
  .hero-copy .label { max-width: 44%; }
}
@media (max-width: 700px) {
  .hero { height: auto; min-height: clamp(390px, 63svh, 540px); max-height: none; display: grid; align-items: end; }
  .hero-photo { inset: 0; -webkit-mask-image: none; mask-image: none; }
  .hero-photo img { object-position: 52% 40%; }
  .hero-photo::after { background: linear-gradient(0deg, var(--bg) 8%, rgb(14 15 16 / .86) 46%, rgb(14 15 16 / .1) 78%); }
  .hero-copy { height: auto; padding-top: clamp(96px, 20svh, 180px); padding-bottom: 24px; }
  .hero-copy .display { font-size: clamp(44px, 13vw, 64px); margin-top: 12px; }
  .hero-copy .lead { margin-top: 16px; }
  .hero-actions { margin-top: 16px; }
  .hero-availability { position: static; padding-block: 16px; background: var(--surface); border-block: 1px solid var(--line); }
}

@media (max-width: 700px) and (max-height: 500px) {
  .hero { min-height: 0; }
  .hero-copy { padding-top: 40px; }
}

.work-list { display: grid; gap: 72px; }
.work-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: center;
}
.work-media { grid-column: 1 / 8; }
.work-media .well { aspect-ratio: 16 / 10; }
.work-media img { transition: transform 500ms var(--ease); }
.work-row:hover .work-media img { transform: scale(1.02); }
.work-text { grid-column: 8 / 13; padding-left: var(--gutter); }
.work-row.flip .work-media { grid-column: 6 / 13; grid-row: 1; }
.work-row.flip .work-text { grid-column: 1 / 6; grid-row: 1; padding: 0 var(--gutter) 0 0; }
.work-heading { margin-bottom: 48px; }
.work-row:focus-visible { outline-offset: 8px; }
.work-text h3 {
  margin-top: 16px;
  font-size: clamp(32px, 3.2vw, 48px);
  line-height: 1.05;
  font-weight: 450;
  letter-spacing: -.035em;
  transition: color 150ms;
}
.work-row:hover h3 { color: var(--accent); }
.work-text p { margin-top: 16px; color: var(--ink-2); }
.mini-spec { display: grid; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.mini-spec div { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: baseline; }
.mini-spec dt {
  font: 500 12px/1.4 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.mini-spec dd { font-size: 14px; color: var(--ink); }
.more-work { margin-top: 112px; }
.more-work h3 { margin-bottom: 16px; }
.more-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: baseline;
  min-height: 72px;
  padding-block: 24px;
  border-top: 1px solid var(--line);
}
.more-row .h3 { grid-column: 1 / 5; transition: color 150ms; }
.more-row p { grid-column: 5 / 11; font-size: 15px; color: var(--ink-2); }
.more-row p .tag { margin-left: 8px; }
.more-row .data { grid-column: 11 / 13; text-align: right; color: var(--muted); }
.more-row:hover .h3 { color: var(--accent); }
@media (max-width: 900px) {
  .work-media, .work-row.flip .work-media { grid-column: 1 / 8; grid-row: auto; }
  .work-text, .work-row.flip .work-text { grid-column: 8 / 13; grid-row: auto; padding: 0; }
}
@media (max-width: 700px) {
  .work-list { gap: 48px; }
  .work-row { row-gap: 24px; }
  .work-media, .work-text, .work-row.flip .work-media, .work-row.flip .work-text { grid-column: 1 / -1; }
  .more-work { margin-top: 72px; }
  .more-row { row-gap: 8px; }
  .more-row .h3 { grid-column: 1 / 10; }
  .more-row .data { grid-column: 10 / 13; }
  .more-row p { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Home: experience ---------- */

.xp-feature {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 32px;
  align-items: start;
}
.xp-text { grid-column: 1 / 6; padding-right: var(--gutter); }
.xp-media { grid-column: 6 / 13; }
.xp-video { aspect-ratio: 16 / 9; }
.xp-media figcaption { margin-top: 12px; color: var(--muted); }
.xp-media figcaption .tag { margin-left: 8px; }
.xp h3, .xp-text h3 { font-size: clamp(24px, 2vw, 30px); line-height: 1.15; font-weight: 480; letter-spacing: -.025em; }
.xp-role { margin-top: 8px; font-size: 15px; color: var(--ink-2); }
.xp-role + .xp-role { margin-top: 2px; }
.xp-when { margin-left: 8px; font: 400 14px/1.5 var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.xp-fact { margin-top: 24px; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.5; letter-spacing: -.01em; color: var(--ink); max-width: 40ch; }
.xp-text .xp-fact ~ p { margin-top: 16px; font-size: 15px; max-width: 46ch; }
.xp-pair {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 48px;
  margin-top: 72px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.xp-pair .xp:first-child { grid-column: 1 / 6; padding-right: var(--gutter); }
.xp-pair .xp:last-child { grid-column: 6 / 11; }
.xp > p:last-child { margin-top: 16px; max-width: 52ch; }
@media (max-width: 900px) {
  .xp-text, .xp-media { grid-column: 1 / -1; padding-right: 0; }
  .xp-pair .xp:first-child, .xp-pair .xp:last-child { grid-column: 1 / -1; padding-right: 0; }
}
@media (max-width: 700px) {
  .xp-pair { margin-top: 56px; padding-top: 32px; row-gap: 40px; }
}

/* ---------- Motion ---------- */

@view-transition { navigation: auto; }
::view-transition-group(*),
::view-transition-old(*),
::view-transition-new(*) {
  animation-duration: 280ms;
  animation-timing-function: var(--ease);
}
.vt-dispenser { view-transition-name: work-dispenser; }
.vt-boat { view-transition-name: work-boat; }
.vt-robot { view-transition-name: work-robot; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html, html:focus-within { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
  img.will-fade { opacity: 1; }
  .work-row:hover .work-media img, .next-link:hover .next-thumb img { transform: none; }
}

/* ---------- 404 ---------- */

.not-found { min-height: calc(100svh - var(--header) - 70px); padding-block: 160px 112px; }
.not-found .page-title { margin-top: 16px; }

/* ---------- Homepage look, shared by every page (2026-12) ----------
   The homepage sets the type and palette: Instrument Serif for display, Instrument Sans for text,
   night background, warm amber for interaction and marks. These rules carry it to every page. */
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url(assets/fonts/instrument-serif-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url(assets/fonts/instrument-serif-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 400; font-display: swap; src: url(assets/fonts/instrument-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 500; font-display: swap; src: url(assets/fonts/instrument-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 600; font-display: swap; src: url(assets/fonts/instrument-sans-latin-600-normal.woff2) format("woff2"); }
:root {
  --bg: #05080b;
  --surface: #0b1117;
  --plate: #ecebe4;
  --line: #1f2830;
  --line-strong: #33404a;
  --ink: #ecebe4;
  --ink-2: #c4cacb;
  --muted: #9aa3a6;
  --accent: #e3a05e;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Instrument Sans", system-ui, "Helvetica Neue", Arial, sans-serif;
}
.display, .page-title, h2, .h2, .identity, .next-text .page-title {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.02em;
}
.display { letter-spacing: -.03em; }
h2, .h2 { font-size: clamp(32px, 3.2vw, 48px); line-height: 1.02; }
.identity { font-size: 21px; }
h3, .h3 { font-weight: 500; letter-spacing: 0; }
.label {
  font: 500 13px/1.4 var(--sans);
  letter-spacing: .01em;
  text-transform: none;
}
