:root{
  /* Kleuren */
  --bg: #0b0b0d;
  --panel: #141418;
  --panel-2: #1b1b21;
  --text: #f5f6f8;
  --muted: #b8bcc6;
  --brand: #ff4d4f;
  --brand-2: #c81d25;
  --border: #23232b;

  /* Schaduw & radius */
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius-card: 16px;
  --radius-btn: 12px;

  /* Ritme */
  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
}


* { box-sizing: border-box; }
html, body { height: 100%; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  font-family: "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  
  /* Default mouse position (center) */
  --mouse-x: 50vw;
  --mouse-y: 50vh;

  background: 
    /* Mouse spotlight */
    radial-gradient(600px 600px at var(--mouse-x) var(--mouse-y), rgba(255, 77, 79, 0.15), transparent),
    /* Static ambient glows */
    radial-gradient(1200px 800px at 70% -10%, rgba(255,77,79,.25), transparent) no-repeat,
    radial-gradient(800px 600px at -10% 20%, rgba(200,29,37,.18), transparent) no-repeat,
    var(--bg);
  
  background-attachment: fixed; /* Keeps the background fixed relative to viewport */
  line-height: 1.6;
}

/* Scroll Progress Bar */
/* Removed as requested in favor of ring */

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  /* Removed background/border to let SVG ring be the border */
  background: rgba(20, 20, 24, 0.8);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  color: var(--brand); /* Default color for icon */
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  text-decoration: none;
  box-shadow: var(--shadow);
  z-index: 90;
  
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  /* Smooth fade out: Delay visibility switch until opacity is done */
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, visibility 0s linear 0.3s;
}

/* The Progress Ring SVG */
.progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg); /* Start at top */
  z-index: 1;
  pointer-events: none; /* Ensure click passes to link */
}
.progress-ring__circle {
  stroke: var(--brand);
  transition: stroke-dashoffset 0.1s linear;
  /* Circumference = 2 * PI * 22 ≈ 138.23 */
  stroke-dasharray: 138.23 138.23; 
  stroke-dashoffset: 138.23; /* Start empty */
}

/* The Icon centered inside */
.back-to-top-icon {
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: transform 0.3s ease;
}
.back-to-top-icon svg {
  width: 20px;
  height: 20px;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  /* Smooth fade in: No delay on visibility */
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, visibility 0s linear 0s;
}

.back-to-top:hover {
  /* Hover glow effect */
  box-shadow: 0 0 20px rgba(255, 77, 79, 0.35);
}
.back-to-top:hover .back-to-top-icon {
  color: var(--brand);
  transform: translateY(-2px);
}
/* Add a faint background track for the ring */
.back-to-top::before {
  content: "";
  position: absolute;
  top: 2px; left: 2px; right: 2px; bottom: 2px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.05);
}

/* Layout helpers */
.container{
  width: min(1100px, 92%);
  margin-inline: auto;
}
.section{ padding: var(--space-5) 0; }
.hero, .section, #top, #cv-brief{ scroll-margin-top: 80px; }
.grid-2{
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
@media (min-width: 900px){
  .grid-2{ grid-template-columns: 1.1fr .9fr; }
}

/* Scroll Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for children if needed */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* Profile photo */
.profile-photo{
  height: 25rem;
  width: auto;
  max-width: 100%;
  object-fit: contain; 
  border-radius: var(--radius-card);
  display: block;
  margin: auto;
}

/* Header */
.site-header{
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  background: rgba(11,11,13,.6);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .8rem 0;
  gap: 1rem;
}
.brand{
  display: inline-flex; align-items: center; gap: .6rem;
  color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: .2px;
}
.brand-logo{
  display: inline-block;
  width: 36px; height: 36px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.brand-text{ font-size: 1rem; }
.header-right{
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav a{
  color: var(--muted); text-decoration: none; margin-left: 1rem; font-weight: 600;
}
.nav a:hover{ color: var(--text); }

/* Language Toggle */
.lang-toggle{
  position: relative;
  background: transparent;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}
.lang-toggle:hover{
  opacity: 0.8;
}
.lang-toggle .flag{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  object-fit: contain;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.lang-toggle .flag-nl{
  transform: translate(-50%, -50%);
  opacity: 1;
}
.lang-toggle .flag-en{
  transform: translate(50%, -50%);
  opacity: 0;
}
.lang-toggle.swapped .flag-nl{
  transform: translate(-150%, -50%);
  opacity: 0;
}
.lang-toggle.swapped .flag-en{
  transform: translate(-50%, -50%);
  opacity: 1;
}

/* Navigation (responsive) */
.nav-toggle{
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 42px; height: 42px;
  border-radius: 10px;
  align-items: center; justify-content: center;
  cursor: pointer;
}
.nav-toggle:hover{ color: var(--brand); border-color: rgba(255,255,255,.18); }

/* Hamburger icon -> X morph */
.nav-toggle-box{ position: relative; width: 22px; height: 16px; display: inline-block; }
.nav-toggle .line,
.nav-toggle .line::before,
.nav-toggle .line::after{
  position: absolute; left: 0; right: 0; height: 2px;
  background: currentColor; border-radius: 2px;
  content: "";
}
.nav-toggle .line{ top: 50%; transform: translateY(-50%); }
.nav-toggle .line::before{ transform: translateY(-6px); }
.nav-toggle .line::after{ transform: translateY(6px); }

/* Smooth transforms */
.nav-toggle .line{ transition: background-color .45s ease; }
.nav-toggle .line::before,
.nav-toggle .line::after{ transition: transform .5s ease; }

/* Expanded state → X */
.nav-toggle[aria-expanded="true"] .line{ background: transparent; }
.nav-toggle[aria-expanded="true"] .line::before{ transform: translateY(0) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .line::after{ transform: translateY(0) rotate(-45deg); }

@media (max-width: 650px){
  .header-inner{ position: relative; }
  .header-right{ position: relative; }
  .nav-toggle{ display: inline-flex; }
  .nav{
    position: absolute; top: calc(100% + 12px); right: 0;
    display: flex; flex-direction: column; gap: .4rem;
    padding: .6rem;
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--border);
    border-radius: 12px; box-shadow: var(--shadow);
    min-width: 200px;

    opacity: 0;
    transform: translateY(6px) scale(.98);
    visibility: hidden;
    pointer-events: none;
    transition: opacity .42s ease, transform .5s ease, visibility 0s linear .5s;
    will-change: transform, opacity;
  }
  .nav a{ 
    margin: 0; padding: .6rem .8rem; 
    opacity: 0; 
    transform: translateY(4px);
    transition: opacity .35s ease, transform .45s ease;
  }
  .nav.is-open{ 
    opacity: 1; 
    transform: translateY(0) scale(1); 
    visibility: visible; 
    pointer-events: auto; 
    transition: opacity .42s ease, transform .5s ease, visibility 0s; 
  }
  .nav.is-open a{ opacity: 1; transform: translateY(0); }
  .nav.is-open a:nth-child(1){ transition-delay: .06s; }
  .nav.is-open a:nth-child(2){ transition-delay: .12s; }
  .nav.is-open a:nth-child(3){ transition-delay: .18s; }
  .nav.is-open a:nth-child(4){ transition-delay: .24s; }
  .nav.is-open a:nth-child(5){ transition-delay: .30s; }
  
  /* Adjust language toggle for mobile */
  .lang-toggle{
    width: 32px;
    height: 32px;
  }
  .lang-toggle .flag{
    width: 22px;
    height: 22px;
  }
}

/* Hero */
.hero{
  padding: clamp(3rem, 6vw, 6rem) 0 clamp(2rem, 4vw, 4rem);
}
.hero-inner{
  display: grid; grid-template-columns: 1fr; gap: var(--space-3);
}
.hero h1{
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15; margin: 0 0 .6rem 0;
  /* Reserve space to prevent layout shift */
  min-height: 2.3em; 
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.25em; /* Replaces space lost due to flex display */
}
@media (min-width: 600px){
  .hero h1{ min-height: 1.15em; } /* On larger screens, 1 line is enough */
}
/* Typewriter cursor */
#typewriter::after {
  content: '|';
  display: inline-block;
  margin-left: 2px;
  animation: blink-cursor 0.75s step-end infinite;
  color: var(--brand);
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.hero p{ color: var(--muted); max-width: 58ch; }
.cta{ display: flex; gap: .8rem; margin-top: 1rem; flex-wrap: wrap; }

/* Buttons */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.1rem; border-radius: var(--radius-btn); font-weight: 700;
  text-decoration: none; color: white; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: 1px solid rgba(255,255,255,.1); box-shadow: var(--shadow);
}
.btn:hover{ transform: translateY(-1px); }
.btn-ghost{
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border);
}

/* Cards & utilities */
.card{
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-3);
  box-shadow: var(--shadow);
}
.card.highlight p{ color: var(--muted); }
.link{ color: var(--brand); text-decoration: none; font-weight: 700; }
.link:hover{ text-decoration: underline; }
.bullets{ margin: .6rem 0 0 1rem; color: var(--muted); }


/* Tags */
.tags, .project-tags{
  display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem;
}
.tag, .project-tags span{
  display: inline-block; padding: .4rem .7rem; border-radius: 999px;
  background: #191923; color: var(--muted); border: 1px solid var(--border);
  font-size: .9rem; font-weight: 600;
}
/* Branded style for project tags */
.project-tags span{
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border-color: rgba(255,255,255,.12);
}

/* Skills marquee */
.marquee{ 
  position: relative; 
  overflow: hidden; 
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
/* Removed ::before and ::after overlays as we now use mask-image */
.marquee-track{
  display: flex; gap: .5rem;
  width: max-content; position: relative; z-index: 1;
  animation: marquee-scroll 80s linear infinite;
}
.marquee > .marquee-track:nth-child(2){
  animation-direction: reverse;
}
.marquee .tags{ flex-wrap: nowrap; }
.marquee .tag{ white-space: nowrap; }
.marquee .tag:hover{
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border-color: rgba(255,255,255,.12);
}

@keyframes marquee-scroll{
  0%{ transform: translateX(0); }
  100%{ transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce){
  .marquee-track{ animation: none; }
}

/* Projects */
.projects{
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
@media (min-width: 900px){
  .projects{ grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px){
  .projects > .project-card:last-child:nth-child(odd){
    grid-column: 1 / -1;
    justify-self: center;
    width: min(100%, 540px);
  }
}
.project-card{
  display: grid; grid-template-rows: auto 1fr;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
  
  /* 3D Tilt Support */
  transform-style: preserve-3d;
  transform: perspective(1000px);
  will-change: transform;
}
/* Glare effect overlay */
.project-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,255,255,0.08), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 4;
}
.project-card:hover::after {
  opacity: 1;
}
.view-more-btn{
  display: inline-flex;
  align-items: center;
  margin-top: 0.75rem;
  margin-left: auto;
  padding: 0.5rem 0.9rem;
  background: transparent;
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-btn);
  border: 1px solid var(--brand);
  transition: all 0.2s ease;
  width: fit-content;
}
.view-more-btn:hover{
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 77, 79, 0.25);
}
.project-card img{
  width: 100%; height: 220px; object-fit: cover; display: block;
  background: #111;
}
.project-card video{
  width: 100%; height: 220px; object-fit: cover; display: block;
  background: #111;
}
.project-card img.project-logo{
  object-fit: contain;
  padding: 1rem;
  background: #23232b;
}
.project-card img.project-logo.atlas-logo{
  background: #ffffff;
  padding: 0.5rem;
  object-fit: scale-down;
  height: 220px;
}
.project-card img.project-image-bacardi{
  object-fit: contain;
  background: #1a1a1f;
}
.project-card .media-placeholder{
  width: 100%; height: 220px; display: grid; place-items: center;
  background: #111;
  color: var(--muted); font-weight: 600;
}
.project-content{ 
  padding: 1rem 1rem 1.2rem; 
  display: flex;
  flex-direction: column;
}
.project-content h3{
  margin: 0 0 .4rem 0; line-height: 1.25;
}
.project-content p{ color: var(--muted); margin: 0 0 .6rem 0; }
.year{
  font-size: .85rem; font-weight: 800; color: var(--brand);
  letter-spacing: .2px; margin-left: .25rem;
}
.note{ color: var(--muted); margin-top: var(--space-2); text-align: center; }
.project-note{
  color: var(--muted);
  font-size: 0.9rem;
  margin: -0.5rem 0 var(--space-3) 0;
  padding: 0.75rem 1rem;
  background: rgba(255, 77, 79, 0.08);
  border-left: 3px solid var(--brand);
  border-radius: 6px;
}

/* Contact */
.contact-grid{
  display: grid; gap: var(--space-3);
  grid-template-columns: 1fr;
}
@media (min-width: 800px){
  .contact-grid{ grid-template-columns: 1fr 1fr; }
}
.contact-card{
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-3);
  box-shadow: var(--shadow);
}
.contact-card a:not(.btn){ color: var(--text); text-decoration: none; font-weight: 600; }
.contact-card a:not(.btn):hover{ color: var(--brand); text-decoration: underline; }
.contact-card .btn:hover{ color: #fff; text-decoration: none; }

/* Center CV button vertically inside its card */
#cv-brief{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#cv-brief .cta{
  margin-top: 0;
  margin-bottom: 1.2rem; /* add space below CV button */
}

/* Social links under CV */
#cv-brief .social-links{
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: .6rem;
}
#cv-brief .icon{
  display: inline-block;
  width: 28px; height: 28px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.35));
}
#cv-brief .icon-link{
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #191923;
  transition: transform .2s ease, border-color .2s ease;
}
#cv-brief .icon-link:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.18);
}

/* Make the Social SVGs use brand gradient via mask */
.icon-linkedin,
.icon-github,
.icon-instagram {
  width: 24px;
  height: 24px;
  display: inline-block;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  background-clip: border-box;
}

.icon-linkedin {
  -webkit-mask-image: url('Assets/images/linkedin.svg');
  mask-image: url('Assets/images/linkedin.svg');
}

.icon-github {
  -webkit-mask-image: url('Assets/images/github.svg');
  mask-image: url('Assets/images/github.svg');
}

.icon-instagram {
  -webkit-mask-image: url('Assets/images/instagram.svg');
  mask-image: url('Assets/images/instagram.svg');
}

/* Toggle switch section */
.toggle-section {
  padding: var(--space-4) 0;
  margin: var(--space-4) 0;
}

.toggle-title {
  text-align: center;
  margin: 0 0 var(--space-3) 0;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

.toggle-container {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-3);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto;
}

.toggle-label {
  font-weight: 600;
  color: var(--text);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: .3s;
  border-radius: 30px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--brand);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(30px);
}

/* Footer */
.site-footer{
  border-top: 1px solid var(--border);
  background: rgba(20,20,24,.6);
}
.footer-inner{
  display: flex; align-items: center; justify-content: center;
  padding: 1rem 0;
  position: relative;
}
.footer-inner p{ margin: 0; color: var(--muted); }
.footer-inner .link{ position: absolute; right: 0; }

@media (max-width: 700px){
  .footer-inner{
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .4rem;
  }
  .footer-inner .link{
    position: static;
  }
}
