@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ============================================================
   DESIGN SYSTEM — Light / Dark Theme Variables
   ============================================================ */

:root,
[data-theme="light"] {
    /* — Surface — */
    --bg-body:                 #F9F9F7;
    --bg-surface:              #fbf9f8;
    --bg-surface-dim:          #efeded;
    --bg-surface-container:    #f5f3f3;
    --bg-surface-elevated:     #ffffff;
    --bg-skills:               #e5e5e5;

    /* — Text — */
    --text-primary:            #1b1c1c;
    --text-secondary:          #444748;
    --text-muted:              #747878;

    /* — Accents — */
    --accent-primary:          #b8cac5;
    --accent-secondary:        #daeae4;
    --accent-primary-text:     #111111; /* For text inside accent backgrounds */
    
    /* — Borders — */
    --border-subtle:           #c4c7c7;
    --border-strong:           #000000;

    /* — Buttons — */
    --btn-bg:                  #000000;
    --btn-text:                #ffffff;

    /* — Inverted (navbar/footer) — */
    --nav-bg:                  #1A1A1A;
    --nav-text:                #f2f0f0;
    --nav-text-muted:          rgba(255, 255, 255, 0.6);

    /* — Gradient target — */
    --gradient-end:            #F9F9F7;

    /* — Hero image — */
    --hero-image:              url('../public/images/PortfolioomslagVIT.webp');

    /* — Vignette — */
    --vignette-color:          rgba(249, 249, 247, 0.5);

    /* — Spacing Tokens — */
    --margin-desktop:  80px;
    --margin-mobile:   24px;
    --gutter:          32px;
    --stack-xl:        160px;
    --stack-lg:        80px;
    --stack-md:        40px;
}

[data-theme="dark"] {
    --bg-body:                 #111111;
    --bg-surface:              #1A1A1A;
    --bg-surface-dim:          #222222;
    --bg-surface-container:    #252525;
    --bg-surface-elevated:     #2a2a2a;
    --bg-skills:               rgba(255, 255, 255, 0.05);

    --text-primary:            #f2f0f0;
    --text-secondary:          #a8a8a8;
    --text-muted:              #747878;

    --border-subtle:           #3a3a3a;
    --border-strong:           #f2f0f0;

    --accent-primary:          #b8cac5;
    --accent-secondary:        rgba(218, 234, 228, 0.1);
    --accent-primary-text:     #f2f0f0;

    --btn-bg:                  #f2f0f0;
    --btn-text:                #111111;

    --nav-bg:                  #0a0a0a;
    --nav-text:                #f2f0f0;
    --nav-text-muted:          rgba(255, 255, 255, 0.5);

    --gradient-end:            #111111;

    --hero-image:              url('../public/images/PortfolioomslagMORK.webp');

    --vignette-color:          rgba(17, 17, 17, 0.5);
}

/* ============================================================
   RESET & BASE
   ============================================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Header offset */
}

/* — Back Link Circle — */
.back-link-circle {
    position: fixed;
    top: 80px;
    left: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    z-index: 99;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.back-link-circle:hover {
    transform: scale(1.05);
    background-color: var(--accent-primary);
    color: var(--accent-primary-text);
    border-color: var(--accent-primary);
}

.back-link-circle svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 768px) {
    .back-link-circle {
        top: 80px;
        left: var(--margin-mobile);
        width: 40px;
        height: 40px;
    }
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: 0em;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

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

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

/* ============================================================
   TYPOGRAPHY TOKENS
   ============================================================ */

.display-xl {
    font-family: 'Inter', sans-serif;
    font-size: 120px;
    font-weight: 700;
    line-height: 100px;
    letter-spacing: -0.04em;
}

.display-lg {
    font-family: 'Inter', sans-serif;
    font-size: 80px;
    font-weight: 700;
    line-height: 72px;
    letter-spacing: -0.03em;
}

.headline-lg {
    font-family: 'Inter', sans-serif;
    font-size: 48px;
    font-weight: 600;
    line-height: 52px;
    letter-spacing: -0.02em;
}

.body-lg {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 28px;
    letter-spacing: 0em;
}

.body-md {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: 0em;
}

.label-caps {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ============================================================
   SECTION HEADERS — Bold, commanding
   ============================================================ */

.section-header {
    grid-column: 1 / -1;
    font-family: 'Inter', sans-serif;
    font-size: clamp(22px, 5vw, 30px);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin-bottom: var(--stack-lg);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    white-space: nowrap;
}

.section-header--centered {
    text-align: center;
    border-bottom: none;
    padding-bottom: 0;
}

/* ============================================================
   GRID SYSTEM
   ============================================================ */

.grid-frame {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: var(--gutter);
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--margin-desktop);
    padding-right: var(--margin-desktop);
}

.span-full { grid-column: 1 / -1; }

/* ============================================================
   NAVIGATION — Dark bar with avatar & theme toggle
   ============================================================ */

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: var(--nav-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-nav .grid-frame {
    height: 56px;
    align-items: center;
}

.nav-left {
    grid-column: 1 / 5;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-avatar {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-wordmark {
    color: var(--nav-text);
    white-space: nowrap;
}

.nav-right {
    grid-column: 8 / 13;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 24px;
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    color: var(--nav-text);
    transition: opacity 0.2s ease;
}

.nav-links a:hover {
    opacity: 0.7;
}

/* — Theme toggle — */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    color: var(--nav-text);
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
    opacity: 0.8;
    border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* — Language toggle — */
.lang-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    color: var(--nav-text);
    font-size: 10px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.05em;
    transition: opacity 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.lang-toggle:hover {
    opacity: 0.8;
    border-color: rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Language Visibility Control */
html[lang="sv"] .lang-en {
    display: none !important;
}
html[lang="en"] .lang-sv {
    display: none !important;
}

/* ============================================================
   HERO — Clean image, no text
   ============================================================ */

.hero {
    margin-top: 56px;
    height: calc(100vh - 56px);
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: var(--hero-image);
    background-size: cover;
    background-position: center;
    transition: background-image 0.5s ease;
    will-change: transform;
}

/* — Gradient overlay — */
.hero-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--gradient-end) 100%
    );
    pointer-events: none;
}

/* ============================================================
   NAME BLOCK — Massive typography below hero
   ============================================================ */

.name-block {
    padding-top: var(--stack-lg);
    padding-bottom: var(--stack-lg);
}

.name-block-title {
    grid-column: 1 / -1;
    font-family: 'Inter', sans-serif;
    font-size: clamp(64px, 10vw, 140px);
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    margin-bottom: 16px;
    white-space: nowrap;
}

.name-block-sub {
    grid-column: 1 / -1;
    color: var(--text-secondary);
    padding-bottom: var(--stack-md);
    border-bottom: 1px solid var(--border-subtle);
}

/* ============================================================
   PROFILE SECTION
   ============================================================ */

.profile-section {
    padding-top: var(--stack-md);
    padding-bottom: var(--stack-xl);
}

.profile-intro {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: var(--stack-lg);
    align-items: start;
    margin-bottom: var(--stack-lg);
}

.profile-portrait { position: relative; }

.portrait-link {
    display: block;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--bg-surface-dim);
    transition: transform 0.3s ease;
    will-change: transform;
    cursor: pointer;
}

.portrait-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.4s ease;
    will-change: filter;
}

.portrait-link:hover {
    transform: scale(1.05);
}

.portrait-link:hover img {
    filter: grayscale(0%);
}

.profile-bio { padding-top: 8px; }

.profile-bio p {
    color: var(--text-secondary);
    max-width: 55ch;
}

/* — Pillars — */
.pillar-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: var(--gutter);
    padding-top: var(--stack-lg);
    border-top: 1px solid var(--border-subtle);
}

.pillar-icon {
    margin-bottom: 20px;
    color: var(--text-primary);
    opacity: 0.7;
}

.pillar-icon svg,
.pillar-icon img {
    display: block;
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.pillar h3 {
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
    line-height: 28px;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.pillar p {
    color: var(--text-secondary);
    max-width: 45ch;
}

.pillar-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.2s ease;
}

.pillar-link:hover {
    opacity: 0.6;
}

.cv-btn {
    grid-column: 1 / -1;
    margin-top: var(--stack-lg);
    display: inline-block;
    width: fit-content;
    padding: 14px 28px;
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

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

/* ============================================================
   PROJECT INDEX — Cards with hover overlay + vignette
   ============================================================ */

.project-index {
    padding-bottom: var(--stack-xl);
}

.index-description {
    grid-column: 1 / -1;
    color: var(--text-secondary);
    margin-top: calc(var(--stack-lg) * -1 + 16px);
    margin-bottom: var(--stack-lg);
    max-width: 65ch;
}

.category-header {
    grid-column: 1 / -1;
    border-bottom: 1px solid var(--border-strong);
    padding-bottom: 12px;
    margin-bottom: var(--stack-md);
}

.category-header h3 {
    font-size: clamp(14px, 4vw, 18px);
    font-weight: 600;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: nowrap;
}

/* — Featured — */
.project-featured {
    grid-column: 1 / -1;
    margin-bottom: var(--stack-lg);
}

.project-card--featured .project-card-image {
    aspect-ratio: 21 / 9;
}

/* — Pair — */
.project-pair {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: var(--gutter);
    margin-bottom: var(--stack-lg);
}

.project-card {
    display: block;
    cursor: pointer;
}

.project-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    margin-bottom: 16px;
    position: relative;
}

.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.3s ease, transform 0.3s ease;
    will-change: filter, transform;
}

/* — Vignette — */
.project-card-image::before {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 40px 10px var(--vignette-color);
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.3s ease;
}

/* — Hover overlay with title — */
.project-hover-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0);
    transition: background-color 0.3s ease;
    pointer-events: none;
}

.project-hover-title {
    font-family: 'Inter', sans-serif;
    font-size: clamp(20px, 2.5vw, 36px);
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    will-change: opacity, transform;
    text-align: center;
    padding: 0 20px;
}

/* — Hover state: colour, scale, overlay, no vignette — */
.project-card:hover .project-card-image img,
.project-card.hover-active .project-card-image img {
    filter: grayscale(0%);
    transform: scale(1.02);
}

.project-card:hover .project-card-image::before,
.project-card.hover-active .project-card-image::before {
    opacity: 0;
}

.project-card:hover .project-hover-overlay {
    background-color: rgba(0, 0, 0, 0.4);
}

.project-card:hover .project-hover-title {
    opacity: 1;
    transform: translateY(0);
}

.project-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.project-card-meta .project-number {
    display: none;
}

.project-type-label {
    color: var(--text-muted);
    font-weight: 400;
}

/* — Archive link — */
.archive-link-wrapper {
    grid-column: 1 / -1;
    margin-top: var(--stack-md);
    padding-top: var(--stack-md);
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.archive-link {
    display: inline-block;
    padding: 16px 40px;
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.archive-link:hover {
    background-color: var(--accent-primary);
    color: var(--accent-primary-text);
    border-color: var(--accent-primary);
}

/* ============================================================
   CREATIVE SECTION
   ============================================================ */

.creative-section {
    padding-top: var(--stack-xl);
    padding-bottom: var(--stack-xl);
    border-top: 1px solid var(--border-subtle);
}

.creative-grid { margin-top: var(--stack-md); }

.creative-card {
    grid-column: span 6;
    display: block;
    position: relative;
    overflow: hidden;
}

.creative-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    position: relative;
}

.creative-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.4s ease, transform 0.4s ease;
    will-change: filter, transform;
}

.creative-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 60px 15px var(--vignette-color);
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.creative-card:hover .creative-card-image img,
.creative-card.hover-active .creative-card-image img {
    filter: grayscale(0%);
    transform: scale(1.02);
}

.creative-card:hover .creative-card-image::after,
.creative-card.hover-active .creative-card-image::after {
    opacity: 0;
}

.creative-card-title {
    margin-top: 16px;
    text-align: center;
    color: var(--text-primary);
}

/* Coming-soon (non-clickable) creative card */
.creative-card--soon {
    cursor: default;
}
.creative-card--soon .creative-card-image img {
    filter: grayscale(100%);
    opacity: 0.65;
}
.creative-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 4px 10px;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--text-primary);
    border-radius: 2px;
}

/* ============================================================
   CONTACT SECTION
   ============================================================ */

.contact-section {
    background-color: var(--nav-bg);
    color: var(--nav-text);
    padding: var(--stack-xl) 0 var(--stack-lg);
}

.contact-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.contact-portrait {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: var(--stack-md);
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.contact-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact-name {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.9;
    margin-bottom: 8px;
}

.contact-role {
    font-size: 15px;
    opacity: 0.5;
    margin-bottom: var(--stack-md);
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--nav-text);
    font-size: 15px;
    font-weight: 400;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    text-decoration: none;
}

.contact-link:hover {
    opacity: 1;
}

.contact-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
    background-color: var(--nav-bg);
    color: var(--nav-text);
    padding: var(--stack-md) 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-content p { opacity: 0.5; font-size: 12px; }

/* ============================================================
   PDF MODAL / LIGHTBOX
   ============================================================ */

.pdf-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pdf-modal.is-active {
    opacity: 1;
    visibility: visible;
}

.pdf-modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.pdf-modal-container {
    position: relative;
    width: 90vw;
    height: 90vh;
    max-width: 1200px;
    background-color: var(--bg-surface-elevated);
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    will-change: transform;
}

.pdf-modal.is-active .pdf-modal-container {
    transform: translateY(0);
}

.pdf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background-color: var(--nav-bg);
    color: var(--nav-text);
    flex-shrink: 0;
}

.pdf-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    color: var(--nav-text);
    transition: opacity 0.2s ease;
}

.pdf-modal-close:hover { opacity: 0.7; }

.pdf-modal-body {
    flex: 1;
    min-height: 0;
}

.pdf-modal-body iframe {
    border: none;
    display: block;
}

/* Lock scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* ============================================================
   PROJECT PAGE SPECIFICS
   ============================================================ */

.project-hero-image {
    position: relative;
    margin-top: 56px;
    width: 100%;
    height: 75vh;
    background-size: cover;
    background-position: center;
}

.project-hero-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--gradient-end) 100%
    );
    pointer-events: none;
}

.project-title-block {
    grid-column: 1 / -1;
    padding-top: var(--stack-lg);
    padding-bottom: var(--stack-md);
}

.project-metadata-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: var(--gutter);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--stack-md);
    margin-bottom: var(--stack-lg);
}

.meta-item .meta-label {
    color: var(--text-muted);
    margin-bottom: 8px;
}

.meta-item .meta-value { color: var(--text-primary); }

.project-content-image {
    grid-column: 2 / 12;
    margin-bottom: var(--stack-xl);
}

.project-content-image img { width: 100%; }

.project-content-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 64px;
    margin-bottom: 80px;
    align-items: start;
}

.project-description h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 28px;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.project-description p { color: var(--text-secondary); }

.skills-card {
    background-color: var(--bg-skills);
    padding: 32px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.skills-card h4 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.skills-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.skills-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.skills-list li::before {
    content: "•";
    position: absolute;
    left: 8px;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .project-content-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

.project-download {
    grid-column: 1 / -1;
    margin-bottom: var(--stack-lg);
}

.project-nav-bar {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    padding-top: var(--stack-md);
    padding-bottom: var(--stack-md);
    border-top: 1px solid var(--border-subtle);
}

.project-nav-bar a {
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.project-nav-bar a:hover { color: var(--text-primary); }

.back-link-circle {
    position: fixed;
    top: 100px;
    left: var(--margin-desktop);
    z-index: 90;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--nav-bg);
    color: var(--nav-text);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.back-link-circle:hover {
    transform: scale(1.1);
    background-color: var(--accent-primary);
    color: var(--accent-primary-text);
    border-color: var(--accent-primary);
}

.back-link-circle svg {
    width: 20px;
    height: 20px;
}

/* ============================================================
   ARCHIVE INDEX
   ============================================================ */

.archive-page {
    min-height: 100vh;
}

.archive-header {
    grid-column: 1 / -1;
    margin-top: 56px;
    padding-top: var(--stack-lg);
    padding-bottom: var(--stack-md);
    border-bottom: 1px solid var(--border-strong);
    margin-bottom: var(--stack-md);
}

.archive-list {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border-strong);
    margin-bottom: var(--stack-xl);
}

.archive-item {
    display: grid;
    grid-template-columns: 3fr 1fr 2fr 4fr;
    column-gap: var(--gutter);
    padding: 24px 0;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-primary);
    position: relative;
    transition: color 0.3s ease, background-color 0.3s ease;
    align-items: baseline;
}

.archive-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--accent-primary);
    transform: scaleY(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

.archive-item:hover {
    background-color: var(--accent-secondary);
}

.archive-item:hover::before {
    transform: scaleY(1);
}

.archive-item-title {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.archive-item-year {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.archive-item-tags {
    color: var(--text-secondary);
}

.archive-item-desc {
    color: var(--text-secondary);
}

/* ============================================================
   EDITORIAL STACK (Native Image Viewing)
   ============================================================ */

.editorial-stack {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.editorial-stack img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 6rem; /* Generous white space between pages */
    background-color: var(--bg-surface); /* Fallback for transparency/loading */
}

.editorial-stack.is-large-project {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem;
}

.editorial-stack.is-large-project img {
    margin-bottom: 0;
}

/* ============================================================
   STICKY PROJECT NAVIGATION
   ============================================================ */

.sticky-project-nav {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(var(--bg-surface-rgb), 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 40px;
    padding: 12px 24px;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid var(--border-subtle);
}

.sticky-project-nav .nav-inner {
    display: flex;
    align-items: center;
    gap: 24px;
}

.sticky-project-nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.sticky-project-nav a:hover {
    opacity: 0.6;
}

.sticky-project-nav .nav-back {
    font-weight: 700;
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */


@media (max-width: 768px) {
    .editorial-stack.is-large-project {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .grid-frame {
        grid-template-columns: repeat(4, 1fr);
        padding-left: var(--margin-mobile);
        padding-right: var(--margin-mobile);
    }

    .display-xl {
        font-size: 56px;
        line-height: 58px;
        letter-spacing: -0.03em;
    }

    .display-lg {
        font-size: 32px;
        line-height: 36px;
        letter-spacing: -0.02em;
    }

    .headline-lg {
        font-size: 28px;
        line-height: 32px;
    }

    .section-header {
        font-size: clamp(18px, 5.5vw, 30px);
        line-height: 1.3;
    }

    .category-header h3 {
        font-size: clamp(14px, 4.5vw, 22px);
        line-height: 1.5;
    }

    .name-block-title {
        font-size: clamp(24px, 10vw, 48px);
        line-height: 0.9;
        white-space: nowrap;
    }

    .profile-intro {
        grid-template-columns: 1fr;
        row-gap: var(--stack-md);
    }

    .portrait-link {
        width: min(72vw, 280px);
        height: min(72vw, 280px);
        margin: 0 auto;
    }

    .profile-bio { text-align: left; }

    .pillar-grid {
        grid-template-columns: 1fr;
        row-gap: var(--stack-md);
    }

    .project-pair {
        grid-template-columns: 1fr;
        row-gap: var(--stack-md);
    }

    .project-featured { grid-column: 1 / -1; }

    .project-card--featured .project-card-image {
        aspect-ratio: 16 / 9;
    }

    .creative-card {
        grid-column: 1 / -1;
        margin-bottom: var(--stack-md);
    }

    .project-content-image,
    .project-text-col {
        grid-column: 1 / -1;
    }

    .project-metadata-grid {
        grid-template-columns: 1fr;
        row-gap: 24px;
    }

    .nav-left { 
        grid-column: 1 / 4; 
        flex-wrap: nowrap;
        white-space: nowrap;
    }
    
    .nav-avatar {
        width: 40px;
        height: 40px;
    }

    .nav-right { 
        grid-column: 4 / 5; 
        gap: 12px; 
        justify-content: flex-end;
    }
    
    .nav-links { 
        display: none; 
    }

    .sticky-project-nav {
        bottom: 24px;
        width: 92%;
        padding: 8px 16px;
        border-radius: 30px;
    }

    .sticky-project-nav .nav-inner {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 12px;
    }

    .sticky-project-nav a {
        padding: 8px 10px;
        font-size: 12px;
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
    }

    /* Small mobile screens */
    @media (max-width: 380px) {
        .sticky-project-nav {
            padding: 6px 12px;
        }
        .sticky-project-nav .nav-inner {
            gap: 6px;
        }
        .sticky-project-nav a {
            padding: 6px 8px;
            font-size: 11px;
        }
    }

    /* Extra small mobile screens */
    @media (max-width: 320px) {
        .sticky-project-nav {
            padding: 4px 8px;
            width: 96%;
        }
        .sticky-project-nav .nav-inner {
            gap: 4px;
        }
        .sticky-project-nav a {
            padding: 4px 6px;
            font-size: 10px;
        }
    }

    /* Mobile-specific hero images per theme */
    [data-theme="light"],
    :root {
        --hero-image: url('../public/images/PortfolioomslagmobilVIT.webp');
    }
    [data-theme="dark"] {
        --hero-image: url('../public/images/PortfolioomslagmobilMORK.webp');
    }

    .hero {
        height: auto;
    }

    [data-theme="light"] .hero {
        aspect-ratio: 855 / 1332;
    }

    [data-theme="dark"] .hero {
        aspect-ratio: 848 / 1389;
    }

    .hero-bg {
        background-size: 100% 100%;
        background-position: center;
        background-repeat: no-repeat;
    }

    .back-link {
        padding: 12px var(--margin-mobile);
    }

    .pdf-modal-container {
        width: 100vw;
        height: 100vh;
        max-width: none;
        border-radius: 0;
    }

    .archive-item {
        grid-template-columns: 1fr;
        row-gap: 8px;
        padding: 24px 0;
    }

    .archive-item-year,
    .archive-item-tags,
    .archive-item-desc {
        font-size: 14px;
    }
}

/* — Scroll Reveal — */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), 
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

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

/* ============================================================
   MASONRY GALLERY (Grafisk Design)
   ============================================================ */

.masonry-gallery {
    column-count: 1;
    column-gap: 2rem;
    padding: 2rem 0;
}

@media (min-width: 768px) {
    .masonry-gallery {
        column-count: 2;
    }
}

@media (min-width: 1024px) {
    .masonry-gallery {
        column-count: 3;
    }
}

@media (min-width: 1440px) {
    .masonry-gallery {
        column-count: 4;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.4s ease,
                filter 0.4s ease;
    will-change: transform, opacity;
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* — Hovered item: dramatic pop — */
.masonry-item:hover {
    z-index: 10;
}

.masonry-item:hover img {
    transform: scale(1.4);
    box-shadow:
        0 32px 90px rgba(0, 0, 0, 0.35),
        0 14px 32px rgba(0, 0, 0, 0.22);
}

/* — Dim non-hovered siblings when any item is hovered (scatter handled by JS) — */
.masonry-gallery:has(.masonry-item:hover) .masonry-item:not(:hover) {
    opacity: 0.45;
    filter: saturate(0.5) blur(1px);
}

/* Dark mode: brighter shadow glow */
[data-theme="dark"] .masonry-item:hover img {
    box-shadow:
        0 32px 90px rgba(0, 0, 0, 0.55),
        0 0 50px rgba(184, 202, 197, 0.1);
}
}

/* ============================================================
   ARCHIVE HIGHLIGHT (Recently Viewed)
   ============================================================ */
.archive-item.recently-viewed {
    position: relative;
    padding-left: 1rem;
    background-color: var(--bg-secondary);
}

.archive-item.recently-viewed::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 2px;
    background-color: var(--accent-primary);
    opacity: 0.8;
}

[data-theme="dark"] .archive-item.recently-viewed {
    background-color: rgba(184, 202, 197, 0.05); /* Slight tint of accent-primary */
}

/* ============================================================
   MOBILE MENU PANEL
   ============================================================ */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--nav-text);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transition: opacity 0.2s ease, border-color 0.2s ease;
    position: relative;
    z-index: 110;
    pointer-events: auto;
}

.mobile-menu-toggle:hover {
    opacity: 0.8;
    border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

.mobile-menu-panel {
    position: fixed;
    inset: 0;
    z-index: 95; /* Below nav bar (100) but above content */
    background-color: var(--nav-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: translateX(100%); /* Slide from right */
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s, opacity 0.4s;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.mobile-menu-panel.is-open {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu-links {
    list-style: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.mobile-menu-links a {
    font-size: 24px;
    color: var(--nav-text);
    text-decoration: none;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* ============================================================
   CV PAGE
   ============================================================ */

.cv-page {
    margin-top: 56px;
    padding-top: var(--stack-lg);
    padding-bottom: var(--stack-xl);
    align-items: start;
}

.cv-page-header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: var(--stack-md);
    border-bottom: 1px solid var(--border-strong);
    margin-bottom: var(--stack-md);
}

.cv-page-name {
    font-size: clamp(40px, 7vw, 80px);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.cv-page-role {
    color: var(--text-muted);
}

.cv-page-portrait {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    align-self: flex-end;
}

@media (max-width: 768px) {
    .cv-page-portrait {
        width: 100px;
        height: 100px;
    }
}

/* Two-column layout */
.cv-col-left {
    grid-column: 1 / 5;
    border-right: 1px solid var(--border-subtle);
    padding-right: 16px;
}

.cv-col-right {
    grid-column: 5 / 13;
}

/* Content blocks */
.cv-block {
    margin-bottom: var(--stack-lg);
}

.cv-block:last-child {
    margin-bottom: 0;
}

.cv-block-heading {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

/* Contact */
.cv-contact-block {
    font-style: normal;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cv-contact-item {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.cv-contact-item a {
    color: inherit;
    transition: color 0.2s ease;
}

.cv-contact-item a:hover {
    color: var(--text-primary);
}

/* Body text */
.cv-body-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Bullet lists */
.cv-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cv-bullets li {
    position: relative;
    padding-left: 14px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.cv-bullets li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--text-muted);
}

.cv-bullets strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Languages */
.cv-lang-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cv-lang-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.cv-lang-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.cv-lang-level {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* Experience & education entries */
.cv-entry {
    padding-bottom: 32px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-subtle);
}

.cv-entry:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.cv-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.cv-entry-company {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 3px;
}

.cv-entry-role {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.cv-entry-meta {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 2px;
}

/* Education layout — meta and description stacked, no flex header */
.cv-entry--edu .cv-entry-meta {
    display: block;
    margin-top: 4px;
    margin-bottom: 8px;
    white-space: normal;
}

/* CV mobile */
@media (max-width: 768px) {
    .cv-col-left {
        grid-column: 1 / -1;
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        padding-bottom: var(--stack-lg);
    }

    .cv-col-right {
        grid-column: 1 / -1;
    }

    .cv-entry-header {
        flex-direction: column;
        gap: 4px;
    }

    .cv-entry-meta {
        white-space: normal;
    }
}

/* ============================================================
   DIGITAL PROCESS PAGE
   ============================================================ */

.dp-page {
    margin-top: 56px;
    padding-bottom: var(--stack-xl);
    align-items: start;
}

/* Hero */
.dp-hero {
    grid-column: 1 / -1;
    padding-top: var(--stack-lg);
    padding-bottom: var(--stack-xl);
    border-bottom: 1px solid var(--border-strong);
}

.dp-eyebrow {
    display: block;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.dp-title {
    font-size: clamp(36px, 6vw, 72px);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 28px;
}

.dp-intro {
    font-size: 18px;
    line-height: 1.65;
    color: var(--text-secondary);
    max-width: 62ch;
}

/* Sections */
.dp-section {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 64px 1fr;
    column-gap: var(--gutter);
    padding-top: var(--stack-xl);
    padding-bottom: var(--stack-xl);
    border-top: 1px solid var(--border-subtle);
    align-items: start;
}

.dp-section-num {
    display: block;
    color: var(--text-muted);
    padding-top: 7px;
}

.dp-heading {
    font-size: clamp(22px, 3.5vw, 32px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.dp-body-text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 65ch;
    margin-bottom: var(--stack-md);
    display: block;
}

/* Results list */
.dp-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 65ch;
}

.dp-results-list li {
    position: relative;
    padding-left: 20px;
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-secondary);
}

.dp-results-list li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

.dp-results-list strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Flow chart */
.dp-flow {
    display: flex;
    align-items: stretch;
    margin-top: var(--stack-md);
    border: 1px solid var(--border-subtle);
    background-color: var(--bg-surface);
}

.dp-step {
    flex: 1;
    padding: 28px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-right: 1px solid var(--border-subtle);
}

.dp-step:last-child {
    border-right: none;
}

.dp-step-num {
    display: block;
    color: var(--accent-primary);
}

.dp-step-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--text-primary);
}

.dp-step-desc {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
    flex: 1;
}

.dp-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 14px;
    letter-spacing: 0;
}

.dp-poc {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: var(--stack-md);
}

.dp-poc-code {
    background: #1a1a1a;
    padding: 28px 32px;
    overflow-x: auto;
}

.dp-poc-code pre {
    margin: 0;
}

.dp-poc-code code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.75;
    color: #d4d4d4;
    white-space: pre;
}

.dp-poc-placeholder {
    aspect-ratio: 16 / 9;
    background: var(--bg-surface-dim);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
    font-style: italic;
}

.dp-poc-caption {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* — Sub-eyebrow / mini heads — */
.dp-subeyebrow {
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.12em;
    margin-bottom: 10px;
}
.dp-minihead {
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.14em;
    margin: var(--stack-lg) 0 18px;
}

/* — Iterative loop animation — */
.ai-loop {
    --size: 380px;
    --r: 148px;
    --inset: 42px;
    position: relative;
    width: var(--size);
    max-width: 100%;
    aspect-ratio: 1;
    margin: 8px auto var(--stack-md);
}
.ai-loop-spin {
    position: absolute;
    inset: var(--inset);
    border-radius: 50%;
    border: 2px dashed var(--border-subtle);
}
.ai-loop-spin::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 70%, var(--accent-primary) 86%, transparent 100%);
    -webkit-mask: radial-gradient(circle, transparent calc(50% - 4px), #000 calc(50% - 2px));
    mask: radial-gradient(circle, transparent calc(50% - 4px), #000 calc(50% - 2px));
    animation: ai-loop-spin 7s linear infinite;
}
@keyframes ai-loop-spin { to { transform: rotate(360deg); } }
.ai-loop-center {
    position: absolute;
    inset: 27%;
    border-radius: 50%;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px;
    gap: 6px;
}
.ai-loop-center .label-caps { font-size: 10px; letter-spacing: 0.12em; color: var(--text-muted); }
.ai-loop-center-note { font-size: 12px; line-height: 1.35; color: var(--text-primary); max-width: 15ch; }
.ai-loop-node {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 78px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    text-align: center;
    transform: translate(-50%, -50%) rotate(calc(var(--i) * 72deg)) translateY(calc(var(--r) * -1)) rotate(calc(var(--i) * -72deg));
}
.ai-loop-dot {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--text-primary);
    color: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ai-loop-dot svg { width: 22px; height: 22px; }
.ai-loop-label { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--text-secondary); }

/* — Loop legend — */
.ai-loop-legend {
    list-style: none;
    margin: 0 auto var(--stack-md);
    padding: 0;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ai-loop-legend li {
    display: flex;
    gap: 12px;
    align-items: baseline;
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-secondary);
}
.ai-loop-legend-num { flex-shrink: 0; min-width: 22px; color: var(--text-muted); font-size: 11px; letter-spacing: 0.1em; }

/* — Where AI entered: card grid — */
.ai-areas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
    gap: 14px;
    margin-bottom: var(--stack-md);
}
.ai-area {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 20px 22px;
}
.ai-area-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ai-area-ico {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-secondary);
    color: var(--text-primary);
}
.ai-area-ico svg { width: 20px; height: 20px; }
.ai-area-num { color: var(--text-muted); font-size: 11px; letter-spacing: 0.1em; }
.ai-area h4 { font-size: 15px; margin: 0 0 6px; color: var(--text-primary); }
.ai-area p { font-size: 13px; line-height: 1.5; color: var(--text-secondary); }

/* — Honest reflection blockquote — */
.dp-reflection {
    margin: var(--stack-md) 0;
    padding: 4px 0 4px 24px;
    border-left: 3px solid var(--accent-primary);
}
.dp-reflection p { font-size: clamp(15px, 1.8vw, 18px); line-height: 1.6; color: var(--text-primary); font-style: italic; }

/* — Case links — */
.dp-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: var(--stack-md); }
.dp-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    background: var(--btn-bg);
    color: var(--btn-text);
    text-decoration: none;
    font-size: 11px;
    letter-spacing: 0.1em;
    border: 1px solid var(--btn-bg);
    transition: opacity 0.2s ease;
}
.dp-link:hover { opacity: 0.75; }
.dp-link--ghost { background: transparent; color: var(--text-primary); border-color: var(--border-subtle); }

/* — Maturity status pills — */
.dp-status {
    display: inline-block;
    font-size: 10px;
    letter-spacing: 0.1em;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid currentColor;
    white-space: nowrap;
}
.dp-status--dev { color: #2f7d5b; }
.dp-status--proto { color: #a8792a; }
.dp-status--concept { color: var(--text-muted); }

/* — Lab items — */
.dp-lab-item { margin-top: var(--stack-md); }
.dp-lab-item .source-card { margin-bottom: 18px; }
.source-card-url--static { color: var(--text-muted); cursor: default; }
.dp-lab-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.dp-lab-title { font-size: clamp(20px, 2.4vw, 26px); color: var(--text-primary); }
.dp-lab-tagline { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }

/* — Lab carousel (inside the app-window frame) — */
.lab-count { margin-left: auto; flex-shrink: 0; font-size: 10px; letter-spacing: 0.1em; color: var(--text-muted); }
.lab-count b { color: var(--text-primary); font-weight: 600; }
.lab-carousel { position: relative; }
.lab-viewport { position: relative; overflow: hidden; background: var(--bg-surface-dim); }
.lab-track { display: flex; transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.lab-slide { flex: 0 0 100%; }
.lab-slide img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: contain;
    background: var(--bg-surface-dim);
}
.lab-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: opacity 0.2s ease, background 0.2s ease;
}
.lab-nav:hover { opacity: 1; }
.lab-prev { left: 12px; }
.lab-next { right: 12px; }
.lab-captions { padding: 16px 18px 4px; min-height: 3.4em; }
.lab-cap { display: none; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.lab-cap.is-active { display: block; }
.lab-dots { display: flex; gap: 8px; justify-content: center; padding: 12px 0 4px; }
.lab-dots button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: var(--border-subtle);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}
.lab-dots button.is-active { background: var(--text-primary); transform: scale(1.25); }

@media (max-width: 600px) {
    .lab-nav { width: 34px; height: 34px; font-size: 19px; }
    .lab-prev { left: 8px; }
    .lab-next { right: 8px; }
}

/* — Also exploring (R&D list) — */
.dp-rd-list { list-style: none; padding: 0; margin: 0; }
.dp-rd-list li {
    display: flex;
    gap: 14px;
    align-items: baseline;
    padding: 16px 0;
    border-top: 1px solid var(--border-subtle);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}
.dp-rd-list strong { color: var(--text-primary); }

@media (prefers-reduced-motion: reduce) {
    .ai-loop-spin::after { animation: none; }
}

@media (max-width: 600px) {
    .ai-loop { --size: 300px; --r: 116px; --inset: 34px; }
    .ai-loop-dot { width: 40px; height: 40px; }
    .ai-loop-dot svg { width: 19px; height: 19px; }
    .ai-loop-label { font-size: 11px; }
    .ai-loop-center-note { font-size: 11px; }
}
@media (max-width: 360px) {
    .ai-loop { --size: 268px; --r: 103px; --inset: 30px; }
}

/* Flow chart mobile */
@media (max-width: 768px) {
    .dp-section {
        grid-template-columns: 1fr;
        row-gap: var(--stack-md);
    }

    .dp-section-num {
        padding-top: 0;
    }

    .dp-flow {
        flex-direction: column;
        border: none;
        background-color: transparent;
    }

    .dp-step {
        border-right: none;
        border: 1px solid var(--border-subtle);
        border-bottom: none;
        background-color: var(--bg-surface);
    }

    .dp-step:last-child {
        border-bottom: 1px solid var(--border-subtle);
    }

    .dp-arrow {
        display: none;
    }

    .dp-poc {
        grid-template-columns: 1fr;
    }
}

/* Scroll Hover State for Mobile — colour + scale, no title overlay */
@media (max-width: 768px) {
    .project-card.hover-active .project-card-image img,
    .creative-card.hover-active .creative-card-image img {
        filter: grayscale(0%);
        transform: scale(1.05);
    }

    .project-card.hover-active .project-card-image::before,
    .creative-card.hover-active .creative-card-image::after {
        opacity: 0;
    }

    /* Profile portrait — colour + scale on mobile scroll */
    .portrait-link.hover-active {
        transform: scale(1.05);
    }
    .portrait-link.hover-active img {
        filter: grayscale(0%);
    }

    /* Animate project name below image — bigger when card pops */
    .project-name {
        display: inline-block;
        transition: font-size 0.3s ease, letter-spacing 0.3s ease;
    }

    .project-card.hover-active .project-name {
        font-size: 14px;
        letter-spacing: 0.08em;
    }

    [data-theme="dark"] .archive-item.hover-active {
        background: rgba(255, 255, 255, 0.05);
        color: var(--text-primary);
    }
    [data-theme="light"] .archive-item.hover-active {
        background: rgba(0, 0, 0, 0.03);
        color: var(--text-primary);
    }

    .profile-image {
        grid-column: 1 / -1;
        width: 100%;
    }
    .profile-image img {
        width: 100%;
        height: auto;
    }
}

/* ============================================================
   ACCESSIBILITY — Reduced motion
   Honour the OS "reduce motion" setting: disable scroll/reveal
   animations and ensure all content is visible regardless.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    .reveal-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============================================================
   PRAKTIK PAGE
   ============================================================ */

/* — Section Divider Header — */
.praktik-section-header {
    padding-top: var(--stack-xl);
    padding-bottom: var(--stack-md);
    border-top: 1px solid var(--border-strong);
}

.praktik-section-header h2 {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text-primary);
}

/* — Welcome image (inline, after intro) — */
.praktik-welcome-image {
    margin-top: var(--stack-lg);
    margin-bottom: var(--stack-xl);
}

.praktik-welcome-image img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 520px;
    object-fit: cover;
    object-position: center 35%;
}

/* — Welcome article (Nyréns text) — */
.praktik-welcome-article {
    margin-bottom: var(--stack-xl);
}

.praktik-welcome-text {
    max-width: 68ch;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.praktik-welcome-heading {
    font-size: clamp(18px, 2.5vw, 26px);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--text-primary);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.praktik-welcome-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 2px;
    letter-spacing: 0.1em;
    font-size: 10px;
    transition: opacity 0.2s ease;
}

.praktik-welcome-link:hover {
    opacity: 0.55;
}

/* — External source / clipping card (makes excerpts clearly third-party) — */
.source-card {
    margin: 0 0 var(--stack-xl);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-surface-elevated);
}
.source-card-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-surface-dim);
    border-bottom: 1px solid var(--border-subtle);
}
.source-card-dots {
    display: inline-flex;
    gap: 6px;
    flex-shrink: 0;
}
.source-card-dots i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-subtle);
    display: block;
}
.source-card-url {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex: 1;
    max-width: 360px;
    margin: 0 auto;
    padding: 5px 14px;
    background: var(--bg-body);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 0.02em;
    transition: opacity 0.2s ease;
}
.source-card-url:hover { opacity: 0.6; }
.source-card-url svg { width: 13px; height: 13px; flex-shrink: 0; }
.source-card-tag {
    flex-shrink: 0;
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    padding: 3px 8px;
    border-radius: 3px;
    white-space: nowrap;
}
.source-card-media img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 520px;
    object-fit: cover;
    object-position: center 35%;
}
.source-card-media--articles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border-subtle);
}
.source-card-media--articles img { max-height: none; }
.source-card-body {
    padding: clamp(22px, 4vw, 40px);
}

/* — External article block (heading above a source card) — */
.praktik-article-block {
    margin-top: var(--stack-xl);
}
.praktik-article-head {
    margin-bottom: 20px;
}
.praktik-article-title {
    font-size: clamp(18px, 2.5vw, 26px);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--text-primary);
    margin-top: 6px;
}

@media (max-width: 600px) {
    .source-card-dots,
    .source-card-tag { display: none; }
    .source-card-url { max-width: none; }
    .source-card-media--articles {
        grid-template-columns: 1fr;
    }
}

/* — Under-arbete placeholder card — */
.praktik-placeholder-wrap {
    aspect-ratio: 4 / 3;
    border: 1.5px dashed var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-surface-dim);
}

.praktik-placeholder-badge {
    color: var(--text-muted);
    letter-spacing: 0.12em;
    font-size: 10px;
}

/* — Sub-project grid — */
.praktik-subproject-grid {
    display: flex;
    flex-direction: column;
    gap: var(--stack-xl);
    padding-bottom: var(--stack-xl);
}

.praktik-subproject {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 64px;
    align-items: start;
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--stack-lg);
}

.praktik-subproject:nth-child(even) {
    grid-template-columns: 0.9fr 1.1fr;
}

.praktik-subproject:nth-child(even) .praktik-subproject-images {
    order: 2;
}

.praktik-subproject:nth-child(even) .praktik-subproject-meta {
    order: 1;
}

.praktik-subproject-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.praktik-subproject-images--single {
    grid-template-columns: 1fr;
}

.praktik-img-wrap {
    overflow: hidden;
    background-color: var(--bg-surface-dim);
}

.praktik-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 4 / 3;
    display: block;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.praktik-img-wrap:hover img {
    transform: scale(1.03);
}

.praktik-subproject-meta {
    padding: 8px 0;
}

.praktik-sub-label {
    margin-bottom: 10px;
    display: block;
}

.praktik-sub-title {
    font-size: clamp(22px, 3vw, 36px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 20px;
}

/* — Vaksala expanded section — */
.praktik-vaksala-block {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border-strong);
    padding-top: var(--stack-xl);
    padding-bottom: var(--stack-xl);
}

.praktik-vaksala-header {
    margin-bottom: var(--stack-lg);
}

.praktik-vaksala-title {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text-primary);
    margin-top: 10px;
}

/* Vaksala image gallery */
.praktik-vaksala-gallery {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: var(--stack-lg);
}

.praktik-vaksala-img-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.praktik-vaksala-img-pair img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.praktik-vaksala-img-full img {
    width: 100%;
    height: auto;
    display: block;
}

/* Artiklar */
.praktik-vaksala-articles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: var(--stack-xl);
}

.praktik-vaksala-articles img {
    width: 100%;
    height: auto;
    display: block;
}

/* — Pergola sub-section — */
.praktik-pergola-block {
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--stack-lg);
}

.praktik-pergola-header {
    margin-bottom: var(--stack-lg);
}

.praktik-pergola-title {
    font-size: clamp(20px, 3vw, 32px);
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.2;
    color: var(--text-primary);
}

/* ============================================================
   PERGOLA — SIDE-BY-SIDE COMPARISON
   ============================================================ */

/* Outer stack: one pair per row */
.pergola-sidebyside-stack {
    display: flex;
    flex-direction: column;
    gap: var(--stack-lg);
    margin-bottom: var(--stack-lg);
}

/* Each pair: label row + [img | arrow | img] */
.pergola-sidebyside {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto 1fr;
    column-gap: 24px;
    align-items: center;
}

/* The view-label spans all three columns */
.pergola-sidebyside > .label-caps {
    grid-column: 1 / -1;
    grid-row: 1;
}

/* Image cards */
.pergola-img-card {
    grid-row: 2;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border-subtle);
    background-color: var(--bg-surface-dim);
    overflow: hidden;
}

.pergola-img-card img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.pergola-img-card:hover img {
    transform: scale(1.02);
}

/* Caption strip at the bottom of each card */
.pergola-img-caption {
    display: block;
    padding: 10px 14px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    background-color: var(--bg-surface);
    font-size: 10px;
    letter-spacing: 0.1em;
}

/* Arrow column */
.pergola-arrow {
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.pergola-arrow-desktop {
    display: block;
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

.pergola-arrow-mobile {
    display: none;
    width: 36px;
    height: 36px;
    opacity: 0.5;
}

/* Extra Pergola images (vy 3 & 4) */
.praktik-pergola-extras {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: var(--stack-md);
}

.praktik-pergola-extras img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

/* ============================================================
   PRAKTIK — RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .praktik-subproject {
        grid-template-columns: 1fr;
        gap: var(--stack-md);
    }

    .praktik-subproject:nth-child(even) {
        grid-template-columns: 1fr;
    }

    .praktik-subproject:nth-child(even) .praktik-subproject-images,
    .praktik-subproject:nth-child(even) .praktik-subproject-meta {
        order: unset;
    }

    .praktik-subproject-images {
        grid-template-columns: 1fr 1fr;
    }

    .praktik-vaksala-img-pair {
        grid-template-columns: 1fr;
    }

    .praktik-vaksala-articles {
        grid-template-columns: 1fr;
    }

    /* Pergola: stack vertically on mobile */
    .pergola-sidebyside {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        row-gap: 16px;
    }

    .pergola-sidebyside > .label-caps {
        grid-column: 1;
        grid-row: 1;
    }

    /* first img-card */
    .pergola-sidebyside .pergola-img-card:first-of-type {
        grid-row: 2;
    }

    /* arrow */
    .pergola-arrow {
        grid-row: 3;
    }

    /* second img-card */
    .pergola-sidebyside .pergola-img-card:last-of-type {
        grid-row: 4;
    }

    .pergola-arrow-desktop { display: none; }
    .pergola-arrow-mobile  { display: block; }

    .praktik-pergola-extras {
        grid-template-columns: 1fr;
    }
}
