@font-face {
  font-family: "PP Neue Montreal Mono";
  src: url("assets/fonts/PPNeueMontrealMono-Book.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --text: #151515;
  --text-active: #F24147;
  --bg-hover: #FEF0F0;
  --bg: #FFFFFF;

  --pad: 12px;
  --gap: 12px;
  --cols: 16;

  --fs-body: 16px;
  --lh-body: 24px;
  --fs-lg: 24px;
  --lh-lg: 32px;
}

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

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PP Neue Montreal Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-variant-numeric: slashed-zero;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-top: 48px;
}

figure { margin: 0; }

.boil-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.boil { animation: boil 0.36s infinite; }

@keyframes boil {
  0%,   32.9% { filter: url(#boil-1); }
  33%,  65.9% { filter: url(#boil-2); }
  66%,  100%  { filter: url(#boil-3); }
}

@media (prefers-reduced-motion: reduce) {
  .boil {
    animation: none;
    filter: none;
  }
  .cell {
    animation: none;
    transform: none;
  }
}

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

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  column-gap: var(--gap);
  padding: var(--pad);
  align-items: center;
  text-transform: uppercase;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.nav__brand {
  grid-column: 1 / span 3;
  justify-self: start;
}

.nav__menu {
  grid-column: 7 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav__link {
  padding: 2px 0;
  text-decoration: underline dotted;
  text-decoration-color: var(--text);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

.nav__link:hover {
  color: var(--text-active);
  text-decoration-color: transparent;
}

.nav__link[aria-current="page"] {
  color: var(--text-active);
  text-decoration: none;
}

.nav__toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  color: inherit;
}

.nav__toggle-label {
  display: none;
  text-transform: uppercase;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-active);
}

.nav__toggle-close {
  display: none;
  text-transform: uppercase;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
}

.nav__toggle-close-x {
  text-decoration: underline dotted;
  text-decoration-color: var(--text);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.nav__menu-label {
  display: none;
  position: fixed;
  top: var(--pad);
  left: var(--pad);
  padding: 8px 0;
  text-transform: uppercase;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  z-index: 30;
}

.page {
  padding: 0 var(--pad);
}

.row {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  column-gap: var(--gap);
  row-gap: var(--gap);
}

.row--top { margin-top: 250px; }
.row--sink { margin-top: 250px; }
.row--arms { margin-top: 8px; }
.row--back { margin-top: 8px; }
.row--diptych2 { margin-top: 250px; }
.row--alley { margin-top: 250px; }
.row--tank { margin-top: 24px; }
.row--hood { margin-top: 250px; }
.row--pair { margin-top: 24px; }
.row--lean { margin-top: 250px; }
.row--field { margin-top: 24px; }
.row--coat { margin-top: 24px; }
.row--sports { margin-top: 140px; }
.row--sit    { margin-top: 250px; }
.row--small  { margin-top: 400px; }
.row--studio { margin-top: 24px; }
.row--jacket { margin-top: 400px; }
.row--pair2  { margin-top: 640px; }
.row--stool  { margin-top: 400px; }
.row--ending { margin-top: 250px; padding-bottom: 128px; }

.cell { display: block; }

.cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #efefef;
  cursor: pointer;
  transition: opacity 240ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

.cell:hover { opacity: 0.7; }

.overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  column-gap: var(--gap);
  align-items: center;
  z-index: 40;
  padding: 0 var(--pad);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 300ms cubic-bezier(0.25, 0.1, 0.25, 1),
              visibility 300ms;
}

.overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.overlay--flip {
  transition: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.overlay--flip .overlay__image {
  transition: none;
  transform: none;
}

.overlay__image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 48px);
  height: auto;
  transform: scale(0.94);
  transition: transform 320ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

.overlay.is-open .overlay__image {
  transform: scale(1);
}

.overlay__image--vertical   { grid-column: 6 / span 6; }
.overlay__image--horizontal { grid-column: 4 / span 10; }

.overlay__close {
  position: fixed;
  top: var(--pad);
  right: var(--pad);
  background: none;
  border: 0;
  padding: 2px 0;
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  z-index: 50;
}

.overlay__caption {
  position: fixed;
  top: var(--pad);
  left: var(--pad);
  margin: 0;
  padding: 2px 0;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  text-transform: uppercase;
  z-index: 50;
}

.overlay__close-x {
  text-decoration: underline dotted;
  text-decoration-color: var(--text);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.cell--1 {
  grid-column: 2 / span 4;
  aspect-ratio: 3 / 2;
}

.diptych {
  grid-column: 11 / span 4;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--gap);
}

.diptych .cell { aspect-ratio: 2 / 3; }

.cell--3 {
  grid-column: 9 / span 2;
  aspect-ratio: 2 / 3;
}

.cell--4 {
  grid-column: 8 / span 2;
  aspect-ratio: 2 / 3;
}

.cell--5 {
  grid-column: 2 / span 4;
  aspect-ratio: 3 / 2;
}

.cell--6 { grid-column: 2 / span 4; }

.cell--7 {
  grid-column: 11 / span 4;
  aspect-ratio: 3 / 2;
}

.cell--8 {
  grid-column: 2 / span 4;
  aspect-ratio: 3 / 2;
}

.cell--9 {
  grid-column: 8 / span 2;
  aspect-ratio: 2 / 3;
}

.cell--10 {
  grid-column: 13 / span 4;
  aspect-ratio: 3 / 2;
}

.cell--11 { grid-column: 7  / span 2; aspect-ratio: 2 / 3; }
.cell--12 { grid-column: 9  / span 2; aspect-ratio: 2 / 3; }
.cell--13 { grid-column: 13 / span 2; aspect-ratio: 2 / 3; }
.cell--14 { grid-column: 14 / span 2; aspect-ratio: 2 / 3; }
.cell--15 { grid-column: 2  / span 2; aspect-ratio: 2 / 3; }
.cell--16 { grid-column: 8  / span 2; aspect-ratio: 2 / 3; }

.cell--17 { grid-column: 13 / span 4; aspect-ratio: 3 / 2; }
.cell--18 { grid-column: 2  / span 4; aspect-ratio: 3 / 2; }
.cell--19 { grid-column: 11 / span 4; }
.cell--20 { grid-column: 4  / span 2; aspect-ratio: 2 / 3; }
.cell--21 { grid-column: 13 / span 4; }
.cell--22 { grid-column: 7  / span 2; aspect-ratio: 2 / 3; }
.cell--23 { grid-column: 4  / span 2; aspect-ratio: 2 / 3; }
.cell--24 { grid-column: 12 / span 2; aspect-ratio: 2 / 3; }
.cell--25 { grid-column: 14 / span 2; aspect-ratio: 2 / 3; }
.cell--26 { grid-column: 2  / span 4; aspect-ratio: 3 / 2; }
.cell--27 { grid-column: 10 / span 2; aspect-ratio: 2 / 3; }

.cell--3, .cell--4, .cell--9,
.cell--11, .cell--12, .cell--13, .cell--14, .cell--15, .cell--16,
.cell--20, .cell--22, .cell--23, .cell--24, .cell--25, .cell--27 {
  animation: parallax-up linear;
  animation-timeline: view();
  animation-range: cover;
}

/* Diptych: opposite "scissor" parallax that stays aligned at rest. The two
   halves sit aligned while the pair enters and is centred, then diverge
   only over the second half of the pass (as it scrolls up and out) — so
   nothing moves until you start scrolling past it. */
.diptych .cell {
  animation: diptych-up linear;
  animation-timeline: view();
  animation-range: cover 50% cover 100%;
}

.diptych .cell:last-child { animation-name: diptych-down; }

@keyframes parallax-up {
  from { transform: translateY(30px); }
  to   { transform: translateY(-30px); }
}

@keyframes diptych-up {
  from { transform: translateY(0); }
  to   { transform: translateY(-30px); }
}

@keyframes diptych-down {
  from { transform: translateY(0); }
  to   { transform: translateY(30px); }
}

@media (max-width: 767px) {
  body { padding-top: 60px; }

  .nav { grid-template-columns: 1fr auto; }

  .nav__brand { grid-column: 1; }

  .nav__toggle {
    display: flex;
    grid-column: 2;
    justify-self: end;
    position: relative;
    z-index: 30;
  }

  .nav__toggle-label { display: inline-block; }

  .nav__toggle[aria-expanded="true"] .nav__toggle-label { display: none; }
  .nav__toggle[aria-expanded="true"] .nav__toggle-close { display: inline-block; }

  /* 84px top padding = the visible "MENU / (X)" bar text (which ends ~44px
     down) + the requested 40px gap to the first menu item. */
  .nav__menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 88px;
    position: fixed;
    inset: 0;
    background: var(--bg);
    padding: 84px var(--pad) var(--pad);
    z-index: 25;
    transform: translateY(-100%);
    transition: transform 240ms ease;
    overflow-y: auto;
  }

  .nav__menu.is-open { transform: translateY(0); }
  .nav__menu.is-open .nav__menu-label { display: inline-block; }

  .nav__link {
    font-size: var(--fs-lg);
    line-height: var(--lh-lg);
    letter-spacing: 0.02em;
  }

  .row--top      { margin-top: 80px; }
  .row--sink     { margin-top: 80px; }
  .row--arms     { margin-top: 12px; }
  .row--back     { margin-top: 12px; }
  .row--diptych2 { margin-top: 80px; }
  .row--alley    { margin-top: 80px; }
  .row--tank     { margin-top: 24px; }
  .row--hood     { margin-top: 80px; }
  .row--pair     { margin-top: 24px; }
  .row--lean     { margin-top: 80px; }
  .row--field    { margin-top: 24px; }
  .row--coat     { margin-top: 24px; }
  .row--sports   { margin-top: 80px; }
  .row--sit      { margin-top: 80px; }
  .row--small    { margin-top: 120px; }
  .row--studio   { margin-top: 24px; }
  .row--jacket   { margin-top: 120px; }
  .row--pair2    { margin-top: 160px; }
  .row--stool    { margin-top: 120px; }
  .row--ending   { margin-top: 80px; }

  .cell--1,
  .cell--3,
  .cell--4,
  .cell--5,
  .cell--7,
  .cell--8,
  .cell--9,
  .cell--10,
  .cell--11,
  .cell--12,
  .cell--13,
  .cell--14,
  .cell--15,
  .cell--16,
  .cell--17,
  .cell--18,
  .cell--20,
  .cell--22,
  .cell--23,
  .cell--24,
  .cell--25,
  .cell--26,
  .cell--27,
  .diptych {
    grid-column: 1 / -1;
  }

  /* Parallax (scroll-linked) only makes sense on the wider desktop layout. */
  .cell,
  .diptych .cell,
  .diptych .cell:last-child {
    animation: none;
    transform: none;
  }

  .overlay__image--vertical,
  .overlay__image--horizontal {
    grid-column: 1 / -1;
  }
}

/* About page
   ------------------------------------------------------------------ */
.page--about {
  margin-top: 40px;
  padding-bottom: 124px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  column-gap: var(--gap);
  align-items: start;
}

.about-portrait {
  grid-column: 3 / span 3;
  grid-row: 1;
  margin: 0;
}

.about-portrait img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #ececec;
}

.about-bio {
  grid-column: 7 / span 9;
  grid-row: 1;
  align-self: end;
  margin: 0;
  font-size: var(--fs-lg);
  line-height: var(--lh-lg);
  letter-spacing: 0.02em;
}

.about-sections {
  grid-column: 7 / span 9;
  grid-row: 2;
}

.about-section {
  margin-top: 80px;
}

.about-section__title {
  margin: 0;
  font-weight: 400;
  font-size: var(--fs-lg);
  line-height: var(--lh-lg);
  letter-spacing: 0.02em;
}

.about-section__rule {
  margin-top: 8px;
  height: 2px;
  background-image: radial-gradient(circle, currentColor 1px, transparent 1.2px);
  background-size: 6px 2px;
  background-repeat: repeat-x;
  background-position: left center;
}

.about-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.about-list--education {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  row-gap: 12px;
}

.about-list__row {
  display: grid;
  grid-template-columns: 96px 1fr;
  column-gap: var(--gap);
}

.text-link {
  text-decoration: underline dotted;
  text-decoration-color: var(--text);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

.text-link:hover {
  color: var(--text-active);
  text-decoration-color: transparent;
}

.about-list--publications {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  row-gap: 12px;
}

.about-list--publications li { display: block; }

.pub {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  column-gap: var(--gap);
  align-items: center;
  padding: 0;
  margin: 0;
  transition: background-color 120ms ease, color 120ms ease;
}

.pub__cta { justify-self: end; }

.pub__cta-label { display: none; }

.pub:hover,
.pub:focus-visible {
  background-color: var(--bg-hover);
  color: var(--text-active);
  outline: none;
}

.pub:hover .pub__cta-label,
.pub:focus-visible .pub__cta-label {
  display: inline;
}

@media (max-width: 767px) {
  .page--about {
    margin-top: 48px;
    padding-bottom: 72px;
  }

  .about-portrait {
    grid-column: 1 / span 11;
    grid-row: auto;
  }

  .about-bio {
    grid-column: 1 / -1;
    grid-row: auto;
    align-self: auto;
    margin-top: 48px;
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    letter-spacing: 0;
  }

  .about-sections {
    grid-column: 1 / -1;
    grid-row: auto;
    margin-top: 72px;
  }

  .about-section { margin-top: 0; }
  .about-section + .about-section { margin-top: 72px; }

  .about-list--education,
  .about-list--publications {
    row-gap: 16px;
  }

  .about-list__row,
  .pub {
    grid-template-columns: 56px 1fr auto;
  }
}

/* Projects page
   ------------------------------------------------------------------ */
.page--projects {
  margin-top: 0;
  padding-bottom: 12px;
  min-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}

.projects-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-template-rows: auto 1fr auto;
  column-gap: var(--gap);
}

.projects-hero {
  grid-column: 7 / -1;
  grid-row: 1;
  margin: 0;
}

.projects-hero img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  background: #ececec;
}

.projects-list-wrap {
  grid-column: 1 / span 6;
  grid-row: 3;
  margin-top: 0;
}

.projects-list__title {
  margin: 0;
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.projects-list {
  margin-top: 20px;
}

.projects-list .pub {
  grid-template-columns: 20px 1fr auto;
}

@media (max-width: 767px) {
  .page--projects {
    padding-bottom: 80px;
    min-height: auto;
    display: block;
  }

  .projects-grid {
    flex: none;
    grid-template-rows: none;
  }

  .projects-hero {
    grid-column: 1 / -1;
    grid-row: auto;
    margin-top: 88px;
  }

  .projects-list-wrap {
    grid-column: 1 / -1;
    grid-row: auto;
    margin-top: 88px;
  }

  .projects-list .pub {
    grid-template-columns: 20px 1fr auto;
  }
}

/* Project detail page
   ------------------------------------------------------------------ */
.project-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--pad);
  background: var(--bg);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  text-transform: uppercase;
}

.project-bar__name {
  padding: 2px 0;
}

.project-bar__close {
  padding: 2px 0;
  flex-shrink: 0;
  margin-left: var(--gap);
}

.project-bar__close-x {
  text-decoration: underline dotted;
  text-decoration-color: var(--text);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.body--project .nav { display: none; }

.page--project {
  padding-bottom: 60px;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  column-gap: var(--gap);
  min-height: calc(100vh - 48px);
  align-content: center;
}

.project-image {
  grid-column: 4 / span 10;
  margin: 0;
}

.project-image img {
  display: block;
  width: 100%;
  height: auto;
  background: #ececec;
}

.project-pagination {
  grid-column: 4 / span 10;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 24px;
}

.project-pagination__btn {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 2px 0;
  font: inherit;
  color: var(--text);
  text-decoration: underline dotted;
  text-decoration-color: var(--text);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.project-pagination__count {
  min-width: 80px;
  text-align: center;
}

.project-info {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  column-gap: var(--gap);
  margin-top: 64px;
}

.project-info__header {
  grid-column: 5 / span 8;
}

.project-info__title {
  margin: 0;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 2px 0;
  font: inherit;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  color: var(--text);
  text-transform: uppercase;
  text-decoration: underline dotted;
  text-decoration-color: var(--text);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

.project-info__title:hover {
  color: var(--text-active);
  text-decoration-color: transparent;
}

.project-info__body {
  grid-column: 5 / span 8;
  margin-top: 16px;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.project-info__body p {
  margin: 0;
}

.project-info__body p + p {
  margin-top: 16px;
}

.project-info.is-collapsed .project-info__body {
  display: none;
}

@media (max-width: 767px) {
  /* Match the Projects page: top-align the gallery 88px below the bar
     instead of vertically centring it. */
  .project-gallery {
    min-height: 0;
    align-content: start;
    margin-top: 88px;
  }

  .project-title,
  .project-image,
  .project-pagination,
  .project-info__header,
  .project-info__body {
    grid-column: 1 / -1;
  }
}

/* Portraits page
   ------------------------------------------------------------------ */
.page--portraits {
  padding-bottom: 60px;
}

.portraits-gallery {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  column-gap: var(--gap);
}

.portraits-column--left  { grid-column: 7 / span 5; }
.portraits-column--right { grid-column: 12 / span 5; }

.portraits-column__track {
  display: flex;
  flex-direction: column;
}

.portrait {
  margin: 0 0 var(--gap) 0;
  aspect-ratio: 4 / 5;
  cursor: pointer;
  transition: opacity 240ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #ececec;
}

.portrait:hover { opacity: 0.7; }

.portraits-caption {
  position: fixed;
  left: var(--pad);
  bottom: var(--pad);
  margin: 0;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  text-transform: uppercase;
}


@media (max-width: 767px) {
  .portraits-column--left,
  .portraits-column--right {
    grid-column: 1 / -1;
  }

  .portraits-caption { display: none; }
}

/* Contact page
   ------------------------------------------------------------------ */
.body--contact {
  padding-top: 0;
  background: var(--text-active);
  color: #fff;
}

.page--contact {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: var(--pad);
  text-transform: uppercase;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.contact-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.contact-close { color: inherit; }

.contact-close-x {
  text-decoration: underline dotted;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.contact-name {
  align-self: center;
  justify-self: start;
  margin: 0;
  font-size: var(--fs-lg);
  line-height: var(--lh-lg);
  letter-spacing: 0.02em;
  font-weight: 400;
}

.contact-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--gap);
  font-size: var(--fs-lg);
  line-height: var(--lh-lg);
  letter-spacing: 0.02em;
}

.contact-bottom__left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-link { color: inherit; }

.contact-link > span {
  text-decoration: underline dotted;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.contact-link--phone { word-spacing: -0.32em; }
.contact-link__kern  { letter-spacing: -0.12em; }

@media (max-width: 767px) {
  .contact-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
  }
}

/* Contact page-enter curtain
   ------------------------------------------------------------------
   A white panel (matching the other pages' background) that wipes
   downward to reveal the red Contact page, so the colour change reads
   as a top-to-bottom transition. It runs before the dot/text reveal. */
.contact-curtain {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: var(--bg);
  pointer-events: none;
}

.contact-curtain--down {
  transform: translateY(100%);
  transition: transform 620ms cubic-bezier(0.76, 0, 0.24, 1);
}

@media (prefers-reduced-motion: reduce) {
  .contact-curtain { display: none; }
}

/* Dot reveal on Contact page load
   ------------------------------------------------------------------ */
.dot-transition {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(var(--dt-cols, 24), 1fr);
  grid-template-rows: repeat(var(--dt-rows, 14), 1fr);
}

.dot-transition__dot {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dot-transition__fill {
  display: block;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--text-active);
  transform: scale(2.4);
  will-change: transform;
}

/* Radial reveal; each dot's start delay (--dt-out) is set per-element in JS. */
.dot-transition--out .dot-transition__fill {
  transform: scale(0);
  transition: transform 480ms cubic-bezier(0.22, 1, 0.36, 1) var(--dt-out, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  .dot-transition { display: none; }
}

/* Custom cursor
   ------------------------------------------------------------------
   Frosted translucent circle that follows the pointer (positioned via
   transform in script.js) and grows over interactive elements.
   Mouse/fine-pointer only. */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(242, 65, 71, 0.16);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: none;
  z-index: 200;
  opacity: 0;
  transition: width 200ms ease, height 200ms ease, opacity 220ms ease;
  will-change: transform;
}

.cursor.is-visible { opacity: 1; }

.cursor--hover {
  width: 32px;
  height: 32px;
}

@media (hover: none), (pointer: coarse) {
  .cursor { display: none; }
}
