/* =========================================================================
   Kevin Verkruijsse - personal site
   Plain CSS. No build step. No third-party resources. CSP-clean.
   Rebrand by editing the tokens in :root (and the dark-mode block).
   ========================================================================= */

/* ----------------------------------------------------------------------- *
   Self-hosted fonts (optional upgrade).
   The site is fully functional with the system fallbacks below. To use the
   intended typography, download the OFL font files and drop them into
   /assets/fonts/ (see README.md). Until then the @font-face simply falls
   back. All sources are same-origin; nothing is fetched from a CDN.
 * ----------------------------------------------------------------------- */
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/Fraunces-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ----------------------------------------------------------------------- *
   Design tokens
 * ----------------------------------------------------------------------- */
:root {
  color-scheme: light dark;

  /* Palette (light) */
  --paper:   #F6F5F1;
  --paper-2: #EFEDE6;
  --ink:     #0E0E0E;
  --muted:   #57534B;
  --accent:  #C0552F;
  --on-accent: #FFFFFF; /* text/icon color that sits on an accent fill (AA-safe both modes) */
  --line:    rgba(14, 14, 14, 0.14);
  --ring:    var(--accent);

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Fluid type scale */
  --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.92rem);
  --step-0:  clamp(1rem, 0.95rem + 0.25vw, 1.15rem);
  --step-1:  clamp(1.25rem, 1.15rem + 0.5vw, 1.6rem);
  --step-2:  clamp(1.6rem, 1.4rem + 1vw, 2.4rem);
  --step-3:  clamp(2rem, 1.6rem + 2vw, 3.4rem);
  --hero:    clamp(2.75rem, 1.6rem + 5.2vw, 6.5rem);

  /* Spacing & layout */
  --gutter: clamp(1.25rem, 0.8rem + 2.2vw, 3rem);
  --section-y: clamp(4rem, 2.5rem + 7vw, 9rem);
  --maxw: 1180px;
  --radius: 4px;

  --speed: 0.7s;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:   #0E0E0E;
    --paper-2: #17150F;
    --ink:     #EDEBE6;
    --muted:   #A8A299;
    --accent:  #D9744B;
    --on-accent: #0E0E0E; /* dark ink reads on the lighter dark-mode accent (6:1) */
    --line:    rgba(237, 235, 230, 0.16);
  }
}

/* ----------------------------------------------------------------------- *
   Reset / base
 * ----------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--accent); color: var(--paper); }

/* ----------------------------------------------------------------------- *
   Helpers
 * ----------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.microlabel {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.skip-link {
  position: absolute;
  left: 0; top: 0;
  transform: translateY(-120%);
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  z-index: 1000;
  transition: transform 0.2s ease;
}
.skip-link:focus {
  transform: translateY(0);
}

.dot { color: var(--accent); }

/* ----------------------------------------------------------------------- *
   Header / nav
 * ----------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0.9rem var(--gutter);
}

.nav__brand {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.nav__menu {
  display: flex;
  gap: clamp(1rem, 0.5rem + 1.5vw, 2.25rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: lowercase;
  text-decoration: none;
  letter-spacing: 0.02em;
  padding-block: 0.25rem;
  position: relative;
  color: var(--muted);
  transition: color 0.2s ease;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav__link:hover,
.nav__link:focus-visible { color: var(--ink); }
.nav__link:hover::after { transform: scaleX(1); }

.nav__toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: lowercase;
  color: var(--ink);
}
.nav__toggle-icon {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  width: 18px;
}
.nav__toggle-bar {
  display: block;
  height: 1.5px;
  width: 100%;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) { transform: translateY(2.75px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) { transform: translateY(-2.75px) rotate(-45deg); }

/* Right-hand cluster: menu + language switch + mobile toggle */
.nav__cluster {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 0.5rem + 1.5vw, 2.25rem);
}

/* Language switch (only meaningful with JS; hidden otherwise) */
.lang-switch { display: none; align-items: center; gap: 0.1rem; }
html.js .lang-switch { display: inline-flex; }
.lang-switch__btn {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: none;
  border: none;
  padding: 0.3rem 0.4rem;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.2s ease;
}
.lang-switch__btn:hover,
.lang-switch__btn[aria-pressed="true"] { color: var(--ink); }
.lang-switch__sep { color: var(--line); font-family: var(--font-mono); font-size: var(--step--1); }

/* Internationalisation: show only the active language. Default markup is
   Dutch-visible (html[lang="nl"]) so the site reads correctly with JS off. */
html[data-lang="nl"] [lang="en"],
html[data-lang="en"] [lang="nl"] { display: none; }

/* ----------------------------------------------------------------------- *
   Sections
 * ----------------------------------------------------------------------- */
.section { padding-block: var(--section-y); }
.section + .section { border-top: 1px solid var(--line); }

.section__head {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: clamp(2rem, 1rem + 3vw, 3.5rem);
}
.section__title {
  font-family: var(--font-display);
  font-weight: 460;
  font-size: var(--step-3);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* Large display text must wrap rather than overflow the viewport. */
.hero__headline,
.section__title,
.statement__lead,
.contact__lead { overflow-wrap: break-word; }

/* ----------------------------------------------------------------------- *
   Hero
 * ----------------------------------------------------------------------- */
.hero { padding-top: clamp(3rem, 1.5rem + 6vw, 7rem); padding-bottom: 0; }

.hero .container > .microlabel { margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.5rem); }

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 1rem + 4vw, 4rem);
  align-items: end;
}

.hero__headline {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: var(--hero);
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.hero__intro {
  font-size: var(--step-1);
  color: var(--muted);
  max-width: 46ch;
  text-wrap: pretty;
  margin-bottom: 2rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero__portrait {
  max-width: 340px;
  width: 100%;
}
.hero__portrait img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  filter: grayscale(1) contrast(1.02);
}
.hero__portrait figcaption {
  margin-top: 0.6rem;
  font-size: 0.72rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: lowercase;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn__ext { font-size: 0.85em; }

/* ----------------------------------------------------------------------- *
   Marquee
 * ----------------------------------------------------------------------- */
.marquee {
  margin-top: clamp(3rem, 2rem + 4vw, 6rem);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding-block: 1.1rem;
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 55s linear infinite;
}
.marquee__group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-right: 1.5rem;
  white-space: nowrap;
}
.marquee__item {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 420;
  letter-spacing: -0.01em;
}
.marquee__sep { color: var(--accent); font-family: var(--font-mono); }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ----------------------------------------------------------------------- *
   What I do - cards
 * ----------------------------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  margin: 0;
  padding: 0;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.card__index { color: var(--accent); }
.card__title {
  font-family: var(--font-display);
  font-weight: 460;
  font-size: var(--step-1);
  line-height: 1.15;
}
.card__body { color: var(--muted); }

/* ----------------------------------------------------------------------- *
   Vision - statement
 * ----------------------------------------------------------------------- */
.section--statement { background: var(--paper-2); }
.statement__lead {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: var(--step-3);
  line-height: 1.1;
  letter-spacing: -0.015em;
  max-width: 18ch;
  text-wrap: balance;
  margin-bottom: 1.75rem;
}
.statement__body {
  font-size: var(--step-1);
  color: var(--muted);
  max-width: 58ch;
  text-wrap: pretty;
}

/* ----------------------------------------------------------------------- *
   Experience - timeline
 * ----------------------------------------------------------------------- */
.timeline { display: flex; flex-direction: column; margin: 0; padding: 0; }
.timeline__item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem 2rem;
  padding-block: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
  border-top: 1px solid var(--line);
}
.timeline__item:last-child { border-bottom: 1px solid var(--line); }
.timeline__years { padding-top: 0.35rem; }
.timeline__role {
  font-family: var(--font-display);
  font-weight: 460;
  font-size: var(--step-1);
  line-height: 1.2;
}
.timeline__company { color: var(--muted); font-weight: 420; }
.timeline__note { color: var(--muted); margin-top: 0.4rem; }

/* ----------------------------------------------------------------------- *
   Contact
 * ----------------------------------------------------------------------- */
.section--contact { background: var(--paper-2); }
.contact__lead {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: var(--step-2);
  line-height: 1.15;
  max-width: 20ch;
  text-wrap: balance;
  margin-bottom: clamp(2rem, 1rem + 3vw, 3rem);
}
.contact__links { display: flex; flex-direction: column; gap: 1.25rem; margin: 0; padding: 0; }
.contact__links li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.contact__key { align-self: center; }
.contact__value {
  font-family: var(--font-display);
  font-size: var(--step-1);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: border-color 0.2s ease;
}
.contact__value:hover { border-bottom-color: var(--accent); }

/* ----------------------------------------------------------------------- *
   Footer
 * ----------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding-block: clamp(2.5rem, 1.5rem + 3vw, 4rem); }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
}
.site-footer a { text-decoration: none; border-bottom: 1px solid var(--line); }
.site-footer a:hover { border-bottom-color: var(--accent); }

/* ----------------------------------------------------------------------- *
   Scroll reveal (progressive enhancement)
   Hidden only when JS is active (html.js). With JS off, everything shows.
 * ----------------------------------------------------------------------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--speed) ease, transform var(--speed) ease;
  will-change: opacity, transform;
}
html.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ----------------------------------------------------------------------- *
   Responsive
 * ----------------------------------------------------------------------- */
@media (min-width: 721px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.9fr);
  }
  .timeline__item {
    grid-template-columns: minmax(140px, 0.4fr) minmax(0, 1.6fr);
  }
  .contact__links li {
    grid-template-columns: minmax(120px, 0.3fr) minmax(0, 1.7fr);
    align-items: baseline;
  }
}

@media (max-width: 720px) {
  .nav__toggle { display: inline-flex; }

  html.js .nav__menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gutter) 1.25rem;
  }
  html.js .nav__menu:not(.is-open) { display: none; }
  html.js .nav__menu .nav__link { display: block; padding-block: 0.85rem; font-size: var(--step-0); }
}

/* ----------------------------------------------------------------------- *
   Reduced motion - disable all non-essential motion
 * ----------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .marquee__track { animation: none; transform: none; }
  html.js [data-reveal] { opacity: 1; transform: none; }
}
