@font-face {
  font-family: "Gambarino";
  src: url("fonts/Gambarino-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #f3efe7;
  --slot: #eae4d8;
  --line: #e3ddd0;
  --ink: #14120d;
  --muted: #8b8478;
  --nav: #6c6559;
  --black: #0b0a08;
  --dot: 12px;
  --edge: 56px;
  --rail: 280px;
  --gutter: 56px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Gambarino", Georgia, serif;
  font-weight: 400;
  overflow-x: hidden;
}

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

/* ---------- nav ---------- */

.nav {
  display: flex;
  justify-content: flex-end;
  gap: 30px;
  padding: 30px var(--edge) 0;
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--nav);
}

.nav a:hover,
.nav a.is-active {
  color: var(--ink);
}

/* Only the About page carries a back link; it pushes the others to the right. */
.nav .brand {
  margin-right: auto;
  color: var(--ink);
}

/* ---------- viewport ---------- */

/* The first screen is exactly one viewport: nav, then the wordmark low on the
   page. The works section starts below the fold. */
.viewport {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* ---------- wordmark ---------- */

/* Sits clear of the bottom edge. JS trims the empty descender space under the
   caps first, so this padding is the real gap you see. */
.wordmark-block {
  flex-shrink: 0;
  margin-top: auto;
  padding: 40px var(--edge) 76px;
  overflow: hidden;
}

.wordmark b {
  font-weight: inherit;
}

.wordmark {
  margin: 0;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.02;
  white-space: nowrap;
  /* JS fits this to the container; this is the pre-fit estimate. */
  font-size: calc((100vw - (var(--edge) * 2)) / 9.48);
}

/* Second wordmark: its baseline rests on the very bottom edge of the page.
   JS trims the line box's descender space so nothing sits under the caps. */
.footer-wordmark {
  padding: 150px var(--edge) 0;
  /* contains the negative margin below, so it can't collapse past the body */
  overflow: hidden;
}

.footer-wordmark .wordmark {
  margin: 0;
  line-height: 0.92;
}

/* ---------- works ---------- */

.works {
  display: flex;
  align-items: flex-start;
  gap: var(--gutter);
  padding: 112px var(--edge) 0;
}

/* Not sticky: with twenty-odd places the list is taller than a short window
   would allow, and pinning it would cut the bottom off. */
.rail {
  width: var(--rail);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.rail .rail-label {
  font-size: 16px;
  line-height: 29px;
  color: var(--muted);
  margin-bottom: 29px;
}

.rail button {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  font: inherit;
  font-size: 16px;
  line-height: 29px;
  letter-spacing: 0.01em;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s;
}

.rail button:hover {
  color: var(--ink);
}

.rail button[aria-selected="true"] {
  color: var(--ink);
}

/* Every cell is the same shape, so each row lines up exactly. Photos are
   cover-cropped from their centre rather than letterboxed. */
.grid {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
}

.grid figure {
  margin: 0;
  aspect-ratio: 3 / 2;
  background: var(--slot);
  overflow: hidden;
}

.grid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  cursor: zoom-in;
  transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) {
  .grid figure:hover img.is-loaded {
    transform: scale(1.012);
  }
}

.grid img.is-loaded {
  opacity: 1;
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 88px var(--edge);
  background: rgba(243, 239, 231, 0.93);
  -webkit-backdrop-filter: blur(20px) saturate(1.08);
  backdrop-filter: blur(20px) saturate(1.08);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.4s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.lightbox.is-open img {
  opacity: 1;
  transform: none;
}

.lightbox-close {
  position: absolute;
  top: 28px;
  right: var(--edge);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--nav);
  cursor: pointer;
  transition: color 0.2s, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  color: var(--ink);
  transform: rotate(90deg);
}

.lightbox-close svg {
  display: block;
}

/* ---------- curtain ---------- */

/* The period after the wordmark grows into a full black screen, holds, then
   slides up as the works section arrives. Enabled by JS only, so without it
   the page stays an ordinary scroll. */
.curtain,
.curtain-scroll {
  display: none;
}

.has-curtain .curtain-scroll {
  display: block;
  height: 100vh;
  height: 100svh;
}

/* The period is drawn as a true circle, not the glyph: it has to grow into the
   page transition, and both wordmarks must match exactly. Sized and seated in
   em by layout alone, so it lands identically on every load. */
.wm-dot {
  display: inline-block;
  position: relative;
  /* the advance the glyph would have taken, so the fit is unchanged */
  width: 0.218em;
  /* zero height means the box bottom sits on the text baseline */
  height: 0;
  margin-left: -0.045em;
  vertical-align: baseline;
}

.wm-circle {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 0.107em;
  height: 0.107em;
  border-radius: 50%;
  background: var(--black);
}

/* On the landing page the curtain draws this dot instead, so the real one is
   hidden to avoid two circles stacked on the same spot. */
.has-curtain .viewport .wm-circle {
  visibility: hidden;
}

.has-curtain .curtain {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 90;
  overflow: hidden;
  pointer-events: none;
  will-change: transform;
}

/* A full-screen black panel revealed through a circular clip, rather than a
   scaled-up dot - the edge stays crisp at every radius. */
.curtain-dot {
  position: absolute;
  inset: 0;
  background: var(--black);
  will-change: clip-path;
}

/* ---------- cursor ---------- */

/* A dot the size of the wordmark's period, easing toward the pointer rather
   than snapping to it. It never changes size - growing it over a link would
   cover the word - it fades back instead, so the label reads through it.
   Pointer devices only. */
@media (hover: hover) and (pointer: fine) {
  /* Only hide the system cursor once JS has actually put ours on screen, and
     name the elements that set their own cursor so those don't win instead. */
  .has-cursor body,
  .has-cursor a,
  .has-cursor button,
  .has-cursor .rail button,
  .has-cursor .lightbox-close,
  .has-cursor .grid img {
    cursor: none;
  }

  .cursor {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 200;
    pointer-events: none;
    will-change: transform;
  }

  .cursor i {
    position: absolute;
    left: calc(var(--dot) / -2);
    top: calc(var(--dot) / -2);
    width: var(--dot);
    height: var(--dot);
    background: var(--black);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.4);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.35s ease, background-color 0.45s ease, border-color 0.45s ease;
  }

  .cursor.is-awake i {
    opacity: 1;
    transform: scale(1);
  }

  /* links, tabs, the close button: recede so the text stays legible */
  .cursor.is-hover i {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor {
    display: none;
  }
  body,
  a,
  button {
    cursor: auto;
  }
}

/* ---------- footer ---------- */

.site-footer {
  display: flex;
  align-items: flex-start;
  padding: 180px var(--edge) 0;
  font-size: 16px;
  line-height: 29px;
  letter-spacing: 0.02em;
}

.site-footer .col-home {
  width: 335px;
  flex-shrink: 0;
}

.site-footer .col-links {
  display: flex;
  flex-direction: column;
  width: 341px;
  flex-shrink: 0;
  color: var(--muted);
}

.site-footer .col-social {
  flex: 1;
  color: var(--muted);
}

.site-footer .col-links a:hover,
.site-footer .col-social a:hover {
  color: var(--ink);
}

.site-footer .copyright {
  font-size: 15px;
  letter-spacing: 0.02em;
  color: #3a352b;
}

/* ---------- about ---------- */

.about {
  display: flex;
  align-items: flex-start;
  gap: var(--gutter);
  padding: 76px var(--edge) 0;
}

.about .label {
  width: var(--rail);
  flex-shrink: 0;
  font-size: 16px;
  line-height: 29px;
  color: var(--muted);
}

.about .bio {
  width: 800px;
  max-width: 100%;
}

.about .bio p {
  margin: 0 0 30px;
  font-size: 28px;
  line-height: 40px;
}

/* Her own photographs of herself, oldest to newest, on one line. Equal
   heights and centre crops so the row reads as a single band. */
.about .portraits {
  display: flex;
  gap: 16px;
  margin-top: 22px;
  width: 100%;
}

.about .portraits figure {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  aspect-ratio: 4 / 5;
  background: var(--slot);
  overflow: hidden;
}

.about .portraits img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  :root {
    --edge: 32px;
    --rail: 180px;
    --gutter: 32px;
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .site-footer .col-home,
  .site-footer .col-links {
    width: 220px;
  }
}

@media (max-width: 700px) {
  :root {
    --edge: 24px;
  }

  .works,
  .about {
    flex-direction: column;
    gap: 36px;
    padding-top: 72px;
  }

  /* Stays a column rather than wrapping into rows. */
  .rail {
    width: 100%;
  }

  .rail button {
    line-height: 34px;
  }

  .about .label {
    width: auto;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .wordmark-block {
    padding-bottom: 48px;
  }

  /* Stacked, so each line can fill the width and the name reads large. */
  .wordmark > span {
    white-space: normal;
  }

  /* fit-content, not a full-width block: the fit measures the text, not the
     container it would otherwise stretch to. */
  .wordmark .wm-word {
    display: block;
    width: fit-content;
    /* keeps the period on the same line as the name it belongs to */
    white-space: nowrap;
  }

  .wordmark {
    line-height: 0.92;
  }

  .site-footer {
    flex-wrap: wrap;
    gap: 20px;
    padding-top: 90px;
  }

  .site-footer .col-home,
  .site-footer .col-links,
  .site-footer .col-social {
    width: 100%;
    flex: none;
  }

  .footer-wordmark {
    padding-top: 80px;
  }

  .about .bio p {
    font-size: 22px;
    line-height: 32px;
  }

  /* Keep the single row on a phone, just tighter. */
  .about .portraits {
    gap: 8px;
  }

  .lightbox {
    padding: 64px 20px;
  }

  .lightbox-close {
    top: 20px;
    right: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
