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

:root {
  --paper: #F4F3EF;
  --paper-hi: #FBFAF8;
  --card: #FFFFFF;
  --ink: #080C10;
  --ink-2: #6E7176;
  --ink-3: #B4B5B7;
  --cobalt: #0B65F9;
  --col: 452px;
  --gutter: 16px;
  --radius: 20px;
  --sans: "Onest", ui-sans-serif, system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;
}

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

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

/* no rubber-band bounce: the pages are built to sit still */
html, body { overscroll-behavior: none; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 14px/20px var(--sans);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

/* page transitions between home and project (cross-document View Transitions;
   browsers without support simply navigate). Each page names its own parts, so
   the direction follows from which names leave and which arrive. The footer stays
   in the root snapshot: it is identical on both pages, so it never moves. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

.hero { view-transition-name: home-hero; }
.col { view-transition-name: home-body; }
.gallery { view-transition-name: work; }

::view-transition-old(root),
::view-transition-new(root) { animation-duration: 260ms; }

/* home → project: home lifts and slides left, the gallery glides in from the right */
::view-transition-old(home-hero):only-child { animation: vt-up-out 420ms cubic-bezier(.4, 0, .2, 1) both; }
::view-transition-old(home-body):only-child { animation: vt-left-out 420ms cubic-bezier(.4, 0, .2, 1) both; }
::view-transition-new(work):only-child { animation: vt-from-right 720ms cubic-bezier(.16, 1, .3, 1) 120ms both; }

/* project → home: the gallery slides back out right, home settles in from the left */
::view-transition-old(work):only-child { animation: vt-right-out 420ms cubic-bezier(.4, 0, .2, 1) both; }
::view-transition-new(home-hero):only-child { animation: vt-from-above 720ms cubic-bezier(.16, 1, .3, 1) 80ms both; }
::view-transition-new(home-body):only-child { animation: vt-from-left 720ms cubic-bezier(.16, 1, .3, 1) 160ms both; }

@keyframes vt-up-out    { to   { opacity: 0; transform: translateY(-40px); filter: blur(6px); } }
@keyframes vt-left-out  { to   { opacity: 0; transform: translateX(-80px); filter: blur(6px); } }
@keyframes vt-right-out { to   { opacity: 0; transform: translateX(140px); filter: blur(6px); } }
@keyframes vt-from-right { from { opacity: 0; transform: translateX(160px); filter: blur(8px); } }
@keyframes vt-from-above { from { opacity: 0; transform: translateY(-40px); filter: blur(8px); } }
@keyframes vt-from-left  { from { opacity: 0; transform: translateX(-80px); filter: blur(8px); } }

/* the cursor layer stays live and above everything during a page transition */
.cursor-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  view-transition-name: cursor;
}
::view-transition-group(cursor) { animation: none; z-index: 100; }
::view-transition-new(cursor) { animation: none; }
::view-transition-old(cursor) { display: none; }

/* a page being left hides its cursor before the snapshot (see cursor.js) */
.cursor-off .cursor-line,
.cursor-off .cursor-ring,
.cursor-off .cursor-label,
.cursor-off .cursor-coords { visibility: hidden !important; }

/* arriving through a page transition: the logo's own entrance would double up */
.vt .logo { animation: none; }

/* hero */
.hero {
  position: relative;
  background: var(--paper);
}

.hero__title {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.logo {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  animation: rise 900ms cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
}

.hero__fade {
  position: absolute;
  inset: auto 0 0 0;
  height: 96px;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--paper));
}

.hero__reset {
  position: absolute;
  bottom: 8px;
  left: 24px;
  padding: 0;
  border: 0;
  background: none;
  font: 400 12px/16px var(--mono);
  text-transform: uppercase;
  color: #A3A3A3;
  transition: color 150ms;
}

.hero__reset:hover { color: #262626; }
.hero__reset[hidden] { display: none; }

/* column */
.col {
  width: min(var(--col), 100% - 2 * var(--gutter));
  margin: 0 auto;
  padding: 24px 0 160px;
}

section + section,
.intro + .work { margin-top: 72px; }

/* wide screens: intro on the left, the work on the right, so it all sits on the first screen */
@media (min-width: 960px) {
  .col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 80px;
    align-items: stretch;
    width: min(984px, 100% - 2 * var(--gutter));
  }

  .intro + .work { margin-top: 0; }

  /* one screen, no scrolling: room below the work is just the footer's height,
     and on short screens the logo scales down so the cards still fit */
  .col { padding-top: 8px; padding-bottom: 52px; }
  .col h2 { margin-bottom: 12px; }
  .card img { margin-bottom: 8px; }
  /* 360 = what sits under the logo: 8 top + heading + 12 + 216 card + 8 + caption + 52 footer room (measured) */
  .logo { max-height: calc(100vh - 360px); }

  .intro { display: flex; flex-direction: column; }
  .intro .hello { margin: auto 0 0; padding-top: 24px; }
  .intro p.lead { font-size: 18px; line-height: 26px; }

  .work section + section { margin-top: 48px; }
}

h2 {
  margin: 0 0 16px;
  font: 500 14px/20px var(--sans);
  color: var(--ink);
}

p { margin: 0 0 16px; color: var(--ink-2); }

.intro .hello, p a { color: var(--ink); }

.intro .lead {
  margin-bottom: 20px;
  font-size: 17px;
  line-height: 25px;
  letter-spacing: -0.015em;
  color: var(--ink);
}

p a {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  transition: color 160ms;
}

p a:hover { color: var(--cobalt); }

/* list */
.list { list-style: none; margin: 0; padding: 0; }

.list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 0;
  color: var(--ink-2);
  transition: color 160ms;
}

.list time { color: var(--ink-3); font-variant-numeric: tabular-nums; }

.list li:hover { color: var(--ink); }
.list li:hover time { color: var(--cobalt); }

/* cards */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card {
  display: grid;
  gap: 0;
  text-decoration: none;
  color: var(--ink-2);
}

.card img { margin-bottom: 12px; }
.card__title { color: var(--ink); }
.card__meta { color: var(--ink-2); transition: color 160ms; }
.card:hover .card__meta { color: var(--cobalt); }

/* a card that is not a link yet: no hover reaction */
.card--soon:hover img { transform: none; }
.card--soon:hover .card__meta { color: var(--ink-2); }

.card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  transition: transform 400ms cubic-bezier(.2, .7, .2, 1);
}

.card:hover img { transform: scale(.98); }

.cards--team { margin-top: 28px; row-gap: 28px; }

.member { margin: 0; display: grid; gap: 12px; text-align: center; color: var(--ink-2); }

.member__frame {
  display: grid;
  place-items: center;
  aspect-ratio: 214 / 287;
  background: var(--card);
  border-radius: var(--radius);
  text-decoration: none;
}

.member__frame img { width: 28%; }

.member--join .member__frame { color: var(--ink-3); font-size: 11px; transition: color 160ms; }
.member--join .member__frame:hover { color: var(--cobalt); }

.member figcaption a { color: var(--ink); text-decoration: underline dotted; text-underline-offset: 3px; }

/* bar */
.bar {
  position: fixed;
  inset: auto 0 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  font: 400 12px/16px var(--mono);
  text-transform: uppercase;
  color: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  z-index: 70;
}

.bar__clock, .bar__date { white-space: nowrap; }
.bar time { font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .hero { padding: 48px 0; }
  .bar { padding: 14px var(--gutter); }
  .cards { gap: 12px; }
}

/* project page */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.back {
  position: fixed;
  top: 40px;
  left: 24px;
  z-index: 70;
  font: 400 12px/16px var(--mono);
  text-transform: uppercase;
  color: #fff;
  mix-blend-mode: difference;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.projects {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  padding: 0 24px 120px;
}

.gallery__text { flex-shrink: 0; padding-top: 96px; }

.gallery__text h2 { margin: 0; }

.gallery__text h2 a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gallery__text p { margin: 16px 0 0; color: var(--ink-2); }
.gallery__text p + p { margin-top: 12px; }

.gallery__sub {
  margin: 28px 0 8px;
  font: 500 14px/20px var(--sans);
  color: var(--ink);
}

.list .meta { color: var(--ink-3); text-align: right; }
.list li:hover .meta { color: var(--cobalt); }

.gallery__text .gallery__facts {
  margin-top: 24px;
  font: 400 11px/16px var(--mono);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.gallery__media {
  flex-shrink: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 24px;
  background: var(--card);
}

.gallery__media img,
.gallery__media video {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

@media (min-width: 768px) {
  .gallery {
    flex-direction: row;
    align-items: center;
    gap: 24px;
    padding: 0 24px 0 64px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .gallery::-webkit-scrollbar { display: none; }

  .gallery__text {
    display: flex;
    flex-direction: column;
    width: 400px;
    height: var(--gallery-h);
    padding: 16px 32px 0 0;
  }

  .gallery__text .gallery__facts { margin-top: auto; }

  .gallery__media { height: var(--gallery-h); }

  .gallery__media img,
  .gallery__media video {
    width: auto;
    height: 100%;
  }
}

:root { --gallery-h: min(600px, calc(100vh - 160px)); }

/* media protection (see protect.js) */
.gallery__media img,
.gallery__media video,
.card img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

/* cursor */
@media (min-width: 768px) {
  * { cursor: none; }
}

.cursor-line,
.cursor-ring,
.cursor-label,
.cursor-coords {
  position: fixed;
  pointer-events: none;
}

.cursor-line { z-index: 40; transition: opacity 200ms; }
.cursor-line--h { width: 24px; border-top: 1px solid #FF9500; }
.cursor-line--v { height: 24px; border-left: 1px solid #FF9500; }

.cursor-ring {
  z-index: 50;
  width: 15px;
  height: 15px;
  border: 1px solid #FF9500;
  border-radius: 50%;
  background-color: transparent;
}

.cursor-ring.is-link {
  border-radius: 22px;
  background-color: rgba(255, 149, 0, 0.08);
  transition: width 200ms, height 200ms, border-radius 200ms, background-color 200ms, transform 100ms;
}

.cursor-label {
  z-index: 50;
  padding: 2px 8px;
  background: #000;
  color: #fff;
  font: 400 10px/1.5 var(--sans);
  white-space: nowrap;
  transform: translateX(-50%);
}

.cursor-coords {
  z-index: 50;
  font: 400 10px/1.5 var(--mono);
  color: #fff;
  mix-blend-mode: difference;
}

.cursor-coords span { display: block; }

.cursor-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 50;
  transform: translateX(-50%);
  padding: 8px 16px;
  background: #000;
  color: #fff;
  font: 400 12px/16px var(--mono);
  pointer-events: none;
  display: none;
}

.cursor-toast.is-on { display: block; }

@media (max-width: 767px) {
  .cursor-line, .cursor-ring, .cursor-label, .cursor-coords { display: none !important; }
}

@media (min-width: 768px) {
  .cursor-toast { display: none !important; }
}

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