/* ==========================================================================
   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;
  --placeholder: #d9d9d9;

  --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;
  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;
}

.about__placeholder {
  fill: var(--placeholder);
}

.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: 400;
  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;
}

/* ==========================================================================
   Site nav (subpages)
   ========================================================================== */
.site-header {
  padding: calc(var(--px) * 48) 20px 0;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px calc(var(--px) * 50);
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-accent);
  font-size: max(20px, calc(var(--px) * 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));
  --row-pad: max(20px, calc(var(--px) * 114));
  --title-pad: max(20px, calc(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;
}

@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) * 120);
  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;
}

/* Shown until the real icon image is added */
.skill-icon__placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 8px;
  background: rgb(255 255 255 / 0.14);
  border-radius: inherit;
  font-size: max(13px, calc(var(--t) * 22));
  font-weight: 600;
  line-height: 1.1;
}

/* 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;
  }
}
