/* ==========================================================
   FIXUNA MORGIA — CYBER CLOCK
   Neonklok, HEX-puzzel, glitchtitel en navigatie.
   ========================================================== */


/* Algemene pagina-instellingen */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #000;
    color: #00ffcc;
    font-family: Consolas, 'Courier New', monospace;
    overflow-x: hidden;
}


/* Achtergrondcanvas voor de klokanimatie */
#clock-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}


/* Centrale container boven de achtergrondanimatie */
#clock-core-wrapper {
    position: relative;
    z-index: 1;
    max-width: 850px;
    margin: 40px auto;
    padding: 30px;

    background: rgba(0, 0, 0, .93);
    border: 1px solid #ff0f6f;
    box-shadow: 0 0 20px rgba(255, 15, 111, .18);
}


/* Header met glitchtitel en subtitel */
header {
    text-align: center;
    border-bottom: 1px solid #ff0f6f;
    padding-bottom: 20px;
    margin-bottom: 35px;
}

.clock-glitch-title {
    position: relative;
    display: inline-block;
    font-size: clamp(19px, 4vw, 28px);
    color: #ff0f6f;
    letter-spacing: 1.5px;
    text-shadow: 0 0 8px #ff0f6f;

    animation: clockTitleJitter 6s infinite;
}


/* Twee gekleurde tekstlagen voor het glitcheffect */
.clock-glitch-title::before,
.clock-glitch-title::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
}

.clock-glitch-title::before {
    color: #00ffcc;
    animation: clockGhostA 5.7s infinite;
}

.clock-glitch-title::after {
    color: #faff0a;
    animation: clockGhostB 6.1s infinite;
}

.subtitle {
    color: #4cff00;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 8px;
}


/* Algemene secties en hun titels */
.clock-block {
    margin-bottom: 35px;
}

.clock-block h2 {
    font-size: 15px;
    color: #faff0a;
    margin: 0 0 15px;
}


/* ==========================================================
   INTERACTIEVE KLOK EN HEX-PUZZEL
   ========================================================== */

/* Terminalvenster met de digitale klok */
#interactive-time-module {
    background: rgba(5, 5, 5, .95);
    border: 1px solid #00ffcc;
    padding: 25px;
    text-align: center;

    box-shadow:
        inset 0 0 15px rgba(0, 255, 204, .1);
}


/* Digitale klok met pulserende neongloed */
#cyber-clock-display {
    font-size: clamp(30px, 8vw, 48px);
    font-weight: bold;
    color: #00ffcc;

    text-shadow: 0 0 15px #00ffcc;
    letter-spacing: 3px;
    margin: 0 0 15px;

    animation: clockPulse 1s infinite alternate;
    font-variant-numeric: tabular-nums;
}


/* Instructietekst voor de klokpuzzel */
.puzzle-instruction {
    font-size: 13px;
    color: #fff;
    margin-bottom: 15px;
    line-height: 1.65;
}


/* Uitklapbare hint met HEX-uitleg */
.hex-hint {
    text-align: left;
    border: 1px solid #516a55;
    padding: 10px 14px;
    margin: 0 auto 18px;
    max-width: 540px;

    color: #fff;
    font-size: 13px;
    line-height: 1.6;
}

.hex-hint summary {
    cursor: pointer;
    color: #faff0a;
    font-weight: bold;
}

.hex-hint p {
    margin-bottom: 0;
}

.hex-hint code {
    color: #00ffcc;
}


/* Invoerveld en knop voor het synchroniseren van de tijd */
.clock-input-zone {
    display: flex;
    gap: 15px;
    max-width: 450px;
    margin: 0 auto 15px;
}

#time-puzzle-input {
    min-width: 0;
    flex: 2;
    height: 44px;

    background: #000;
    border: 1px solid #00ffcc;
    color: #00ffcc;

    font: 14px Consolas, monospace;
    text-align: center;
}

#time-sync-btn {
    flex: 1;
    min-height: 44px;

    background: #00ffcc;
    color: #000;

    font: 700 13px Consolas, monospace;
    border: 0;
    cursor: pointer;

    transition:
        background .2s,
        box-shadow .2s;
}


/* Hover-effect van de synchronisatieknop */
#time-sync-btn:hover {
    background: #4cff00;
    box-shadow: 0 0 15px #4cff00;
}


/* Feedback bij het oplossen van de klokpuzzel */
#clock-puzzle-status {
    font-size: 12px;
    font-weight: bold;
    color: #faff0a;
    line-height: 1.7;
    overflow-wrap: anywhere;
    min-height: 2em;
}

#clock-puzzle-status.success {
    color: #4cff00;
}

#clock-puzzle-status.error {
    color: #ff4a55;
}


/* ==========================================================
   AFBEELDINGEN EN TERMINALTEKST
   ========================================================== */

/* Container voor afbeeldingen op de Clock-pagina */
.media-container {
    position: relative;
    width: min(100%, 350px);
    margin: 0 auto;

    border: 1px solid #555;
    box-shadow: 0 0 15px rgba(0, 255, 204, .12);
}

.media-container img {
    width: 100%;
    height: auto;
    display: block;
}


/* Tekstkader met terminaluitstraling */
.text-terminal-style {
    background: rgba(5, 5, 5, .9);
    border-left: 3px solid #faff0a;
    padding: 20px;
    line-height: 1.8;
    font-size: 14px;
    color: #fff;
}

.text-terminal-style p {
    margin: 0 0 1em;
}

.text-terminal-style p:last-child {
    margin-bottom: 0;
}


/* ==========================================================
   NAVIGATIE NAAR ANDERE PAGINA'S
   ========================================================== */

/* Grid met twee kolommen voor navigatieknoppen */
#clock-navigation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 35px;
}


/* Cyberpunk-navigatieknoppen */
.clock-nav-btn {
    min-height: 54px;
    padding: 12px;

    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;

    background: transparent;
    border: 1px solid #ff0f6f;
    color: #ff0f6f;

    font: 700 12px Consolas, monospace;
    text-decoration: none;

    transition: all .25s;
}

.clock-nav-btn:hover {
    background: #ff0f6f;
    color: #000;
    box-shadow: 0 0 15px #ff0f6f;
}


/* Footer met terugknop naar de hub */
footer {
    text-align: center;
    border-top: 1px solid #222;
    padding-top: 20px;
}

.back-hub-btn {
    display: inline-block;
    padding: 13px 25px;

    background: #ff1a0a;
    color: #fff;

    font: 700 12px Consolas, monospace;
    text-decoration: none;

    box-shadow: 0 0 8px rgba(255, 26, 10, .3);
}

.back-hub-btn:hover {
    background: #ff0f6f;
    box-shadow: 0 0 15px #ff0f6f;
}


/* ==========================================================
   TOEGANKELIJKHEID
   ========================================================== */

/* Zichtbare focusrand voor toetsenbordgebruikers */
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
    outline: 3px solid #faff0a;
    outline-offset: 3px;
}


/* Tekst verbergen zonder deze voor schermlezers te verwijderen */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* ==========================================================
   ANIMATIES
   ========================================================== */

/* Pulserende neongloed van de digitale klok */
@keyframes clockPulse {
    from {
        opacity: .85;
        text-shadow: 0 0 10px #00ffcc;
    }

    to {
        opacity: 1;
        text-shadow:
            0 0 20px #00ffcc,
            0 0 30px #00ffcc;
    }
}


/* Korte horizontale verschuiving van de titel */
@keyframes clockTitleJitter {
    0%,
    90%,
    94%,
    100% {
        transform: translateX(0);
    }

    91% {
        transform: translateX(-2px);
    }

    92% {
        transform: translateX(2px);
    }

    93% {
        transform: translateX(-1px);
    }
}


/* Turquoise spooklaag van de glitchtitel */
@keyframes clockGhostA {
    0%,
    89%,
    93%,
    100% {
        opacity: 0;
        transform: none;
    }

    90%,
    92% {
        opacity: .8;
        transform: translate(-3px, -1px);
    }

    91% {
        opacity: .4;
        transform: translate(3px, 1px);
    }
}


/* Gele spooklaag van de glitchtitel */
@keyframes clockGhostB {
    0%,
    89%,
    93%,
    100% {
        opacity: 0;
        transform: none;
    }

    90%,
    92% {
        opacity: .65;
        transform: translate(3px, 1px);
    }

    91% {
        opacity: .4;
        transform: translate(-3px, -1px);
    }
}


/* ==========================================================
   RESPONSIVE DESIGN
   ========================================================== */

/* Mobiele schermen: compactere indeling en verticale knoppen */
@media (max-width: 768px) {

    #clock-core-wrapper {
        margin: 12px;
        padding: 18px;
    }

    #clock-navigation-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .clock-input-zone {
        flex-direction: column;
    }

    #time-sync-btn {
        padding: 12px;
    }
}


/* ==========================================================
   MINDER BEWEGING
   ========================================================== */

/* Schakelt de CSS-animaties uit als de bezoeker dit wenst */
@media (prefers-reduced-motion: reduce) {

    .clock-glitch-title,
    .clock-glitch-title::before,
    .clock-glitch-title::after,
    #cyber-clock-display {
        animation: none !important;
    }

    .clock-glitch-title::before,
    .clock-glitch-title::after {
        display: none;
    }
}
