/* ==========================================================================
   XASI PREMIUM LAAG
   Komt NA style.css en verfijnt vorm, typografie, diepte en beweging.
   Kleuren blijven uit de thema-variabelen komen, dus elk kleurenschema
   (licht, neon, matrix, fluid, axiom, ...) krijgt dezelfde afwerking.
   Uitzetten: verwijder de <link> naar premium.css in index.html.
   Tegels hoeven NIET aangepast te worden: alles werkt op .tile.
   ========================================================================== */

/* --- 1. LETTERTYPES (zelf gehost, OFL-licentie) --- */
@font-face {
    font-family: "Inter";
    src: url("../_fonts/inter-var.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Sora";
    src: url("../_fonts/sora-var.woff2") format("woff2");
    font-weight: 100 800;
    font-style: normal;
    font-display: swap;
}

/* --- 2. ONTWERPMATEN --- */
:root {
    --xp-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --xp-display: "Sora", "Inter", "Segoe UI", sans-serif;
    --xp-ease: cubic-bezier(0.22, 0.8, 0.24, 1);
    --xp-ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);
    --xp-radius-tile: 14px;
    --xp-radius-ctrl: 11px;
    --xp-gap: clamp(8px, 0.75vw, 14px);
    --xp-gutter: clamp(10px, 1.6vw, 32px);
    --xp-tile-min: 116px;
    --xp-hairline: color-mix(in srgb, var(--text-color) 10%, transparent);
    --xp-sheen: rgba(255, 255, 255, 0.16);
    --xp-lift-shadow: rgba(0, 0, 0, 0.55);
}

body.light-mode {
    --xp-sheen: rgba(255, 255, 255, 0.55);
    --xp-lift-shadow: color-mix(in srgb, var(--accent-color) 30%, rgba(0, 0, 0, 0.30));
}

/* --- 3. TYPOGRAFIE --- */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body,
button,
input,
select,
textarea {
    font-family: var(--xp-font);
    font-feature-settings: "cv11", "ss01", "ss03";
}

html body .copyright-wrapper {
    font-family: var(--xp-font);
}

::selection {
    background: color-mix(in srgb, var(--accent-color) 38%, transparent);
    color: var(--text-color);
}

/* Slanke scrollbalk in de themakleur */
html {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--accent-color) 55%, var(--border-color)) transparent;
}

/* --- 4. LOGO-INTRO: zelfde regenboog, verfijnder lettertype en gloed --- */
html body .rgb-logo-svg,
html body .rgb-logo-mobile {
    font-family: var(--xp-display) !important;
    font-weight: 700 !important;
}

html body .rgb-logo-svg text {
    letter-spacing: -0.01em;
}

html body .layer-glow text {
    stroke-width: 5px;
    opacity: 0.62;
}

html body .layer-sharp text {
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.55));
}

/* --- 5. HEADER: glas, haarlijn en diepte zodra je scrolt --- */
html body .main-header {
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    backdrop-filter: blur(18px) saturate(1.5);
    transition: background-color 0.3s, box-shadow 0.45s var(--xp-ease);
}

html.xp-scrolled body .main-header {
    box-shadow:
        0 1px 0 var(--xp-hairline),
        0 18px 40px -26px var(--xp-lift-shadow);
}

html body .main-header .header-welcome {
    letter-spacing: 0.06em;
}

/* --- 6. ZOEKEN & THEMAKEUZE --- */
html body .search-panel {
    gap: 10px;
    padding-left: var(--xp-gutter);
    padding-right: var(--xp-gutter);
}

html body .search-box input {
    border-radius: var(--xp-radius-ctrl);
    border-color: color-mix(in srgb, var(--border-color) 80%, transparent);
    box-shadow: inset 0 1px 2px color-mix(in srgb, #000 18%, transparent);
    font-size: 0.98rem;
    letter-spacing: 0.005em;
    transition: border-color 0.25s var(--xp-ease), box-shadow 0.25s var(--xp-ease), background-color 0.25s;
}

html body .search-box input::placeholder {
    color: color-mix(in srgb, var(--text-color) 46%, transparent);
}

html body .search-box input:focus {
    border-color: var(--accent-color);
    box-shadow:
        0 0 0 4px color-mix(in srgb, var(--accent-color) 16%, transparent),
        0 8px 24px -14px color-mix(in srgb, var(--accent-color) 70%, transparent);
}

html body .search-submit,
html body .search-clear,
html body .search-engine {
    border-radius: var(--xp-radius-ctrl);
    font-weight: 600;
    letter-spacing: 0.01em;
    background-image: linear-gradient(180deg, color-mix(in srgb, var(--text-color) 6%, transparent), transparent 60%);
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, #fff 9%, transparent),
        0 1px 2px color-mix(in srgb, #000 22%, transparent);
    transition:
        color 0.22s var(--xp-ease),
        border-color 0.22s var(--xp-ease),
        box-shadow 0.3s var(--xp-ease),
        transform 0.22s var(--xp-ease);
}

html body .search-submit:hover,
html body .search-clear:hover,
html body .search-engine:hover,
html body .search-engine.is-active {
    text-shadow: none;
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, #fff 12%, transparent),
        0 0 0 1px color-mix(in srgb, var(--accent-color) 30%, transparent),
        0 6px 18px -8px color-mix(in srgb, var(--accent-color) 65%, transparent);
}

html body .search-submit:active,
html body .search-clear:active,
html body .search-engine:active,
html body .theme-option:active {
    transform: translateY(1px) scale(0.98);
}

html body .theme-selector {
    border-radius: calc(var(--xp-radius-ctrl) + 3px);
    border-color: color-mix(in srgb, var(--border-color) 80%, transparent);
    background: color-mix(in srgb, var(--card-bg) 35%, transparent);
    box-shadow: inset 0 1px 2px color-mix(in srgb, #000 16%, transparent);
}

html body .theme-option {
    border-radius: var(--xp-radius-ctrl);
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: color 0.22s var(--xp-ease), background-color 0.22s, box-shadow 0.3s var(--xp-ease), transform 0.22s var(--xp-ease);
}

html body .theme-option.is-active {
    text-shadow: none;
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, #fff 10%, transparent),
        0 4px 14px -6px color-mix(in srgb, var(--accent-color) 60%, transparent),
        0 0 0 1px color-mix(in srgb, var(--accent-color) 28%, transparent);
}

/* --- 7. RUBRIEKBALK: rustige letterspatiëring + actieve rubriek --- */
html body nav a {
    position: relative;
    font-weight: 600;
    letter-spacing: 0.09em;
    font-size: clamp(0.68rem, 0.84vw, 1rem);
}

html body nav a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 3px;
    width: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--accent-color);
    box-shadow: 0 0 10px color-mix(in srgb, var(--accent-color) 70%, transparent);
    transform: translateX(-50%);
    opacity: 0;
    transition: width 0.4s var(--xp-ease), opacity 0.3s;
}

html body nav a.xp-current {
    color: var(--accent-color) !important;
}

html body nav a.xp-current::after {
    width: 18px;
    opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
    html body nav a:hover {
        text-shadow: none !important;
    }

    html body nav a:hover::after {
        width: 28px;
        opacity: 0.85;
    }
}

/* --- 8. RUBRIEKKOPPEN: zwevende pil met display-letter --- */
html body .category-jump-control {
    border-radius: 999px;
    border-color: color-mix(in srgb, var(--border-color) 85%, transparent);
    -webkit-backdrop-filter: blur(10px) saturate(1.3);
    backdrop-filter: blur(10px) saturate(1.3);
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, #fff 8%, transparent),
        0 10px 30px -16px var(--xp-lift-shadow),
        0 0 22px -6px color-mix(in srgb, var(--accent-color) 22%, transparent);
}

html body .category-jump-button,
html body .category-title-button {
    border-right-color: color-mix(in srgb, var(--border-color) 55%, transparent);
    transition: color 0.25s var(--xp-ease), background 0.3s var(--xp-ease), box-shadow 0.3s var(--xp-ease);
}

html body .category-jump-button {
    font-weight: 500;
    text-shadow: none;
}

html body .category-jump-edge {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
}

html body .category-jump-control .category-header,
html body .category-header {
    font-family: var(--xp-display);
    font-weight: 600;
    font-size: 1.12rem;
    letter-spacing: 0.2em;
    text-indent: 0.2em; /* compenseert de spatiëring rechts, zodat het echt centreert */
}

/* --- 9. GRID: volle schermbreedte, zodat widescreen meer tegels per rij toont --- */
html body .grid-container {
    gap: var(--xp-gap);
    padding-left: var(--xp-gutter);
    padding-right: var(--xp-gutter);
}

@media (min-width: 600px) {
    html body .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(var(--xp-tile-min), 1fr));
    }
}

/* "In huis ontwikkeld"-rij: zelfde tussenruimte als het gewone raster */
html body .showcase-grid {
    gap: var(--xp-gap);
}

/* --- 10. TEGELS: diepte, zachte lift, glans en een tastbare klik --- */
html:root body .tile {
    border-radius: var(--xp-radius-tile);
    isolation: isolate;
    box-shadow:
        0 1px 2px color-mix(in srgb, #000 22%, transparent),
        0 6px 16px -10px var(--xp-lift-shadow);
    transition:
        transform 0.45s var(--xp-ease),
        box-shadow 0.45s var(--xp-ease),
        border-color 0.3s var(--xp-ease),
        background-color 0.3s;
}

html:root body .tile img,
html:root body a.tile.tile-featured img {
    border-radius: calc(var(--xp-radius-tile) - 1px);
}

/* Lichtrand + glans (alleen gewone tegels: featured gebruikt ::before/::after al) */
html body .tile:not(.tile-featured)::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    pointer-events: none;
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, #fff 16%, transparent),
        inset 0 0 0 1px color-mix(in srgb, #fff 4%, transparent);
    background: linear-gradient(
        115deg,
        transparent 0%,
        transparent 38%,
        var(--xp-sheen) 50%,
        transparent 62%,
        transparent 100%
    ) no-repeat;
    background-size: 260% 100%;
    background-position: 130% 0;
    transition: background-position 0.9s var(--xp-ease);
}

html:root body .tile:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

/* Muis: zachte lift met gekleurde diepte in de themakleur */
@media (hover: hover) and (pointer: fine) {
    html:root body .tile:hover {
        z-index: 10;
        /* Alleen schalen vanuit het midden: de tegel schuift nooit onder de
           cursor vandaan, dus geen hover-flikkering bij verticaal bewegen. */
        transform: scale(1.045);
        box-shadow:
            0 2px 4px color-mix(in srgb, #000 18%, transparent),
            0 22px 44px -18px var(--xp-lift-shadow),
            0 14px 34px -14px color-mix(in srgb, var(--accent-color) 55%, transparent),
            0 0 0 1px color-mix(in srgb, var(--accent-color) 45%, transparent);
    }

    html body .tile:not(.tile-featured):hover::after {
        background-position: -30% 0;
    }

    /* Buren wijken subtiel terug zodat de gekozen tegel eruit springt.
       Gekoppeld aan hover op de hele rubriek: de gaten tussen tegels laten
       de buren dan niet telkens kort oplichten. */
    html body .grid-container:hover .tile:not(:hover) {
        filter: saturate(0.82) brightness(0.9);
    }

    html body.light-mode .grid-container:hover .tile:not(:hover) {
        filter: saturate(0.85) brightness(0.97);
    }

    html body .grid-container .tile {
        transition:
            transform 0.45s var(--xp-ease),
            box-shadow 0.45s var(--xp-ease),
            border-color 0.3s var(--xp-ease),
            background-color 0.3s,
            filter 0.45s var(--xp-ease);
    }
}

/* Touch: geen blijvende hover, wel een directe druk-respons */
@media (hover: none), (pointer: coarse) {
    html:root body .tile:hover {
        transform: none;
    }
}

html:root body .tile:active {
    transform: translateY(0) scale(0.965);
    transition-duration: 0.12s;
}

/* Naamlabel onderin de tegel (data-name komt uit de alt-tekst via premium.js) */
@media (hover: hover) and (pointer: fine) {
    html body .tile[data-name]::before {
        content: attr(data-name);
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 3;
        padding: 22px 8px 7px;
        background: linear-gradient(180deg, transparent, rgba(6, 8, 12, 0.55) 40%, rgba(6, 8, 12, 0.86));
        color: #fff;
        font-family: var(--xp-font);
        font-size: 0.7rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        line-height: 1.2;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
        opacity: 0;
        transform: translateY(8px);
        transition: opacity 0.28s var(--xp-ease), transform 0.35s var(--xp-ease);
        pointer-events: none;
    }

    html body .tile[data-name]:hover::before,
    html body .tile[data-name]:focus-visible::before {
        opacity: 1;
        transform: none;
    }
}

/* --- RECENT BEZOCHT --- */
html body .xp-recent-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin: 30px auto;
    padding: 4px 4px 4px 22px;
    border: 1px solid color-mix(in srgb, var(--border-color) 85%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--card-bg) 82%, transparent);
    -webkit-backdrop-filter: blur(10px) saturate(1.3);
    backdrop-filter: blur(10px) saturate(1.3);
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, #fff 8%, transparent),
        0 10px 30px -16px var(--xp-lift-shadow),
        0 0 22px -6px color-mix(in srgb, var(--accent-color) 22%, transparent);
}

html body .xp-recent-title {
    padding-right: 10px;
    color: var(--accent-color);
    font-family: var(--xp-display);
    font-size: 1.12rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    white-space: nowrap;
}

html body .xp-recent-clear {
    min-height: 30px;
    padding: 0 14px;
    border: 1px solid color-mix(in srgb, var(--border-color) 60%, transparent);
    border-radius: 999px;
    background: transparent;
    color: var(--nav-text);
    font: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.22s var(--xp-ease), border-color 0.22s var(--xp-ease), background-color 0.22s;
}

html body .xp-recent-clear:hover,
html body .xp-recent-clear:focus-visible {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: color-mix(in srgb, var(--accent-color) 10%, transparent);
    outline: none;
}

html body .xp-recent[hidden] {
    display: none;
}

/* Altijd één rij: premium.js verbergt de tegels die niet meer passen.
   Bij een update geen onthulling, alleen de nieuwste tegel springt erin. */
html.xp-reveal body .xp-recent-grid.xp-static > .tile {
    animation: none;
}

html body .xp-recent-grid > .tile.xp-recent-new,
html.xp-reveal body .xp-recent-grid.xp-static > .tile.xp-recent-new {
    animation: xpRecentPop 0.55s var(--xp-ease-spring) backwards;
}

@keyframes xpRecentPop {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 599px) {
    html body .xp-recent-title {
        font-size: 1rem;
    }
}

/* --- 11. ONTHULLING BIJ SCROLLEN (alleen als premium.js draait) --- */
html.xp-reveal body .grid-container:not(.xp-in) > .tile {
    opacity: 0;
}

html.xp-reveal body .grid-container.xp-in > .tile {
    /* backwards: na afloop laat de animatie transform los, zodat hover blijft werken */
    animation: xpTileIn 0.55s var(--xp-ease) backwards;
    animation-delay: calc(min(var(--xp-i, 0), 18) * 16ms);
}

@keyframes xpTileIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* Featured tegels houden hun eigen ballon-uitlijning: alleen faden */
html.xp-reveal body .grid-container.xp-in > .tile-featured {
    animation-name: xpFadeIn;
}

@keyframes xpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- 12. FOOTER ---
   Zelfde opbouw als de statistiektegels: label linksboven, één groot getal,
   onderaan achter een haarlijn een rustige tweede regel. Kleuren, randen en
   gloed blijven per thema uit style.css komen. */
html body .cyber-footer {
    font-family: var(--xp-font);
    padding: 40px var(--xp-gutter);
}

html body .footer-grid {
    gap: 18px;
    text-align: left;
}

html body .footer-module {
    position: relative;
    min-height: 150px;
    padding: 20px 22px 18px;
    border-radius: 18px;
    gap: 6px;
    align-items: stretch;
    justify-content: flex-start;
    text-align: left;
    -webkit-backdrop-filter: blur(8px) saturate(1.25);
    backdrop-filter: blur(8px) saturate(1.25);
}

/* Klikbare panelen: een klein pijltje in plaats van het hoekhaakje */
html body .footer-module.swatch-module-link::before,
html body .footer-module.visitor-module::before {
    content: "\2197";
    top: 16px;
    right: 18px;
    width: auto;
    height: auto;
    border: 0;
    filter: none;
    color: var(--accent-color);
    font: 600 0.95rem/1 var(--xp-font);
    opacity: 0.45;
    transition: opacity 0.25s var(--xp-ease), transform 0.3s var(--xp-ease);
}

html body .footer-module.swatch-module-link:hover::before,
html body .footer-module.visitor-module:hover::before {
    opacity: 1;
    transform: translate(2px, -2px);
}

html body .visitor-link {
    align-items: stretch;
    gap: 6px;
}

/* Label linksboven */
html body .module-label {
    font-family: var(--xp-font);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-align: left;
    padding-right: 24px;
}

/* Het grote getal */
html body .digital-text {
    justify-content: flex-start;
    font-family: var(--xp-font);
    font-size: clamp(1.55rem, 1.9vw, 2rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum", "cv11";
}

html body .visitor-total {
    min-width: 0;
    justify-content: flex-start;
    letter-spacing: -0.02em;
}

html body #newyear-content small {
    /* Flex slikt de spatie in de tekst: ruimte na de "d" komt van hier */
    margin: 0 0.4em 0 0.06em;
    font-size: 0.55em;
    font-weight: 600;
    opacity: 0.6;
}

/* Klok verzetten: datums zonder vaste cijferbreedte, anders krijgen de streepjes lucht */
html body #dst-content,
html body #dst-other {
    font-variant-numeric: normal;
    font-feature-settings: "cv11";
}

/* style.css zette dit veld als kolom (oude tweeregelige opbouw): links uitlijnen zoals de rest */
html body #dst-content {
    flex-direction: row;
}

/* De tweede regel onderin: haarlijn, label links, waarde rechts */
html body .swatch-line,
html body .footer-subgrid,
html body .visitor-today-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin: auto 0 0;
    padding: 12px 0 0 !important;
    border: 0 !important;
    border-top: 1px solid color-mix(in srgb, var(--text-color) 10%, transparent) !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    transform: none;
}

html body .visitor-today-row::before,
html body .visitor-today-row::after {
    content: none;
}

html body .swatch-label {
    flex-direction: row;
    align-items: baseline;
    gap: 0.35em;
    text-align: left;
}

html body .swatch-label,
html body .footer-subgrid em,
html body .visitor-today-row span {
    font-family: var(--xp-font);
    font-size: 0.66rem;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

html body .footer-subgrid span {
    gap: 8px;
}

html body #swatch-content,
html body .calendar-metric,
html body .visitor-today-row strong {
    font-family: var(--xp-font);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum", "cv11";
}

html body .copyright-text,
html body .facebook-pulse-link {
    letter-spacing: 0.08em;
    font-weight: 700;
}

/* --- 13. TOEGANKELIJKHEID & PRINT --- */
@media (prefers-reduced-motion: reduce) {
    html body .tile,
    html body .tile::after,
    html body nav a::after {
        transition: none !important;
        animation: none !important;
    }

    html.xp-reveal body .grid-container > .tile {
        opacity: 1 !important;
    }
}

@media print {
    html.xp-reveal body .grid-container > .tile {
        opacity: 1 !important;
        animation: none !important;
    }
}
