@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  /* Her hours: a late-evening blue, her white fur, straw, and a pink nose. */
  --night: #161b2b;
  --dusk: #222941;
  --fur: #f2eee6;
  --mist: #9aa3ba;
  --straw: #e6c784;
  --nose: #e79aa5;

  --serif: "Fraunces", Georgia, serif;
  --sans: "Figtree", ui-rounded, system-ui, sans-serif;

  --gutter: clamp(1rem, 4vw, 3rem);
  --row: 240px;
  --gap: 6px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--night);
  color: var(--fur);
  font: 400 1.0625rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; height: auto; }

h1, h2 {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 100;
  margin: 0;
}
h2 { font-size: 1.75rem; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0; }

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

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 30rem);
  column-gap: var(--gutter);
  align-items: end;
  max-width: 82rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 4rem) var(--gutter) 0;
}
.hero-photo {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 1.25rem;
  background: var(--dusk);
}
.hero h1 {
  grid-column: 1 / -1;
  grid-row: 1;
  z-index: 1;
  font-size: clamp(5.5rem, 21vw, 17rem);
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: -0.035em;
  margin: 0 0 0.12em -0.04em;
  text-shadow: 0 0.02em 0.25em rgb(22 27 43 / 0.45);
  pointer-events: none;
}
.hero-text {
  grid-column: 1;
  grid-row: 2;
  max-width: 30rem;
  padding-top: 1.75rem;
  color: var(--mist);
}
.hero-text .years {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--straw);
  margin-bottom: 0.5rem;
}

/* The one orchestrated moment: the photo settles, then the name swells in
   letter by letter, from thin to dumpling-round, and the text follows. */
.letters span { display: inline-block; }

@media (prefers-reduced-motion: no-preference) {
  .hero-photo { animation: settle 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .letters span {
    transform-origin: 50% 85%;
    animation: plump 1.1s cubic-bezier(0.2, 1.35, 0.4, 1) both;
    animation-delay: calc(0.35s + var(--i) * 90ms);
  }
  .hero-text > * { animation: rise 0.9s ease-out both; }
  .hero-text > :nth-child(1) { animation-delay: 1.25s; }
  .hero-text > :nth-child(2) { animation-delay: 1.45s; }
}
@keyframes settle {
  from { opacity: 0; transform: scale(1.06); clip-path: inset(7% round 1.25rem); }
  to { opacity: 1; transform: none; clip-path: inset(0 round 1.25rem); }
}
@keyframes plump {
  from { opacity: 0; font-weight: 300; transform: translateY(0.2em) scale(0.9); }
  45% { opacity: 1; }
  to { opacity: 1; font-weight: 900; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(0.6rem); }
  to { opacity: 1; transform: none; }
}

/* ---------- Night dial ---------- */

main { max-width: 82rem; margin: 0 auto; padding: 0 var(--gutter); }

.night {
  display: grid;
  grid-template-columns: minmax(0, 26rem) minmax(0, 28rem);
  gap: var(--gutter);
  align-items: center;
  justify-content: center;
  padding: clamp(4rem, 10vw, 8rem) 0;
}
.night-text p { color: var(--mist); margin-top: 0.75rem; }

.wheel { width: 100%; height: auto; overflow: visible; }
.wheel .rim { fill: none; stroke: var(--dusk); stroke-width: 2; }
.wheel .spokes line {
  stroke: var(--straw);
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0.5;
}
.wheel .hours text {
  fill: var(--mist);
  font: 500 13px var(--sans);
  text-anchor: middle;
  dominant-baseline: central;
}
.wheel .hub { fill: var(--dusk); }

/* ---------- Film ---------- */

.film { padding-bottom: clamp(4rem, 10vw, 8rem); }
.film-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1.25rem; margin-bottom: 1rem; }
.film-text p { color: var(--mist); }
.film video { width: 100%; border-radius: 1rem; background: #000; aspect-ratio: 16 / 9; }

/* ---------- Months ---------- */

.jump {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1) 1.75rem;
  padding: 0.6rem var(--gutter);
  background: rgb(22 27 43 / 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
  font-size: 0.9375rem;
}
.jump::-webkit-scrollbar { display: none; }
.jump span {
  font-family: var(--serif);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding-right: 0.4rem;
}
.jump span:not(:first-child) { margin-left: 1.25rem; }
.jump a {
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  color: var(--mist);
  text-decoration: none;
}
.jump a:hover { color: var(--fur); }
.jump a[aria-current] { background: var(--dusk); color: var(--straw); }

.month {
  scroll-margin-top: 3.75rem;
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 0 1.5rem;
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
.month h2 {
  position: sticky;
  top: 4.25rem;
  align-self: start;
}
.month h2 span {
  display: block;
  font: 500 1rem var(--sans);
  letter-spacing: 0;
  color: var(--mist);
  margin-top: 0.25rem;
  font-variant-numeric: tabular-nums;
}

/* Justified rows: every tile keeps its own proportions and the row height. */
.shots { display: flex; flex-wrap: wrap; gap: var(--gap); }
.shots::after { content: ""; flex-grow: 1000000; }
.shot {
  position: relative;
  flex: calc(var(--r) * 100) 1 calc(var(--r) * var(--row));
  max-width: calc(var(--r) * var(--row) * 1.6);
  aspect-ratio: var(--r);
  overflow: hidden;
  border-radius: 0.5rem;
  background: var(--dusk);
  color: var(--mist);
  font-size: 0.75rem;
}
.shot img, .shot video { width: 100%; height: 100%; object-fit: cover; }
.shot:hover img { filter: brightness(1.08); }
.len {
  position: absolute;
  left: 0.4rem;
  bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.5rem 0.1rem 0.45rem;
  border-radius: 99px;
  background: rgb(22 27 43 / 0.78);
  color: var(--fur);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.len::before {
  content: "";
  border-style: solid;
  border-width: 0.25rem 0 0.25rem 0.4rem;
  border-color: transparent transparent transparent var(--nose);
}

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

footer {
  padding: clamp(3rem, 8vw, 6rem) var(--gutter) clamp(4rem, 10vw, 7rem);
  text-align: center;
}
footer p {
  font: italic 400 clamp(1.75rem, 5vw, 2.75rem) / 1.1 var(--serif);
  font-variation-settings: "SOFT" 100;
  color: var(--nose);
}

/* ---------- Viewer ---------- */

#viewer {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(13 16 27 / 0.97);
  color: var(--fur);
}
#viewer:focus { outline: none; }
#viewer[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
#viewer::backdrop { background: #0d101b; }
.stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 3.5rem 0.75rem 0;
}
.stage img, .stage video {
  width: auto;
  height: auto;
  max-width: 100%;
  /* Viewport minus the top bar and the caption line. */
  max-height: calc(100dvh - 7.5rem);
  object-fit: contain;
  border-radius: 0.5rem;
  background-size: cover;
}
.viewer-caption {
  min-height: 3.5rem;
  padding: 0.9rem 4rem 1.1rem;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--mist);
}
.viewer-caption em {
  font: italic 400 1.125rem var(--serif);
  color: var(--fur);
  margin-left: 0.6rem;
}
#viewer button {
  position: absolute;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(34 41 65 / 0.8);
  color: var(--fur);
  cursor: pointer;
}
#viewer button:hover { background: var(--dusk); color: var(--straw); }
#viewer button[disabled] { opacity: 0.25; cursor: default; }
#viewer svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.viewer-close { top: 0.5rem; right: 0.75rem; }
.viewer-prev, .viewer-next { top: 50%; translate: 0 -50%; }
.viewer-prev { left: 0.75rem; }
.viewer-next { right: 0.75rem; }

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  :root { --row: 150px; --gap: 4px; }

  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-photo { grid-column: 1; aspect-ratio: 4 / 5; }
  .hero h1 { margin-bottom: -0.16em; }
  .hero-text { padding-top: 2.5rem; }

  .night { grid-template-columns: minmax(0, 1fr); }
  .wheel { max-width: 22rem; margin: 0 auto; }

  .month { grid-template-columns: minmax(0, 1fr); }
  .month h2 {
    position: static;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
  }
  .month h2 span { margin: 0; }

  .viewer-prev, .viewer-next { top: auto; bottom: 0.35rem; translate: none; }
  .stage { padding: 3.5rem 0 0; }
  .stage img, .stage video { border-radius: 0; }
}
