/* ================================
   Kleuren
==================================*/
:root {
  --bg: #ffffff;
  --bg-elev: #111418;
  --text: #e6e6e6;
  --muted: #a3a9b6;
  --brand: #6ee7b7;
  --brand-2: #7dd3fc;
  --card: #0f1216;
  --border: #1b2027;
}
:root.light {
  --bg: #f8fafc;
  --bg-elev: #ffffff;
  --text: #005553;
  --muted: #475569;
  --brand: #0ea5e9;
  --brand-2: #10b981;
  --card: #ffffff;
  --border: #e2e8f0;
}

/* ================================
   Basislayout
==================================*/
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Inter, Roboto, Helvetica, Arial;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ================================
   Header / nav (desktop)
==================================*/
.site-header {
  position: sticky; top: 0; z-index: 3000;
  backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 100px; }
.brand { display: flex; align-items: center; gap: 20px; font-weight: 700; }
.dot {
  width: 75px; height: 75px; border-radius: 0; display: inline-block; margin-right: .5rem; vertical-align: middle;
  box-shadow: none;
  background: url("/img/MB.svg") center/contain no-repeat;
}
nav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
nav a { opacity: .9; padding: 8px 10px; border-radius: 10px; }
nav a:hover, nav a.active { background: var(--bg-elev); }

/* ================================
   Hero
==================================*/
.kicker { color: var(--muted); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); line-height: 1.1; margin: 10px 0 14px; }
.accent { background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.subtitle { font-size: 1.1rem; color: var(--muted); }
.hero { padding: 72px 0 32px; }
.hero-cta { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }

/* Typewriter cursor */
#heroTitle { position: relative; min-height: 1em; white-space: pre-wrap; }
#heroTitle::after {
  content: '|'; display: inline-block; margin-left: 2px;
  animation: blink 1s step-start 3, hideCursor 0s linear 3s forwards; opacity: 0.8;
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes hideCursor { to { opacity: 0; content: ''; } }
#heroTitle .accent { background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }

/* ================================
   Knoppen
==================================*/
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #ffffff; border: 0; padding: 10px 14px; border-radius: 12px; font-weight: 600; cursor: pointer;
  box-shadow: 0 6px 20px color-mix(in oklab, var(--brand) 35%, transparent);
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.theme-toggle { border: 1px solid var(--border); background: var(--bg-elev); padding: 8px 10px; border-radius: 12px; cursor: pointer; }

/* ================================
   Secties / kaarten
==================================*/
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.card {
  grid-column: span 6; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px color-mix(in oklab, var(--brand) 18%, transparent); }
.card > img { width: 100%; border-radius: 12px; border: 1px solid var(--border); aspect-ratio: 16/9; object-fit: cover; }
.card h3 { margin: 12px 0 6px; font-size: 1.1rem; }
.site-footer { padding: 28px 0 48px; color: var(--muted); border-top: 1px solid var(--border); margin-top: 32px; }

/* ================================
   Over mij
==================================*/
.about { padding-block: clamp(2rem, 5vw, 4rem); }
.about-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(1.25rem, 3vw, 3rem); align-items: center; }
.about-media img { width: 100%; height: auto; display: block; border-radius: 1rem; object-fit: cover; box-shadow: var(--shadow, 0 10px 30px rgba(0,0,0,.08)); }
.about-title { font-size: clamp(2rem, 4.8vw, 3.2rem); line-height: 1.1; margin: 0 0 .75rem; }
.about-content p { max-width: 60ch; margin: 0 0 1rem; }
.about-facts { list-style: none; padding: 0; margin: 1rem 0 1.5rem; display: grid; gap: .5rem; }
.about-cta { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ================================
   Project detail pagina
==================================*/
.project-hero { padding-block: clamp(1.5rem, 4vw, 3rem); }
.project-meta { list-style: none; margin: .75rem 0 1.25rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.project-meta li { border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: .3rem .6rem; font-size: .9rem; }
.hero-media img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border); }

/* Links in body-tekst */
.project-body a.link{
  color: #d1374e;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.project-body a.link:hover{ color: #021744; }
.project-body a.link:focus-visible{ outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

/* ================================
   Gallery grid / media
==================================*/
.media-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; margin-top: 1rem; }
.media-grid figure { grid-column: span 6; margin: 0; }
.media-grid .span-12 { grid-column: span 12; }
.media-grid img { width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid var(--border); }

.media-grid .video-wrap{
  position: relative; aspect-ratio: 16/10; overflow: hidden;
  border-radius: 12px; border: 1px solid var(--border); background: var(--card);
}
.media-grid .video-wrap.ratio-9-16 { aspect-ratio: 9/16; }
.media-grid .video-wrap video{
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; border: 0; display: block;
}

/* ================================
   Kaarten als link
==================================*/
.card.project { display: block; text-decoration: none; color: inherit; }
.card.project:hover h3 { text-decoration: underline; text-underline-offset: 2px; }

/* ================================
   Mobiel
==================================*/
@media (max-width: 900px) {
  .grid .card { grid-column: span 12; }
  .about-grid { grid-template-columns: 1fr; }
  .about-media { order: -1; }
  .about-title { font-size: clamp(1.8rem, 6vw, 2.4rem); }
  .media-grid figure, .media-grid .span-12 { grid-column: span 12; }
}

/* ================================
   Menu: hamburger (desktop verbergen)
==================================*/
.menu-toggle{
  display: none;
  background: none; border: 0; padding: 0; font: inherit; line-height: 1; cursor: pointer;
  color: var(--menu-color, inherit); font-size: 2rem;
}
.menu-toggle:focus-visible{ outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

/* ================================
   Mobiel menu – slide-in vanaf links
==================================*/
@media (max-width: 900px){
  .menu-toggle{ display: inline-block; position: relative; z-index: 3200; }

  .site-header nav{
    position: fixed; top: 0; bottom: 0; left: 0;
    width: 100vw; background: var(--bg); border: 0;
    transform: translateX(-100%); visibility: hidden;
    transition: transform .35s cubic-bezier(.2,.8,.2,1), visibility 0s linear .35s;
    z-index: 3100; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding-top: max(16px, env(safe-area-inset-top));
  }
  .site-header nav.open{
    transform: translateX(0); visibility: visible;
    transition: transform .35s cubic-bezier(.2,.8,.2,1), visibility 0s;
  }

  .site-header nav ul{
    display: flex; flex-direction: column; gap: clamp(18px, 3.5vh, 28px);
    padding: clamp(20px, 3vh, 32px) clamp(20px, 7vw, 48px); margin: 0;
  }
  .site-header nav a,
  .site-header .theme-toggle{
    width: 100%; text-align: left; border-radius: 12px; padding: 14px 12px; background: none;
  }
  .site-header nav a{
    font-size: clamp(1.4rem, 5.8vw, 2.2rem); line-height: 1.2; text-transform: none; letter-spacing: 0;
  }

  /* Optionele ×-knop (alleen tonen als je 'm in HTML zet) */
  .menu-close{
    display: none; position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px;
    padding: 10px 12px; font-size: 1.6rem; line-height: 1;
    background: var(--bg); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; z-index: 3300;
  }
  .site-header nav.open .menu-close{ display: inline-flex; }
  .menu-close:focus-visible{ outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 12px; }

  /* Overlay + scroll lock */
  body.menu-open { overflow: hidden; }
  body.menu-open::before{
    content: ""; position: fixed; inset: 0;
    background: rgba(0,0,0,.45); backdrop-filter: blur(2px); z-index: 2000;
  }

  /* Hamburger verbergen wanneer open */
  body.menu-open #menuToggle{ visibility: hidden; }
}

/* Menu open: geen scroll-bounce naar de pagina erachter */
@media (max-width: 900px){
  .site-header nav{ 
    height: 100dvh;                 /* 100% van zichtbare viewport */
    overscroll-behavior: contain;   /* scroll stopt in het panel */
  }
  body.menu-open{
    overscroll-behavior: none;      /* geen propagerende scroll */
  }
}

@media (max-width: 900px){
  .menu-close{
    position:absolute;
    top: calc(env(safe-area-inset-top) + 8px);
    right: 12px;
    min-width:44px; min-height:44px;
    background: transparent;
    border: 0;            /* geen rand */
    color: var(--text);
    font-size: 1.8rem;    /* mooi formaat */
    line-height: 1;
    cursor: pointer;
  }
  .menu-close:hover { color: var(--brand); }
  .menu-close:focus-visible{
    outline: 2px solid var(--brand);
    outline-offset: 4px;
    border-radius: 10px;
  }
}

/* Kruisje standaard nooit tonen (ook desktop) */
.menu-close { display: none !important; }

/* Alleen op mobiel en alleen wanneer het menu open is zichtbaar */
@media (max-width: 900px){
  .site-header nav.open .menu-close{
    display: inline-flex !important;
  }
}
