@font-face {
    font-family: "Brockmann";
    src: url("font/brockmann-medium-webfont.woff2") format("woff2");
    font-display: swap;
}

:root {
    --bg: #f9f4ec;
    --surface: #ffffff;
    --ink: #142900;
    --muted: #5b5b5b;
    --accent: #66f57a;
    --back: #142900;
    --radius: 22px;
}

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

html,
body {
    height: 100%;
}

body {
    font-family:
        "Brockmann",
        -apple-system,
        BlinkMacSystemFont,
        "Inter",
        "Segoe UI",
        Helvetica,
        Arial,
        sans-serif;
    font-size: 16px;
    color: var(--ink);
    background:
        radial-gradient(
            1800px 650px at 0% 0%,
            rgba(102, 245, 122, 0.16),
            rgba(102, 245, 122, 0) 60%
        ),
        var(--bg);
    padding: clamp(1rem, 4vw, 4rem);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
}

.container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
    gap: clamp(0.75rem, 1.5vw, 1.25rem);
    width: 100%;
    height: 100%;
    max-width: 1100px;
    max-height: 600px;
    margin: 0 auto;
}

.left {
    position: relative;
    background-image: url("pf.webp");
    background-size: cover;
    background-position: center;
    background-color: #b9d2dd;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    gap: 1rem;
    padding: clamp(1rem, 2.5vw, 1.75rem);
}

.story-play {
    align-self: center;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: #fff;
    font: inherit;
    font-size: 1rem;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 16px rgba(0, 0, 0, 0.45);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 5px;
}

.story-play-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 255, 255, 0.95);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45);
    animation: storyPulse 2.2s ease-out infinite;
}

.story-play-icon svg {
    margin-left: 2px; /* optisch centreren van de driehoek */
}

@keyframes storyPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45);
    }
    70% {
        box-shadow: 0 0 0 14px rgba(255, 255, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.right {
    position: relative;
    perspective: 2200px;
    border-radius: var(--radius);
    overflow: hidden;
}

/* Tijdens de flip mag de kaart buiten zijn box uitsteken */
.right.is-flipping {
    overflow: visible;
}

.flipper {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform 1.1s cubic-bezier(0.83, 0, 0.17, 1);
}

.right.is-flipped .flipper {
    transform: rotateY(180deg);
}

.face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--radius);
    overflow: hidden;
}

.front-bg {
    background: var(--surface);
}

.back {
    background: var(--back);
    color: #fff;
    transform: rotateY(180deg);
    display: flex;
}

.back iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--back);
}

/* Inactieve kant mag geen clicks of scroll opvangen */
.right:not(.is-flipped) .back {
    pointer-events: none;
}

/* Tekst-overlay leeft buiten de flipper — geen 3D-voorouder, dus scherp op zoom */
.text-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    --content-xpad: clamp(2rem, 4vw, 3rem);
    transition: opacity 0.55s ease 0.55s; /* fade-in met delay zodat de kaart eerst 90° draait */
}

.right.is-flipped .text-overlay {
    opacity: 0;
    transition-delay: 0s; /* bij wegfaden geen delay — verdwijn meteen */
    pointer-events: none;
}

.right.is-flipped .content {
    pointer-events: none;
}

.content {
    flex: 1;
    min-height: 0;
    overflow: hidden auto;
    padding: clamp(2rem, 4vw, 3rem) var(--content-xpad) 1rem var(--content-xpad);
    scrollbar-width: none;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
}

.content::-webkit-scrollbar {
    display: none;
}

.name {
    font-size: 1rem;
    margin-bottom: 15px;
}

.title {
    color: #26c03c;
    margin-left: 10px;
}

.lead {
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-bottom: 2.5rem;
}

.now-working {
    flex: 0 0 auto;
    padding: 0 var(--content-xpad) 0.4rem var(--content-xpad);
    font-size: 1rem;
    color: var(--muted);
    line-height: 1.35;
    pointer-events: auto;
    margin-bottom: 5px;
}

.more-work {
    flex: 0 0 auto;
    align-self: flex-start;
    margin: 0 var(--content-xpad) clamp(1.25rem, 2.5vw, 1.75rem)
        var(--content-xpad);
    font-size: 1.1rem;
    color: #26c03c;
    text-decoration: none;
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s ease;
}

.more-work:hover {
    color: var(--ink);
}

.more-work svg {
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.more-work:hover svg {
    transform: translateX(3px);
}

.pulse-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(102, 245, 122, 0.55);
    animation: pulseDot 1.35s ease-out infinite;
    vertical-align: middle;
    margin-right: 0.65rem;
}

.now-working-link {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    text-decoration-color: rgba(20, 41, 0, 0.35);
}

.now-working-link:hover {
    text-decoration-color: rgba(20, 41, 0, 0.65);
}

@keyframes pulseDot {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 245, 122, 0.55);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(102, 245, 122, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 245, 122, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .pulse-dot,
    .story-play-icon {
        animation: none;
    }
    .flipper,
    .text-overlay {
        transition: none;
    }
    body {
        animation: none;
    }
}

.cta {
    border: 0;
    cursor: pointer;
    width: 100%;
    background: var(--accent);
    color: #142900;
    font: inherit;
    font-size: 1rem;
    letter-spacing: 0.01em;
    padding: 1rem 1.75rem;
    border-radius: 12px;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.08),
        0 8px 24px rgba(0, 0, 0, 0.15);
}

.cta:active {
    transform: translateY(1px);
}

.close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    cursor: pointer;
    z-index: 2;
    padding: 0;
    transition:
        background 0.25s ease,
        border-color 0.25s ease;
}

.close svg {
    display: block;
}

.close:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.5);
}

.links-menu {
    position: fixed;
    bottom: clamp(1rem, 3vw, 2rem);
    right: clamp(1rem, 3vw, 2rem);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.carbon-badge,
a.carbon-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    color: var(--muted);
    max-width: 100px;
    padding: 20px 5px;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 10px;
    border: 1px solid #00000036;
}

a.carbon-badge {
    text-decoration: none;
}

.links-controls {
    position: relative;
}

.links-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
}

.copyright {
    font-size: 1rem;
}

.links-toggle {
    font-size: 1rem;
    background: none;
    border: 0;
    font-weight: bold;
    border-bottom: 2px dotted;
    cursor: pointer;
    color: var(--ink);
    font-family: inherit;
    padding: 0;
}

.links-panel {
    position: absolute;
    bottom: calc(100% + 0.6rem);
    right: 0;
    min-width: 240px;
    background: #fff;
    border-radius: 14px;
    padding: 0.5rem;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.12),
        0 1px 3px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.links-menu.is-open .links-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.links-panel a,
.links-panel .item {
    font-size: 0.92rem;
    color: var(--ink);
    text-decoration: none;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    white-space: nowrap;
    display: block;
    transition: background 0.2s ease;
}

.links-panel .subitem {
    font-size: 0.85rem;
    line-height: 1.35;
    padding-top: 0;
    margin-top: -0.25rem;
    white-space: normal;
    color: var(--muted);
}

.links-panel .subitem-title {
    color: var(--muted);
    cursor: default;
}

.links-panel a:hover {
    background: rgba(0, 0, 0, 0.04);
}

.links-panel .item {
    color: var(--muted);
    cursor: default;
}

.links-panel hr {
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin: 0.25rem 0;
}

.work-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(20, 41, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.work-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.two-column {
    display: flex;
    gap: clamp(1rem, 2vw, 1.5rem);
}

/* Safari mobile fix: flex-basis 0% + min-width 0 voorkomt overflow */
.two-column > * {
    flex: 1 1 0%;
    min-width: 0;
}

/* Safari behandelt width:100% op img anders — expliciet op 0 zetten zodat flex-grow het overneemt */
.two-column > img {
    width: 0;
    height: auto;
}

.work-modal p {
    text-align: center;
}

.work-sheet {
    position: relative;
    width: 100%;
    max-width: 920px;
    height: 92vh;
    height: 92dvh;
    background: var(--surface);
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
}

.work-modal.is-open .work-sheet {
    transform: translateY(0);
}

.work-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.04);
    color: var(--ink);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    z-index: 2;
    padding: 0;
    transition: background 0.2s ease;
}

.work-close:hover {
    background: rgba(0, 0, 0, 0.08);
}

.work-content {
    height: 100%;
    overflow-y: auto;
    padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 3rem)
        clamp(2rem, 5vw, 3rem);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.work-content::-webkit-scrollbar {
    width: 8px;
}
.work-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 99px;
}
.work-content::-webkit-scrollbar-track {
    background: transparent;
}

.work-header {
    margin-bottom: 25px;
}

.work-header .eyebrow {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.work-header h2 {
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.work-grid {
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 2vw, 1.5rem);
}

.work-grid img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
    background: #eee;
}

.work-item {
    display: block;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

/* Border-radius zit op de wrapper; img hoeft die niet te herhalen */
.work-item img {
    border-radius: 0;
}

.work-link-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    opacity: 0.7;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
    pointer-events: none;
}

.work-item:hover .work-link-icon {
    opacity: 1;
    transform: scale(1.2);
}

/* Op touch-devices altijd goed zichtbaar (geen hover) */
@media (hover: none) {
    .work-link-icon {
        opacity: 0.88;
    }
}

body.modal-open {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .work-modal,
    .work-sheet {
        transition: none;
    }
}

@media (max-width: 820px) {
    body {
        overflow: auto;
        padding: 1rem 1rem max(3rem, env(safe-area-inset-bottom));
        display: block;
    }
    .container {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
        gap: 1rem;
    }
    .left {
        aspect-ratio: 4 / 5;
    }
    .right {
        height: auto;
        min-height: 0;
    }
    /* Op mobile geen absolute overlay — laat de kaart naar de content groeien */
    .text-overlay {
        position: relative;
    }
    .content {
        position: static;
        flex: 0 0 auto;
        overflow: visible;
    }
    .links-menu {
        position: relative;
        width: fit-content;
        padding-top: 3rem;
        align-items: center;
        margin: 0 auto;
        padding-bottom: 2rem;
        bottom: 0;
        right: 0;
    }
    .links-panel {
        left: 50%;
        right: auto;
        transform: translate(-50%, 6px);
    }
    .links-menu.is-open .links-panel {
        transform: translate(-50%, 0);
    }
}
