/* vogtjonas.com — dark, scroll-only portfolio
   Palette from the "Homepage — Dark" artboard, layout from "Homepage — Light, scroll". */

:root {
  --paper: #1E1E1E;        /* page background = black point of the footage (media/303030 measures rgb 30,30,30) */
  --ink: #E6E6E6;          /* text, slightly off-white, 13.4:1 */
  --muted: #A3A3A3;        /* 6.6:1 on --paper */
  --line: #333333;         /* hairlines */
  --still-bg: #1E1E1E;     /* empty still frame while loading — same as page, so frames don't flash */
  --clip-bg: #1E1E1E;      /* empty clip frame while loading */
  --footer-muted: #A3A3A3;
  --accent: #CCCC99;       /* 10.1:1 on --paper */

  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --sans: Archivo, 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --pad: 24px;
  --max: 1080px;           /* max content width */
  /* side padding that keeps content at most --max wide, centred, never less than --pad */
  --gutter: max(var(--pad), calc((100% - var(--max)) / 2));
  --gap: 8px;
  --project-space: 120px;
  --ratio: 2.4 / 1;        /* placeholder shape until a file loads; then the frame takes the file's own ratio (no cropping) */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 11px/1.45 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--muted); }
button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
.muted { color: var(--muted); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 32px;
  padding: 14px var(--gutter);
  background: rgba(30, 30, 30, .88);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.logo { display: flex; align-items: center; font: 600 15px var(--sans); letter-spacing: .02em; }
.logo:hover { color: var(--ink); }
@media (max-width: 560px) { .header-meta { display: none; } }

/* ---------- frames ---------- */
.frame { position: relative; width: 100%; aspect-ratio: var(--ratio); overflow: hidden; background: var(--still-bg); }
.frame--dark { background: var(--clip-bg) center / cover no-repeat; }
.frame img, .frame video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
.frame-label { position: absolute; left: 12px; bottom: 10px; font-size: 10px; color: #fff; mix-blend-mode: difference; }

/* fade media in once it has loaded */
.frame img, .stream .frame video { opacity: 0; transition: opacity .6s ease; }
/* must out-rank the rule above (.stream .frame video), or clips stay invisible */
.frame img.is-loaded, .stream .frame video.is-loaded { opacity: 1; }

/* ---------- work stream ---------- */
.stream { padding: 0 var(--gutter); }
.stream > .project:first-child { padding-top: 48px; }
.project { padding-top: var(--project-space); }
.caption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; padding-bottom: 12px; }
.caption .pos { color: var(--accent); }
.caption .title { font: 600 15px var(--sans); letter-spacing: .01em; }
.caption .venue { color: var(--muted); }
.rest {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;      /* frames keep their own ratio instead of stretching to the row */
  gap: var(--gap);
  margin-top: var(--gap);
}
.rest--first { margin-top: 0; }
/* an odd last frame closes the project at full width */
.rest > .frame:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 860px) {
  .rest { grid-template-columns: minmax(0, 1fr); }
}
.links { display: flex; flex-wrap: wrap; gap: 20px; padding-top: 12px; }
.links a { color: var(--muted); }
.links a:hover { color: var(--ink); }

/* ---------- trailer (click to play) ---------- */
.frame--trailer { margin-top: var(--gap); background: var(--paper); }
.frame--trailer .poster { transition: opacity .6s ease; }  /* not dimmed: its blacks must stay on the background */
.frame--trailer .play {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  background: transparent; border: 0; cursor: pointer; color: var(--ink);
}
.frame--trailer .play-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border: 1px solid var(--ink); border-radius: 50%;
  font-size: 14px; padding-left: 3px; transition: background .2s, color .2s;
  background: rgba(30, 30, 30, .55);
}
.frame--trailer .play:hover .play-icon,
.frame--trailer .play:focus-visible .play-icon { background: var(--ink); color: var(--paper); }
.frame--trailer .frame-label { z-index: 1; color: var(--ink); opacity: .7; mix-blend-mode: normal; }
.stream .frame--trailer iframe, .stream .frame--trailer video {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 1; background: var(--paper);
  /* The black-point filter is set per trailer by blackPointFilter() in main.js
     (from the trailer's measured black and --paper). Fallback for black = 0: */
  filter: contrast(0.7895) brightness(1.1176);
}

.frame--trailer .tc-player, .frame--trailer iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.frame--trailer .tc-cover {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: var(--paper) center / cover no-repeat;
  opacity: 1; transition: opacity .3s ease;
}
.frame--trailer .tc-cover:not(.is-on) { opacity: 0; }
.frame--trailer .tc-hit {
  position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%;
  background: transparent; border: 0; cursor: pointer;          /* click video = play/pause; keeps YouTube's overlays out of reach */
}
.frame--trailer .tcontrols {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; align-items: center; gap: 16px; padding: 10px 12px;
  background: rgba(30, 30, 30, .78);
  opacity: 0; transition: opacity .25s ease;
}
.frame--trailer.is-paused .tcontrols,
.frame--trailer:hover .tcontrols,
.frame--trailer:focus-within .tcontrols { opacity: 1; }
@media (hover: none) { .frame--trailer .tcontrols { opacity: 1; } }
.tc-btn {
  background: transparent; border: 0; padding: 6px 0; min-height: 32px;
  color: var(--ink); cursor: pointer; white-space: nowrap;
}
.tc-btn:hover { color: var(--accent); }
.tc-time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tc-track {
  position: relative; flex: 1; height: 24px; min-width: 60px;
  background: transparent; border: 0; padding: 0; cursor: pointer;
}
.tc-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.tc-fill { position: absolute; left: 0; top: calc(50% - 1px); height: 2px; width: 0; background: var(--ink); }
.frame--trailer:fullscreen { aspect-ratio: auto; background: var(--paper); }
@media (max-width: 560px) { .tc-time { display: none; } }
/* YouTube serves the trailers as 16:9 with the 2.4:1 film letterboxed inside. Make the player
   16:9 at full frame width and centre it, so the baked-in bars fall outside the frame and the
   picture fills it edge to edge (slight overscan hides any last line of bar). */
.stream .frame--trailer iframe {
  inset: auto; left: 0; top: 50%;
  width: 100%; height: auto; aspect-ratio: 16 / 9;
  transform: translateY(-50%) scale(1.02);
}
.frame--trailer .blackpoint {
  position: absolute; inset: 0; pointer-events: none;
  background: var(--paper); mix-blend-mode: lighten;
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: 160px;
  background: var(--paper); color: var(--ink);
  border-top: 1px solid var(--line);
  padding: 48px var(--gutter) 24px;
  display: flex; flex-direction: column; gap: 48px;
}
.site-footer a:hover { color: var(--footer-muted); }
.footer-top { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }   /* email above Instagram */
.footer-mail { text-transform: none; }   /* same small mono as the rest of the UI, just lower-case */
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; color: var(--footer-muted); }
.footer-bottom nav { display: flex; gap: 24px; }

/* ---------- legal pages ---------- */
.legal { padding: 64px var(--gutter) 120px; text-transform: none; letter-spacing: 0; font-size: 14px; line-height: 1.6; }
.legal > * { max-width: 760px; }
.legal h1 { font: 500 40px/1 var(--sans); letter-spacing: -.02em; margin: 0 0 32px; }
.legal h2 { font: 600 15px var(--sans); margin: 32px 0 8px; }

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