/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

@view-transition {
  navigation: auto;
}

:root {
  /* Fonts come from the active theme in themes.css */
  --gutter: clamp(16px, 4vw, 56px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.5s ease, color 0.5s ease;
}

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

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

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

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

.mono {
  font-family: var(--font-mono);
  font-size: 0.78em;
  letter-spacing: 0.02em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(48px, 9vw, 128px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  padding: 8px 14px;
  border-radius: 8px;
}
.skip:focus {
  left: 8px;
}

/* Film grain over everything */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 90;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-1%, 3%); }
  80% { transform: translate(3%, 1%); }
  100% { transform: translate(0, 0); }
}

/* Custom cursor (only on devices with a real mouse) */
.cursor {
  display: none;
}
@media (hover: hover) and (pointer: fine) {
  .cursor {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: var(--accent);
    pointer-events: none;
    z-index: 95;
    mix-blend-mode: difference;
    transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out), margin 0.3s var(--ease-out), opacity 0.3s;
    opacity: 0;
  }
  .cursor.is-visible {
    opacity: 1;
  }
  .cursor.is-hover {
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
  }
  .cursor.is-view::after {
    content: "View";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font: 500 11px var(--font-mono);
    color: var(--on-accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  .cursor.is-view {
    width: 72px;
    height: 72px;
    margin: -36px 0 0 -36px;
    mix-blend-mode: normal;
  }
}

/* ---------- Top bar ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(14px, env(safe-area-inset-top)) var(--gutter) 14px;
  transition: transform 0.5s var(--ease-out), background-color 0.4s, backdrop-filter 0.4s;
  view-transition-name: topbar;
}
.topbar.is-scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.topbar.is-hidden {
  transform: translateY(-100%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font: 500 13px var(--font-mono);
  transition: transform 0.6s var(--ease-spring);
}
.brand:hover .brand-mark {
  transform: rotate(-12deg) scale(1.08);
}
.brand-name {
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-2) 60%, transparent);
}
.nav a {
  position: relative;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 15px;
  color: var(--muted);
  transition: color 0.3s;
}
.nav a:hover,
.nav a.active {
  color: var(--text);
}
.nav a.active::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--surface);
  view-transition-name: nav-pill;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.menu-toggle {
  display: none;
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
}
.menu-toggle span {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.4s var(--ease-out);
}
.menu-toggle span:first-child { top: 16px; }
.menu-toggle span:last-child { top: 24px; }
.menu-open .menu-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-open .menu-toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 0 var(--gutter);
  background: var(--bg);
  clip-path: circle(0% at calc(100% - 40px) 36px);
  transition: clip-path 0.7s var(--ease-out);
}
.mobile-nav[hidden] {
  display: flex;
  visibility: hidden;
}
.menu-open .mobile-nav {
  visibility: visible;
  clip-path: circle(150% at calc(100% - 40px) 36px);
}
.mobile-nav a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font: 400 clamp(44px, 13vw, 72px) / 1.1 var(--font-display);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s, transform 0.6s var(--ease-out);
}
.mobile-nav a .mono {
  font-size: 13px;
  color: var(--accent);
}
.menu-open .mobile-nav a {
  opacity: 1;
  transform: none;
  transition-delay: calc(0.15s + var(--i) * 0.07s);
}

@media (max-width: 760px) {
  .nav { display: none; }
  .menu-toggle { display: block; }
  .brand-name { display: none; }
}

/* ---------- Icons ---------- */
.icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: none;
}
.icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
  will-change: transform;
}
.btn-solid {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.btn-solid:hover {
  box-shadow: 0 10px 40px var(--glow);
}
.btn-ghost:hover {
  border-color: var(--text);
}

.link-arrow {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 500;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.3s;
  white-space: nowrap;
}
.link-arrow span {
  transition: transform 0.4s var(--ease-out);
}
.link-arrow:hover {
  border-color: var(--accent);
}
.link-arrow:hover span {
  transform: translateX(5px);
}

.back-link {
  display: inline-block;
  color: var(--muted);
  margin-bottom: 24px;
  transition: color 0.3s, transform 0.3s;
}
.back-link:hover {
  color: var(--accent);
  transform: translateX(-4px);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: 120px var(--gutter) clamp(48px, 9vh, 96px);
  overflow: hidden;
  isolation: isolate;
}

.hero-stage {
  position: absolute;
  inset: 0;
  z-index: -1;
  /* Themes can shrink this frame, the photos inside must never spill out */
  overflow: hidden;
}
.hero-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--bg) 2%, color-mix(in srgb, var(--bg) 55%, transparent) 40%, color-mix(in srgb, var(--bg) 20%, transparent) 75%, color-mix(in srgb, var(--bg) 60%, transparent)),
    radial-gradient(ellipse at 20% 90%, color-mix(in srgb, var(--bg) 70%, transparent), transparent 60%);
}
.hero-slide {
  position: absolute;
  inset: 0;
  background: var(--tile-bg, var(--bg));
  opacity: 0;
  transition: opacity 1.6s ease;
}
.hero-slide.is-active {
  opacity: 1;
}
/*
  The photo is 20% taller than the hero (10% spare above and below) so the
  scroll parallax, capped at 9% in site.js, can never pull an edge into view.
  The slow zoom lives on `transform` and the parallax on `translate`, so the
  zoom's long transition doesn't make scrolling lag behind.
*/
.hero-slide img {
  position: absolute;
  left: 0;
  top: -10%;
  width: 100%;
  height: 120%;
  object-fit: cover;
  transform: scale(1.14);
  translate: 0 var(--parallax, 0px);
  transition: transform 8s linear;
  backface-visibility: hidden;
}
.hero-slide.is-active img:not(.lqip) {
  transform: scale(1.06);
}
/* Blur makes the placeholder's edges see-through, so push them well outside the frame */
.hero-slide .lqip,
.hero-slide.is-active .lqip {
  filter: blur(24px);
  transform: scale(1.35);
  transition: none;
}

.hero-blob {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  right: -20vmax;
  top: -20vmax;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent), var(--accent-2) 40%, transparent 70%);
  filter: blur(60px);
  opacity: 0.45;
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  to { transform: translate(-12vmax, 14vmax) scale(1.2); }
}

.hero-copy {
  max-width: 980px;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(48px, 8vw, 120px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 22px;
}
/* First and last name sit on one line, each clipped so the letters rise into view */
.hero-title .line {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.08em;
  vertical-align: bottom;
}
.hero-title .line + .line {
  margin-left: 0.22em;
}
.hero-title .italic {
  font-style: italic;
  color: var(--accent);
}
.char {
  display: inline-block;
  transform: translateY(105%) rotate(6deg);
  animation: char-in 1.1s var(--ease-out) forwards;
  animation-delay: calc(150ms + var(--ci) * 45ms);
}
@keyframes char-in {
  to { transform: none; }
}

.hero-in {
  opacity: 0;
  transform: translateY(18px);
  animation: fade-up 1s var(--ease-out) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes fade-up {
  to { opacity: 1; transform: none; }
}

.hero-intro {
  max-width: 560px;
  font-size: clamp(17px, 1.6vw, 20px);
  color: color-mix(in srgb, var(--text) 85%, transparent);
  margin: 0 0 32px;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  padding: 24px 0;
  border-block: 1px solid var(--line);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
  display: flex;
  gap: 16px;
  width: max-content;
  animation: marquee 60s linear infinite;
}
.marquee:hover .marquee-track {
  animation-play-state: paused;
}
.marquee img {
  height: clamp(120px, 18vw, 200px);
  aspect-ratio: var(--ar);
  object-fit: cover;
  border-radius: var(--radius);
  filter: grayscale(0.6);
  transition: filter 0.5s, transform 0.5s var(--ease-out);
}
.marquee img:hover {
  filter: none;
  transform: scale(1.04);
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- Sections ---------- */
main {
  view-transition-name: main;
}

.section {
  padding: clamp(64px, 10vw, 140px) var(--gutter) 0;
}
.page-top {
  padding-top: clamp(120px, 16vw, 200px);
  min-height: 60vh;
}
.page-title {
  margin-bottom: clamp(32px, 5vw, 64px);
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(28px, 4vw, 56px);
}
.section-head .display {
  font-size: clamp(40px, 7vw, 96px);
}

.split .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.08em;
}
.split .word > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1s var(--ease-out);
  transition-delay: calc(var(--wi) * 70ms);
}
.split.is-in .word > span {
  transform: none;
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease-out), transform 1.1s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}
.no-js .reveal,
.no-js .split .word > span {
  opacity: 1;
  transform: none;
}

.empty {
  color: var(--muted);
  font-size: 18px;
  padding: 40px 0;
}

.lede {
  font-size: clamp(19px, 2vw, 24px);
  max-width: 720px;
  color: color-mix(in srgb, var(--text) 85%, transparent);
}

.prose {
  max-width: 680px;
  margin-bottom: 40px;
}
.prose p {
  margin: 0 0 1.2em;
}
.prose.big {
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.65;
}

/* ---------- Filter chips ---------- */
.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 32px;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: none;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
  transition: all 0.3s;
  text-transform: capitalize;
}
.chip .mono {
  opacity: 0.6;
}
.chip:hover {
  color: var(--text);
  border-color: var(--text);
}
.chip.is-on {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.chips li {
  font: 12px var(--font-mono);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

/* ---------- Masonry gallery ---------- */
.masonry {
  --cols: 3;
  --gap: clamp(10px, 1.4vw, 20px);
  columns: var(--cols);
  column-gap: var(--gap);
}
.masonry.is-js {
  columns: auto;
  display: flex;
  gap: var(--gap);
  align-items: flex-start;
}
.masonry-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* Column counts for each size. site.js reads --cols for the masonry layout. */
.masonry[data-size="s"] { --cols: 5; --gcols: 8; --row-h: 170px; --gap: clamp(6px, 0.8vw, 12px); }
.masonry[data-size="m"] { --cols: 3; --gcols: 5; --row-h: 280px; }
.masonry[data-size="l"] { --cols: 2; --gcols: 3; --row-h: 440px; --gap: clamp(12px, 2vw, 28px); }
@media (max-width: 1000px) {
  .masonry[data-size="s"] { --cols: 4; --gcols: 6; --row-h: 130px; }
  .masonry[data-size="m"] { --cols: 2; --gcols: 4; --row-h: 210px; }
  .masonry[data-size="l"] { --cols: 2; --gcols: 2; --row-h: 320px; }
}
@media (max-width: 520px) {
  .masonry[data-size="s"] { --cols: 3; --gcols: 4; --row-h: 90px; --gap: 4px; }
  .masonry[data-size="m"] { --cols: 2; --gcols: 3; --row-h: 140px; --gap: 8px; }
  .masonry[data-size="l"] { --cols: 1; --gcols: 2; --row-h: 220px; --gap: 12px; }
}

/* Grid: even squares, cropped to fill */
.masonry[data-layout="grid"] {
  columns: auto;
  display: grid;
  grid-template-columns: repeat(var(--gcols), minmax(0, 1fr));
  gap: var(--gap);
}
.masonry[data-layout="grid"] .tile {
  margin: 0;
}
.masonry[data-layout="grid"] .tile-link {
  aspect-ratio: 1;
}

/* Rows: every row the same height, photos keep their shape (like Flickr) */
.masonry[data-layout="rows"] {
  columns: auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
}
.masonry[data-layout="rows"]::after {
  /* Soaks up the space in the last row so it isn't stretched */
  content: "";
  flex-grow: 999999;
}
.masonry[data-layout="rows"] .tile {
  margin: 0;
  flex-grow: calc(var(--ar));
  flex-basis: calc(var(--ar) * var(--row-h));
  min-width: 0;
}

.tile {
  margin: 0 0 var(--gap);
  break-inside: avoid;
}
.masonry.is-js .tile {
  margin: 0;
}
.tile.is-filtered {
  display: none;
}
.tile-link {
  position: relative;
  display: block;
  aspect-ratio: var(--ar);
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--tile-bg, var(--bg-2));
}
.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lqip {
  filter: blur(14px);
  transform: scale(1.1);
}
.thumb {
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.8s ease, transform 1.2s var(--ease-out);
}
.thumb.is-loaded {
  opacity: 1;
  transform: scale(1);
}
.tile-link:hover .thumb.is-loaded {
  transform: scale(1.05);
}
.tile figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 40px 16px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s, transform 0.5s var(--ease-out);
}
.tile-link:hover figcaption,
.tile-link:focus-visible figcaption {
  opacity: 1;
  transform: none;
}
@media (hover: none) {
  .tile figcaption { display: none; }
}

/* ---------- Albums ---------- */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: clamp(16px, 2vw, 28px);
}
.album-card {
  display: block;
  transform-style: preserve-3d;
}
.album-cover {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--tile-bg, var(--bg-2));
}
.album-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.album-card:hover .thumb.is-loaded {
  transform: scale(1.06);
}
.album-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-top: 14px;
}
.album-meta h3 {
  margin: 0;
  font: 400 clamp(26px, 2.6vw, 34px) / 1.1 var(--font-display);
}
.album-meta .mono {
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- Projects ---------- */
.project-list {
  border-top: 1px solid var(--line);
}
.project-card {
  position: relative;
  display: grid;
  grid-template-columns: 60px 1fr auto 40px;
  gap: 24px;
  align-items: start;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
  transition: padding 0.5s var(--ease-out);
}
.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--surface);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.5s var(--ease-out);
}
.project-card:hover {
  padding-inline: 20px;
}
.project-card:hover::before {
  transform: scaleY(1);
}
.project-index,
.project-year {
  color: var(--muted);
  padding-top: 10px;
}
.project-main h3 {
  margin: 0 0 6px;
  font: 400 clamp(30px, 4vw, 52px) / 1.05 var(--font-display);
}
.project-main p {
  margin: 0;
  color: var(--muted);
  max-width: 620px;
}
.project-card .arrow {
  font-size: 28px;
  padding-top: 4px;
  transition: transform 0.5s var(--ease-out), color 0.3s;
}
.project-card:hover .arrow {
  transform: translateX(6px) rotate(-45deg);
  color: var(--accent);
}
.project-peek {
  position: absolute;
  right: 120px;
  top: 50%;
  width: 240px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%) rotate(-4deg) scale(0.8);
  transition: opacity 0.4s, transform 0.6s var(--ease-spring);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
@media (hover: hover) {
  .project-card:hover .project-peek {
    opacity: 1;
    transform: translateY(-50%) rotate(3deg) scale(1);
  }
}
@media (max-width: 700px) {
  .project-card {
    grid-template-columns: 1fr auto;
    gap: 8px 16px;
  }
  .project-index { display: none; }
  .project-year { grid-row: 1; grid-column: 2; }
  .project-card .arrow { display: none; }
  .project-peek { display: none; }
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0;
}
.project-hero {
  width: 100%;
  border-radius: var(--radius);
  margin: 40px 0;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.about-grid > .prose:only-child {
  grid-column: 1 / -1;
}
.about-photo {
  position: relative;
  aspect-ratio: var(--ar);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--tile-bg, var(--bg-2));
}
.about-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.about-email {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 32px 0 0;
}
.about-email .eyebrow {
  margin: 0;
}
.about-email-address {
  font-size: clamp(18px, 1.8vw, 22px);
  user-select: all;
  word-break: break-word;
}
.about-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
@media (max-width: 800px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* ---------- 404 ---------- */
.notfound {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
.glitch {
  position: relative;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0.8;
}
.glitch::before {
  color: var(--accent);
  animation: glitch 2.4s infinite steps(2);
  clip-path: inset(0 0 60% 0);
}
.glitch::after {
  color: var(--accent-2);
  animation: glitch 2s infinite reverse steps(2);
  clip-path: inset(55% 0 0 0);
}
@keyframes glitch {
  0%, 90%, 100% { transform: none; }
  92% { transform: translate(-6px, 2px); }
  95% { transform: translate(5px, -3px); }
}

/* ---------- Footer ---------- */
.footer {
  margin-top: clamp(80px, 10vw, 140px);
  padding: 0 var(--gutter) max(32px, env(safe-area-inset-bottom));
}
.footer-row {
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
}
.footer-icon {
  display: inline-flex;
  padding: 4px;
  transition: color 0.3s, transform 0.4s var(--ease-spring);
}
.footer-icon:hover {
  transform: translateY(-2px);
}
.footer-icon .icon {
  width: 20px;
  height: 20px;
}
.footer-links a:hover {
  color: var(--accent);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  transition: opacity 0.4s;
  touch-action: none;
}
.lightbox[hidden] {
  display: none;
}
.lightbox.is-open {
  opacity: 1;
}
.lb-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) var(--gutter) 14px;
}
.lb-count {
  color: var(--muted);
}
.lb-actions {
  display: flex;
  gap: 8px;
}
.lb-btn {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-size: 14px;
  transition: border-color 0.3s, background-color 0.3s;
}
.lb-btn:hover {
  border-color: var(--accent);
}
.lb-stage {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.lb-img-wrap {
  position: relative;
  max-width: calc(100vw - 2 * var(--gutter));
  max-height: 100%;
  transition: transform 0.45s var(--ease-out), opacity 0.35s;
}
.lb-img-wrap img {
  max-width: 100%;
  max-height: calc(100svh - 190px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: calc(var(--radius) / 2);
  user-select: none;
  -webkit-user-drag: none;
}
.lb-img-wrap .lb-low {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: blur(8px);
}
.lb-img-wrap .lb-full {
  position: relative;
  opacity: 0;
  transition: opacity 0.5s;
}
.lb-img-wrap .lb-full.is-loaded {
  opacity: 1;
}
.lb-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
.lb-full.is-loaded ~ .lb-spinner {
  display: none;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-size: 20px;
  z-index: 2;
  transition: transform 0.3s var(--ease-spring), border-color 0.3s;
}
.lb-nav:hover {
  border-color: var(--accent);
  transform: translateY(-50%) scale(1.08);
}
.lb-prev { left: var(--gutter); }
.lb-next { right: var(--gutter); }
@media (hover: none) {
  .lb-nav { display: none; }
}
.lb-info {
  padding: 14px var(--gutter) max(18px, env(safe-area-inset-bottom));
  text-align: center;
  min-height: 72px;
}
.lb-title {
  margin: 0;
  font: 400 24px/1.2 var(--font-display);
}
.lb-caption {
  margin: 4px auto 0;
  max-width: 640px;
  font-size: 15px;
  color: color-mix(in srgb, var(--text) 80%, transparent);
}
.lb-exif {
  margin: 6px 0 0;
  color: var(--muted);
}
.lb-album {
  color: var(--accent);
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .grain { animation: none; }
  .reveal, .split .word > span, .char, .hero-in { opacity: 1; transform: none; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* Page transitions between pages */
::view-transition-old(main) {
  animation: vt-out 0.35s var(--ease-out) both;
}
::view-transition-new(main) {
  animation: vt-in 0.6s var(--ease-out) both;
}
@keyframes vt-out {
  to { opacity: 0; transform: translateY(-24px); filter: blur(6px); }
}
@keyframes vt-in {
  from { opacity: 0; transform: translateY(32px); filter: blur(6px); }
}

/* ---------- Page title with an action button ---------- */
.page-title {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.slideshow-btn span {
  font-size: 11px;
}
.lb-btn[hidden] {
  display: none;
}

/* ---------- Single photo page ---------- */
.photo-page {
  padding: clamp(80px, 10vw, 96px) var(--gutter) 0;
}
.photo-stage {
  position: relative;
  display: grid;
  place-items: center;
  height: calc(100svh - 190px);
  min-height: 320px;
  border-radius: var(--radius);
  overflow: hidden;
}
.photo-stage .lqip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  filter: blur(40px);
  transform: scale(1.2);
}
.photo-main {
  position: relative;
  max-width: 100%;
  /* Percent heights don't resolve inside the grid, so size against the viewport */
  max-height: calc(100svh - 190px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: calc(var(--radius) / 2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
.photo-stage .lb-nav {
  display: grid;
  place-items: center;
}
.photo-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 24px 0 0;
}
.photo-meta {
  max-width: 680px;
}
.photo-meta .back-link {
  margin-bottom: 8px;
}
.photo-title {
  margin: 0;
  font: 400 clamp(32px, 4vw, 52px) / 1.05 var(--font-display);
}
.photo-caption {
  margin: 8px 0 0;
  color: color-mix(in srgb, var(--text) 82%, transparent);
}
.photo-exif {
  margin: 8px 0 0;
  color: var(--muted);
}
.photo-meta .chips a:hover {
  color: var(--accent);
}
.photo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.photo-actions .muted {
  color: var(--muted);
  margin-right: 6px;
}
@media (max-width: 700px) {
  .photo-stage {
    height: auto;
    min-height: 0;
  }
  .photo-main {
    max-height: 75svh;
  }
}

/* ---------- Slideshow ---------- */
.slideshow {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: #000;
  color: #fff;
  cursor: default;
  animation: fade-in 0.5s ease;
}
.slideshow.is-idle {
  cursor: none;
}
@keyframes fade-in {
  from { opacity: 0; }
}
.ss-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.ss-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1.4s ease, transform 7s linear;
}
.ss-img.is-on {
  opacity: 1;
  transform: scale(1);
}
.ss-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(70px, calc(env(safe-area-inset-bottom) + 60px));
  text-align: center;
  font: 400 22px var(--font-display);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  transition: opacity 0.6s;
}
.ss-controls {
  position: absolute;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
  transition: opacity 0.6s;
}
.ss-controls .lb-btn {
  background: rgba(20, 20, 20, 0.6);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.ss-progress {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
}
.ss-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}
.slideshow.is-idle .ss-controls,
.slideshow.is-idle .ss-caption {
  opacity: 0;
}

/* ---------- Toast for "Link copied" ---------- */
.site-toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 99;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.35s var(--ease-out);
}
.site-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Download protection ---------- */
.protect-images img {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------- Gallery view switcher ---------- */
.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 28px;
}
.gallery-toolbar .filter-bar {
  flex: 1 1 320px;
  min-width: 0;
  margin-bottom: 0;
}
.view-controls {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.seg {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.seg button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  transition: background-color 0.25s, color 0.25s;
}
.seg button:hover {
  color: var(--text);
}
.seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
}
.size-dot {
  display: block;
  border: 1.6px solid currentColor;
  border-radius: 3px;
}
.size-s { width: 8px; height: 8px; border-radius: 2px; }
.size-m { width: 12px; height: 12px; }
.size-l { width: 16px; height: 16px; }

/* ---------- Albums dropdown in the top bar ---------- */
.nav-drop {
  position: relative;
}
.nav-drop-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 15px;
  color: var(--muted);
  transition: color 0.3s;
}
.nav-drop-btn:hover,
.nav-drop-btn.active,
.nav-drop-btn[aria-expanded="true"] {
  color: var(--text);
}
.nav-drop-btn.active::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--surface);
  view-transition-name: nav-pill;
}
.nav-drop-btn svg {
  transition: transform 0.35s var(--ease-out);
}
.nav-drop-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
.nav-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  min-width: 200px;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  transform: translateX(-50%);
  transform-origin: top center;
  animation: menu-pop 0.3s var(--ease-out);
}
.nav-menu[hidden] {
  display: none;
}
/* Invisible bridge so the menu doesn't close while the mouse crosses the gap */
.nav-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}
.nav-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: calc(var(--radius) - 4px);
  color: var(--text);
  font-size: 15px;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}
.nav-menu a:hover,
.nav-menu a:focus-visible {
  background: var(--bg-2);
  color: var(--accent);
}
.nav-menu a[aria-current="page"] {
  color: var(--accent);
}
@keyframes menu-pop {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px) scale(0.96);
  }
}

/* Albums inside the full screen phone menu */
.mobile-albums {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s, transform 0.6s var(--ease-out);
}
.menu-open .mobile-albums {
  opacity: 1;
  transform: none;
  transition-delay: calc(0.15s + var(--i) * 0.07s);
}
.mobile-albums-label {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font: 400 clamp(44px, 13vw, 72px) / 1.1 var(--font-display);
}
.mobile-albums-label .mono {
  font-size: 13px;
  color: var(--accent);
}
.mobile-nav .mobile-albums-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 6px;
  padding-left: 34px;
}
.mobile-nav .mobile-albums-list a {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 500 15px / 1.3 var(--font-body);
  opacity: 1;
  transform: none;
}
