@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@view-transition { navigation: auto; }

@property --paper { syntax: "<color>"; inherits: true; initial-value: #F1F1EF; }
@property --ink { syntax: "<color>"; inherits: true; initial-value: #0D0D0E; }

:root {
  --paper: #F1F1EF;
  --ink: #0D0D0E;
  --muted: color-mix(in srgb, var(--ink) 55%, var(--paper));
  --gutter: clamp(16px, 2.2vw, 28px);
  --text: clamp(15px, 0.55vw + 11px, 20px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --track: -0.03em; /* tightens every Geist letter-spacing by 3% */

  /* Progressive-blur vignette: where the clear oval starts to soften (% of the oval's radius) */
  --vignette: 90%;

  color-scheme: light;
  transition: --paper 0.7s var(--ease-in-out), --ink 0.7s var(--ease-in-out);
}

:root[data-theme="dark"] {
  --paper: #0D0D0E;
  --ink: #F1F1EF;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--text);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: calc(-0.011em + var(--track));
  font-feature-settings: "ss03"; /* straight lowercase l */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

::selection { background: var(--ink); color: var(--paper); }

:focus-visible {
  outline: 1.5px solid var(--ink);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ———————————————————————— Header ———————————————————————— */

.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--gutter) + env(safe-area-inset-top, 0px)) calc(var(--gutter) + env(safe-area-inset-right, 0px)) 0 calc(var(--gutter) + env(safe-area-inset-left, 0px));
  view-transition-name: header;
  pointer-events: none;
}

.header > * { pointer-events: auto; }

.header { transition: opacity 0.6s var(--ease-in-out); }
.is-lightbox .header { opacity: 0; }
.is-lightbox .header > * { pointer-events: none; }

.nav { display: flex; gap: 1.1em; }

.nav a,
.text-link {
  position: relative;
  text-decoration: none;
  padding-block: 2px;
}

.nav a::after,
.text-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease-out);
}

.nav a:hover::after,
.nav a[aria-current="page"]::after,
.text-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.theme-toggle {
  position: relative;
  width: 0.95em;
  height: 0.95em;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
  transition: transform 0.4s var(--ease-out);
}

.theme-toggle:hover { transform: scale(1.18); }

/* Invisible ~44px hit area around the small dot */
.theme-toggle::before {
  content: "";
  position: absolute;
  inset: calc(50% - 22px);
  border-radius: 50%;
}

/* ———————————————————————— Home ———————————————————————— */

.home {
  height: 100dvh;
  overflow: clip;
  overscroll-behavior: none;
}

.logo {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 2; /* sits between [data-layer="back"] (1) and [data-layer="front"] (3) */
  width: clamp(224px, 40vw, 880px);
  margin: 0;
  translate: -50% -50%;
  pointer-events: none;
  line-height: 0;
  transition: opacity 0.6s var(--ease-in-out);
}

.is-lightbox .logo { opacity: 0; }

.logo__mask {
  display: block;
  overflow: hidden;
}

@media (orientation: portrait) {
  .logo { width: min(69vw, 512px); }
}

.logo svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.gallery {
  /* Must not form a stacking context (so no fixed, transform, opacity or z-index),
     so each shot's z-index competes with the logo directly */
  position: absolute;
  inset: 0;
  overflow: hidden; /* keeps off-screen shots from widening the mobile layout viewport */
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}

.gallery[data-dragging] { cursor: grabbing; }
.gallery[data-dragging] .shot { pointer-events: none; }

.shot {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

.shot[data-layer="back"] { z-index: 1; }
.shot[data-layer="front"] { z-index: 3; }

.shot picture,
.shot img {
  display: block;
  width: 100%;
  height: 100%;
}

.shot img {
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.1s var(--ease-out), translate 0.5s var(--ease-out);
}

.is-ready .shot img.is-loaded { opacity: 1; }

@media (hover: hover) {
  body:not(.is-lightbox) .shot:hover img { translate: 0 -6px; }
}

.is-lightbox .shot { cursor: pointer; }
.is-lightbox .shot[data-active] { cursor: inherit; }
.is-lightbox .gallery[data-exit] { cursor: zoom-out; }

.shot:focus-visible { outline-offset: 6px; }

/* ———————————————————————— Edges ———————————————————————— */
/* Stacked backdrop blurs, each masked to a band of a viewport-shaped oval, so blur
   ramps up toward the edges and is strongest in the corners. */

.edges {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.edges span {
  position: absolute;
  inset: 0;
  --oval: ellipse closest-side at 50% 50%;
}

.edges span:nth-child(1) {
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
  -webkit-mask-image: radial-gradient(var(--oval), transparent var(--vignette), #000 calc(var(--vignette) + 6%), #000 calc(var(--vignette) + 12%), transparent calc(var(--vignette) + 18%));
  mask-image: radial-gradient(var(--oval), transparent var(--vignette), #000 calc(var(--vignette) + 6%), #000 calc(var(--vignette) + 12%), transparent calc(var(--vignette) + 18%));
}

.edges span:nth-child(2) {
  -webkit-backdrop-filter: blur(3.5px);
  backdrop-filter: blur(3.5px);
  -webkit-mask-image: radial-gradient(var(--oval), transparent calc(var(--vignette) + 6%), #000 calc(var(--vignette) + 12%), #000 calc(var(--vignette) + 18%), transparent calc(var(--vignette) + 24%));
  mask-image: radial-gradient(var(--oval), transparent calc(var(--vignette) + 6%), #000 calc(var(--vignette) + 12%), #000 calc(var(--vignette) + 18%), transparent calc(var(--vignette) + 24%));
}

.edges span:nth-child(3) {
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  -webkit-mask-image: radial-gradient(var(--oval), transparent calc(var(--vignette) + 12%), #000 calc(var(--vignette) + 20%));
  mask-image: radial-gradient(var(--oval), transparent calc(var(--vignette) + 12%), #000 calc(var(--vignette) + 20%));
}

/* ———————————————————————— Lightbox mode ———————————————————————— */
/* The shots themselves rearrange into an ordered strip (see gallery.js). */

.return {
  position: fixed;
  left: 50%;
  bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  translate: -50% 0;
  padding: 6px 10px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-in-out);
}

.is-lightbox .return {
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0.45s;
}

.return::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 4px;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform 0.45s var(--ease-out);
}

.return:hover::after { transform: scaleX(1); }

/* ———————————————————————— Content pages ———————————————————————— */

.page {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: calc(var(--gutter) * 4) var(--gutter) calc(var(--gutter) * 3);
}

.about {
  width: min(100%, 980px);
}

.about__bio {
  margin: 0 0 2.4em;
  max-width: 34ch;
  font-size: clamp(22px, 2.2vw + 8px, 40px);
  line-height: 1.12;
  letter-spacing: calc(-0.03em + var(--track));
  font-weight: 400;
  text-wrap: balance;
}

.about__bio a {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.14em;
  transition: text-decoration-color 0.3s;
}

.about__bio a:hover { text-decoration-color: transparent; }

.credits { margin: 0; }

.credits div {
  display: grid;
  grid-template-columns: minmax(10em, 1fr) 2fr;
  gap: 1em;
  padding: 0.85em 0;
  border-top: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
}

.credits dt { color: var(--muted); }
.credits dd { margin: 0; }

@media (max-width: 640px) {
  .credits div { grid-template-columns: 1fr; gap: 0.2em; }
}

.print {
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 360px);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
}

.print__image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

.print__copy p {
  margin: 0 0 1.4em;
  font-size: clamp(20px, 1.2vw + 10px, 28px);
  line-height: 1.18;
  letter-spacing: calc(-0.025em + var(--track));
  text-wrap: balance;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.6em 1.25em;
  border: 1px solid currentColor;
  border-radius: 999px;
  text-decoration: none;
  transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out);
}

.button:hover { background: var(--ink); color: var(--paper); }
.button:active { opacity: 0.7; }

@media (max-width: 760px) {
  .print { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .print__image { max-width: 340px; }
}

/* ———————————————————————— Motion ———————————————————————— */

.reveal {
  animation: rise 0.9s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 90ms + 120ms);
}

.home .nav a,
.home .theme-toggle {
  animation: fade-in 0.7s var(--ease-out) both;
  animation-delay: calc(1500ms + var(--i, 0) * 140ms);
}

/* Window slides down while the wordmark counter-slides, so it stays put and is revealed top-down */
.home .logo__mask { animation: logo-window 1.2s var(--ease-in-out) 0.1s both, settle 1.8s var(--ease-in-out) 0.8s both; }
.home .logo svg { animation: logo-ink 1.2s var(--ease-in-out) 0.1s both; }

@keyframes logo-window { from { translate: 0 -100%; } to { translate: 0 0; } }
@keyframes logo-ink { from { translate: 0 100%; opacity: 0; } to { translate: 0 0; opacity: 1; } }
@keyframes settle { from { scale: 1; } to { scale: 1.02; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes rise { from { opacity: 0; translate: 0 10px; } }

/* Cross-page transition */
::view-transition-old(root) { animation: 0.35s var(--ease-in-out) both fade-out; }
::view-transition-new(root) { animation: 0.5s var(--ease-out) both rise; }

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