/* ==========================================================================
   Tokens
   The design is drawn on a 1440px wide canvas. --px is "one design pixel":
   it scales with the viewport and stops growing at 1680px wide.
   --hu is the same unit for the hero, but also shrinks on short screens so
   the hero always fits in one viewport.
   ========================================================================== */
:root {
  --blue: #1859ff;
  --cream: #fbfaf5;
  --white: #ffffff;
  --yellow: #ffe019;
  --purple: #bb86ff;
  --pink: #ff3366;
  --red: #ff3539;

  --font-display: "Gasoek One", "Arial Black", sans-serif;
  --font-accent: "Fugaz One", "Arial Black", sans-serif;
  --font-body: "Fira Sans Extra Condensed", "Arial Narrow", sans-serif;

  --max-width: 1680px;
  --px: calc(min(100vw, var(--max-width)) / 1440);
  --hu: min(var(--px), calc(100svh / 960));
  --gutter: max(20px, calc(var(--px) * 128));
}

/* ==========================================================================
   Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--blue);
  color: var(--white);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.hero__inner {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding: calc(var(--hu) * 70) var(--gutter) calc(var(--hu) * 40);
}

.hero__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: calc(var(--hu) * 248);
  line-height: 0.887;
  color: var(--cream);
}

.hero__name span {
  display: block;
}

.hero__intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-top: calc(var(--hu) * 53);
}

.hero__tagline {
  margin: 0;
  font-family: var(--font-accent);
  font-size: calc(var(--hu) * 100);
  line-height: 1.3;
  color: var(--yellow);
}

.hero__nav {
  margin-top: calc(var(--hu) * 30);
}

.hero__nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: right;
  font-family: var(--font-accent);
  font-size: max(20px, calc(var(--hu) * 32));
  line-height: 1.93;
}

.hero__nav a {
  text-decoration: none;
  transition: color 0.2s ease;
}

.hero__nav a:hover {
  color: var(--yellow);
}

/* Scroll hint: corner arrows + centered "Meer info beneden" */
.hero__scroll {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px calc(var(--hu) * 40);
}

.hero__more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s ease;
}

.hero__more:hover {
  color: var(--yellow);
}

.arrow {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==========================================================================
   About / kennismaken
   ========================================================================== */
.about {
  display: grid;
  grid-template-columns: calc(var(--px) * 480) minmax(0, calc(var(--px) * 664));
  column-gap: calc(var(--px) * 104);
  align-items: center;
  max-width: var(--max-width);
  margin-inline: auto;
  /* The design's text column runs closer to the right edge than the gutter */
  padding: calc(var(--px) * 200) calc(var(--px) * 72) calc(var(--px) * 240) calc(var(--gutter) - var(--px) * 8);
}

.about__visual svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.arc {
  fill: none;
  stroke-width: 7;
}

.arc--purple { stroke: var(--purple); }
.arc--yellow { stroke: var(--yellow); }
.arc--pink   { stroke: var(--pink); }

.about__title {
  margin: 0 0 0.55em;
  font-family: var(--font-accent);
  font-weight: 400;
  font-size: max(30px, calc(var(--px) * 48));
  line-height: 1.25;
}

.underline {
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 0.085em;
  text-underline-offset: 0.16em;
}

.about__text p {
  margin: 0 0 1.19em;
  font-size: max(18px, calc(var(--px) * 32));
  font-weight: 600;
  line-height: 1.19;
  letter-spacing: 0.015em;
  word-spacing: 0.1em;
}

.about__text p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Tablet: stack the about section
   ========================================================================== */
@media (max-width: 860px) {
  .about {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 48px;
    padding: 96px var(--gutter) 120px;
  }

  .about__visual {
    width: min(420px, 100%);
  }

  .about__text {
    max-width: 640px;
  }

  .about__title {
    font-size: clamp(28px, 6vw, 40px);
  }

  .about__text p {
    font-size: clamp(18px, 3.4vw, 24px);
    line-height: 1.3;
  }
}

/* ==========================================================================
   Phone + portrait tablet: menu stacks below the tagline, name fills the width
   ========================================================================== */
@media (max-width: 760px), (max-width: 1024px) and (orientation: portrait) {
  :root {
    --gutter: clamp(20px, 6vw, 56px);
  }

  .hero__nav {
    margin-top: 0;
  }

  .hero__inner {
    padding-top: 40px;
    padding-bottom: 32px;
  }

  .hero__name {
    /* "Balvert" is ~4.02em wide: size it to fill the available width */
    font-size: calc((100vw - 2 * var(--gutter)) / 4.1);
  }

  .hero__intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 32px;
    margin-top: 28px;
  }

  .hero__tagline {
    font-size: clamp(34px, 11vw, 64px);
    line-height: 1.2;
  }

  .hero__nav ul {
    text-align: left;
    font-size: clamp(22px, 6.5vw, 30px);
    line-height: 1.6;
  }

  .hero__scroll {
    padding-bottom: 24px;
  }

  .hero__more {
    font-size: 17px;
  }
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Fit to screen (desktop)
   Pages with .fit-screen also scale with the screen height: --px becomes the
   smaller of "width / 1440" and "height / --fit-h", where --fit-h is how tall
   (in design pixels) the part is that must be visible without scrolling.
   ========================================================================== */
.fit-screen--projecten { --fit-h: 925; } /* rows 1-2 in full + the "Eigen werk" heading */
.fit-screen--skills    { --fit-h: 850; } /* whole page */
.fit-screen--contact   { --fit-h: 880; } /* whole page */
.fit-screen--escher    { --fit-h: 1122; } /* whole page (1107, plus room for the menu, which scales with --hu) */

@media (min-width: 761px) {
  .fit-screen {
    --px: min(calc(min(100vw, var(--max-width)) / 1440), calc(100svh / var(--fit-h)));
  }

  /* the 220px minimum card size is for phones; on desktop the cards just scale */
  .fit-screen .projects {
    --card-w: calc(var(--px) * 343);
  }
}

/* ==========================================================================
   Site nav (subpages) — the markup comes from js/navbar.js
   Sized with --hu, not --px: .fit-screen pages change --px to fit their own
   content, which made the menu a different size on every page. --hu is set
   once on :root, so the menu is the same everywhere (and matches the home menu).
   ========================================================================== */
site-nav {
  display: block;
}

.site-header {
  padding: calc(var(--hu) * 48) 20px 0;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px calc(var(--hu) * 50);
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-accent);
  font-size: max(20px, calc(var(--hu) * 32));
  line-height: 1.3;
}

.site-nav a {
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* ==========================================================================
   Projecten
   Cards are 343 x 218 on the 1440 canvas. The first card in a row has a
   rounded left side, the last card a rounded right side; rows that hold
   more cards than fit scroll sideways.
   ========================================================================== */
.projects {
  --card-w: max(220px, calc(var(--px) * 343));
  --card-gap: max(20px, calc(var(--px) * 91));
  /* (100% - 1440 design px) / 2 centres the layout when height limits the scale */
  --row-pad: max(20px, calc((100% - var(--px) * 1440) / 2 + var(--px) * 114));
  --title-pad: max(20px, calc((100% - var(--px) * 1440) / 2 + var(--px) * 79));
  --corner: max(6px, calc(var(--px) * 10));
  /* room so the card shadow isn't clipped by the scrolling row */
  --shadow-room: 24px;

  max-width: var(--max-width);
  margin-inline: auto;
  padding: calc(var(--px) * 73) 0 calc(var(--px) * 60);
}

.project-group + .project-group {
  margin-top: calc(var(--px) * 9);
}

.project-group__title {
  margin: 0;
  padding-inline: var(--title-pad);
  font-family: var(--font-accent);
  font-weight: 400;
  font-size: max(24px, calc(var(--px) * 36));
  line-height: 1.2;
}

.project-row {
  display: flex;
  gap: var(--card-gap);
  margin: calc(var(--px) * 19 - var(--shadow-room)) 0 calc(-1 * var(--shadow-room));
  padding: var(--shadow-room) var(--row-pad);
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--row-pad);
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / 0.5) transparent;
}

.project-card {
  flex: none;
  width: var(--card-w);
  scroll-snap-align: start;
}

.project-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 343 / 218;
  overflow: hidden;
  background: var(--cream);
  border-radius: var(--corner);
  box-shadow: 0 3px 14px rgb(0 15 80 / 0.6);
}

/* Half-height radius = a full semicircle: 31.78% of the width, 50% of the height */
.project-card:first-child .project-card__media {
  border-top-left-radius: 31.78% 50%;
  border-bottom-left-radius: 31.78% 50%;
}

.project-card:last-child .project-card__media {
  border-top-right-radius: 31.78% 50%;
  border-bottom-right-radius: 31.78% 50%;
}

.project-card__media img {
  display: block;
  width: var(--w, auto);
  height: var(--h, auto);
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.project-card__title {
  margin: calc(var(--px) * 21) 0 0;
  font-size: max(16px, calc(var(--px) * 24));
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  transition: color 0.2s ease;
}

.project-card__link {
  display: block;
  text-decoration: none;
}

.project-card__link:hover .project-card__title {
  color: var(--yellow);
}

@media (max-width: 760px) {
  .site-header {
    padding-top: 24px;
  }

  .site-nav ul {
    gap: 4px 20px;
  }

  .projects {
    padding-top: 28px;
    padding-bottom: 40px;
  }

  .project-group + .project-group {
    margin-top: 28px;
  }

  .project-row {
    margin-top: calc(12px - var(--shadow-room));
  }

  .project-card__title {
    margin-top: 10px;
  }
}

/* ==========================================================================
   Skills
   Icon tiles are 200 x 200 on the 1440 canvas. Everything in the icon row
   is sized in --t (one design pixel of the row), so the brackets, stems and
   labels keep their proportions when the tiles shrink.
   ========================================================================== */
.skills {
  max-width: var(--max-width);
  margin-inline: auto;
  padding: calc(var(--px) * 60) var(--gutter) calc(var(--px) * 40);
  text-align: center;
}

.skills__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: calc(var(--px) * 248);
  line-height: 1;
  color: var(--cream);
}

.skill-groups {
  --tile: calc(var(--px) * 200);
  --t: calc(var(--tile) / 200);
  --line: max(2px, calc(var(--t) * 4));

  display: flex;
  justify-content: center;
  gap: calc(var(--t) * 20);
  margin: calc(var(--px) * 134) 0 0;
  padding: 0;
  list-style: none;
}

.skill-group {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.skill-group__tools {
  position: relative;
  display: flex;
  gap: calc(var(--t) * 20);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Bracket: hugs the bottom of the group's tiles */
.skill-group__tools::after {
  content: "";
  position: absolute;
  left: calc(var(--t) * -7);
  right: calc(var(--t) * -7);
  top: calc(100% - var(--t) * 56);
  bottom: calc(var(--t) * -8);
  border: var(--line) solid var(--white);
  border-top: 0;
  border-radius: 0 0 calc(var(--t) * 36) calc(var(--t) * 36);
  pointer-events: none;
}

/* Stem from the bracket down to the label */
.skill-group__tools::before {
  content: "";
  position: absolute;
  top: calc(100% + var(--t) * 4);
  left: calc(50% - var(--line) / 2);
  width: var(--line);
  height: calc(var(--t) * 34);
  background: var(--white);
}

.skill-icon {
  display: grid;
  place-items: center;
  width: var(--tile);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: calc(var(--t) * 35);
}

.skill-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* width: 0 keeps wide labels ("Photoshoppen") from pushing the groups apart */
.skill-group__label {
  display: flex;
  justify-content: center;
  width: 0;
  margin: calc(var(--t) * 39) 0 0;
  font-family: var(--font-accent);
  font-size: max(15px, calc(var(--t) * 30));
  line-height: 1;
  color: var(--yellow);
  white-space: nowrap;
}

/* Phone: two rows of three tiles */
@media (max-width: 760px) {
  .skills {
    padding-top: 32px;
    padding-bottom: 64px;
  }

  .skills__title {
    /* "Skills" is ~3.12em wide: fill the available width */
    font-size: calc((100vw - 2 * var(--gutter)) / 3.2);
  }

  .skill-groups {
    --tile: min(140px, calc((100vw - 2 * var(--gutter)) / 3.25));

    flex-wrap: wrap;
    row-gap: 36px;
    /* exactly three tiles per row */
    max-width: calc(var(--tile) * 3.25);
    margin: 48px auto 0;
  }
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact {
  --icon: calc(var(--px) * 110);
  --icon-gap: calc(var(--px) * 49);

  /* No max-width here: the side padding below centres the layout by itself
     (100% = page width), also on screens wider than 1680px.
     (100% - 1440 design px) / 2 centres the layout when height limits the scale;
     same on both sides so the centred "Laten we in contact komen!" stays centred */
  --side: max(calc(var(--px) * 35), calc((100% - var(--px) * 1440) / 2 + var(--px) * 35));
  padding: calc(var(--px) * 115) var(--side) calc(var(--px) * 40);
}

.contact-list {
  display: grid;
  gap: calc(var(--px) * 65);
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-item {
  display: inline-flex;
  align-items: center;
  gap: var(--icon-gap);
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-item:hover {
  color: var(--yellow);
}

/* Inline SVG icons, drawn in currentColor */
.contact-item__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--icon);
  height: var(--icon);
  color: var(--yellow);
  /* line up with the middle of the lowercase letters, not the line box */
  transform: translateY(calc(var(--icon) * 0.08));
}

.contact-item__icon svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.contact-item__text {
  font-family: var(--font-display);
  font-size: calc(var(--px) * 90);
  line-height: 1.2;
}

.contact__cta {
  margin: calc(var(--px) * 105) 0 0;
  font-size: max(24px, calc(var(--px) * 48));
  font-weight: 700;
  line-height: 1.2;
  color: var(--yellow);
  text-align: center;
}

@media (max-width: 760px) {
  .contact {
    --icon: 36px;
    --icon-gap: 14px;

    padding: 48px var(--gutter) 64px;
  }

  .contact-list {
    gap: 28px;
  }

  .contact-item__text {
    /* size so "semsgraphic" fills the line; the e-mail wraps after the @ */
    font-size: calc((100vw - 2 * var(--gutter) - var(--icon) - var(--icon-gap)) / 7.4);
    line-height: 1.1;
  }

  .contact__cta {
    margin-top: 56px;
  }
}

/* ==========================================================================
   Over mij
   ========================================================================== */
.intro {
  position: relative;
  max-width: var(--max-width);
  margin-inline: auto;
  padding: calc(var(--px) * 37) 0 0;
}

.intro__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: calc(var(--px) * 200);
  line-height: 1;
  color: var(--cream);
  text-align: center;
}

/* Column widths reproduce the design's line breaks at every desktop width */
.intro__columns {
  display: grid;
  grid-template-columns: repeat(2, calc(var(--px) * 593));
  column-gap: calc(var(--px) * 58);
  margin-top: calc(var(--px) * 71);
  padding-left: calc(var(--px) * 116);
}

/* The text column holds an invisible float with the photo's outline, so the
   text wraps around the head. height: 0 keeps that float from stretching the row. */
.intro__text--photo {
  height: 0;
  /* in the design this column starts slightly higher than the left one */
  margin-top: calc(var(--px) * -8);
}

/* Pushes the outline below down. A margin-top on the outline would do the same in
   Chrome, but Safari ignores that margin when wrapping the text around the shape. */
.intro__text--photo::before {
  content: "";
  float: right;
  height: calc(var(--px) * 189);
}

/* Outline of the head (in % of the photo), tuned so the lines break like the design */
.intro__photo-shape {
  float: right;
  clear: right;
  width: calc(var(--px) * 686);
  aspect-ratio: 1055 / 1183;
  margin-right: calc(var(--px) * -68);
  shape-outside: polygon(100% 0.4%, 60% 0.4%, 53% 5%, 53% 6.2%, 43.5% 6.6%, 43.5% 10%, 47.4% 12%, 47.5% 14%, 47.8% 16%, 48% 18%, 49.1% 20%, 50.2% 22%, 51% 24%, 52.2% 26%, 52.7% 30%, 51.4% 34%, 100% 34%) border-box;
}

/* The photo itself hangs from the bottom of this section, so its straight bottom
   edge always lands under the white wave of the next section, whatever the text does */
.intro__photo {
  position: absolute;
  left: calc(var(--px) * 742);
  bottom: calc(var(--px) * -151);
  width: calc(var(--px) * 686);
}

.intro__photo img {
  position: relative; /* above the decorations */
  display: block;
  width: 100%;
  height: auto;
}

/* Exclamation marks and lines, drawn behind the photo */
.intro__deco {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.deco--navy   { color: #0049b6; }
.deco--purple { color: #8a38f5; }
.deco--yellow { color: var(--yellow); }
.deco--red    { color: var(--red); }

.deco__shape {
  fill: currentColor;
  stroke: currentColor;
  stroke-linejoin: round;
}

/* the lines are outlines that get thinner towards their ends */
.deco__fill {
  fill: currentColor;
}

.intro__text p,
.music__text p {
  margin: 0 0 1.1875em;
  font-size: max(18px, calc(var(--px) * 32));
  font-weight: 600;
  line-height: 1.1875;
}

.intro__text p:last-of-type,
.music__text p:last-child {
  margin-bottom: 0;
}

/* The page ends on the white music section: show white (not blue) below it on tall screens */
html:has(.music) {
  background: var(--white);
}

.music {
  position: relative;
  overflow: hidden;
  min-height: calc(var(--px) * 1153);
  padding-top: calc(var(--px) * 118);
  /* white starts below the wave band; the wave itself draws the white under the curve */
  background: linear-gradient(transparent calc(var(--px) * 184), var(--white) 0);
  color: #000;
}

.music__wave {
  position: absolute;
  top: 0;
  /* The design's 1440-wide curve lines up with the centred layout (like the photo);
     the path runs on smoothly 2000 units past both ends for very wide screens */
  left: calc(max(0px, (100% - var(--px) * 1440) / 2) - var(--px) * 2000);
  width: calc(var(--px) * 5440);
  height: calc(var(--px) * 185);
  fill: var(--white);
}

.music__text {
  position: relative;
  width: calc(var(--px) * 578);
  margin-left: max(calc(var(--px) * 116), calc((100% - var(--max-width)) / 2 + var(--px) * 116));
}

.music__title {
  margin: 0 0 calc(var(--px) * 29);
  font-family: var(--font-accent);
  font-weight: 400;
  font-size: calc(var(--px) * 68);
  line-height: 1.1;
}

.music__text a {
  text-decoration: none;
  transition: color 0.2s ease;
}

.music__text a:hover {
  color: var(--blue);
}

.music__text a:focus-visible {
  outline-color: var(--blue);
}

.music__vinyl {
  position: absolute;
  top: calc(var(--px) * 69);
  right: 0;
  width: calc(var(--px) * 575);
  height: calc(var(--px) * 1150);
}

.vinyl__rim   { fill: #d9d9d9; }
.vinyl__disc  { fill: #161616; }
.vinyl__label { fill: #604a99; }
.vinyl__hole  { fill: #d9d9d9; }

.vinyl__grooves {
  fill: none;
  stroke: #202020;
  stroke-width: 7;
  stroke-linecap: round;
}

.music__vinyl .arc {
  stroke-width: 10;
  stroke-linecap: round;
}

.arc--blue { stroke: var(--blue); }
.arc--red  { stroke: var(--red); }

@media (max-width: 760px) {
  .intro {
    padding: 24px var(--gutter) 40px;
  }

  .intro__title {
    /* "Wie ben ik?" is ~6.3em wide: fill the available width */
    font-size: calc((100vw - 2 * var(--gutter)) / 6.4);
  }

  .intro__columns {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 1.3em;
    margin-top: 32px;
    padding-left: 0;
  }

  .intro__text p,
  .music__text p {
    font-size: 19px;
    line-height: 1.35;
    margin-bottom: 1.3em;
  }

  /* Photo below the text, bleeding off the right edge; its straight bottom
     edge tucks under the white wave of the music section */
  .intro__text--photo {
    height: auto;
    margin-top: 0;
  }

  .intro__text--photo::before,
  .intro__photo-shape {
    display: none;
  }

  .intro__photo {
    /* back in the flow (relative, so the decorations stay attached to it) */
    position: relative;
    left: auto;
    bottom: auto;
    display: block;
    width: min(85vw, 420px);
    /* intro bottom padding + the full wave band, so the bottom edge is always under white */
    margin: 24px calc(-1 * var(--gutter)) calc(-40px - var(--px) * 185) auto;
  }

  .music {
    min-height: 0;
    padding-top: 64px;
  }

  .music__text {
    width: auto;
    margin: 0;
    padding-inline: var(--gutter);
  }

  .music__title {
    margin-bottom: 20px;
    font-size: clamp(32px, 10vw, 44px);
  }

  .music__text a {
    overflow-wrap: anywhere;
  }

  .music__vinyl {
    position: relative;
    top: 0;
    display: block;
    width: min(60vw, 300px);
    height: auto;
    aspect-ratio: 575 / 1150;
    margin: 24px 0 0 auto;
  }
}

/* ==========================================================================
   Project pages: shared title and text
   --title-size (optional, set on the title) is its size in design px.
   --title-em is how many em its widest word is: on phones the title is
   sized so that word fills the screen width.
   ========================================================================== */
.project-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: calc(var(--px) * var(--title-size, 135));
  line-height: 1.125;
}

.project-text h2,
.project-text p {
  margin: 0;
  font-size: max(18px, calc(var(--px) * 40));
  font-weight: 600;
  line-height: 1.2;
}

/* one empty line between paragraphs, and below a heading */
.project-text h2 + p,
.project-text p + p {
  margin-top: 1.2em;
}

/* YouTube video (markup from js/youtube-video.js) */
youtube-video {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}

youtube-video[vertical] {
  aspect-ratio: 9 / 16;
}

youtube-video iframe,
.youtube-video__cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.youtube-video__cover {
  padding: 0;
  background: none;
  cursor: pointer;
}

youtube-video .youtube-video__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.youtube-video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(56px, calc(var(--px) * 88));
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 3px 14px rgb(0 15 80 / 0.6);
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease;
}

/* Play triangle, nudged right so it looks centred */
.youtube-video__play::after {
  content: "";
  position: absolute;
  inset: 30% 26% 30% 38%;
  background: var(--blue);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.youtube-video__cover:hover .youtube-video__play {
  transform: translate(-50%, -50%) scale(1.08);
}

.youtube-video__cover:focus-visible {
  outline-offset: -6px;
}

.project-placeholder {
  display: grid;
  place-items: center;
  aspect-ratio: var(--ratio, 1191 / 842);
  background: repeating-conic-gradient(#e9e9e9 0 25%, #fbfbfb 0 50%) 50% 50% / max(24px, calc(var(--px) * 65.25)) max(24px, calc(var(--px) * 65.25));
  color: #6b6b6b;
  font-size: max(16px, calc(var(--px) * 28));
  font-weight: 600;
}

@media (max-width: 760px) {
  .project-title {
    /* up to a point, for wide phones */
    font-size: min(120px, calc((100vw - 2 * var(--gutter)) / var(--title-em, 4)));
  }

  .project-text h2,
  .project-text p {
    font-size: 19px;
    line-height: 1.35;
  }

  .project-text h2 + p,
  .project-text p + p {
    margin-top: 1.35em;
  }
}

/* ==========================================================================
   Project: Gielijn Escher — title + text on the left, the poster on the right
   --u is one design pixel of the visual, so the lines around it keep their
   place when the visual changes size (on phones it is sized to the screen).
   ========================================================================== */
.project-intro {
  display: grid;
  grid-template-columns: calc(var(--px) * 540) calc(var(--px) * 657);
  column-gap: calc(var(--px) * 48.5);
  align-items: center;
  width: calc(var(--px) * 1440);
  margin-inline: auto;
  padding: calc(var(--px) * 53.4) 0 calc(var(--px) * 34.7) calc(var(--px) * 107.5);
}

/* Width reproduces the design's line breaks */
.project-intro__text p {
  max-width: calc(var(--px) * 452);
  margin: calc(var(--px) * 41) 0 0 calc(var(--px) * 9);
}

.project-intro__visual {
  --u: var(--px);

  position: relative;
  margin: 0;
}

.project-intro__visual img {
  display: block;
  width: 100%;
  height: auto;
}

/* Purple corner top left, red corner bottom right, yellow line along the bottom */
.project-intro__visual--escher::before,
.project-intro__visual--escher::after,
.project-intro__line {
  content: "";
  position: absolute;
  pointer-events: none;
}

.project-intro__visual--escher::before {
  left: calc(var(--u) * -11.5);
  top: calc(var(--u) * -12.5);
  width: calc(var(--u) * 140.5);
  height: calc(var(--u) * 125);
  border-top: calc(var(--u) * 7) solid #8a38f5;
  border-left: calc(var(--u) * 7) solid #8a38f5;
}

.project-intro__visual--escher::after {
  right: calc(var(--u) * -15.5);
  bottom: calc(var(--u) * -14.2);
  width: calc(var(--u) * 45);
  height: calc(var(--u) * 157.5);
  border-right: calc(var(--u) * 7) solid var(--red);
  border-bottom: calc(var(--u) * 7) solid var(--red);
}

.project-intro__line {
  left: calc(var(--u) * 58);
  bottom: calc(var(--u) * -14.2);
  width: calc(var(--u) * 221);
  height: calc(var(--u) * 7);
  background: var(--yellow);
}

/* Phone: title, text and the poster stacked */
@media (max-width: 760px) {
  .project-intro {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 40px;
    width: auto;
    padding: 24px var(--gutter) 64px;
  }

  .project-intro__text p {
    max-width: 560px;
    margin: 20px 0 0;
  }

  .project-intro__visual {
    --u: min(460px / 657, (100vw - 2 * var(--gutter)) / 657);

    width: calc(var(--u) * 657);
  }
}

/* ==========================================================================
   Project: Sharity — title, two text columns, then the logo and the
   huisstijl (business cards + envelope) next to the letterhead
   ========================================================================== */
.sharity {
  width: calc(var(--px) * 1440);
  margin-inline: auto;
  padding: calc(var(--px) * 115) 0 calc(var(--px) * 145);
}

.sharity__title {
  padding-left: calc(var(--px) * 122);
}

/* Column width reproduces the design's line breaks in both columns */
.sharity__text {
  display: grid;
  grid-template-columns: repeat(2, calc(var(--px) * 556));
  column-gap: calc(var(--px) * 60);
  margin-top: calc(var(--px) * 66);
  padding-left: calc(var(--px) * 131);
}

.sharity__media {
  display: grid;
  grid-template-columns: calc(var(--px) * 662) calc(var(--px) * 595);
  column-gap: calc(var(--px) * 43);
  margin-top: calc(var(--px) * 59);
  padding-inline: calc(var(--px) * 70);
}

.sharity__media img {
  display: block;
  width: 100%;
  height: auto;
}

/* Logo at the top, huisstijl at the bottom: lines up with the letterhead's edges */
.sharity__stack {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sharity__media .sharity__logo {
  width: calc(var(--px) * 600);
  margin: calc(var(--px) * 1) 0 0 calc(var(--px) * 22);
}

/* Phone: everything stacked: logo, huisstijl, letterhead */
@media (max-width: 760px) {
  .sharity {
    width: auto;
    padding: 24px var(--gutter) 64px;
  }

  .sharity__title {
    padding-left: 0;
  }

  .sharity__text {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 1.35em;
    max-width: 560px;
    margin-top: 20px;
    padding-left: 0;
    font-size: 19px;
  }

  .sharity__media {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 24px;
    max-width: 460px;
    margin-top: 40px;
    padding-inline: 0;
  }

  .sharity__stack {
    gap: 24px;
  }

  .sharity__media .sharity__logo {
    width: 100%;
    margin: 0;
  }
}

/* ==========================================================================
   Project: Sem-Cam — title + text with the monogram next to it, then the
   two magazine spreads
   ========================================================================== */
.sem-cam {
  width: calc(var(--px) * 1440);
  margin-inline: auto;
  padding: calc(var(--px) * 87) 0 calc(var(--px) * 243);
}

.sem-cam__intro {
  display: grid;
  grid-template-columns: calc(var(--px) * 720) calc(var(--px) * 477);
  column-gap: calc(var(--px) * 33.4);
  align-items: start;
  padding-left: calc(var(--px) * 125.6);
}

/* Width reproduces the design's line breaks */
.sem-cam__text p {
  max-width: calc(var(--px) * 585);
  margin-left: calc(var(--px) * 8);
}

.sem-cam__text .project-title + p {
  margin-top: calc(var(--px) * 30);
}

.sem-cam__logo {
  display: block;
  width: 100%;
  height: auto;
  margin-top: calc(var(--px) * 102.6);
}

.sem-cam__spreads {
  display: grid;
  justify-items: center;
  row-gap: calc(var(--px) * 181);
  margin-top: calc(var(--px) * 111.4);
}

.sem-cam__spreads img {
  display: block;
  width: calc(var(--px) * 1191);
  height: auto;
}

/* Phone: title, text, monogram, then the spreads stacked */
@media (max-width: 760px) {
  .sem-cam {
    width: auto;
    padding: 24px var(--gutter) 64px;
  }

  .sem-cam__intro {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 40px;
    padding-left: 0;
  }

  .sem-cam__text p {
    max-width: 560px;
    margin-left: 0;
  }

  .sem-cam__text .project-title + p {
    margin-top: 20px;
  }

  .sem-cam__logo {
    width: min(240px, 60%);
    margin-top: 0;
  }

  .sem-cam__spreads {
    row-gap: 24px;
    margin-top: 40px;
  }

  .sem-cam__spreads img {
    width: 100%;
  }
}

/* ==========================================================================
   Project: One World — title, text with the logo next to it, then the
   cover and the two spreads, each with a caption below it
   ========================================================================== */
.oneworld {
  width: calc(var(--px) * 1440);
  margin-inline: auto;
  padding: calc(var(--px) * 62.3) 0 calc(var(--px) * 98.4);
}

.oneworld__title {
  padding-left: calc(var(--px) * 120.7);
}

/* Text column width reproduces the design's line breaks */
.oneworld__intro {
  display: grid;
  grid-template-columns: calc(var(--px) * 526) calc(var(--px) * 608);
  column-gap: calc(var(--px) * 84.7);
  align-items: start;
  margin-top: calc(var(--px) * 24.8);
  padding-left: calc(var(--px) * 128.3);
}

.oneworld__logo {
  display: block;
  width: 100%;
  height: auto;
  margin-top: calc(var(--px) * 37.4);
}

.oneworld__pieces {
  margin-top: calc(var(--px) * 83.4);
  padding-left: calc(var(--px) * 125);
}

.oneworld__piece {
  margin: 0;
}

.oneworld__piece + .oneworld__piece {
  margin-top: calc(var(--px) * 8.4);
}

.oneworld__piece img {
  display: block;
  width: calc(var(--px) * 1191);
  height: auto;
}

/* Width reproduces the design's line breaks in all three captions */
.oneworld__piece figcaption {
  max-width: calc(var(--px) * 1183);
  margin-top: calc(var(--px) * 55.6);
}

/* Phone: everything stacked */
@media (max-width: 760px) {
  .oneworld {
    width: auto;
    padding: 24px var(--gutter) 64px;
  }

  .oneworld__title {
    padding-left: 0;
  }

  .oneworld__intro {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 40px;
    max-width: 560px;
    margin-top: 20px;
    padding-left: 0;
  }

  .oneworld__logo {
    width: min(300px, 80%);
    margin-top: 0;
  }

  .oneworld__pieces {
    margin-top: 48px;
    padding-left: 0;
  }

  .oneworld__piece + .oneworld__piece {
    margin-top: 48px;
  }

  .oneworld__piece img {
    width: 100%;
  }

  .oneworld__piece figcaption {
    max-width: 560px;
    margin-top: 20px;
  }
}

/* ==========================================================================
   Project: Foodcourt — title + text with the title card, then the steps:
   wide images with a caption below, sketches with the text beside them.
   The spacing differs per step in the design, so each step sets its own
   values (in design px) inline: --gap above the step; side steps also set
   --text-x (space between sketch and text) and --text-y (where the text
   starts, measured from the top of the sketch).
   ========================================================================== */
.foodcourt {
  width: calc(var(--px) * 1440);
  margin-inline: auto;
  padding: calc(var(--px) * 123.8) calc(var(--px) * 80) calc(var(--px) * 60.4);
}

.foodcourt__title {
  padding-left: calc(var(--px) * 42.3);
}

/* Text column width reproduces the design's line breaks */
.foodcourt__intro {
  display: grid;
  grid-template-columns: calc(var(--px) * 590) calc(var(--px) * 522);
  column-gap: calc(var(--px) * 65.7);
  align-items: start;
  margin-top: calc(var(--px) * 78.3);
  padding-left: calc(var(--px) * 51.3);
}

.foodcourt__card {
  display: block;
  width: 100%;
  height: auto;
  margin-top: calc(var(--px) * 32.4);
}

.foodcourt__step {
  margin: calc(var(--px) * var(--gap)) 0 0;
}

.foodcourt__step img {
  display: block;
  width: 100%;
  height: auto;
}

/* Captions under the wide images are as wide as the image */
.foodcourt__step figcaption {
  margin-top: calc(var(--px) * 96.6);
}

/* The text column ends where the wide images end */
.foodcourt__step--side {
  display: grid;
  grid-template-columns: calc(var(--px) * 657) minmax(0, 1fr);
  column-gap: calc(var(--px) * var(--text-x));
  align-items: start;
}

.foodcourt__step--side figcaption {
  margin-top: calc(var(--px) * var(--text-y));
}

/* Phone: everything stacked, captions below their image */
@media (max-width: 760px) {
  .foodcourt {
    width: auto;
    padding: 24px var(--gutter) 64px;
  }

  .foodcourt__title {
    padding-left: 0;
  }

  .foodcourt__intro {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 40px;
    max-width: 560px;
    margin-top: 20px;
    padding-left: 0;
  }

  .foodcourt__card {
    margin-top: 0;
  }

  .foodcourt__step {
    margin-top: 48px;
  }

  .foodcourt__step figcaption,
  .foodcourt__step--side figcaption {
    max-width: 560px;
    margin-top: 20px;
  }

  .foodcourt__step--side {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================
   Project: Festival stijl — sections with text beside an image, and rows of
   three slides with a caption below. Everything sits in one 1202-wide box
   (x 120-1322 on the 1440 canvas).
   The spacing differs per section in the design, so each section sets its
   own values (in design px) inline: --gap above the section, and --media-y
   (where the image starts, measured from the top of the text; the default
   lines it up with the paragraph under the heading).
   ========================================================================== */
.festival {
  width: calc(var(--px) * 1440);
  margin-inline: auto;
  padding: calc(var(--px) * 123.8) calc(var(--px) * 118) calc(var(--px) * 144.4) calc(var(--px) * 120);
}

.festival__title {
  padding-left: calc(var(--px) * 1.3);
}

.festival__section {
  margin: calc(var(--px) * var(--gap)) 0 0;
}

.festival img {
  display: block;
  width: 100%;
  height: auto;
}

/* Text column width reproduces the design's line breaks */
.festival__split {
  display: grid;
  grid-template-columns: calc(var(--px) * 592.75) calc(var(--px) * 522);
  column-gap: calc(var(--px) * 86.75);
  align-items: start;
  padding-left: calc(var(--px) * 0.5);
}

.festival__split--media-left {
  grid-template-columns: calc(var(--px) * 522) calc(var(--px) * 592.75);
  column-gap: calc(var(--px) * 76);
  padding-left: 0;
}

.festival__split--media-left .festival__media {
  grid-row: 1;
  grid-column: 1;
}

.festival__split--media-left .festival__text {
  grid-column: 2;
}

.festival__media {
  display: grid;
  row-gap: calc(var(--px) * 159);
  margin-top: calc(var(--px) * var(--media-y, 100.4));
}

.festival__row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: calc(var(--px) * 9);
}

/* The Short is as tall as its text and sits at the side next to it */
.festival__short {
  justify-self: end;
  width: calc(var(--px) * 270);
}

/* Caption width reproduces the design's line breaks */
.festival__set figcaption {
  max-width: calc(var(--px) * 1197.5);
  margin-top: calc(var(--px) * 71.6);
  padding-left: calc(var(--px) * 0.5);
}

/* Phone: everything stacked, text above its images */
@media (max-width: 760px) {
  .festival {
    width: auto;
    padding: 24px var(--gutter) 64px;
  }

  .festival__title {
    padding-left: 0;
  }

  .festival__section {
    margin-top: 48px;
  }

  .festival__title + .festival__section {
    margin-top: 20px;
  }

  .festival__split,
  .festival__split--media-left {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 24px;
    padding-left: 0;
  }

  .festival__split--media-left .festival__media,
  .festival__split--media-left .festival__text {
    grid-row: auto;
    grid-column: auto;
  }

  .festival__text {
    max-width: 560px;
  }

  .festival__media,
  .festival__row {
    row-gap: 16px;
    max-width: 460px;
    margin-top: 0;
  }

  .festival__row {
    grid-template-columns: minmax(0, 1fr);
  }

  .festival__set figcaption {
    max-width: 560px;
    margin-top: 20px;
    padding-left: 0;
  }

  .festival__short {
    justify-self: start;
    width: min(270px, 70%);
  }
}

/* ==========================================================================
   Project: MBElektro Beveiliging — two columns: intro + logo, then each
   sticker next to its text. The design's columns overlap a little: the
   "MB Elektro sticker" text runs one line past the top of the next row,
   so its bottom margin is minus one line.
   ========================================================================== */
.mb-elektro {
  width: calc(var(--px) * 1440);
  margin-inline: auto;
  padding: calc(var(--px) * 71.3) 0 calc(var(--px) * 117.4) calc(var(--px) * 113);
}

.mb-elektro__title {
  padding-left: calc(var(--px) * 15.3);
}

.mb-elektro__grid {
  display: grid;
  grid-template-columns: calc(var(--px) * 666.6) calc(var(--px) * 588.4);
  align-items: start;
  margin-top: calc(var(--px) * 149.9);
}

.mb-elektro img {
  display: block;
  width: 100%;
  height: auto;
}

/* Text widths reproduce the design's line breaks */
.mb-elektro__intro {
  max-width: calc(var(--px) * 644.6);
  padding-left: calc(var(--px) * 24.6);
}

.mb-elektro .mb-elektro__logo {
  width: calc(var(--px) * 534);
  margin-left: calc(var(--px) * 14.4);
}

.mb-elektro__text--elektro {
  grid-row: 2;
  grid-column: 2;
  max-width: calc(var(--px) * 562.5);
  margin: calc(var(--px) * 46) 0 calc(var(--px) * -48);
}

.mb-elektro .mb-elektro__sticker {
  grid-row: 2;
  grid-column: 1;
  width: calc(var(--px) * 625);
  margin-top: calc(var(--px) * 66.4);
}

.mb-elektro__text--beveiliging {
  max-width: calc(var(--px) * 608.3);
  padding-left: calc(var(--px) * 11.6);
}

/* The sticker file has empty space on its right and bottom: show only the sticker */
.mb-elektro__crop {
  width: calc(var(--px) * 567);
  aspect-ratio: 1064 / 591;
  overflow: hidden;
  margin: calc(var(--px) * 95.4) 0 0 calc(var(--px) * 14.4);
}

.mb-elektro .mb-elektro__crop img {
  width: calc(100% * 1156 / 1064);
  max-width: none;
}

/* Phone: stacked, each sticker below its text */
@media (max-width: 760px) {
  .mb-elektro {
    width: auto;
    padding: 24px var(--gutter) 64px;
  }

  .mb-elektro__title {
    padding-left: 0;
  }

  .mb-elektro__grid {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 24px;
    margin-top: 20px;
  }

  .mb-elektro__intro,
  .mb-elektro__text--elektro,
  .mb-elektro__text--beveiliging {
    grid-row: auto;
    grid-column: auto;
    max-width: 560px;
    margin: 0;
    padding-left: 0;
  }

  .mb-elektro__text {
    margin-top: 24px;
  }

  .mb-elektro .mb-elektro__logo {
    width: min(300px, 80%);
    margin: 0;
  }

  .mb-elektro .mb-elektro__sticker {
    grid-row: auto;
    grid-column: auto;
    width: 100%;
    max-width: 460px;
    margin: 0;
  }

  .mb-elektro__crop {
    width: 100%;
    max-width: 460px;
    margin: 0;
  }
}

/* ==========================================================================
   Project: Posters — centred title, a row of three posters with a caption
   below, then text beside a poster
   ========================================================================== */
.posters {
  width: calc(var(--px) * 1440);
  margin-inline: auto;
  padding: calc(var(--px) * 44.4) calc(var(--px) * 118) calc(var(--px) * 123) calc(var(--px) * 106.5);
}

/* Centred on the whole page, not just the content box */
.posters__title {
  margin-inline: calc(var(--px) * -106.5) calc(var(--px) * -118);
  text-align: center;
}

.posters__set {
  margin: calc(var(--px) * 89) 0 0;
}

.posters__row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: calc(var(--px) * 72);
  padding-left: calc(var(--px) * 12.5);
}

/* Text widths reproduce the design's line breaks (this one runs past the posters) */
.posters__set figcaption {
  width: calc(var(--px) * 1288);
  margin-top: calc(var(--px) * 29.6);
}

.posters__split {
  display: grid;
  grid-template-columns: calc(var(--px) * 571) calc(var(--px) * 617);
  column-gap: calc(var(--px) * 27.5);
  align-items: start;
  margin-top: calc(var(--px) * 93);
}

.posters__row img,
.posters__poster {
  display: block;
  width: 100%;
  height: auto;
}

/* Phone: everything stacked, the poster below its text */
@media (max-width: 760px) {
  .posters {
    width: auto;
    padding: 24px var(--gutter) 64px;
  }

  .posters__title {
    margin-inline: 0;
  }

  .posters__set {
    margin-top: 20px;
  }

  .posters__row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 16px;
    max-width: 300px;
    padding-left: 0;
  }

  .posters__set figcaption {
    width: auto;
    max-width: 560px;
    margin-top: 20px;
  }

  .posters__split {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 24px;
    max-width: 560px;
    margin-top: 48px;
  }

  .posters__poster {
    max-width: 400px;
  }
}
