/* Milan Vanderstraeten — portfolio. Black, minimal, after Drew Tekulve's layout and proportions. */

@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Big Shoulders"; src: url("/fonts/big-shoulders.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("/fonts/roboto-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("/fonts/roboto-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("/fonts/roboto-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #000;
  --fg: #fff;
  --muted: rgba(255, 255, 255, 0.6);
  --line: rgba(255, 255, 255, 0.4);
  --gutter: clamp(16px, 5vw, 96px);
  --max: 1500px;
  --header-h: 56px;
  --serif: "Fraunces", Georgia, serif;
  --label: "Big Shoulders", "Arial Narrow", sans-serif;
  --text: "Roboto", system-ui, -apple-system, sans-serif;
  /* Big name size (home hero + about), same proportion to the screen as Drew's. */
  --bigname: clamp(27px, 4.4vw, 80px);
  /* Slider height. Keep in sync with SLIDE_SIZES in scripts/build.mjs. */
  --slide-h: 34vw;
}
@media (min-width: 768px) { :root { --slide-h: clamp(170px, 15vw, 300px); --header-h: 64px; } }

*, *::before, *::after { box-sizing: border-box; }
/* scrollbar-gutter: the scrollbar's space is kept on every page, so short and long pages line up and
   the header never shifts sideways. */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header-h); scrollbar-gutter: stable; background: var(--bg); }
/* Column layout: main grows, so on a page shorter than the screen the footer sits at the bottom of the
   screen; on longer pages it simply follows the content. */
body {
  margin: 0; background: var(--bg); color: var(--fg);
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh;
  font: 400 16px/1.6 var(--text); letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--fg); color: var(--bg); padding: 8px 12px; }

.label, .pill, .site-header__role, .site-header__nav a {
  font-family: var(--label); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
}
.label { font-size: 15px; margin: 0 0 14px; }

/* ---------- pills ---------- */
/* ---------- buttons (filters, play, arrows, send) ----------
   A plain rectangle with slightly rounded corners. The border thickens *inwards* (an inset shadow on
   top of the .5px hairline border), so the button never changes size: .5px default, 1px hover, 2px
   selected. (On a 1x screen browsers draw the .5px border as one full pixel.)
   Colour like Drew's: grey border + grey text by default, a bit lighter on hover, full white when
   selected. One colour per state (--pc) drives the border, the inset shadow and the text. */
:root { --radius: 5px; }
.pill {
  --pc: rgba(255, 255, 255, .4);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 4px 18px; border: .5px solid var(--pc); border-radius: var(--radius);
  background: transparent; color: var(--pc); font-size: 15px; line-height: 1; cursor: pointer;
  transition: color .15s, border-color .15s, box-shadow .15s; white-space: nowrap;
}
.pill:hover { --pc: rgba(255, 255, 255, .75); box-shadow: inset 0 0 0 .5px var(--pc); }
.pill[aria-pressed="true"] { --pc: var(--fg); box-shadow: inset 0 0 0 1.5px var(--pc); }
.pill--arrow { min-width: 52px; padding: 4px 14px; font-family: var(--text); font-size: 15px; }
/* Drawn arrow (build.mjs ARROW_ICON), colour follows the button state. Optically centred: the head
   carries most of the visual weight, so the arrow sits .75px back toward its tail. */
.pill__arrow { display: block; width: 14px; height: 8px; flex: none; overflow: visible; transform: translateX(-.75px); }
.pill--arrow[rel="prev"] .pill__arrow { transform: scaleX(-1) translateX(-.75px); }

/* ---------- header ----------
   Solid black, so nothing shows through while scrolling. On the home page it starts transparent over
   the reel and turns solid within the first few px of scrolling (--bg-p, set by site.js).
   Pages with a big name (home, about): the big name itself shrinks into the header as you scroll
   (site.js); the header's own name is shown only once the big one has docked (.name-docked). */
/* Sticky (not fixed) with a negative bottom margin: it stays on top while scrolling and overlaps the
   page exactly like a fixed header, but its width follows the page, so with the reserved scrollbar
   gutter it never shifts sideways (Chrome sizes fixed elements to the full window on short pages). */
.site-header {
  --bg-p: 1;
  position: sticky; top: 0; margin-bottom: calc(var(--header-h) * -1); z-index: 20; height: var(--header-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  /* Text lines up with the works grid: same gutter, same maximum width (wider screens get the grid's
     margins too), so the tagline starts at the grid's left edge and WORK / ABOUT end at its right edge.
     --header-drop moves the text down a little: the content box shrinks by twice that at the top. */
  --header-drop: 6px;
  padding: calc(var(--header-drop) * 2 + env(safe-area-inset-top)) max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))) 0;
  background: rgba(0, 0, 0, var(--bg-p));
}
/* Over the home reel, a soft shade keeps the nav readable; it fades out as the header turns solid. */
.site-header::before {
  content: ""; position: absolute; inset: 0 0 -24px; z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(0,0,0,.4), rgba(0,0,0,0)); opacity: calc(1 - var(--bg-p));
}
.site-header__role { font-size: 17px; justify-self: start; }
/* Same face, weight and optical size as the big name, so the hand-over is seamless. */
.site-header__name, .hero__name, .about__name {
  font-family: var(--serif); font-weight: 600; font-variation-settings: "opsz" 144; letter-spacing: -0.01em;
}
.site-header__name { font-size: 22px; line-height: 1; white-space: nowrap; }
.site-header__nav { justify-self: end; display: flex; gap: 20px; }
.site-header__nav a { font-size: 17px; line-height: 1; color: var(--muted); padding: 0 0 3px; border-bottom: 1px solid transparent; }
.site-header__nav a:hover { color: var(--fg); }
.site-header__nav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--fg); }
.is-home .site-header { --bg-p: 0; }
:is(.is-home, .is-about) .site-header:not(.name-docked) .site-header__name { opacity: 0; pointer-events: none; }

/* The big name (wrapped in a span that site.js scales and moves). It sits above the header while it docks. */
[data-bigname] { position: relative; z-index: 21; pointer-events: none; }
[data-bigname] > span { display: inline-block; transform-origin: 50% 50%; will-change: transform; }
[data-bigname].is-docked > span { visibility: hidden; }

@media (max-width: 767px) {
  .site-header { grid-template-columns: 1fr auto 1fr; --header-drop: 4px; }
  .site-header__role { display: none; }
  .site-header__nav { display: contents; }
  .site-header__nav a:first-child { grid-column: 1; grid-row: 1; justify-self: start; }
  .site-header__name { grid-column: 2; grid-row: 1; justify-self: center; font-size: 19px; margin: 0 10px; }
  .site-header__nav a { font-size: 16px; }
  .site-header__nav a:last-child { grid-column: 3; grid-row: 1; justify-self: end; }
}

/* ---------- home hero ---------- */
/* The reel is always shown whole: 16:9 at full width, never cropped (each shot keeps its own aspect
   ratio inside it, with black bars; see scripts/reel.mjs). */
.hero { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
/* The reel fades in from black once, when it starts playing (site.js adds .is-in). Done here, not in the
   video, so the loop itself stays seamless. An animation, not a transition: it still runs when the
   stylesheet arrives after .is-in (a transition would then jump straight to visible). */
.hero__video[data-fade] { opacity: 0; }
.hero__video[data-fade].is-in { opacity: 1; animation: reel-in 1s ease-out; }
@keyframes reel-in { from { opacity: 0; } }
.hero__name {
  position: absolute; inset: 0; margin: auto; height: fit-content; text-align: center; padding: 0 var(--gutter);
  font-size: var(--bigname); line-height: 1.05; white-space: nowrap;
  text-shadow: 0 2px 24px rgba(0, 0, 0, calc(0.25 * (1 - var(--p, 0))));
}
/* Phones and other tall screens: the reel sits under a black header; the filters and first works show below it. */
@media (max-aspect-ratio: 4/3) {
  .hero { margin-top: var(--header-h); }
  .is-home .site-header { background: #000; }
  .is-home .site-header::before { display: none; }
}

/* ---------- work grid ---------- */
.work { max-width: var(--max); margin: 0 auto; padding: clamp(40px, 6vw, 96px) var(--gutter) 32px; }
.filters { margin-bottom: 32px; }
.filters__row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.filters__row--sub { margin-top: 12px; padding-left: 8px; }
.filters__row--sub .pill { min-height: 32px; font-size: 14px; padding: 3px 16px; }
.filters__arrow { font-size: 18px; color: var(--muted); margin-right: 6px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 44px 16px; }
.card a { display: block; }
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #111; margin-bottom: 8px; transition: opacity .3s; }
.card a:hover img { opacity: .85; }
.card__title { display: block; font-family: var(--label); font-weight: 600; font-size: 17px; line-height: 1.25; text-transform: uppercase; letter-spacing: .06em; }
.card__note, .card__year { display: block; font-size: 14px; line-height: 1.45; color: var(--muted); }
.card[hidden] { display: none; }
.grid__empty { color: var(--muted); }
@media (max-width: 1099px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 699px) {
  .grid { grid-template-columns: 1fr; gap: 36px; }
  /* Phone: filter pills scroll sideways in one row. */
  .filters__row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter); }
  .filters__row::-webkit-scrollbar { display: none; }
}

/* ---------- project page ---------- */
/* Order: slider (same height on every project), title + arrows, year/format + credits, then the video
   (only where there is one). Everything above the title has a fixed height, so the title and arrows
   sit at exactly the same spot on every project page. */
.project { padding-top: calc(var(--header-h) + clamp(40px, 6vw, 96px)); }
.project__hero { max-width: var(--max); margin: clamp(48px, 6vw, 88px) auto 0; padding: 0 var(--gutter); }
/* YouTube: own thumbnail + play button; the player replaces it on click. Fits on the screen whole. */
.video {
  position: relative; margin: 0 auto; aspect-ratio: 16 / 9; background: #000; overflow: hidden;
  width: min(100%, 1100px, calc((100svh - var(--header-h) - 48px) * 16 / 9));
}
.video img, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.video__play { position: absolute; inset: 0; margin: auto; width: fit-content; height: fit-content; min-width: 72px; min-height: 42px; gap: 10px; background: rgba(0, 0, 0, .35); }
/* The play button sits on a picture, so it is white from the start (on a dark see-through backing);
   hover only thickens the border. */
.pill.video__play, .pill.video__play:hover { --pc: var(--fg); }
.video__icon { width: 12px; height: 14px; flex: none; }
/* Title row: aligned to the top, the arrows centred on the title's *first* line, so a title that wraps
   to two lines never moves the arrows. */
.project__head {
  --title-size: clamp(24px, 2.5vw, 40px);
  max-width: 1100px; margin: clamp(32px, 4vw, 56px) auto 0; padding: 0 var(--gutter);
  display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 16px;
}
.project__head .pill--arrow { margin-top: calc((var(--title-size) * 1.05 - 36px) / 2); }
.project__title {
  margin: 0; text-align: center; font-family: var(--label); font-weight: 800;
  font-size: var(--title-size); line-height: 1.05; text-transform: uppercase; letter-spacing: .02em;
}
.project__meta { margin: 28px auto 0; padding: 0 var(--gutter); text-align: center; display: grid; gap: 14px; }
.project__meta dt { color: var(--muted); font-size: 13px; line-height: 1.5; }
.project__meta dd { margin: 0; text-transform: uppercase; letter-spacing: .06em; font-size: 14px; line-height: 1.5; }
.project__format dd { text-transform: none; letter-spacing: .02em; }
@media (max-width: 599px) {
  .project__head { gap: 10px; }
  .project__head .pill--arrow { min-width: 44px; padding: 4px 10px; }
}

/* ---------- slider: free scrolling, drifts slowly on its own (site.js) ---------- */
.slider { min-height: var(--slide-h); }
.slider__track {
  display: flex; gap: clamp(8px, 1vw, 14px); overflow-x: auto; overscroll-behavior-x: contain;
  padding: 0 var(--gutter); scrollbar-width: none; cursor: grab; outline-offset: -2px;
}
.slider__track::-webkit-scrollbar { display: none; }
.slider__track.is-dragging { cursor: grabbing; }
.slider__track.is-dragging * { pointer-events: none; }
.slide {
  position: relative; flex: 0 0 auto; height: var(--slide-h); width: calc(var(--slide-h) * var(--a));
  background: #0b0b0b; user-select: none; -webkit-user-select: none;
}
.slide img, .slide video { width: 100%; height: 100%; object-fit: contain; }
.slide--paired video { position: absolute; inset: 0; opacity: 0; transition: opacity .25s; }
.slide--paired.is-playing video { opacity: 1; }
.slide__badge {
  position: absolute; right: 8px; bottom: 8px; width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.8); background: rgba(0,0,0,.35); pointer-events: none; transition: opacity .25s;
}
.slide__badge::after { content: ""; position: absolute; left: 7px; top: 5px; border: 4.5px solid transparent; border-left: 6.5px solid #fff; border-right: 0; }
.slide--paired.is-playing .slide__badge { opacity: 0; }

/* ---------- about ---------- */
/* Generous space under the name (like Drew's), and always enough page to scroll the name away. */
/* The bio sits close under the name; the space it gives up goes under the bio, so CONTACT stays exactly
   where it was (--about-gap = the original space under the name, --about-name-gap = the new one). */
.about {
  --about-gap: clamp(96px, 22vh, 260px); --about-name-gap: clamp(40px, 9vh, 110px);
  max-width: 960px; min-height: calc(100svh + 60px); margin: 0 auto; padding: calc(var(--header-h) + clamp(56px, 10vw, 140px)) var(--gutter) 32px; text-align: center; }
/* 404: no big name to dock into the header, so no extra height; its footer sits at the screen bottom. */
.about--short { min-height: 0; }
.about__name { font-size: var(--bigname); line-height: 1.05; white-space: nowrap; margin: 0 0 var(--about-name-gap); }
.about--short .about__name { margin-bottom: var(--about-gap); }
.about__bio {
  font-size: 16px; line-height: 1.75; max-width: 60ch;
  margin: 0 auto calc(clamp(48px, 7vw, 96px) + var(--about-gap) - var(--about-name-gap));
}
.about__title {
  margin: 0 0 18px; font-family: var(--label); font-weight: 800; font-size: clamp(26px, 2.6vw, 38px);
  line-height: 1.05; text-transform: uppercase; letter-spacing: .02em;
}
.about__text { margin: 0 auto 20px; max-width: 52ch; }
.about__links { display: grid; gap: 6px; justify-items: center; margin-bottom: 40px; }
.about__links a { border-bottom: 1px solid var(--line); }
.about__links a:hover { border-bottom-color: var(--fg); }

/* Contact form: black, thin white lines, the same slightly rounded corners as the buttons. */
.contact-form { max-width: 640px; margin: 0 auto; text-align: left; display: grid; gap: 18px; }
.contact-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.contact-form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.field { display: grid; gap: 6px; }
.field__label { font-family: var(--label); font-weight: 600; font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 10px 12px; background: #000; color: var(--fg); font: inherit; font-size: 16px; line-height: 1.5;
  border: 1px solid var(--line); border-radius: var(--radius); outline: none; transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 160px; }
.field input:hover, .field textarea:hover { border-color: var(--fg); }
.field input:focus, .field textarea:focus { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.contact-form__foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.contact-form__foot .pill { min-width: 110px; }
.contact-form__status { margin: 0; color: var(--muted); font-size: 15px; }
.contact-form__privacy { margin: 0; color: var(--muted); font-size: 13px; }
@media (max-width: 599px) { .contact-form__row { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
main { flex: 1 0 auto; }
.site-footer {
  width: 100%; max-width: var(--max); margin: clamp(72px, 9vw, 128px) auto 0; padding: 28px var(--gutter) calc(36px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; font-size: 14px; line-height: 1.5;
}
.site-footer__social { display: flex; gap: 20px; align-items: center; }
.site-footer__social a { display: block; color: var(--fg); opacity: .9; }
.site-footer__social a:hover { opacity: 1; }
.site-footer__social svg { height: 20px; width: auto; }
.site-footer__role { justify-self: end; text-align: right; }
@media (max-width: 599px) {
  .site-footer { grid-template-columns: 1fr 1fr; grid-template-areas: "social social" "who role"; row-gap: 24px; }
  .site-footer__social { grid-area: social; justify-self: center; }
  .site-footer__who { grid-area: who; }
  .site-footer__role { grid-area: role; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
  .hero__video[data-fade].is-in { animation: none; }
}
