/* Aaron Hong — portfolio. One stylesheet for every page. */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: "Varela Round";
  src: url("fonts/varela-round-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sono";
  src: url("fonts/sono-latin-wght-mono-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
/* Warm off-white, black and brass. The dark theme, gunmetal and gold, applies only when a
   visitor switches to it. --paper is the off-white itself, which is also the text colour on
   every dark surface. */
:root {
  color-scheme: light;
  --paper: #eae4da;
  --bg: var(--paper);
  --bg-2: #ddd6ca;
  --panel: #f4f0e8;
  --ink: #1a1815;
  --ink-2: #57534b;
  --ink-3: #888378;
  --line: rgb(26 24 21 / 0.2);
  --dots: rgb(26 24 21 / 0.42);
  --accent: #805700;
  --fill: #f4c430;
  --on-fill: #1a1815;
  --footer-bg: #1a1815;
  --footer-ink: var(--paper);
  --tile-dark: #1b1917;
  --tile-light: #f4f0e8;

  /* One typeface in one weight carries the page; size and colour set the hierarchy. */
  --font: "Varela Round", ui-rounded, "Hiragino Maru Gothic ProN", "Arial Rounded MT", system-ui, sans-serif;
  --mono: "Sono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --w-display: 400;
  --w-head: 400;
  --tight: -0.02em;

  --wrap: 82rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --header-h: 4rem;
  --stroke: 2px;
  --radius: 0.875rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1a18;
  --bg-2: #2a2724;
  --panel: #23211e;
  --ink: var(--paper);
  --ink-2: #aaa499;
  --ink-3: #7d786f;
  --line: rgb(234 228 218 / 0.16);
  --dots: rgb(234 228 218 / 0.38);
  --accent: #f4c430;
  --on-fill: #1c1a18;
  --footer-bg: #121110;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variation-settings: "MONO" 1;
}
img,
video,
svg {
  display: block;
  max-width: 100%;
}
img,
video {
  height: auto;
}
h1,
h2,
h3,
p,
ul,
ol,
figure,
dl,
dd {
  margin: 0;
}
ul[class],
ol[class] {
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: var(--stroke);
  text-underline-offset: 0.22em;
}
a:hover {
  color: var(--accent);
}
button {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
::selection {
  background: var(--fill);
  color: var(--on-fill);
}
[id] {
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius);
}
.skip:focus {
  top: 1rem;
  color: var(--bg);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Small label in the mono companion, used all over */
.eyebrow,
.label {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink-2);
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 0.625rem;
  height: 0.625rem;
  margin-right: 0.6rem;
  border: var(--stroke) solid var(--ink);
  border-radius: 50%;
  background: var(--fill);
  vertical-align: -0.02em;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--line);
}
.home .site-header {
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom-color: transparent;
}
.home .site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
  opacity: var(--hdr, 1);
}
.home .site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 1px;
  background: var(--line);
  opacity: var(--seal, 1);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
}
.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: var(--w-display);
  font-size: 1.125rem;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover {
  color: inherit;
}
.brand svg {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
}
/* Home page: stands in the name's slot until the big name docks there */
.brand-tag {
  position: absolute;
  left: calc(1.5rem + 0.65rem);
  top: 50%;
  translate: 0 -50%;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
  opacity: var(--tag, 0);
  pointer-events: none;
}
.brand .mark-cap {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.brand .mark-dish {
  fill: var(--fill);
  transition: transform 0.4s var(--ease);
  transform-origin: center;
}
.brand:hover .mark-dish {
  transform: scale(0.72);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.5vw, 1.9rem);
}
.site-nav a {
  font-size: 0.9375rem;
  text-decoration: none;
  padding-block: 0.5rem;
}
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-right: -0.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.theme-toggle:hover {
  color: var(--accent);
}
.theme-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
}
.theme-toggle .half {
  fill: currentColor;
  stroke: none;
}

/* ---------- Buttons ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.62rem 1.15rem;
  border: var(--stroke) solid var(--ink);
  border-radius: 999px;
  font-size: 0.9375rem;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.btn:hover {
  background: var(--ink);
  color: var(--bg);
}
.btn.primary {
  background: var(--ink);
  color: var(--bg);
}
.btn.primary:hover {
  background: var(--fill);
  color: var(--on-fill);
}
.btn small {
  font-size: inherit;
  opacity: 0.6;
}

/* ---------- Home: hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  padding-block: clamp(1rem, 2.2vw, 1.75rem) clamp(2.75rem, 6vw, 4.5rem);
}
.hero-main {
  container-type: inline-size;
}
/* Optical alignment, from Varela Round's metrics. The negative top margin puts the top of the
   capitals on the top of the box, and each word gives back its first letter's side bearing
   (A, then H), so the ink starts on the page's left edge. */
.hero h1 {
  margin: -0.063em 0 0.28em;
  font-size: clamp(4.5rem, 34cqi, 14rem);
  font-weight: var(--w-display);
  line-height: 0.9;
  letter-spacing: var(--tight);
}
.hero h1 span {
  display: block;
  margin-left: -0.047em;
}
.hero h1 span + span {
  margin-left: -0.094em;
}
.hero-title {
  margin-left: -0.047em;
  font-size: clamp(1.5rem, 2.7vw, 2.125rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.hero-place {
  margin-top: 0.7rem;
}
.hero .actions {
  margin-top: 1.9rem;
}

/* The big name shrinks into the header as the page scrolls (site.js). .dock is the copy
   that moves; the heading and the header's own name keep their places underneath. */
.dock {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  pointer-events: none;
  font-weight: var(--w-display);
}
.dock span {
  position: absolute;
  top: 0;
  left: 0;
  line-height: 1;
  white-space: nowrap;
  will-change: transform;
}
.docking .hero h1,
.docking .brand-name,
.pre .brand-name {
  opacity: 0;
}
.pre .brand-tag {
  opacity: 1;
}
.pre .site-header::before,
.pre .site-header::after {
  opacity: 0;
}
.dock-static .brand-name {
  opacity: 0;
  transition: opacity 0.2s;
}
.dock-static.docked .brand-name {
  opacity: 1;
}

/* Sono's capitals start 0.387em below the top of this label's box; taking that off lines
   them up with the top of the name beside it. */
.timeline-title {
  margin-top: -0.387em;
  padding-bottom: 0.9rem;
  border-bottom: var(--stroke) solid var(--ink);
}
.timeline li {
  border-bottom: var(--stroke) dotted var(--dots);
}
.timeline .t-row {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.25rem 1rem;
  padding: 0.95rem 0;
  color: inherit;
  text-decoration: none;
}
.t-when {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
  white-space: nowrap;
}
.t-what strong {
  display: block;
  font-weight: var(--w-head);
  line-height: 1.25;
}
.t-what span {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--ink-2);
}
.t-go {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--ink-2);
  white-space: nowrap;
}
a.t-row:hover .t-go,
a.t-row:hover strong {
  color: var(--accent);
}
a.t-row .t-go .icon {
  transition: transform 0.3s var(--ease);
}
a.t-row:hover .t-go .icon {
  transform: translateY(3px);
}

/* ---------- Home: projects ---------- */
.project {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 4rem);
  padding-block: clamp(2.75rem, 6vw, 5rem);
}
.project::before,
.pager::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  border-top: var(--stroke) solid var(--ink);
}
.project-intro h2 {
  margin-top: 0.9rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: var(--w-head);
  line-height: 1.04;
  letter-spacing: var(--tight);
  text-wrap: balance;
}
.project-meta {
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
}
.project-blurb {
  max-width: 30em;
  margin-top: 1.1rem;
  color: var(--ink-2);
  text-wrap: pretty;
}
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin-top: 1.1rem;
}
.ext {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9375rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: clamp(1.75rem, 3vw, 2.5rem) clamp(1rem, 2vw, 1.75rem);
}
.cards.three {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr));
}
/* A project with a single write-up gets one large card */
.cards.feature {
  grid-template-columns: minmax(0, 1fr);
}
.cards.feature .card-img {
  aspect-ratio: 16 / 10;
}
.cards.feature h3 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
}
.cards.feature .card-desc {
  max-width: 38em;
  font-size: 1rem;
}
/* The cue that a card opens a write-up; the whole card is the link */
.card-go {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.3;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: var(--stroke);
  text-underline-offset: 0.22em;
}
.card-go .icon {
  transition: transform 0.3s var(--ease);
}
.card:hover .card-go,
.card:focus-visible .card-go {
  color: var(--accent);
}
.card:hover .card-go .icon {
  transform: translateX(4px);
}
.card {
  display: block;
  height: 100%;
  text-decoration: none;
}
.card:hover {
  color: inherit;
}
.card-img {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-2);
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.card:hover .card-img img {
  transform: scale(1.04);
}
.card-img::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgb(128 128 128 / 0.18);
  pointer-events: none;
}
.card .label {
  margin-top: 0.95rem;
}
.card h3 {
  margin-top: 0.3rem;
  font-size: 1.3125rem;
  font-weight: var(--w-head);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.card-desc {
  max-width: 38em;
  font-size: 1rem;
}
.card {
  display: block;
  height: 100%;
  text-decoration: none;
}
.card:hover {
  color: inherit;
}
.card-img {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-2);
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.card:hover .card-img img {
  transform: scale(1.04);
}
.card-img::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgb(128 128 128 / 0.18);
  pointer-events: none;
}
.card .label {
  margin-top: 0.95rem;
}
.card h3 {
  margin-top: 0.3rem;
  font-size: 1.3125rem;
  font-weight: var(--w-head);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.card h3 .icon {
  display: inline-block;
  margin-left: 0.3rem;
  vertical-align: -0.08em;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-0.4rem);
  transition: opacity 0.25s, transform 0.35s var(--ease);
}
.card:hover h3 .icon,
.card:focus-visible h3 .icon {
  opacity: 1;
  transform: none;
}
.card-desc {
  margin-top: 0.45rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- Case study pages ---------- */
.case-head {
  padding-block: clamp(2rem, 5vw, 3.5rem) clamp(2.25rem, 6vw, 4.5rem);
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--ink-2);
}
.back .icon {
  transition: transform 0.3s var(--ease);
}
.back:hover .icon {
  transform: translateX(-3px);
}
.case-head h1 {
  max-width: 16em;
  margin-top: 1rem;
  font-size: clamp(2.5rem, 6.4vw, 5rem);
  font-weight: var(--w-display);
  line-height: 1;
  letter-spacing: var(--tight);
  text-wrap: balance;
}
.case-sub {
  max-width: 30em;
  margin-top: 1.1rem;
  font-size: clamp(1.2rem, 2.1vw, 1.5rem);
  line-height: 1.3;
  color: var(--ink-2);
  text-wrap: balance;
}
.case-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 1.5rem;
}

/* Key facts under a page title */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.5rem), 1fr));
  gap: 1.4rem 2rem;
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: 1.4rem;
  border-top: var(--stroke) dotted var(--dots);
}
.facts dt {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-2);
}
.facts dd {
  margin-top: 0.4rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.note {
  max-width: 44rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  padding: 1rem 1.25rem;
  background: var(--panel);
  border-radius: var(--radius);
  font-size: 0.9875rem;
}

.chapters {
  counter-reset: chapter;
}
.chapter {
  display: grid;
  gap: clamp(2rem, 4vw, 3.25rem);
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  border-top: var(--stroke) dotted var(--dots);
}
.chapter:first-child {
  border-top: var(--stroke) solid var(--ink);
}
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem clamp(2rem, 5vw, 5rem);
}
.row-text {
  max-width: 40rem;
}
.row-text > * + * {
  margin-top: 1.05em;
}
.row-text h2 {
  font-size: clamp(1.5rem, 2.6vw, 2.05rem);
  font-weight: var(--w-head);
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.row-text h2::before {
  counter-increment: chapter;
  content: counter(chapter, decimal-leading-zero);
  display: block;
  margin-bottom: 0.85rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--accent);
}
/* A titled part of a chapter, numbered under it: 02.1, 02.2 */
.chapter {
  counter-reset: part;
}
.row.part {
  padding-top: clamp(2rem, 4vw, 3.25rem);
  border-top: var(--stroke) dotted var(--dots);
}
.row-text h3 {
  font-size: clamp(1.3rem, 2.1vw, 1.65rem);
  font-weight: var(--w-head);
  line-height: 1.16;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.row.part .row-text h3::before {
  counter-increment: part;
  content: counter(chapter, decimal-leading-zero) "." counter(part);
  display: block;
  margin-bottom: 0.85rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--accent);
}
.row-text .actions {
  margin-top: 1.6rem;
}
.points a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.row-text p,
.row-text li {
  text-wrap: pretty;
}
.row-text ul {
  padding-left: 1.2em;
}
.row-text li + li {
  margin-top: 0.5em;
}
.row-text li::marker {
  color: var(--accent);
}
.row-text code {
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: var(--bg-2);
  font-family: var(--mono);
  font-size: 0.88em;
  white-space: nowrap;
}
.row-media {
  display: grid;
  gap: 0.75rem;
  align-content: start;
  min-width: 0;
}

/* Image rows. Each .shots-row is one row: its images share the width in
   proportion to their aspect ratios (--ar), so they end up the same height,
   uncropped. .shots.wall is the wrapping version used for big galleries. */
.shots {
  display: grid;
  gap: 0.6rem;
}
.shots-row {
  display: flex;
  gap: 0.6rem;
}
.shot {
  min-width: 0;
}
.shots-row > .shot {
  flex: var(--ar) 1 0;
}
.shots-row.solo > .shot {
  max-width: min(100%, calc(var(--ar) * 34rem), var(--max, 100%));
}
.shots.wall {
  display: flex;
  flex-wrap: wrap;
  --row-h: 12rem;
}
.shots.wall > .shot {
  flex: var(--ar) 1 calc(var(--ar) * var(--row-h));
  max-width: calc(var(--ar) * var(--row-h) * 2.2);
}
.shot > a,
.shot > .frame {
  position: relative;
  display: block;
  aspect-ratio: var(--ar);
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-2);
}
.shot > a::after,
.shot > .frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgb(128 128 128 / 0.2);
  pointer-events: none;
}
.shot img,
.shot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
video[data-clip]:not([controls]) {
  cursor: pointer;
}
.shot > a img {
  transition: transform 0.6s var(--ease), opacity 0.2s;
}
.shot > a:hover img {
  transform: scale(1.025);
}
.shot.on-dark > a,
.shot.on-dark > .frame {
  background: var(--tile-dark);
}
.shot.on-light > a,
.shot.on-light > .frame {
  background: var(--tile-light);
}
.shot.pad img {
  object-fit: contain;
  padding: 9%;
}
/* Uniform square tiles, for sets of icons */
.shots.tiles {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr));
}
.shots.tiles .shot > a {
  aspect-ratio: 1;
  background: var(--tile-dark);
}
.shots.tiles .shot img {
  object-fit: contain;
  padding: 13%;
}
.shot figcaption,
.caption {
  margin-top: 0.6rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}
.shot figcaption p + p {
  margin-top: 0.6em;
}
.shot figcaption a,
.row-text a {
  overflow-wrap: anywhere;
}

/* Captioned figures (used where every photo has its own caption) */
.figs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 1.75rem 0.9rem;
}
.figs .wide {
  grid-column: 1 / -1;
}
.figs.two {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

/* YouTube: a thumbnail that becomes the player on click */
.yt {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: #000;
  color: var(--paper);
  text-decoration: none;
}
.yt:hover {
  color: var(--paper);
}
.yt img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), opacity 0.3s;
}
.yt:hover img {
  transform: scale(1.03);
  opacity: 0.85;
}
.yt-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.yt-play span {
  display: grid;
  place-items: center;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 50%;
  background: var(--fill);
  color: var(--on-fill);
  transition: transform 0.35s var(--ease);
}
.yt:hover .yt-play span {
  transform: scale(1.1);
}
.yt-play svg {
  width: 1.5rem;
  height: 1.5rem;
  margin-left: 0.2rem;
  fill: currentColor;
}
.yt-label {
  position: absolute;
  inset: auto 0 0 0;
  padding: 3rem 1rem 0.85rem;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.8));
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.4;
}
.yt iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 0.75rem;
}

.player {
  overflow: hidden;
  border-radius: var(--radius);
  background: #000;
}
.player video {
  width: 100%;
  aspect-ratio: var(--ar, 16 / 9);
}

/* Short titled points, set beside a chapter's text */
.points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 0 2rem;
}
.points li {
  padding: 1.05rem 0 1.25rem;
  border-top: var(--stroke) dotted var(--dots);
}
.points strong {
  display: block;
  font-weight: var(--w-head);
  line-height: 1.3;
}
.points span {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* A pipeline drawn as a list: nodes on a rail, top to bottom */
ol.flow {
  position: relative;
  padding-left: 2rem;
}
.flow li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(-1.685rem - var(--stroke) / 2);
  top: 1.1rem;
  bottom: -0.42rem;
  width: var(--stroke);
  background: var(--ink);
}
.flow li {
  position: relative;
  padding-bottom: 1.35rem;
}
.flow li::before {
  content: "";
  position: absolute;
  left: -2.06rem;
  top: 0.4rem;
  width: 0.75rem;
  height: 0.75rem;
  border: var(--stroke) solid var(--ink);
  border-radius: 50%;
  background: var(--bg);
}
.flow li:first-child::before,
.flow li:last-child::before {
  background: var(--fill);
}
.flow strong {
  display: block;
  font-weight: var(--w-head);
  line-height: 1.3;
}
.flow span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Audio tracks */
.tracks {
  display: grid;
  gap: 0.75rem;
}
.track {
  padding: 1.1rem 1.25rem 1.2rem;
  background: var(--panel);
  border-radius: var(--radius);
}
.track h3 {
  font-size: 1.0625rem;
  font-weight: var(--w-head);
  line-height: 1.25;
}
.track p {
  margin-top: 0.3rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-2);
}
.track audio {
  display: block;
  width: 100%;
  height: 2.5rem;
  margin-top: 0.9rem;
}

/* Small things made at game jams */
.jams {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 2rem 1rem;
}
.jam .frame {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--tile-dark);
}
.jam video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}
.jam h3 {
  margin-top: 0.85rem;
  font-size: 1.125rem;
  font-weight: var(--w-head);
  line-height: 1.2;
}
.jam .ext {
  margin-top: 0.35rem;
}

/* Previous / next */
.pager {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}
.pager a {
  display: block;
  padding: clamp(1.5rem, 4vw, 2.75rem) 0;
  text-decoration: none;
}
.pager a + a {
  text-align: right;
}
.pager .label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.pager strong {
  display: block;
  margin-top: 0.5rem;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: var(--w-head);
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.pager a:hover .label {
  color: var(--accent);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: clamp(1rem, 4vw, 3rem);
  background: var(--footer-bg);
  color: var(--footer-ink);
  --ink: var(--footer-ink);
  --ink-2: color-mix(in srgb, var(--footer-ink) 68%, transparent);
  --dots: color-mix(in srgb, var(--footer-ink) 40%, transparent);
  --accent: var(--fill);
  --bg: var(--footer-bg);
}
.site-footer .wrap {
  padding-block: clamp(2.5rem, 6vw, 4rem) 1.75rem;
}
.site-footer .eyebrow {
  color: var(--ink-2);
}
.site-footer .actions {
  margin-top: 1.25rem;
}
.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.25rem;
  border-top: var(--stroke) dotted var(--dots);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-2);
}
.footer-base a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  text-decoration: none;
}

/* ---------- Lightbox ---------- */
.lb {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(18 17 16 / 0.96);
  color: var(--paper);
  overflow: hidden;
}
.lb::backdrop {
  background: rgb(18 17 16 / 0.6);
}
.lb[open] {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  animation: lb-in 0.2s ease-out;
}
@keyframes lb-in {
  from {
    opacity: 0;
  }
}
.lb-stage {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  min-height: 0;
  padding: 3.5rem clamp(0.75rem, 5vw, 4.5rem) 0.5rem;
  overflow: hidden;
}
.lb-stage img {
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}
.lb-stage img.on-dark {
  background: var(--tile-dark);
}
.lb-stage img.on-light {
  background: var(--tile-light);
}
.lb-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.75rem clamp(1rem, 5vw, 4.5rem) 1.1rem;
  font-size: 0.875rem;
  line-height: 1.45;
}
.lb-caption {
  max-width: 60rem;
  color: color-mix(in srgb, var(--paper) 82%, transparent);
}
.lb-meta {
  display: flex;
  gap: 1.25rem;
  flex: none;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: color-mix(in srgb, var(--paper) 58%, transparent);
  white-space: nowrap;
}
.lb-meta a:hover {
  color: var(--paper);
}
.lb button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(234 228 218 / 0.12);
  color: var(--paper);
  cursor: pointer;
  transition: background-color 0.2s;
}
.lb button:hover {
  background: rgb(234 228 218 / 0.24);
}
.lb button svg {
  width: 1.25rem;
  height: 1.25rem;
}
.lb-close {
  top: 0.6rem;
  right: 0.75rem;
}
.lb-prev,
.lb-next {
  top: calc(50% - 2.5rem);
}
.lb-prev {
  left: 0.75rem;
}
.lb-next {
  right: 0.75rem;
}
.lb.single .lb-prev,
.lb.single .lb-next {
  display: none;
}

/* ---------- Wider screens ---------- */
@media (min-width: 62rem) {
  .hero {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }
  /* The experience list runs the full height of the name's column: tops and bottoms line up */
  .hero-side,
  .timeline {
    display: flex;
    flex-direction: column;
  }
  .timeline,
  .timeline li,
  .timeline .t-row {
    flex: 1;
  }
  .timeline li {
    display: flex;
    align-items: center;
  }
  .project {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  }
  .row {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
  }
  .row.text-only,
  .row.stack {
    grid-template-columns: minmax(0, 1fr);
  }
  .row.stack .row-media {
    margin-top: 0.5rem;
  }
}
@media (min-width: 62rem) and (min-height: 44rem) {
  .project-intro,
  .row:not(.stack) > .row-text {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
  }
}
@media (max-width: 36rem) {
  .shots.wall {
    --row-h: 6rem;
  }
  .shots.tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .jams {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cards,
  .cards.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.6rem 0.75rem;
  }
  .card h3 {
    font-size: 1.0625rem;
  }
  .card-desc {
    display: none;
  }
  .card-go {
    margin-top: 0.5rem;
    font-size: 0.875rem;
  }
  .cards.feature {
    grid-template-columns: minmax(0, 1fr);
  }
  .cards.feature .card-desc {
    display: block;
  }
  .card .label {
    margin-top: 0.7rem;
    font-size: 0.6875rem;
  }
  .site-header .wrap {
    gap: 0.75rem;
  }
  .site-nav {
    gap: 0.65rem;
  }
}
@media (max-width: 24.3rem) {
  .site-nav a[href$="#work"] {
    display: none;
  }
}
@media (max-width: 22.3rem) {
  .site-nav a[href$=".pdf"] {
    display: none;
  }
}
@media (max-width: 30rem) {
  .timeline .t-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .t-when {
    grid-column: 1 / -1;
  }
  .lb-bar {
    flex-direction: column;
    gap: 0.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .pager,
  .theme-toggle,
  .dock,
  .lb {
    display: none !important;
  }
  .docking .hero h1 {
    opacity: 1;
  }
  .row-text {
    position: static !important;
  }
}
