/* Martian Mono, self-hosted variable font (weights 400 and 600 come from the same file) */
@font-face {
  font-family: "Martian Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/martian-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Martian Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/martian-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #141414;
  --muted: #6b6b6b;
  --paper: #f3f3f1;
  --placeholder: #e6e6e3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  /* Wide, but on very large screens the page stops growing at 1760px */
  padding: 28px max(72px, calc((100vw - 1760px) / 2));
  display: flex;
  flex-direction: column;
  gap: 36px;
  font: 11px/1.5 "Martian Mono", monospace;
  text-wrap: pretty;
  color: var(--ink);
  background: var(--paper);
}

a { color: var(--ink); text-decoration: none; }
a, button { transition: color 0.2s ease; }
a:hover, button:hover { color: var(--muted); }
a[aria-current] { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-transform: uppercase;
}

.muted { color: var(--muted); }

header, footer { display: flex; gap: 40px; align-items: baseline; }
header nav { margin-left: auto; display: flex; gap: 40px; text-transform: uppercase; }
header nav a { color: var(--muted); }
header nav a[aria-current] { color: var(--ink); text-underline-offset: 8px; text-decoration-thickness: 2px; }
header nav a:hover { color: var(--ink); }
.logo { font-weight: 600; font-size: 20px; letter-spacing: 0.02em; }
.menu-toggle { display: none; }
footer { margin-top: auto; padding-top: 72px; padding-bottom: 8px; }
.lang { display: flex; gap: 8px; }
.lang a { color: var(--muted); }
.lang a[aria-current] { color: var(--ink); text-decoration: none; }
.lang a:hover { color: var(--ink); }

/* Motion */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
main { animation: fade-in 0.5s ease both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::backdrop { animation: none !important; transition: none !important; }
}

/* Loading: top bar during navigation, placeholders while images load (class set by trackLoading) */
.loading-bar, .lightbox-loading { position: fixed; z-index: 100; height: 2px; overflow: hidden; animation: fade-in 0.2s 0.15s ease both; }
.loading-bar { top: 0; left: 0; right: 0; }
.lightbox-loading { top: 50%; left: 50%; width: 64px; margin-left: -32px; background: var(--placeholder); }
.loading-bar::after, .lightbox-loading::after { content: ""; position: absolute; inset: 0; width: 30%; background: var(--ink); animation: loading 1.2s ease-in-out infinite; }
@keyframes loading { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
img.loading { opacity: 0; transition: none !important; } /* hide instantly, fade in only */
.overview a, .about figure { position: relative; }
.overview img, .about figure img { position: relative; }
.overview a::before, .about figure::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; aspect-ratio: 4 / 5; transition: background-color 0.4s ease, background-image 0s 0.4s allow-discrete; }
.tile { transition: background-color 0.4s ease, background-image 0s 0.4s allow-discrete; }
.overview a:has(img.loading)::before, .about figure:has(img.loading)::before, .tile:has(img.loading) { background-color: var(--placeholder); }
/* Blurred preview while the thumb loads; removed only once the thumb has faded in */
.overview a::before, .tile { background-size: cover; background-position: center; }
.overview a:has(img.loading)::before, .tile:has(img.loading) { background-image: var(--preview, none); transition: none; }
.about figure img { transition: opacity 0.4s ease; }
.lightbox img { transition: opacity 0.4s ease; }
@media (prefers-reduced-motion: reduce) {
  .loading-bar::after, .lightbox-loading::after { width: 100%; }
}

/* Home: overview of all series */
.overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 32px; animation: none; }
.overview a { display: flex; flex-direction: column; gap: 10px; text-transform: uppercase; animation: rise-in 0.6s ease both; }
.overview a:nth-child(2) { animation-delay: 0.06s; }
.overview a:nth-child(3) { animation-delay: 0.12s; }
.overview a:nth-child(4) { animation-delay: 0.18s; }
.overview a:nth-child(5) { animation-delay: 0.24s; }
.overview a:nth-child(6) { animation-delay: 0.3s; }
.overview img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; transition: opacity 0.3s ease; }
.overview a:hover img { opacity: 0.85; }

/* Series page: description left, grid right */
.project { margin-top: 48px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; align-items: start; }
.project-text { position: sticky; top: 28px; display: flex; flex-direction: column; gap: 16px; }
.project-text h1 { margin: 0; font-size: 13px; font-weight: 400; text-transform: uppercase; }
.project-text p { margin: 0; font-size: 13px; line-height: 1.6; white-space: pre-line; }
.back { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; color: var(--muted); text-transform: uppercase; }
.back:hover { color: var(--ink); }
.project-grid { grid-column: span 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.tile { aspect-ratio: var(--tile-ratio, 4 / 5); display: flex; align-items: flex-end; justify-content: center; cursor: zoom-in; animation: fade-in 0.5s ease both; animation-delay: calc(min(var(--i, 0), 12) * 40ms); }
.tile img { max-width: 100%; max-height: 100%; display: block; transition: opacity 0.3s ease; }
.tile:hover img { opacity: 0.85; }
/* Mixed formats: justified rows, each tile as wide as its format, every row (the last too) full width.
   Sizes relative to the grid (cqw), not the window: the page stops growing at 1760px, the grid with it */
.project-grid.justified { display: flex; flex-wrap: wrap; container-type: inline-size; }
.justified .tile { flex: calc(var(--r) * 100) 1 calc(var(--r) * 25cqw); aspect-ratio: var(--r); }
.justified .tile img { width: 100%; height: 100%; }

/* Lightbox */
.lightbox {
  max-width: none;
  max-height: none;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 8vh 4vw;
  border: 0;
  background: transparent;
  cursor: zoom-out;
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; animation: fade-in 0.3s ease; }
.lightbox { --ink: #ededeb; --muted: #959592; --placeholder: #353534; color: var(--ink); }
.lightbox::backdrop { background: #222221; animation: lights-out 0.4s ease both; }
@keyframes lights-out { from { background: var(--paper); } }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox img[data-zone="prev"] { cursor: w-resize; }
.lightbox img[data-zone="next"] { cursor: e-resize; }
/* Arrow following the mouse over the lightbox photo; inverts against what is beneath it */
.lightbox img.custom-cursor { cursor: none; }
.follow-cursor { position: fixed; z-index: 10; top: -14px; left: -14px; display: flex; color: #fff; mix-blend-mode: difference; pointer-events: none; }
.lightbox-counter { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); }
.lightbox-close { position: fixed; top: 28px; right: 72px; display: inline-flex; align-items: center; gap: 6px; }

/* About: same three columns as the overview */
.about { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 32px; align-items: start; }
.about .column { display: flex; flex-direction: column; gap: 40px; font-size: 13px; line-height: 1.6; }
.about-intro { padding-bottom: 8px; }
.about .newsletter { align-self: end; justify-self: center; width: 100%; max-width: 440px; font-size: 13px; line-height: 1.6; }
.about p { margin: 0; }
.about .lead { font-size: 20px; line-height: 1.45; hyphens: auto; }
.about figure { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.about figure img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.about h2 { margin: 0 0 8px; font-size: inherit; font-weight: 400; text-transform: uppercase; color: var(--muted); }
.about dl { margin: 0; display: grid; grid-template-columns: 56px 1fr; gap: 6px 0; }
.about dt { color: var(--muted); }
.about dd { margin: 0; }
/* Second bio text in the size of the project texts; lists without years, spaced like the exhibitions */
.about .lead-more { margin-top: 16px; font-size: 13px; line-height: 1.6; hyphens: manual; }
.about .lines { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.newsletter div { display: flex; border-bottom: 1px solid var(--ink); margin-top: 8px; }
.newsletter input { flex: 1; min-height: 44px; border: 0; font: inherit; background: none; }
.newsletter input:focus-visible { outline: none; }
.newsletter div:has(input:focus-visible) { box-shadow: 0 1px 0 var(--ink); }
.newsletter p { margin-top: 10px; font-size: 11px; }
/* Field only bots fill in (spam trap), out of sight for people */
.newsletter .trap { position: absolute; left: -9999px; width: 1px; height: 1px; }
/* After signing up, the confirmation takes the place of field and button, on the same line */
.newsletter-done { flex: 1; min-height: 44px; display: flex; align-items: center; gap: 6px; text-transform: uppercase; animation: fade-in 0.5s ease both; }

/* About: two columns when three get too narrow, newsletter under the image */
@media (max-width: 1280px) {
  .about { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-intro { grid-row: span 2; }
  .about .newsletter { grid-column: 2; align-self: start; justify-self: stretch; margin-top: 40px; }
}

@media (max-width: 800px) {
  body { padding: 16px; gap: 24px; }
  header { gap: 16px; align-items: center; }
  .menu-toggle { display: flex; align-items: center; justify-content: center; margin-left: auto; min-width: 44px; min-height: 44px; margin-right: -10px; position: relative; z-index: 2; }
  .menu-toggle .icon-close, .menu-open .menu-toggle .icon-open { display: none; }
  .menu-open .menu-toggle .icon-close { display: block; }
  header nav { display: none; }
  .menu-open { overflow: hidden; }
  .menu-open header nav {
    position: fixed;
    inset: 0;
    z-index: 1;
    padding: 120px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-size: 24px;
    background: var(--paper);
    animation: fade-in 0.25s ease;
  }
  .menu-open .logo { position: relative; z-index: 2; }
  /* Two rows: mail · Instagram, then imprint · privacy · language; outer items at the edges */
  footer { display: grid; grid-template-columns: max-content max-content 1fr auto; gap: 12px 20px; }
  footer > :first-child { grid-column: span 3; }
  footer > :last-child { grid-column: 4; }
  /* Imprint's inline margin-left: auto pushes it right on desktop only */
  footer > :nth-child(3) { margin-left: 0 !important; }
  .overview, .about { grid-template-columns: 1fr; }
  .about-intro, .about .newsletter { grid-row: auto; grid-column: auto; }
  .project { grid-template-columns: 1fr; gap: 16px; }
  .project-text { display: contents; }
  .project-grid { grid-column: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
  .justified .tile { flex-basis: calc(var(--r) * 180px); max-width: none; }
  .back { order: 1; margin-top: 16px; }
  .lightbox-close { right: 16px; }
}

/* Imprint (new page, not part of the prototype) */
.text-page { max-width: 640px; font-size: 13px; line-height: 1.6; }
.text-page h2 { margin: 32px 0 8px; font-size: inherit; font-weight: 400; text-transform: uppercase; color: var(--muted); }
.text-page p { margin: 0 0 12px; }

/* Image captions in the lightbox (not part of the prototype: its images have none). Positioned by Lightbox.svelte. */
.lightbox-caption { position: absolute; margin: 0; color: var(--muted); line-height: 1.5; white-space: pre-line; }

/* Project video above the photos (not part of the prototype). Text controls in the site's type, a hairline as timeline. */
.project-video { grid-column: 2 / span 2; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.video-frame { position: relative; }
.project-video ~ .project-grid { grid-column: 2 / span 2; }
.project:has(.project-video) .project-text { grid-row: span 2; }
.project-video video { width: 100%; height: auto; display: block; background: var(--placeholder); cursor: pointer; }
.video-start { position: absolute; inset: 0; display: grid; place-items: center; color: var(--paper); filter: drop-shadow(0 0 12px rgb(0 0 0 / 0.35)); }
.video-start:hover { color: var(--paper); opacity: 0.85; }
.video-controls { display: flex; gap: 24px; align-items: center; }
.video-controls input { flex: 1; min-width: 40px; height: 16px; margin: 0; appearance: none; background: linear-gradient(var(--muted), var(--muted)) center / 100% 1px no-repeat; cursor: pointer; }
.video-controls input::-webkit-slider-thumb { appearance: none; width: 3px; height: 12px; background: var(--ink); border: 0; }
.video-controls input::-moz-range-thumb { width: 3px; height: 12px; background: var(--ink); border: 0; border-radius: 0; }
.video-time { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 800px) {
  .project-video, .project-video ~ .project-grid { grid-column: auto; }
  .project-video { margin-top: 16px; }
  .video-controls { gap: 16px; }
  .video-controls button:last-child { display: none; }
}

/* Client navigations run as a view transition (+layout.svelte). Its cross-fade replaces the page fade-ins;
   the grid keeps its stagger except for the cover tile, which morphs. */
.vt main, .vt .tile.cover, .vt .overview a { animation: none; }
::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: 0.18s; animation-timing-function: cubic-bezier(0.2, 0, 0, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.5s; animation-timing-function: ease; }
