/* ============================================
   DESIGN SYSTEM — Portfolio Luka
   Clean, modest, with subtle unique details
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Colors */
    --bg:             #090b0f;
    --bg-surface:     #10141a;
    --bg-elevated:    #171c24;
    --bg-section-alt: #0d1117;

    --border:         rgba(255, 123, 66, 0.10);
    --border-hover:   rgba(255, 123, 66, 0.20);
    --border-active:  rgba(255, 123, 66, 0.32);

    --text-primary:   #f0f0f0;
    --text-secondary: #9a9a9a;
    --text-tertiary:  #858585;

    --accent:         #ff6b2c;
    --accent-muted:   rgba(255, 107, 44, 0.10);
    --accent-glow:    rgba(255, 107, 44, 0.22);
    --accent-text:    #ffad7a;
    --hero-word:      #ffc09a;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --space-xs:  0.5rem;
    --space-sm:  1rem;
    --space-md:  1.5rem;
    --space-lg:  2.5rem;
    --space-xl:  4rem;
    --space-2xl: 6rem;
    --space-3xl: 10rem;

    /* Sizes */
    --max-width: 1100px;
    --nav-height: 64px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --transition-fast: 200ms var(--ease-out);
    --transition-base: 400ms var(--ease-out);
    --transition-slow: 600ms var(--ease-out);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}


/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scrollbar-width: thin;
    scrollbar-color: var(--text-tertiary) transparent;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg);
    overflow-x: hidden;
    cursor: default;
}

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

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-family: inherit;
}


/* --- Noise Overlay --- */
.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 128px 128px;
}


/* --- Cursor Glow --- */
.cursor-glow {
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    will-change: transform;
}

.cursor-glow.active {
    opacity: 1;
}

@media (hover: none) {
    .cursor-glow {
        display: none;
    }
}


/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 1000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(9, 11, 15, 0.8);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition-base), border-color var(--transition-base);
}

.nav__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav__logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    transition: opacity var(--transition-fast);
}

.nav__logo:hover {
    opacity: 0.7;
}

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

.nav__links {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav__link {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
    position: relative;
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width var(--transition-base);
}

.nav__link:hover,
.nav__link.active {
    color: var(--text-primary);
}

.nav__link:hover::after,
.nav__link.active::after {
    width: 100%;
}

.nav__link--cta {
    padding: 0.45rem 1.2rem;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.nav__link--cta::after {
    display: none;
}

.nav__link--cta:hover {
    background: var(--accent-muted);
    border-color: var(--accent);
    color: var(--accent-text);
}

.nav__link--cta.active {
    background: var(--accent-muted);
    border-color: var(--accent);
    color: var(--accent-text);
}

.nav__toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    z-index: 1001;
}

.nav__toggle span {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--text-primary);
    transition: all var(--transition-base);
    transform-origin: center;
}

.nav__toggle.open span:first-child {
    transform: rotate(45deg) translate(2.5px, 2.5px);
}

.nav__toggle.open span:last-child {
    transform: rotate(-45deg) translate(2.5px, -2.5px);
}


/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--space-3xl) var(--space-md) var(--space-xl);
    position: relative;
    text-align: center;
}

.hero__content {
    max-width: 700px;
}

.hero__label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: var(--space-lg);
}

.hero__label-line {
    display: block;
    width: 32px;
    height: 1px;
    background: var(--text-tertiary);
}

.hero__title {
    margin-bottom: var(--space-md);
}

.hero__title-line {
    display: block;
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.hero__title-name {
    display: block;
    font-size: clamp(3.5rem, 10vw, 7rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
}

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

.hero__subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.6;
}

.hero__rotate-wrapper {
    display: inline-block;
    position: relative;
    min-width: 120px;
}

.hero__rotate {
    color: var(--hero-word);
    font-weight: 500;
    position: relative;
}

.hero__rotate::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: var(--accent);
    vertical-align: text-bottom;
    margin-left: 2px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero__cta {
    display: flex;
    gap: 16px;
    margin-top: 22px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero__scroll-indicator {
    position: absolute;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
}

.hero__scroll-line {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}


/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn--primary {
    background: var(--text-primary);
    color: var(--bg);
}

.btn--primary:hover {
    background: var(--accent-text);
    transform: translateY(-1px);
}

.btn--ghost {
    border: 1px solid var(--border-hover);
    color: var(--text-secondary);
}

.btn--ghost:hover {
    border-color: var(--accent);
    color: var(--accent-text);
    background: var(--accent-muted);
}


/* --- Sections (shared) --- */
.section {
    padding: var(--space-3xl) var(--space-md);
    position: relative;
}

.section--dark {
    background: var(--bg-section-alt);
}

.section__inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.section__header {
    margin-bottom: var(--space-xl);
}

.section__header--center {
    text-align: center;
}

.section__number {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: var(--space-sm);
    letter-spacing: 0.05em;
}

.section__title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.section__title--large {
    font-size: clamp(2.5rem, 6vw, 4rem);
}

.section__subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: var(--space-sm);
    max-width: 500px;
}

.section__header--center .section__subtitle {
    margin-left: auto;
    margin-right: auto;
}


/* --- About Section --- */
.about__grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-xl);
    align-items: start;
}

.about__intro {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.about__body {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.about__body + .about__body {
    margin-top: var(--space-md);
}

.about__stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    padding-left: var(--space-lg);
    border-left: 1px solid var(--border);
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat__number {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--text-primary);
}

.stat__number::after {
    content: '.';
    font-size: 1.5rem;
    color: var(--accent);
    margin-left: 2px;
}

.stat__label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}


/* --- Project Cards --- */
.projects__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.project-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
}

.project-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.5);
}

.project-card__preview {
    height: 180px;
    background: var(--gradient);
    position: relative;
    overflow: hidden;
}

.project-card__preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, var(--bg-surface));
}

/* Preview met een echte schermafdruk in plaats van een kleurverloop.
   De afbeelding zit hoger in beeld (object-position) zodat koppen en
   eerste rijen zichtbaar blijven, en de fade naar de kaartkleur blijft. */
.project-card__preview--shot {
    background: #0d0d0d;
}

.project-card__preview--shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.project-card__preview--shot::after {
    background: linear-gradient(to bottom, transparent 55%, var(--bg-surface));
}

/* Boven een schermafdruk heeft de badge meer dekking nodig; anders loopt hij
   visueel door de interface van de app heen. */
.project-card__preview--shot .project-card__badge {
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* Twee schermafdrukken naast elkaar; onder 560px onder elkaar. */
.project-card__figures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.project-card__figures .project-card__figure {
    margin-bottom: 0;
}

@media (max-width: 560px) {
    .project-card__figures {
        grid-template-columns: 1fr;
    }
}

/* Tweede schermafdruk in de kaart zelf, met bijschrift. */
.project-card__figure {
    margin: 0 0 var(--space-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #0d0d0d;
}

.project-card__figure img {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 1px solid var(--border);
}

/* De vier schermafdrukken hebben verschillende verhoudingen; een vaste
   ratio houdt de rij recht en de bijschriften op gelijke hoogte. */
.project-card__figure {
    display: flex;
    flex-direction: column;
}

.project-card__figure img {
    aspect-ratio: 16 / 10;
    height: auto;
    object-fit: cover;
    object-position: top center;
}

.project-card__figure figcaption {
    flex: 1;
}

.project-card__figure figcaption {
    padding: 0.6rem 0.8rem;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-tertiary);
}

.project-card__badge {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    z-index: 1;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.3rem 0.8rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-full);
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.03em;
}

.project-card__content {
    padding: var(--space-md);
}

.project-card__title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.project-card__desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-sm);
}

.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: var(--space-sm);
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.25rem 0.65rem;
    background: var(--accent-muted);
    color: var(--accent-text);
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 107, 44, 0.14);
}

.project-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast), gap var(--transition-fast);
}

.project-card__link:hover {
    color: var(--accent-text);
    gap: 0.6rem;
}


/* --- Marquee --- */
.marquee {
    padding: var(--space-xl) 0;
    overflow: hidden;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.marquee__track {
    display: flex;
    white-space: nowrap;
    animation: marquee 30s linear infinite;
    width: max-content;
}

.marquee__item {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 500;
    color: var(--text-tertiary);
    padding: 0 var(--space-md);
    transition: color var(--transition-fast);
}

.marquee__separator {
    color: var(--accent);
    opacity: 0.3;
    font-size: 0.5rem;
    display: flex;
    align-items: center;
}

.marquee:hover .marquee__track {
    animation-play-state: paused;
}

.marquee:hover .marquee__item {
    color: var(--text-secondary);
}

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


/* --- Skills Section --- */
.skills__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-lg);
}

.skill-group__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.35;
    margin-bottom: 0.6rem;
}

.skill-group {
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    transition: border-color var(--transition-fast);
}

.skill-group:hover {
    border-color: var(--border-hover);
}

.skill-group__desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

.skill-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.skill-list li {
    position: relative;
    padding-left: 1.1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.skill-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

/* --- AI panel --- */
.mono-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 0.6rem;
}

.ai-panel {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: var(--space-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
}

.ai-panel__copy h3 {
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
    margin-bottom: var(--space-sm);
}

.ai-panel__copy p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.ai-panel__copy p + p {
    margin-top: var(--space-sm);
}

.ai-panel__side {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    font-size: 0.85rem;
    padding: 0.5rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    cursor: default;
}

.skill-tag:hover {
    border-color: var(--accent);
    color: var(--accent-text);
    background: var(--accent-muted);
    transform: translateY(-2px);
}


/* --- Education --- */
.education {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: var(--space-lg);
    align-items: start;
}

.education__main {
    padding: var(--space-lg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
}

.education__main h3 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.education__meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0.4rem 0 var(--space-md);
}

.education__main p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.education__rail {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.education__card {
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-left: 2px solid var(--accent);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.education__card:hover {
    border-color: var(--border-hover);
    border-left-color: var(--accent);
    transform: translateX(4px);
}

.education__card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.education__card p {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    line-height: 1.7;
}


/* --- Contact --- */
.contact__links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    max-width: 800px;
    margin: 0 auto;
}

.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: var(--space-xl) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-base);
}

.contact-card:hover {
    border-color: var(--accent);
    background: var(--accent-muted);
    transform: translateY(-4px);
}

.contact-card__icon {
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--accent-text);
    font-weight: 700;
    transition: all var(--transition-fast);
}

.contact-card:hover .contact-card__icon {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.contact-card__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.contact-card__value {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}


/* --- Footer --- */
.footer {
    border-top: 1px solid var(--border);
    padding: var(--space-lg) var(--space-md);
}

.footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer__copy {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.footer__top {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.footer__top:hover {
    border-color: var(--accent);
    color: var(--accent-text);
    transform: translateY(-2px);
}


/* --- Reveal Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

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


/* --- Responsive --- */
@media (max-width: 900px) {
    .ai-panel {
        grid-template-columns: 1fr;
    }

    .education {
        grid-template-columns: 1fr;
    }

    .projects__grid {
        grid-template-columns: 1fr;
    }

    .about__grid {
        grid-template-columns: 1fr;
    }

    .about__stats {
        flex-direction: row;
        border-left: none;
        border-top: 1px solid var(--border);
        padding-left: 0;
        padding-top: var(--space-lg);
    }

    .skills__grid {
        grid-template-columns: 1fr;
    }

    .contact__links {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
}

@media (max-width: 640px) {
    :root {
        --space-3xl: 6rem;
    }

    /* A backdrop-filter creates a containing block for fixed descendants.
       The overlay supplies its own blur, so disable the header blur on mobile. */
    .nav {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .nav__links {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        padding: calc(var(--nav-height) + var(--space-md)) var(--space-md) var(--space-md);
        background: rgba(9, 11, 15, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        gap: var(--space-lg);
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity var(--transition-base);
    }

    .nav__links.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav__links .nav__link {
        font-size: 1.5rem;
        font-weight: 500;
        color: var(--text-primary);
    }

    .nav__links .nav__link--cta {
        font-size: 1rem;
    }

    .nav__toggle {
        display: flex;
    }

    .hero__title-name {
        font-size: clamp(3rem, 15vw, 5rem);
    }

    .about__stats {
        flex-direction: column;
    }

    .section__title {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }
}

@media (max-width: 640px) and (max-height: 480px) {
    .nav__links {
        justify-content: flex-start;
    }
}


/* --- Skip link --- */
.skip-link {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2000;
    padding: 0.75rem 1.25rem;
    background: var(--accent);
    color: var(--bg);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0 0 var(--radius-md) 0;
    transform: translateY(-120%);
    transition: transform var(--transition-fast);
}

.skip-link:focus {
    transform: translateY(0);
}


/* --- Focus states --- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* Sections get focus programmatically after an anchor jump; no ring needed. */
section:focus,
section:focus-visible {
    outline: none;
}


/* --- Nav scrolled state (was an inline style set on every scroll event) --- */
.nav.scrolled {
    border-bottom-color: var(--border-hover);
    background: rgba(9, 11, 15, 0.92);
}


/* --- Hero intro paragraph --- */
.hero__intro {
    max-width: 54ch;
    margin-top: var(--space-md);
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-secondary);
}


/* --- Project card detail list --- */
.project-card__details {
    margin: var(--space-md) 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.project-card__details dt {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 0.3rem;
}

.project-card__details dd {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}


/* --- Contact note --- */
.contact__note {
    margin-top: var(--space-lg);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}


/* --- Reduced motion ---
   Honour the visitor's OS-level motion preference: no marquee, no tilt,
   no entrance animations. The JS mirrors this for its own effects. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .marquee__track {
        animation: none;
        transform: none;
    }

    .cursor-glow {
        display: none;
    }

    .hero__scroll-indicator {
        display: none;
    }
}


/* --- Datamodel-blok ---
   Twee schaalniveaus: een leesbaar detail, en het volledige model als
   bewijs van omvang. De brede versie mag horizontaal scrollen op smalle
   schermen in plaats van onleesbaar klein te worden. */
.project-card__model {
    margin-bottom: var(--space-lg);
}

.model-figure {
    margin: 0 0 var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #0e0e11;
    overflow: hidden;
}

.model-figure img {
    width: 100%;
    height: auto;
    display: block;
}

.model-figure figcaption {
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--text-tertiary);
}

.model-figure--wide img {
    min-width: 900px;
}

.model-figure--wide {
    overflow-x: auto;
}

.model-figure--wide figcaption {
    position: sticky;
    left: 0;
    min-width: 0;
}


/* --- Uitklapbare projectkaart ---
   De kaart toont ingeklapt alleen het beeld, de titel en een korte
   samenvatting. De knop is het hele bovenblok, zodat klikken doet wat je
   verwacht, maar het blijft een echte button en dus bedienbaar met het
   toetsenbord. */
.project-card__toggle {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.project-card__toggle .project-card__preview {
    display: block;
}

.project-card__head {
    display: block;
    padding: var(--space-md);
}

.project-card__toggle .project-card__title {
    display: block;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}

.project-card__toggle .project-card__desc {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-sm);
}

.project-card__more {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    color: var(--accent-text);
}

.project-card__more-close { display: none; }

.project-card__toggle[aria-expanded="true"] .project-card__more-open { display: none; }
.project-card__toggle[aria-expanded="true"] .project-card__more-close { display: inline; }

.project-card__chevron {
    transition: transform var(--transition-fast);
}

.project-card__toggle[aria-expanded="true"] .project-card__chevron {
    transform: rotate(180deg);
}

.project-card__toggle:hover .project-card__more {
    color: #fff;
}

.project-card__body {
    padding: 0 var(--space-md) var(--space-md);
    border-top: 1px solid var(--border);
    margin-top: 0;
}

.project-card__body[hidden] { display: none; }

.project-card__body > *:first-child {
    margin-top: var(--space-md);
}

/* Een uitgeklapte kaart neemt de volle breedte in, zodat de diagrammen en
   schermafdrukken groot genoeg blijven om iets aan te hebben. */
.project-card:has(.project-card__toggle[aria-expanded="true"]) {
    grid-column: 1 / -1;
}

.project-card:has(.project-card__toggle[aria-expanded="true"]) .project-card__figures {
    grid-template-columns: repeat(4, 1fr);
}

/* Kaarten mogen niet meebewegen met de tilt zolang ze open staan. */
.project-card:has([aria-expanded="true"]) {
    transform: none !important;
}

/* --- Uitklapbare technische noot --- */
.tech-note {
    margin-top: var(--space-sm);
    border-top: 1px solid var(--border);
    padding-top: var(--space-sm);
}

.tech-note summary {
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
}

.tech-note summary:hover { color: var(--accent-text); }

.tech-note[open] summary { margin-bottom: 0.6rem; }

.tech-note p {
    font-size: 0.82rem !important;
    line-height: 1.75;
    color: var(--text-tertiary) !important;
}

.project-card__model-intro {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: var(--space-md);
    max-width: 78ch;
}

/* --- Vergrootbaar beeld --- */
.zoomable {
    cursor: zoom-in;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: rgba(6, 6, 8, 0.94);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.lightbox[hidden] { display: none; }

.lightbox__inner {
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    overflow: auto;
}

.lightbox__img {
    max-width: 100%;
    display: block;
    border-radius: var(--radius-md);
    background: #0e0e11;
}

/* Diagrammen zijn breder dan het scherm; die mogen op ware grootte staan
   zodat je erin kunt scrollen in plaats van te turen. */
.lightbox--wide .lightbox__inner { align-items: flex-start; }
.lightbox--wide .lightbox__img { max-width: none; width: auto; height: auto; }

.lightbox__caption {
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-secondary);
    text-align: center;
    position: sticky;
    left: 0;
}

.lightbox__close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-hover);
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lightbox__close:hover {
    border-color: var(--accent);
    color: var(--accent-text);
}

@media (max-width: 900px) {
    .project-card:has(.project-card__toggle[aria-expanded="true"]) .project-card__figures {
        grid-template-columns: 1fr 1fr;
    }

    .project-card__split {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
}

@media (max-width: 560px) {
    .project-card:has(.project-card__toggle[aria-expanded="true"]) .project-card__figures {
        grid-template-columns: 1fr;
    }
}
