:root {
    color-scheme: dark;
    --bg: #061009;
    --panel: #101914;
    --line: #2a3930;
    --text: #f4f7f5;
    --muted: #9baa9f;
    --accent: #80eea8
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 Inter, system-ui, sans-serif
}

.topbar {
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid var(--line)
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    color: inherit;
    text-decoration: none
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--accent);
    color: #06200f;
    font-weight: 900
}

.brand small, .brand strong {
    display: block
}

.brand small {
    color: var(--muted)
}

.top-actions, .toolbar, .toolbar > div {
    display: flex;
    align-items: center;
    gap: 14px
}

.button, .segmented button, .control-button {
    border: 1px solid var(--line);
    background: #131d17;
    color: var(--text);
    border-radius: 14px;
    padding: 9px 14px;
    cursor: pointer
}

.live-pill {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--muted)
}

.live-pill i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent)
}

main {
    padding: 18px 26px 50px
}

.toolbar {
    flex-wrap: wrap;
    margin-bottom: 16px
}

.segmented {
    display: flex;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px
}

.segmented button {
    border: 0;
    background: transparent;
    border-radius: 999px;
    padding: 7px 13px;
    color: var(--muted)
}

.segmented button.active {
    background: #1d2e24;
    color: var(--text)
}

.workbench {
    display: grid;
    grid-template-columns:280px minmax(0, 1fr) 330px;
    gap: 16px;
    min-height: 72vh
}

.sidebar, .info, .viewer-column {
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 24px;
    overflow: hidden
}

.sidebar {
    padding: 16px;
    overflow: auto;
    max-height: calc(100vh - 130px);
    position: sticky;
    top: 12px
}

.mode-nav {
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line)
}

.mode-nav button {
    min-height: 56px
}

.mode-nav button.active, .control-button.active {
    border-color: #4d8d64;
    background: #1b3525;
    color: var(--accent)
}

.sidebar section {
    border-bottom: 1px solid var(--line);
    padding: 13px 0
}

.sidebar h3 {
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted)
}

.sidebar label {
    display: block;
    padding: 7px 0
}

.control-list {
    display: grid;
    gap: 7px
}

.control-group {
    display: grid;
    gap: 6px
}

.control-group h4 {
    margin: 8px 0 2px;
    color: var(--muted);
    font-size: 12px
}

.control-button {
    text-align: left;
    display: flex;
    justify-content: space-between;
    gap: 8px
}

.control-button small {
    color: var(--muted)
}

.automatic-status {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #131d17
}

.automatic-status strong {
    color: var(--accent)
}

.automatic-status span {
    font-size: 23px;
    font-weight: 800
}

.automatic-status small, .empty-message {
    color: var(--muted)
}

.viewer-column {
    background: #283034;
    display: flex;
    flex-direction: column
}

.floorplan {
    position: relative;
    aspect-ratio: 1978/696;
    overflow: hidden;
    min-height: 460px;

    /* Houd blending binnen de viewer, maar laat weerlagen met de woning mengen. */
    isolation: isolate
}

.world-stack, .weather-stack, .badge-stack, .hotspot-stack {
    position: absolute;
    inset: 0
}

.layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none
}

.layer.ground {
    z-index: 10
}

.layer.ground-day {
    z-index: 11
}

.layer.ground-effect {
    z-index: 20
}

.layer.first {
    z-index: 30
}

.layer.first-effect {
    z-index: 40
}

.layer.roof {
    z-index: 50
}

.layer.roof-effect {
    z-index: 60
}


.layer.top-effect {
    z-index: 65;
}

/* Informatieve beeldlagen mogen zacht in- en uitfaden bij een statuswissel. */
.layer.top-effect,
.layer.climate-effect {
    transition: opacity .22s ease, filter .22s ease;
}

.weather-stack {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;

    /* Geen z-index: anders ontstaat hier een eigen stacking context en kan
       mix-blend-mode niet met de vloerlagen eronder mengen. */
}

.weather-piece {
    position: absolute;
    display: block;
    max-width: none;
    z-index: 70;
    pointer-events: none;
    opacity: 1;
    mix-blend-mode: color-dodge;
    object-fit: fill;
    object-position: center;
    filter: none;
}

/* Buitenweer zonder dak. Deze waarden sluiten aan op de bestaande viewer. */
.weather-piece.left {
    left: 0;
    top: 15%;
    width: 20%;
    height: 70%;
}

.weather-piece.right {
    left: 68%;
    width: 34%;
    top: 15%;
    height: 70%;
}

/* Met dak: weer over de volledige woning. */
.weather-piece.full {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cloud-shade {
    position: absolute;
    inset: 0;
    z-index: 70;
    background: rgba(40, 50, 48, .28);
    mix-blend-mode: multiply
}

.badge-stack {
    z-index: 80;
    pointer-events: none
}

.badge {
    position: absolute;
    transform: translate(-50%, -50%);
    padding: 5px 8px;
    border-radius: 999px;
    background: #122019dd;
    border: 1px solid #4e725c;
    color: #fff;
    font-size: 12px
}

.hotspot-stack {
    z-index: 90
}

.hotspot {
    position: absolute;
    transform: translate(-50%, -50%);
    border: 0;
    background: transparent;
    cursor: pointer;
    outline: 0
}

.hotspot::after {
    content: attr(data-label);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(3px);
    white-space: nowrap;
    padding: 5px 8px;
    border-radius: 8px;
    background: rgba(4, 10, 6, .92);
    color: var(--text);
    font-size: 11px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .12s ease, transform .12s ease, visibility 0s linear .12s
}

.hotspot::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    opacity: 0;
    transition: opacity .12s ease, border-color .12s ease, background-color .12s ease
}

.hotspot:hover::before {
    opacity: 1;
    border-color: rgba(128, 238, 168, .5);
    background: rgba(128, 238, 168, .045)
}

.hotspot:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0s
}

.hotspot:focus, .hotspot:focus-visible, .hotspot.active {
    outline: 0
}

.hotspot.active::before, .hotspot.active::after, .hotspot:focus::before, .hotspot:focus::after, .hotspot:focus-visible::before, .hotspot:focus-visible::after {
    border-color: transparent;
    background: transparent;
    opacity: 0;
    visibility: hidden
}

.floor-status {
    height: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 18px;
    background: #0f1813;
    color: var(--muted)
}

.floor-status strong {
    color: var(--text)
}

.info {
    padding: 30px;
    display: flex;
    flex-direction: column
}

.info h1 {
    font-size: 32px;
    line-height: 1.1
}

.info p {
    color: var(--muted)
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 12px;
    font-weight: 700
}

.facts {
    display: grid;
    gap: 10px;
    margin-top: 18px
}

.facts div {
    background: #17211b;
    padding: 12px;
    border-radius: 14px
}

.facts span, .facts strong {
    display: block
}

.facts span {
    color: var(--muted)
}

.cta {
    margin-top: auto;
    background: var(--accent);
    color: #05200e;
    text-align: center;
    text-decoration: none;
    font-weight: 800;
    padding: 14px;
    border-radius: 999px
}

.energy {
    padding: 55px 0
}

.energy-grid {
    display: grid;
    grid-template-columns:repeat(4, 1fr);
    gap: 14px
}

.energy article {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 20px
}

.energy article span, .energy article strong {
    display: block
}

.energy article strong {
    font-size: 28px
}

.fatal-error {
    margin: 0;
    padding: 12px;
    background: #491515;
    color: #fff;
    white-space: pre-wrap
}

@media (max-width: 1200px) {
    .workbench {
        grid-template-columns:240px 1fr
    }

    .info {
        grid-column: 1/-1
    }

    .sidebar {
        position: relative;
        max-height: none
    }
}

@media (max-width: 760px) {
    main {
        padding: 12px
    }

    .workbench {
        grid-template-columns:1fr
    }

    .floorplan {
        min-height: 300px
    }

    .energy-grid {
        grid-template-columns:1fr 1fr
    }

    .toolbar {
        align-items: flex-start
    }

    .sidebar {
        order: 2
    }

    .viewer-column {
        order: 1
    }

    .info {
        order: 3
    }
}

body.fullscreen-view .topbar, body.fullscreen-view .toolbar, body.fullscreen-view .info, body.fullscreen-view .energy {
    display: none
}

body.fullscreen-view main {
    padding: 0
}

body.fullscreen-view .workbench {
    grid-template-columns:250px 1fr;
    min-height: 100vh
}

body.fullscreen-view .viewer-column {
    border-radius: 0
}

body.fullscreen-view .sidebar {
    border-radius: 0;
    max-height: 100vh;
    top: 0
}

body.fullscreen-view .floorplan {
    height: calc(100vh - 48px);
    aspect-ratio: auto
}

/* Automatische klimaatweergave */
.layer.climate-effect {
    transition: opacity .6s ease, filter .6s ease;
    pointer-events: none
}

.climate-legend {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #131d17
}

.climate-legend div {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px
}

.climate-legend i {
    width: 28px;
    height: 8px;
    border-radius: 999px
}

.climate-legend .cool { background: linear-gradient(90deg, rgba(55,130,255,.15), #3782ff) }
.climate-legend .neutral { background: rgba(255,255,255,.16) }
.climate-legend .heat { background: linear-gradient(90deg, rgba(255,73,55,.15), #ff4937) }

.climate-reading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #131d17
}

.climate-reading span { color: var(--muted) }
.climate-reading.cool strong { color: #69a2ff }
.climate-reading.heat strong { color: #ff7668 }
.climate-reading.neutral strong { color: var(--text) }


/* Vloerverwarming: rustig pulserend binnen het echte modulatiegebied. */
.layer.floor-heating-pulse {
    animation: floorHeatingPulse 3.8s ease-in-out infinite;
    transform-origin: center;
    will-change: opacity;
}

@keyframes floorHeatingPulse {
    0%, 100% { opacity: var(--pulse-min, .07); }
    50% { opacity: var(--pulse-max, .18); }
}

.weather-piece.ice {
    mix-blend-mode: normal;
    object-fit: contain;
    opacity: 1;
    filter: none;
}
.layer.floor-heating,
.layer.floor-cooling,
.layer.climate-effect {
    inset: 0;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}
/* Publieke website-navigatie en inhoudspagina's */
.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 auto;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(16, 25, 20, .78);
}

.site-nav a {
    color: var(--muted);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 999px;
    white-space: nowrap;
    transition: color .16s ease, background-color .16s ease;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--text);
    background: #1d2e24;
}

.site-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
    gap: 22px;
    align-items: start;
}

.page-content {
    min-width: 0;
}

.page-hero,
.content-card,
.faq-item {
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 24px;
}

.page-hero {
    padding: clamp(28px, 5vw, 64px);
    min-height: 360px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        radial-gradient(circle at 85% 15%, rgba(128, 238, 168, .14), transparent 33%),
        var(--panel);
}

.page-hero .eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
}

.page-hero h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(38px, 6vw, 74px);
    line-height: .98;
    letter-spacing: -.045em;
}

.page-hero > p:not(.eyebrow) {
    max-width: 680px;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 18px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.hero-actions a {
    padding: 11px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
    background: #131d17;
}

.hero-actions a.primary {
    color: #05200e;
    background: var(--accent);
    border-color: var(--accent);
    font-weight: 800;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.content-card {
    padding: 22px;
}

.content-card h2,
.content-card h3 {
    margin: 0 0 8px;
}

.content-card p,
.content-card li {
    color: var(--muted);
}

.content-card ul {
    margin: 12px 0 0;
    padding-left: 18px;
}

.metric-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.metric-row div {
    padding: 13px;
    border-radius: 14px;
    background: #17211b;
}

.metric-row span,
.metric-row strong {
    display: block;
}

.metric-row span {
    color: var(--muted);
    font-size: 12px;
}

.metric-row strong {
    margin-top: 4px;
    font-size: 20px;
}

.faq-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.faq-item {
    padding: 18px 20px;
}

.faq-item summary {
    cursor: pointer;
    font-weight: 750;
}

.faq-item p {
    color: var(--muted);
}

.compact-viewer-label {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

.compact-viewer-label a {
    color: var(--accent);
    text-decoration: none;
}

body:not([data-page="demo"]) .demo-only {
    display: none !important;
}

body:not([data-page="demo"]) .site-grid .workbench {
    display: block;
    min-height: 0;
    position: sticky;
    top: 94px;
}

body:not([data-page="demo"]) .viewer-column {
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

body:not([data-page="demo"]) .compact-viewer-label {
    display: flex;
}

body:not([data-page="demo"]) .floorplan {
    min-height: 0;
    aspect-ratio: 1978 / 696;
}

body:not([data-page="demo"]) .floor-status {
    height: auto;
    min-height: 44px;
    padding: 10px 14px;
    font-size: 12px;
}

body[data-page="demo"] .site-grid {
    display: block;
}

body[data-page="demo"] .page-content {
    display: none;
}

body[data-page="demo"] .compact-viewer-label {
    display: none;
}

@media (max-width: 1380px) {
    .topbar {
        height: auto;
        min-height: 76px;
        flex-wrap: wrap;
        gap: 10px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .site-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
    }
}

@media (max-width: 980px) {
    .site-grid {
        grid-template-columns: 1fr;
    }

    body:not([data-page="demo"]) .site-grid .workbench {
        position: static;
        order: -1;
    }

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

@media (max-width: 620px) {
    .top-actions .live-pill {
        display: none;
    }

    .page-hero {
        min-height: 300px;
        padding: 28px 22px;
    }

    .metric-row {
        grid-template-columns: 1fr;
    }
}


/* Navigatie-update: Demo als losse CTA en klok op secondebasis */
.demo-nav-button {
    flex: 0 0 auto;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--accent);
    color: #05200e;
    text-decoration: none;
    font-weight: 850;
    border: 1px solid var(--accent);
    box-shadow: 0 8px 24px rgba(128, 238, 168, .14);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.demo-nav-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(128, 238, 168, .22);
    filter: brightness(1.04);
}

.demo-nav-button.active {
    box-shadow: 0 0 0 3px rgba(128, 238, 168, .18), 0 10px 30px rgba(128, 238, 168, .18);
}

.live-pill {
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(16, 25, 20, .72);
}

#liveSource {
    color: var(--accent);
    font-size: 12px;
    font-weight: 750;
}

#liveClock {
    min-width: 64px;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}

.fullscreen-demo-button {
    margin-left: auto;
}

@media (max-width: 1380px) {
    .demo-nav-button {
        order: 2;
    }

    .top-actions {
        order: 2;
    }
}

@media (max-width: 620px) {
    .top-actions .live-pill {
        display: flex;
    }

    #liveSource {
        display: none;
    }

    .demo-nav-button {
        padding: 9px 15px;
    }
}
