/* ============================================================
   Homepage – fluid / responsive rewrite
   No Tailwind needed. Layout uses flow, grid, flex and clamp().
   ============================================================ */

@font-face {
  font-family: "Hydrogenous";
  src: url("Hydrogenous.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Quest";
  src: url("Questrial-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Mont";
  src: url("Montserrat-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #000;
  --paper: #fff;
  --muted: #e9e9e9;
  --mint: #cffafe;
  --max: 1400px;
  --pad: clamp(1.25rem, 5vw, 4rem);
  --gap: clamp(1.5rem, 5vw, 5rem);
  --display: "Hydrogenous", "Mont", system-ui, sans-serif;
  --body: "Mont", "Montserrat", system-ui, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5.5rem;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}
body.menu-open { overflow: hidden; }

img, svg { max-width: 100%; display: block; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }

a:focus-visible, button:focus-visible {
  outline: 3px solid #0ea5e9;
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 3000;
  padding: 0.6rem 1rem;
  background: var(--ink); color: var(--paper);
}
.skip-link:focus { top: 1rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Navigation ---------- */
.site-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 900;
  display: flex; justify-content: center;
  padding: clamp(0.6rem, 2vw, 1.5rem) clamp(0.75rem, 2vw, 2rem);
  pointer-events: none;
}
.site-nav__bar {
  pointer-events: auto;
  width: min(100%, 1800px);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem;
  padding: 0.55rem clamp(1rem, 2.5vw, 2rem);
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  font-family: var(--display);
  transition: background 0.4s ease, color 0.4s ease;
}
.site-nav.scrolled .site-nav__bar { background: var(--ink); color: var(--paper); }

.site-nav__logo {
  font-size: clamp(1.25rem, 2.3vw, 1.9rem);
  text-decoration: none;
  white-space: nowrap;
}
.site-nav__links {
  display: none;
  gap: clamp(0.5rem, 2vw, 2.5rem);
  font-size: clamp(0.95rem, 1.45vw, 1.3rem);
}
.site-nav__links a,
.site-nav__logo {
  text-decoration: none;
  padding: 0.5rem clamp(0.75rem, 1.3vw, 1.4rem);
  border-radius: 999px;
  /* background + shadow transition (not opacity, so it doesn't fight the load animation) */
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.site-nav__logo { margin-left: calc(-1 * clamp(0.75rem, 1.3vw, 1.4rem)); }

/* "Hole" hover: a lighter, recessed pill pressed into the bar */
.site-nav__links a:hover, .site-nav__links a:focus-visible,
.site-nav__logo:hover,    .site-nav__logo:focus-visible {
  background-color: #e4e4e4;
  box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.32), inset 0 -1px 0 rgba(255, 255, 255, 0.8);
  outline: none;
}
/* once the bar turns black, the hole is a lighter gray than the bar */
.site-nav.scrolled .site-nav__links a:hover, .site-nav.scrolled .site-nav__links a:focus-visible,
.site-nav.scrolled .site-nav__logo:hover,    .site-nav.scrolled .site-nav__logo:focus-visible {
  background-color: #3a3a3a;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.85), inset 0 -1px 0 rgba(255, 255, 255, 0.12);
}

.menu-btn {
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem; padding: 0;
  background: transparent; color: inherit;
  border: 2px solid currentColor; border-radius: 0.5rem;
  cursor: pointer;
}
.menu-btn svg { width: 1.4rem; height: 1.4rem; }

@media (min-width: 800px) {
  .site-nav__links { display: flex; }
  .menu-btn { display: none; }
}

/* Load-in animation (only when JS is on; starts once the loader fades) */
html.js .site-nav__bar { opacity: 0; transform: translateY(-1.5rem); clip-path: inset(0 50% 0 50% round 999px); }
html.loaded .site-nav__bar {
  animation: nav-bar-in 0.9s cubic-bezier(0.65, 0, 0.35, 1) 0.15s forwards;
}
html.js .site-nav__logo,
html.js .site-nav__links a,
html.js .menu-btn { opacity: 0; transform: translateY(-0.75rem); }
html.loaded .site-nav__logo,
html.loaded .site-nav__links a,
html.loaded .menu-btn {
  animation: nav-item-in 0.6s ease forwards;
  animation-delay: calc(0.7s + var(--i, 0) * 0.09s);
}
.site-nav__logo { --i: 0; }
.site-nav__links a:nth-child(1) { --i: 1; }
.site-nav__links a:nth-child(2) { --i: 2; }
.site-nav__links a:nth-child(3) { --i: 3; }
.site-nav__links a:nth-child(4) { --i: 4; }
.site-nav__links a:nth-child(5) { --i: 5; }
.menu-btn { --i: 1; }
@keyframes nav-bar-in {
  to { opacity: 1; transform: none; clip-path: inset(0 0 0 0 round 999px); }
}
@keyframes nav-item-in {
  to { opacity: 1; transform: none; }
}

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 1500;
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--pad);
  background: var(--ink); color: var(--mint);
  font-family: var(--body);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-menu.open { opacity: 1; visibility: visible; }
.mobile-menu__close {
  position: absolute; top: 1rem; right: 1rem;
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem;
  background: transparent; color: inherit;
  border: 2px solid currentColor; border-radius: 0.5rem;
  font-size: 1.4rem; cursor: pointer;
}
.mobile-menu li + li { margin-top: clamp(1.25rem, 6vh, 2.5rem); }
.mobile-menu a {
  display: inline-block;
  font-size: clamp(2.2rem, 10vw, 3.75rem);
  font-weight: 300;
  text-decoration: none;
}

/* ============================================================
   Project pages – same look as the homepage
   ============================================================ */

/* nav sits over the black header, so it is always the dark pill */
.site-nav__bar { border: 1px solid rgba(255, 255, 255, 0.18); }

/* ---------- Header ---------- */
.p-hero {
  background: var(--ink); color: #fff;
  padding: clamp(6.5rem, 14vw, 10rem) var(--pad) clamp(4.5rem, 15vw, 14rem);   /* room so the keywords clear the curve */
  border-radius: 0 0 50% 50% / 0 0 clamp(3rem, 20vw, 20rem) clamp(3rem, 20vw, 20rem);   /* taller curve = rounder dome */
}
.p-hero__inner { max-width: var(--max); margin-inline: auto; }

.p-back {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-left: -0.9rem;
  padding: 0.55rem 1.1rem 0.55rem 0.9rem;
  border-radius: 999px;
  color: #fff; text-decoration: none;
  font-family: var(--display);
  font-size: clamp(0.85rem, 1.2vw, 1rem); letter-spacing: 0.08em;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.p-back svg { width: 0.9rem; height: 0.9rem; }
.p-back:hover, .p-back:focus-visible {
  background-color: #3a3a3a;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.85), inset 0 -1px 0 rgba(255, 255, 255, 0.12);
  outline: none;
}

.p-year {
  margin-top: clamp(1.25rem, 3vw, 2rem);
  font-family: var(--display);
  font-size: clamp(0.9rem, 1.4vw, 1.2rem);
  letter-spacing: 0.25em;
  opacity: 0.65;
}
.p-year + .p-title { margin-top: 0.75rem; }
.p-title {
  margin-top: clamp(1.5rem, 5vw, 3.5rem);
  padding-bottom: 0.08em;
  font-weight: 200;
  font-size: clamp(2.4rem, 9vw, 8.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
html.js .p-title { clip-path: inset(0 100% 0 0); }
html.loaded .p-title { animation: reveal 1.2s cubic-bezier(0.65, 0, 0.35, 1) 0.4s forwards; }
@keyframes reveal { to { clip-path: inset(0 0 0 0); } }

.p-keywords {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-top: clamp(1.25rem, 3vw, 2.25rem);
}
.p-keywords li {
  padding: 0.4rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  font-size: clamp(0.78rem, 1.05vw, 0.95rem);
  line-height: 1.2;
}

/* ---------- Gallery ---------- */
.gallery {
  width: min(100% - 2 * var(--pad), var(--max));
  margin: clamp(1.5rem, 4vw, 3rem) auto 0;
}
.gallery__stage {
  position: relative;
  aspect-ratio: 2 / 1;
  background: var(--muted);
  border-radius: clamp(1.25rem, 4vw, 3rem);
  overflow: hidden;
}
@media (max-width: 800px) { .gallery__stage { aspect-ratio: 16 / 10; } }
.gallery__stage img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  padding: clamp(0.5rem, 2vw, 1.5rem);
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.gallery__stage img.is-active,
html:not(.js) .gallery__stage img:first-child { opacity: 1; }

.gallery__btn {
  position: absolute; top: 50%; z-index: 5;
  display: grid; place-items: center;
  width: clamp(2.25rem, 5vw, 3.25rem); height: clamp(2.25rem, 5vw, 3.25rem);
  padding: 0;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.8); color: var(--ink);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.2s, box-shadow 0.2s;
}
.gallery__btn svg { width: 40%; height: 40%; }
.gallery__btn:hover { background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15); }
.gallery__btn--prev { left: clamp(0.5rem, 1.5vw, 1.25rem); }
.gallery__btn--next { right: clamp(0.5rem, 1.5vw, 1.25rem); }

.gallery__dots { display: flex; justify-content: center; gap: 0.25rem; margin-top: 0.75rem; }
.gallery__dots button {
  width: 1.5rem; height: 1.5rem; padding: 0;
  background: none; border: 0; cursor: pointer;
  display: grid; place-items: center;
}
.gallery__dots button::after {
  content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%;
  border: 1px solid var(--ink); transition: background 0.2s, transform 0.2s;
}
.gallery__dots button[aria-current="true"]::after { background: var(--ink); transform: scale(1.15); }

/* ---------- Details + description ---------- */
.p-info {
  width: min(100% - 2 * var(--pad), var(--max));
  margin: clamp(2.5rem, 7vw, 5rem) auto 0;
  display: grid; gap: clamp(2rem, 5vw, 4rem);
}
@media (min-width: 900px) { .p-info { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); } }
.p-block__head {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 200;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--ink);
}
.details > div {
  display: grid; gap: 0.6rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}
@media (min-width: 480px) { .details > div { grid-template-columns: minmax(6.5rem, 30%) 1fr; gap: 1rem; } }
.details dt { padding-top: 0.35rem; font-weight: 400; font-size: clamp(0.85rem, 1.2vw, 1rem); opacity: 0.7; }
.details dd { margin: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pills li {
  padding: 0.4rem 0.95rem;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  line-height: 1.2;
}
.p-desc { margin-top: 1.25rem; }
.p-desc p {
  max-width: 70ch;
  font-weight: 200;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.75;
}
.p-desc p + p { margin-top: 1rem; }

/* ---------- Previous / next ---------- */
.p-pager {
  width: min(100% - 2 * var(--pad), var(--max));
  margin: clamp(3rem, 8vw, 6rem) auto 0;
  display: grid; gap: 1rem;
}
@media (min-width: 700px) { .p-pager { grid-template-columns: 1fr 1fr; } }
.p-pager a {
  display: flex; align-items: center; gap: 1rem;
  padding: clamp(1.1rem, 2.5vw, 1.75rem) clamp(1.25rem, 3vw, 2.25rem);
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: clamp(1.25rem, 3vw, 2rem);
  color: var(--ink); text-decoration: none;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.p-pager a:hover, .p-pager a:focus-visible { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.p-pager svg { flex: none; width: 1.1rem; height: 1.1rem; }
.p-pager__label { display: block; font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.6; }
.p-pager__title { display: block; margin-top: 0.25rem; font-weight: 300; font-size: clamp(1.15rem, 2.2vw, 1.8rem); line-height: 1.1; }
.p-pager__next { justify-content: flex-end; text-align: right; }
@media (min-width: 700px) { .p-pager__next { grid-column: 2; } }

/* ---------- Footer ---------- */
.p-footer {
  margin-top: clamp(3rem, 8vw, 6rem);
  padding: clamp(2rem, 5vw, 3.5rem) var(--pad);
  border-top: 1px solid rgba(0, 0, 0, 0.2);
  text-align: center;
  font-family: var(--display);
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  letter-spacing: 0.12em;
  overflow-wrap: anywhere;
}
.p-footer a { text-decoration: none; }
.p-footer a:hover { text-decoration: underline; text-underline-offset: 0.3em; }

/* ---------- Scroll reveal ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(2.5rem);
  transition: opacity 0.9s ease, transform 0.9s ease, filter 0.35s ease;
}
html.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
  html.js .reveal { opacity: 1; transform: none; }
}
