/* ─────────────────────────────────────────────────────────────
   Anan Fries — site styles
   Colours and sizes live in the variables right below.
   ───────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-standard-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  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;
}
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-ext-standard-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  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;
}

:root {
  --bg: #0a0a0a;
  --fg: #ededea;
  --muted: #a3a39e;
  --line: #2c2c2a;
  --ph: #161616;
  --pad-y: clamp(16px, 3.3vw, 48px);
  /* side margins: wider on laptops, and the content never gets wider than ~1560px */
  --pad: max(clamp(16px, 12vw, 220px), calc((100vw - 1200px) / 2));
  --gap: clamp(12px, 1.4vw, 20px);
  --hdr: 72px;
  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--pad); top: 8px; z-index: 10; background: var(--fg); color: var(--bg); padding: 8px 12px; }

/* Display style: wide + heavy */
.logo, .tile-title, .work-title, .footer-name, .next, .mw-title {
  font-stretch: 125%;
  font-weight: 800;
  text-transform: uppercase;
}

.label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.rule { border-top: 1px solid var(--line); padding-top: 14px; margin-bottom: 40px; }
.sublabel { font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg); margin: 0 0 12px; }

/* Placeholders (shown until an image file exists) */
.ph { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: #6f6f6b; text-align: center; padding: 16px; }
.ph-box { width: 100%; height: 100%; min-height: 240px; background: var(--ph); display: flex; align-items: center; justify-content: center; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  height: var(--hdr);
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
}
.logo { font-size: 20px; letter-spacing: 0.04em; white-space: nowrap; }
.site-header nav { display: flex; gap: clamp(16px, 2.6vw, 40px); font-size: 15px; }

/* ── Home: six works, all visible on first screen ───────── */
.grid {
  height: calc(100svh - var(--hdr));
  min-height: 560px;
  padding: 0 var(--pad) var(--pad-y);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}
.tile { display: flex; flex-direction: column; gap: 10px; min-height: 0; transition: opacity 0.25s ease; }
.tile:hover { text-decoration: none; }
.tile-img { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--ph); display: flex; align-items: center; justify-content: center; }
.tile-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.tile:hover .tile-img img { transform: scale(1.02); }
.tile-cap { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.tile-title { letter-spacing: 0.02em; }
.tile-meta { color: var(--muted); flex-shrink: 0; }
/* dim the other works while hovering one */
@media (hover: hover) {
  .grid:has(.tile:hover) .tile:not(:hover) { opacity: 0.4; }
}

/* Works page: same tiles, not stretched to full screen height */
.grid.compact { height: auto; min-height: 0; grid-template-rows: none; }
.grid.compact .tile-img { flex: none; aspect-ratio: 4 / 3; }
.works-list { padding-top: clamp(40px, 5vw, 72px); }
/* Landing page on desktop: the six tiles sit in the middle of the first screen */
@media (min-width: 961px) {
  .page-home .grid.compact {
    min-height: calc(100svh - var(--hdr));
    align-content: center;
    padding-top: 0;
    padding-bottom: var(--hdr);
  }
}

/* ── Intro: statement + highlights ──────────────────────── */
.intro {
  padding: clamp(64px, 9vw, 128px) var(--pad);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 40px;
}
.statement { grid-column: 1 / span 8; font-size: clamp(26px, 2.8vw, 40px); line-height: 1.18; font-weight: 400; }
.highlights { grid-column: 10 / span 3; display: flex; flex-direction: column; gap: 18px; font-size: 14px; color: var(--muted); padding-top: 6px; }
.hl-title { display: block; color: var(--fg); }

/* ── Generic sections ───────────────────────────────────── */
.section { padding: 0 var(--pad) clamp(64px, 8vw, 112px); }

.more-works li a { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.mw-title { font-size: 17px; }

/* Dates */
.dates { margin-bottom: 0; }
.dates + .sublabel { margin-top: 48px; }
.date {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr);
  column-gap: 24px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.d-when { color: var(--muted); font-variant-numeric: tabular-nums; }
.all-dates summary { cursor: pointer; font-size: 15px; padding: 14px 0; color: var(--muted); list-style: none; }
.all-dates summary::-webkit-details-marker { display: none; }
.all-dates summary:hover { color: var(--fg); }
.all-dates[open] summary { display: none; }

/* About */
.about-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 48px; }
.about-text { grid-column: 1 / span 7; display: flex; flex-direction: column; gap: 18px; font-size: 18px; line-height: 1.55; }
.about-side { grid-column: 9 / span 4; font-size: 15px; color: var(--muted); }
.about-side p { margin-bottom: 40px; }
.press li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.press a { color: var(--fg); }

/* ── Work page ──────────────────────────────────────────── */
.work-head { padding: clamp(40px, 5vw, 72px) var(--pad) 40px; display: flex; flex-direction: column; gap: 24px; }
/* Title size: as big as possible, but the longest word always fits on one line.
   --lw = letters in the longest word (set in work.njk); a script fine-tunes it on load. */
.work-title { --max: 150px; font-size: min(var(--max), calc((100vw - 2 * var(--pad)) / (var(--lw, 8) * 0.98))); line-height: 0.92; letter-spacing: -0.01em; overflow-wrap: normal; word-break: normal; hyphens: none; }
/* long titles (many words) are set smaller so they don't take over the page */
.work-title.many { --max: 104px; }
/* titles with a very long word get smaller so the word stays whole */
.work-meta { display: flex; flex-wrap: wrap; gap: 8px 40px; font-size: 15px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.work-awards { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; margin-top: -12px; font-size: 15px; color: var(--muted); text-align: right; }
.work-awards .award { display: inline-flex; align-items: center; gap: 8px; }
.laurel { flex-shrink: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.work-hero { margin: 0 var(--pad); }
.work-hero img { width: 100%; height: auto; }
/* upright covers are cropped to landscape so every hero fills the width */
.work-hero.portrait img { aspect-ratio: 3 / 2; object-fit: cover; }
.work-hero .ph-box { aspect-ratio: 16 / 9; }
.photo-credit { margin-top: 10px; font-size: 13px; color: var(--muted); }
.video { position: relative; aspect-ratio: 16 / 9; background: var(--ph); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .ph-box { position: absolute; inset: 0; min-height: 0; }
.work-trailer:has(.video.vertical) .label { text-align: center; }
.video.vertical { aspect-ratio: 9 / 16; width: min(100%, 460px, calc((100svh - 160px) * 9 / 16)); margin: 0 auto; }
.work-trailer { padding: clamp(56px, 7vw, 96px) var(--pad) 0; }
.work-trailer .label { margin-bottom: 14px; }
.video-start {
  border: 0; background: transparent; font: inherit; cursor: pointer; width: 100%;
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: var(--fg); font-size: 15px; text-decoration: none;
}
.video-start:hover { text-decoration: none; }
.video-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.video-start { z-index: 1; }
.video-start svg { transition: transform 0.2s ease; }
.video-start:hover svg { transform: scale(1.08); }
.video-note { font-size: 12px; color: var(--muted); }

.work-text {
  padding: clamp(56px, 7vw, 96px) var(--pad);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 20px;
  font-size: 18px;
  line-height: 1.55;
  color: #d6d6d1;
}
.work-text .lead { grid-column: 1 / span 4; font-size: clamp(20px, 1.9vw, 26px); line-height: 1.28; color: var(--fg); font-weight: 500; }
.work-text .body { grid-column: 6 / span 6; display: flex; flex-direction: column; gap: 20px; }
.work-text blockquote { margin: 0; padding-left: 20px; border-left: 1px solid var(--line); color: var(--muted); font-style: italic; display: flex; flex-direction: column; gap: 10px; }
.work-text blockquote p:last-child { font-style: normal; font-size: 15px; }

.work-images { padding: 0 var(--pad); display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: var(--gap); }
.work-images figure { margin: 0; }
.work-images img { width: 100%; aspect-ratio: 3 / 2; height: auto; object-fit: cover; }
.work-images .ph-box { aspect-ratio: 3 / 2; min-height: 0; }
.work-images.shape-portrait img, .work-images.shape-portrait .ph-box { aspect-ratio: 2 / 3; }
.work-images.shape-square img, .work-images.shape-square .ph-box { aspect-ratio: 1 / 1; }
.work-images figure.wide { grid-column: 1 / -1; }
.work-images figure.whole img { object-fit: contain; }
.work-images figure.wide img, .work-images figure.wide .ph-box { aspect-ratio: 3 / 2; }

/* Click-to-enlarge */
.zoom { display: block; cursor: zoom-in; }
.zoom img { transition: opacity 0.2s ease; }
.zoom:hover img { opacity: 0.88; }
.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(5, 5, 5, 0.97); color: var(--fg);
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.9); }
.lb-img { max-width: calc(100vw - 180px); max-height: calc(100vh - 120px); width: auto; height: auto; object-fit: contain; user-select: none; }
.lightbox button {
  position: absolute; background: none; border: 0; color: var(--fg); cursor: pointer;
  width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; opacity: 0.75;
}
.lightbox button:hover, .lightbox button:focus-visible { opacity: 1; }
.lightbox button:focus-visible { outline: 2px solid var(--fg); outline-offset: -6px; }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .lb-img { max-width: 100vw; max-height: calc(100vh - 140px); }
  .lb-prev, .lb-next { top: auto; bottom: 4px; transform: none; }
}

.work-companions { padding: clamp(56px, 7vw, 96px) var(--pad) 0; }
.work-companions .label { margin-bottom: 14px; }
.companion-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.companion-grid .tile-img { flex: none; aspect-ratio: 3 / 2; }

.work-info {
  padding: clamp(56px, 7vw, 96px) var(--pad) 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  column-gap: 24px;
  row-gap: 40px;
  font-size: 14px;
  color: var(--muted);
}
.work-info .label { color: var(--fg); margin-bottom: 10px; }
.work-info li { padding: 2px 0; }

.work-nav {
  margin: clamp(56px, 7vw, 96px) var(--pad) 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
}
.next { font-size: clamp(18px, 2vw, 28px); text-align: right; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  padding: clamp(96px, 10vw, 160px) var(--pad) var(--pad-y);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 40px;
  align-items: end;
}
.footer-name { grid-column: 1 / span 7; font-size: clamp(56px, 7vw, 104px); line-height: 0.88; letter-spacing: -0.01em; }
.footer-links { grid-column: 9 / span 4; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }

/* Simple text pages (Impressum) */
.page { padding: clamp(40px, 5vw, 72px) var(--pad); max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.page h1 { font-stretch: 125%; font-weight: 800; text-transform: uppercase; font-size: 40px; margin-bottom: 16px; }
.page h2 { font-size: 18px; margin-top: 24px; }
.page h3 { font-size: 14px; font-weight: 600; margin-top: 12px; }
.page p { color: #d6d6d1; }
.page a { text-decoration: underline; text-underline-offset: 3px; }

/* ── Tablet ─────────────────────────────────────────────── */
@media (max-width: 960px) {
  :root { --pad: clamp(16px, 5vw, 48px); }
  .statement { grid-column: 1 / -1; }
  .highlights { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 18px 40px; }
  .about-text, .about-side { grid-column: 1 / -1; }
  .date { grid-template-columns: minmax(0, 2fr) minmax(0, 4fr) minmax(0, 3fr) minmax(0, 2fr); }
  .work-text .lead, .work-text .body { grid-column: 1 / -1; }
  .work-awards { align-items: flex-start; text-align: left; }
  .footer-name, .footer-links { grid-column: 1 / -1; }
}

/* ── Phone ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  :root { --hdr: 60px; --pad: 16px; }
  .logo { font-size: 15px; }
  .site-header nav { gap: 14px; font-size: 14px; }
  .site-header nav a { padding: 12px 0; }
  .grid {
    height: auto;
    min-height: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    row-gap: 24px;
  }
  .tile-img { flex: none; aspect-ratio: 1 / 1; }
  .grid { row-gap: 16px; }
  .tile-cap { flex-direction: column; gap: 2px; font-size: 13px; }
  .tile-title { white-space: normal; }
  .date { grid-template-columns: 1fr; row-gap: 2px; }
  .more-works li a { flex-direction: column; gap: 4px; }
  .work-title { --max: 60px; }
  /* info under the title: one item per line, compact */
  .work-head { gap: 18px; }
  .work-meta { flex-direction: column; gap: 3px; font-size: 14px; line-height: 1.4; }
  .work-awards { margin-top: 0; gap: 8px; font-size: 14px; line-height: 1.4; }
  .work-awards .award { align-items: flex-start; }
  .work-awards .laurel { width: 16px; height: 16px; margin-top: 1px; }
  .work-title.many { --max: 48px; }
  .more-works .muted { font-size: 14px; }
  .d-when { font-size: 13px; }
  .work-images { grid-template-columns: 1fr; }
  .companion-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-info { grid-auto-flow: row; grid-template-columns: 1fr; }
  .work-nav { flex-direction: column; align-items: flex-start; }
  .next { text-align: left; }
}
@media (max-width: 380px) {
  .site-header nav a[href="#contact"] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile, .tile-img img { transition: none; }
}
