/* ==========================================================
   Sofie Verbert portfolio
   Rood op wit, alles in een monospace. Kleuren, lettertype en
   maten staan hieronder in :root, daar pas je het meeste aan.
   ========================================================== */

/* Degular Mono (het lettertype uit het ontwerp) is betalend.
   Heb je een webfontlicentie: zet de .woff2-bestanden in fonts/
   en haal dit blok uit commentaar.

@font-face { font-family: "Degular Mono"; src: url("fonts/DegularMono-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Degular Mono"; src: url("fonts/DegularMono-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Degular Mono"; src: url("fonts/DegularMono-MediumItalic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Degular Mono"; src: url("fonts/DegularMono-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
*/

:root {
  /* kleuren */
  --red: #ff0000;
  --hover: #a80000;         /* hover: donkerrood */
  --bg: #ffffff;

  /* cursor: gewone pijl in het rood, donkerrood boven klikbare dingen */
  --cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24'%3E%3Cpath d='M3 2 L3 19.5 L7.6 15.3 L10.6 22 L13.4 20.8 L10.5 14.2 L16.6 14.2 Z' fill='%23ff0000' stroke='%23ffffff' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 4 3, auto;
  --cursor-link: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24'%3E%3Cpath d='M3 2 L3 19.5 L7.6 15.3 L10.6 22 L13.4 20.8 L10.5 14.2 L16.6 14.2 Z' fill='%23a80000' stroke='%23ffffff' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 4 3, pointer;

  /* lettertype */
  --font: "Degular Mono", "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  /* maten (schalen mee met de schermbreedte) */
  --gutter: clamp(16px, 4.55vw, 58px);   /* marge links en rechts */
  --fs-head: clamp(24px, 3.45vw, 44px);  /* naam en menu */
  --fs-list: clamp(18px, 2.2vw, 28px);   /* projecttitels */
  --fs-small: clamp(14px, 1.56vw, 20px); /* contactregels */
  --fs-body: 15.5px;                     /* lopende tekst */
  --col-text: 390px;                     /* breedte tekstkolom */
  --col-gap: clamp(24px, 4.7vw, 60px);   /* ruimte tekst en beeld */
  --indent: 0.65em;                      /* bolletje + witruimte */
  --main-pt: clamp(28px, 4.4vw, 56px);   /* ruimte boven de inhoud */
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--red);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.36;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  cursor: var(--cursor);
}

a { color: inherit; text-decoration: none; cursor: var(--cursor-link); }
a:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
em { font-style: italic; }
::selection { background: var(--red); color: var(--bg); }

/* ---------- bolletjes ---------- */
.dot,
.site-nav a::before,
.work-item > a::before {
  content: "";
  display: inline-block;
  flex: none;
  width: 0.24em;
  height: 0.24em;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--bg);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 24px;
  padding-block: clamp(14px, 3vw, 38px) 14px;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.site-name,
.site-nav {
  font-size: var(--fs-head);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
}

.site-nav {
  justify-self: end;
  display: flex;
  gap: clamp(18px, 7vw, 90px);
}

.site-nav a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.16em;
}
.site-nav a::before { align-self: center; }

/* actief menu-item: vierkantje in plaats van bolletje */
.site-nav a.is-active::before {
  border-radius: 0;
  width: 0.26em;
  height: 0.26em;
}

.site-name:hover,
.site-nav a:hover { color: var(--hover); }

/* contactregels: enkel zichtbaar na klik op Contact */
.contact-lines {
  display: none;
  grid-column: 1 / -1;
  justify-self: end;
  margin-top: 0.55em;
  font-size: var(--fs-small);
  font-style: italic;
  line-height: 1.15;
  text-align: right;
}
.contact-lines a { display: block; }
.contact-lines a:hover { color: var(--hover); }

[data-view="contact"] .contact-lines { display: block; }

/* terugpijl: verschijnt op projectpagina's als je scrolt */
.back {
  display: none;
  position: absolute;
  top: 100%;
  left: calc(var(--gutter) - 46px);
  /* staat op dezelfde hoogte als de projecttitel en blijft staan bij scrollen */
  margin-top: calc(var(--main-pt) + var(--fs-list) * 0.6 - 26px);
  width: 40px;            /* klikzone groter dan het driehoekje zelf */
  height: 52px;
  align-items: center;
  justify-content: center;
}
.back::before {
  content: "";
  width: 13px;
  height: 22px;
  background: var(--red);
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
  transition: background 0.15s, transform 0.15s;
}
.back:hover::before,
.back:focus-visible::before {
  background: var(--hover);
  transform: translateX(-4px);
}
.back:focus-visible { outline: none; }
[data-view="project"] .back { display: flex; }
.back-inline { display: none; }

/* startpagina: wisselende foto's, zo groot als het scherm toelaat zonder te scrollen */
/* de foto vult alles onder de header, van rand tot rand, zonder te scrollen */
body[data-view="home"] {
  display: flex;
  flex-direction: column;
  height: calc(100svh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow: hidden;
}
[data-view="home"] .site-main {
  flex: 1;
  display: flex;
  min-height: 0;
  padding-block: clamp(12px, 2vw, 28px) clamp(20px, 3vw, 40px);
}
.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.home-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 1em;
  justify-self: start;
  font-size: var(--fs-small);
  font-style: italic;
  font-weight: 400;
  transition: color 0.35s ease;
}
.home-caption:hover { color: var(--hover); }
.home-title { min-width: 0; }
.home-year { flex: none; font-variant-numeric: tabular-nums; }
/* de hele foto blijft zichtbaar (niets afgeknipt), zo groot als past,
   gecentreerd met witruimte langs de zijkanten */
.slideshow {
  flex: 1;
  min-height: 240px;
  container-type: size;
  display: grid;
  place-items: center;
}
.slide {
  grid-area: 1 / 1;
  display: block;
  width: min(100cqw, calc(100cqh * var(--r, 1.45)));
  aspect-ratio: var(--r, 1.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.4s cubic-bezier(0.45, 0.05, 0.25, 1);
}
.slide.is-current {
  opacity: 1;
  pointer-events: auto;
}
.slide picture { display: contents; }
.slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ---------- inhoud ---------- */
.site-main {
  padding-block: var(--main-pt) 96px;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* work-lijst */
.work-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--fs-list);
  font-style: italic;
  font-weight: 400;
  line-height: 1.24;
}

.work-item > a {
  display: flex;
  align-items: baseline;
  gap: 1em;
}

.work-item > a::before {
  margin-right: calc(var(--indent) - 0.24em - 1em);
  transform: translateY(-0.08em);
}

.work-title { flex: 1; min-width: 0; }
.work-year { flex: none; font-variant-numeric: tabular-nums; }

/* hover-preview: rustige flow. Bij openen wacht hij even, laat de ruimte
   traag openschuiven en laat het beeld er pas daarna in vervagen.
   Bij sluiten vervaagt het beeld eerst en schuift de ruimte daarna dicht. */
.preview {
  --flow: cubic-bezier(0.45, 0.05, 0.25, 1);
  display: grid;
  grid-template-rows: 0fr;
  margin-left: var(--indent);
  width: min(705px, calc(100% - var(--indent)));
  opacity: 0;
  transition:
    opacity 0.4s ease,
    grid-template-rows 0.8s var(--flow) 0.15s;
}
.preview-inner { min-height: 0; overflow: hidden; }
.preview img {
  width: auto;
  max-height: 55vh;
  margin: 0.15em 0 0.4em;
  transform: translateY(-6px);
  transition: transform 0.8s var(--flow) 0.15s;
}
.work-item > a { transition: color 0.35s ease; }

.work-item > a:focus-visible { color: var(--hover); outline: none; }

@media (hover: hover) {
  .work-item:hover > a { color: var(--hover); }
  .work-item:hover .preview {
    grid-template-rows: 1fr;
    opacity: 1;
    /* 0.2s wachten: snel over de lijst gaan opent niets */
    transition:
      grid-template-rows 1s var(--flow) 0.2s,
      opacity 0.9s ease 0.45s;
  }
  .work-item:hover .preview img {
    transform: none;
    transition: transform 1.1s var(--flow) 0.35s;
  }
}

/* projectpagina */
.project-title {
  display: flex;
  align-items: baseline;
  gap: calc(var(--indent) - 0.24em);
  margin: 0 0 1.1em;
  font-size: var(--fs-list);
  font-style: italic;
  font-weight: 400;
  line-height: 1.2;
  text-wrap: balance;
}

.project-body {
  display: grid;
  grid-template-columns: minmax(0, var(--col-text)) minmax(0, 1fr);
  column-gap: var(--col-gap);
  align-items: start;
}

.project-text p { margin: 0 0 0.6em; }
.project-text .note { font-style: italic; }

/* formaat, papier, lettertype en links onder de tekst */
.project-details {
  margin-top: 1.4em;
  font-style: italic;
}
.project-details span,
.project-details a { display: block; }
.project-details a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.project-details a:hover { color: var(--hover); }

/* beeldkolom loopt door tot de rechtermarge: de rechterrand van elk beeld
   staat gelijk met het einde van CONTACT in de header */
.project-images {
  display: grid;
  gap: clamp(24px, 4vw, 52px);
  justify-items: end;
  min-width: 0;
}
.project-images figure { margin: 0; min-width: 0; max-width: 100%; }
.project-images > section,
.project-images figure.is-video { justify-self: stretch; }
.project-images img {
  width: auto;
  max-width: 100%;
  max-height: 85vh;
}
.video {
  --r: 1.7778;               /* standaard 16:9; de echte verhouding komt van Vimeo */
  position: relative;
  margin-left: auto;
  width: min(100%, calc(85vh * var(--r)));
  aspect-ratio: var(--r);
}
.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  padding: 16px;
  border: 1.5px solid var(--red);
  font-style: italic;
  text-align: center;
}
.video-placeholder p { margin: 0; font-size: var(--fs-list); }
.video-placeholder a { text-decoration: underline; text-underline-offset: 0.15em; }
.video-placeholder a:hover { color: var(--hover); }
.video-file {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 85vh;
}
/* ---------- specimen (lettertypes als werk) ---------- */
.specimen,
.initials {
  display: grid;
  gap: 28px;
  min-width: 0;
}
.sp-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  font-style: italic;
}
.sp-field {
  display: flex;
  align-items: center;
  gap: 0.6em;
}
.sp-field input[type="text"] {
  box-sizing: border-box;
  width: min(300px, 62vw);
  height: 1.7em;
  padding: 0;
  border: 0;
  border-bottom: 1.5px solid var(--red);
  border-radius: 0;
  background: var(--bg);
  color: var(--red);
  font: inherit;
  font-style: normal;
  cursor: text;
}
.sp-field input[type="text"]:focus { outline: none; border-bottom-color: var(--hover); }
/* schuifbalk: dezelfde rode lijn als het tekstveld ernaast, met een rood bolletje als knop */
.sp-range {
  position: relative;
  display: inline-block;
  box-sizing: border-box;
  width: 150px;
  height: 1.7em;
  border-bottom: 1.5px solid var(--red);
}
.sp-range input[type="range"] {
  --thumb: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Ccircle cx='13' cy='13' r='7' fill='%23ff0000'/%3E%3C/svg%3E");
  position: absolute;
  left: 0;
  bottom: -13.75px;          /* midden van de ster op de lijn */
  width: 100%;
  height: 26px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: var(--cursor-link);
}
.sp-range input[type="range"]:hover,
.sp-range input[type="range"]:active { --thumb: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Ccircle cx='13' cy='13' r='7' fill='%23a80000'/%3E%3C/svg%3E"); }
.sp-range input[type="range"]:focus { outline: none; }
.sp-range input[type="range"]:focus-visible { outline: 1.5px solid var(--red); outline-offset: 2px; }
.sp-range input[type="range"]::-webkit-slider-runnable-track {
  height: 26px;
  background: transparent;
}
.sp-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border: 0;
  background: var(--thumb) center / contain no-repeat;
  cursor: var(--cursor-link);
}
.sp-range input[type="range"]::-moz-range-track {
  height: 26px;
  background: transparent;
}
.sp-range input[type="range"]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 0;
  background: var(--thumb) center / contain no-repeat;
  cursor: var(--cursor-link);
}
.sp-label {
  margin-bottom: 6px;
  font-size: 13px;
  font-style: italic;
}
.sp-sample {
  font-size: var(--sp-size);
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.is-caps .sp-sample { text-transform: uppercase; }
.sp-paragraph {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
}
.sp-dropcap {
  float: left;
  width: 5.8em;
  height: 5.8em;
  margin: 0.15em 0.5em 0.1em 0;
}
.sp-glyphs-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}
.sp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-bottom: 6px;
}
.sp-tabs button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--red);
  font: inherit;
  font-size: 13px;
  font-style: italic;
  cursor: var(--cursor-link);
}
.sp-tabs button:hover { color: var(--hover); }
.sp-tabs button[aria-pressed="true"] {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.sp-glyphs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  border-top: 1px solid var(--red);
  border-left: 1px solid var(--red);
}
.sp-glyphs span {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-right: 1px solid var(--red);
  border-bottom: 1px solid var(--red);
  font-size: 28px;
  line-height: 1;
}
.sp-glyphs span:hover { background: var(--red); color: var(--bg); }

.initials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 22px 16px;
}
.initial { margin: 0; }
.initial img { width: 100%; aspect-ratio: 1; }
.initials .initial figcaption {
  margin-top: 2px;
  text-align: left;
  font-size: 12px;
  font-style: italic;
}

.project-images figcaption {
  margin-top: 0.5em;
  font-size: 13px;
  font-style: italic;
  text-align: right;
}

/* about: klein portret links (onder de naam), tekst rechts */
.about {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: clamp(20px, 2.5vw, 32px);
  align-items: start;
}
.about-photo { margin: 0; }
.about-photo img { width: 120px; height: auto; }
.about .project-text { max-width: 640px; }

/* cv op de about-pagina */
/* de cv staat los van de introtekst: onder de foto, over de hele breedte */
.cv {
  grid-column: 1 / -1;
  display: grid;
  gap: 1.5em;
  max-width: 720px;
  margin-top: clamp(40px, 6vw, 72px);
}
.about.no-intro .cv { margin-top: clamp(24px, 3vw, 36px); }
.cv-block h2 {
  margin: 0 0 0.45em;
  font-size: inherit;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.cv-row {
  display: grid;
  grid-template-columns: 6.8em minmax(0, 1fr);
  gap: 0 1em;
  margin-bottom: 0.35em;
}
.cv-row.no-year {
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 0.15em;
}
.cv-year { font-variant-numeric: tabular-nums; }
.cv-text a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.cv-text a:hover { color: var(--hover); }

/* ---------- smal scherm ---------- */
@media (max-width: 760px) {
  .site-header {
    grid-template-columns: 1fr;
    row-gap: 10px;
  }
  .site-nav {
    justify-self: start;
    font-size: clamp(17px, 5.2vw, 24px);
    gap: clamp(14px, 5vw, 28px);
  }
  .contact-lines {
    justify-self: start;
    text-align: left;
    margin-top: 0;
  }
  [data-view="project"] .back { display: none; }
  .back-inline {
    display: inline-flex;
    flex: none;
    align-items: center;
    align-self: center;
    width: 20px;
    height: 30px;
    margin-left: -2px;
  }
  .back-inline::before {
    content: "";
    width: 9px;
    height: 15px;
    background: var(--red);
    clip-path: polygon(100% 0, 0 50%, 100% 100%);
  }
  .back-inline:hover::before { background: var(--hover); }
  .project-title::before { display: none; }
  .project-body {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 28px;
  }
  .project-text { max-width: 60ch; }
  .about {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 24px;
  }
  .about-photo img { width: 100px; }
  .slideshow { align-items: start; }
  .cv-row { grid-template-columns: 5.6em minmax(0, 1fr); }
  :root { --fs-list: 18px; }
  .work-item > a { gap: 0.6em; }
  .work-item > a::before { margin-right: calc(var(--indent) - 0.24em - 0.6em); }
}

@media (prefers-reduced-motion: reduce) {
  .back::before,
  .preview,
  .preview img,
  .work-item > a,
  .slide { transition: none !important; }
}
