/* Ryan Winter — site styles. Values from the Figma file:
   30px page margins, 20px gutters, 14px UI text, 20px body text, #A7A7A7 / #868686 greys. */

/* Monument Grotesk is a licensed font (ABC Dinamo). Put your web font files in /static/fonts/
   with these names and they'll be used automatically; until then a close system font is shown. */
@font-face {
  font-family: "Monument Grotesk";
  src: url("/fonts/ABCMonumentGrotesk-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Monument Grotesk";
  src: url("/fonts/ABCMonumentGrotesk-MediumItalic.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

:root {
  --margin: 10px;   /* top, left and right edge of the site */
  --gutter: 10px;  /* space between images and columns, same as the margin */
  --ui: 18px;   /* one size for everything */
  --body: 18px;
  --white: #ffffff;
  --grey: #a7a7a7;
  --grey-dark: #868686;
  --font: "Monument Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: #000;
  color: var(--white);
  font-family: var(--font);
  font-weight: 500;
  font-size: var(--ui);
  line-height: 1.2;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:active { opacity: 0.7; }
img, video { display: block; width: 100%; height: auto; }
figure { margin: 0; }
hr { border: 0; height: 1px; background: rgba(255, 255, 255, 0.3); margin: 0; }

main { padding: 120px var(--margin) var(--margin); }
.is-home main { padding: 0; }

/* ---------- nav ---------- */
.nav {
  position: fixed; /* stays at the top while the page scrolls */
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--gutter);
  padding: var(--margin);
  line-height: 1;
  mix-blend-mode: normal;
}
/* progressive blur behind the nav: strongest at the top, fading to nothing
   below it, so there's no hard edge. Two layers (heavy + light) each fade out
   at a different point. On pseudo-elements so they don't trap the mobile menu. */
.nav::before,
.nav::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: -48px;            /* the fade runs past the bottom of the nav */
  z-index: -1;
  pointer-events: none;     /* never blocks clicks on the page underneath */
}
.nav::before {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0));
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent 75%);
  mask-image: linear-gradient(to bottom, #000 35%, transparent 75%);
}
.nav::after {
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  -webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 50%, transparent 100%);
}
.is-home .nav::before, .is-home .nav::after,   /* home slideshow stays clean */
.nav.is-open::before, .nav.is-open::after { display: none; }
.nav__name { color: inherit; }
.nav__tagline {
  display: inline-block;
  vertical-align: top;
  white-space: pre-line;
  height: calc(var(--lines, 2) * 1em); /* room for the longest message, so nothing jumps */
}
.nav__tagline.is-typing::after {
  /* blinking cursor: an inline border never changes the line height */
  content: "\200B";
  margin-left: 1px;
  border-left: 1px solid currentColor;
  animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { border-color: transparent; } }

.nav__links { display: flex; gap: 24px; justify-content: flex-end; flex-wrap: wrap; }
.nav__links a[aria-current="page"] { color: var(--grey-dark); }

/* hamburger: only shown on mobile */
.nav__toggle {
  display: none;
  position: relative;
  width: 24px; height: 18px;
  padding: 0; border: 0; background: none;
  color: inherit;
  cursor: pointer;
}
.nav__toggle span {
  position: absolute; left: 0; right: 0;
  height: 2px; background: currentColor;
  transition: transform 0.25s ease, top 0.25s ease;
}
.nav__toggle span:first-child { top: 4px; }
.nav__toggle span:last-child { top: 12px; }
.nav.is-open .nav__toggle span:first-child { top: 8px; transform: rotate(45deg); }
.nav.is-open .nav__toggle span:last-child { top: 8px; transform: rotate(-45deg); }

/* ---------- home slideshow ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: #111;
}
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
}
.slide.is-active { opacity: 1; z-index: 1; }
.slide img, .slide video { width: 100%; height: 100%; object-fit: cover; }
.hero__dots {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  gap: 8px;
}
.hero__dots button {
  width: 10px; height: 10px;
  padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background 0.2s ease;
}
.hero__dots button.is-active { background: #fff; }

/* ---------- projects grid ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--gutter);
  row-gap: 40px;
}
.card__media { aspect-ratio: 3 / 2; overflow: hidden; background: #111; }
.card__media img, .card__media video { width: 100%; height: 100%; object-fit: cover; }
.card__caption { margin: 8px 0 0; }
.card__caption span { color: var(--grey-dark); }

/* ---------- text blocks (project + info pages) ---------- */
.text { font-size: var(--body); line-height: 1.05; letter-spacing: -0.01em; color: var(--grey); }
.text .white { color: var(--white); }
.text i { font-style: italic; }

.cols {
  display: grid;
  grid-template-columns: 3fr 3fr 6fr;
  column-gap: var(--gutter);
}

.project .blocks { display: grid; gap: var(--gutter); margin-top: 80px; }
.project .blocks .text { margin: 40px 0; }
.project .blocks hr { margin: 40px 0 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); align-items: start; }

/* ---------- info ---------- */
.info { display: grid; gap: 30px; }
.info__row { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--gutter); }

/* ---------- photo / play: 3-column masonry, photos keep their proportions ---------- */
/* Order runs left to right, then down (see masonry() in build.mjs). */
.masonry { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: var(--gutter); align-items: start; }
.masonry__col { min-width: 0; }
.masonry figure { margin-bottom: var(--gutter); }
.page-intro { margin-bottom: 80px; } /* same gap as a project page header */

/* ---------- footer ---------- */
.footer { padding: 0 var(--margin) 20px; font-size: var(--ui); color: var(--grey-dark); }
.is-home .footer { display: none; }

.notfound { min-height: 50vh; }
.notfound a { color: var(--white); }

/* ---------- cursor label ---------- */
#cursor-label {
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  pointer-events: none;
  color: #fff;
  mix-blend-mode: difference;
  white-space: nowrap;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s ease;
}
#cursor-label.is-on { opacity: 1; }
@media (hover: none) { #cursor-label { display: none; } }

/* ---------- mobile ---------- */
@media (max-width: 767px) {
  main { padding-top: 100px; }
  .nav__toggle { display: block; flex-shrink: 0; }
  /* menu: full-screen black panel under the name and the close button */
  .nav__links {
    display: none;
    position: fixed; inset: 0; z-index: -1;
    flex-direction: column; justify-content: flex-start; gap: 12px;
    padding: 100px var(--margin) var(--margin);
    background: #000;
  }
  .nav.is-open .nav__links { display: flex; }
  .nav.is-open { position: fixed; }
  body.menu-open { overflow: hidden; }
  .grid, .pair, .info__row, .cols { grid-template-columns: 1fr; row-gap: 24px; }
  .cols > div:empty { display: none; }
  .masonry { display: flex; flex-direction: column; }
  .masonry__col { display: contents; }
  .project .blocks { margin-top: 48px; }
  .page-intro { margin-bottom: 48px; }
}

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