/*
 * style.css - Huisstijl voor Secure Share ("console / control-deck"-variant).
 *
 * Donker hightech-paneel: bijna-zwarte achtergrond met grid + CRT-scanlines,
 * cyaan hoofdaccent, magenta secundair signaal, groene "online"-LED. De card
 * is een console-paneel met statusstrip, periodieke scanlijn en HUD-knoppen.
 * Digitale readout-vibe via de lokale system-monospace stack.
 *
 * Invariant 5 (geen externe resources): alle fonts lokaal gehost, monospace
 * via de system-stack. Niets wordt van buiten geladen.
 */

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/poppins-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/poppins-700.woff2') format('woff2');
}
@font-face {
    /* Variabel font: een bestand dekt 400-700. */
    font-family: 'Mulish';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('fonts/mulish-var.woff2') format('woff2');
}

:root {
    --bg: #070a0e;          /* diepste achtergrond */
    --bg-2: #0b0f15;        /* iets lichter, voor verloop */
    --card-solid: #10151d;  /* terugval zonder backdrop-filter */
    --text: #c9d2de;        /* lichtgrijs, rustig op donker */
    --heading: #ecf2f9;     /* titels, net iets feller */
    --muted: #66707f;       /* secundaire tekst */

    --cyan: #2bd4ee;        /* hoofdaccent: randen, focus, knoppen */
    --cyan-bright: #67e6fb; /* lichte top van de knop-gradient */
    --cyan-text: #5cd4f0;   /* cyaan als tekst (labels, links) */
    --magenta: #ff2e88;     /* secundair accent: signaal, nadruk */
    --green: #2ee6a6;       /* "online / veilig"-LED */
    --review: #f4b53c;      /* amber: "controleer even" in de optimizer */

    --btn: #0fa6cf;         /* knopvulling, contrastvast op donker */
    --btn-top: #2cc6e6;     /* lichte top van de knop-gradient */
    --btn-hover: #0c8fb4;
    --btn-hover-top: #23b3d6;

    --border: rgba(140, 200, 235, 0.10);
    --field-border: rgba(120, 210, 245, 0.18); /* doorschijnend, blendt in het glas */
    --warn-bg: rgba(255, 46, 136, 0.07);
    --warn-border: rgba(255, 46, 136, 0.34);
    --error: #ff5d6c;

    --radius: 7px;
    --radius-card: 12px;
    --radius-pill: 999px;

    /* Glassmorphism (dark) */
    --glass-card: rgba(14, 19, 27, 0.66);
    --glass-field: rgba(255, 255, 255, 0.035);
    --glass-field-focus: rgba(43, 212, 238, 0.07);
    --glass-border: rgba(120, 210, 245, 0.14);
    --glass-warn: rgba(255, 46, 136, 0.08);

    --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Consolas",
        "Liberation Mono", "Menlo", monospace;
}

* { box-sizing: border-box; }

/* Visueel verborgen maar focusbaar (toetsenbord/screenreader), i.t.t. hidden. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

body {
    margin: 0;
    padding: 2rem 1rem 3rem;
    min-height: 100vh;
    color: var(--text);
    font-family: 'Mulish', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    /* Basisverloop + fijne CRT-scanlines over het hele scherm. */
    background:
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.16) 0px,
            rgba(0, 0, 0, 0.16) 1px,
            transparent 1px,
            transparent 3px
        ),
        linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 45%, #04060a 100%);
}

/* Diepte achter het matglas: cyaan en magenta glows op donker. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(44rem 44rem at 6% 8%, rgba(43, 212, 238, 0.16), transparent 60%),
        radial-gradient(40rem 40rem at 94% 88%, rgba(255, 46, 136, 0.13), transparent 62%),
        radial-gradient(30rem 30rem at 66% 14%, rgba(46, 230, 166, 0.08), transparent 60%);
}

main {
    max-width: 40rem;
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 auto 1.25rem;
    max-width: 40rem;
}
.brand .logo {
    flex: 0 0 auto;
    filter: drop-shadow(0 0 7px rgba(43, 212, 238, 0.5));
}
/* Logo herkleurd naar cyaan, los van de inline SVG-attributen. */
.brand .logo path[stroke] { stroke: var(--cyan); }
.brand .logo rect[fill],
.brand .logo path[fill]:not([fill="none"]) { fill: var(--cyan); }
.brand .wordmark {
    position: relative;
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1rem;
    color: var(--heading);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-shadow: 0 0 14px rgba(43, 212, 238, 0.35);
    animation: wordmark-glitch 7s infinite;
}

/* Subtiele glitch: rustig met cyaan glow, met korte RGB-split-haperingen.
   Het glow-rustpunt staat in de meeste keyframes; de split duurt maar
   enkele procenten van de cyclus. Valt stil bij prefers-reduced-motion. */
@keyframes wordmark-glitch {
    0%, 38%, 44%, 76%, 82%, 100% {
        transform: none;
        opacity: 1;
        clip-path: none;
        text-shadow: 0 0 14px rgba(43, 212, 238, 0.35);
    }
    40% { transform: translateX(-1px) skewX(-2deg); text-shadow: -2px 0 var(--magenta), 2px 0 var(--cyan); }
    41% { transform: translateX(2px);               text-shadow:  2px 0 var(--magenta), -2px 0 var(--cyan); clip-path: inset(22% 0 34% 0); }
    42% { transform: translateX(-1px);              text-shadow: -2px 0 var(--cyan), 2px 0 var(--magenta); }
    78% { transform: translateX(1px) skewX(3deg);   text-shadow:  2px 0 var(--cyan), -2px 0 var(--magenta); opacity: 0.85; }
    79% { transform: translateX(-2px);              text-shadow: -2px 0 var(--cyan), 2px 0 var(--magenta); clip-path: inset(48% 0 20% 0); }
    80% { transform: translateX(1px);               text-shadow:  2px 0 var(--magenta), -2px 0 var(--cyan); }
}

.card {
    position: relative;
    background: var(--glass-card);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    padding: 3.1rem 1.9rem 1.9rem; /* extra ruimte bovenin voor de statusstrip */
    overflow: hidden;
    box-shadow:
        0 34px 80px -34px rgba(0, 0, 0, 0.85),
        0 0 0 1px rgba(43, 212, 238, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Statusstrip bovenin het paneel: groene "online"-LED met labeltekst.
   De tekst is feitelijk juist voor deze app (AES-256-GCM, zero-knowledge). */
.card::before {
    content: 'SECURE CHANNEL // AES-256-GCM // ZERO-KNOWLEDGE';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2.1rem;
    display: flex;
    align-items: center;
    padding-left: 2.05rem;
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: var(--cyan-text);
    white-space: nowrap;
    overflow: hidden;
    border-bottom: 1px solid var(--glass-border);
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    background:
        /* groene "online"-LED links */
        radial-gradient(circle 3px at 1.05rem 50%,
            var(--green) 0%, rgba(46, 230, 166, 0.35) 55%, transparent 72%),
        rgba(6, 10, 15, 0.55);
}

/* Terugval voor browsers zonder backdrop-filter: solide card. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .card { background: var(--card-solid); }
}

h1, h2 {
    font-family: var(--mono);
    color: var(--heading);
    line-height: 1.25;
    letter-spacing: -0.01em;
}
h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    text-shadow: 0 0 18px rgba(43, 212, 238, 0.25);
}
/* Terminal-prompt voor de titel. */
h1::before { content: '> '; color: var(--cyan); }
h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.6rem; }
h2::before { content: '// '; color: var(--cyan); }

.intro { color: var(--muted); margin-top: 0; }

label {
    display: block;
    margin: 1.1rem 0 0.3rem;
    font-family: var(--mono);
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cyan-text);
}
/* Klein prefix-blokje voor de "veld"-labels. */
#compose > label::before,
#gate label::before,
#password-row label::before {
    content: '▸ ';
    color: var(--magenta);
}

textarea,
input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--field-border);
    border-radius: var(--radius);
    font: inherit;
    background: var(--glass-field);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
textarea {
    resize: vertical;
    min-height: 8rem;
    font-family: var(--mono);
    font-size: 0.92rem;
}
::placeholder { color: var(--muted); opacity: 0.7; }

textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
    outline: none;
    border-color: var(--cyan);
    background-color: var(--glass-field-focus);
    box-shadow:
        0 0 0 3px rgba(43, 212, 238, 0.2),
        0 0 20px -3px rgba(43, 212, 238, 0.4);
}

/* Dropdown in huisstijl: eigen chevron via CSS-gradients (geen
   data:-afbeelding, dus CSP-veilig). De geopende optielijst wordt
   door het OS getekend en is niet volledig te stylen. */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    padding-right: 2.4rem;
    font-family: var(--mono);
    background-color: var(--glass-field);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--cyan) 50%),
        linear-gradient(135deg, var(--cyan) 50%, transparent 50%);
    background-position:
        calc(100% - 1.2rem) 1.1rem,
        calc(100% - 0.85rem) 1.1rem;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}
select::-ms-expand { display: none; }
/* OS tekent de optielijst; dit helpt op de meeste dark-mode engines. */
select option { background: var(--card-solid); color: var(--text); }

input[type="file"] {
    width: 100%;
    padding: 0.55rem;
    border: 1px dashed var(--field-border);
    border-radius: var(--radius);
    background: var(--glass-field);
    color: var(--text);
    font: inherit;
}

/* "Bestand kiezen"-knop als cyaan HUD-pill. Twee aparte regels:
   cross-engine pseudo-elementen mogen niet in een selectorlijst. */
input[type="file"]::file-selector-button {
    margin-right: 0.85rem;
    padding: 0.45rem 1.05rem;
    border: 0;
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--btn-top), var(--btn));
    color: #03161c;
    font-family: var(--mono);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
input[type="file"]::file-selector-button:hover {
    background: linear-gradient(180deg, var(--btn-hover-top), var(--btn-hover));
}
input[type="file"]::-webkit-file-upload-button {
    margin-right: 0.85rem;
    padding: 0.45rem 1.05rem;
    border: 0;
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--btn-top), var(--btn));
    color: #03161c;
    font-family: var(--mono);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 1.1rem;
}
.check-row label {
    margin: 0;
    font-weight: 400;
    font-family: 'Mulish', sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text);
}
/* Selectievakje in dezelfde stijl als de invoervelden: donkere glas-achtergrond,
   gelijke rand, en bij aanvinken een cyaan vulling met donker vinkje + glow.
   Vinkje via een geroteerde border (geen afbeelding, dus CSP-veilig). */
.check-row input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 0 0 auto;
    width: 1.15rem;
    height: 1.15rem;
    margin: 0;
    display: inline-grid;
    place-content: center;
    border: 1px solid var(--field-border);
    border-radius: 5px;
    background: var(--glass-field);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.check-row input[type="checkbox"]::after {
    content: '';
    width: 0.34rem;
    height: 0.62rem;
    border: solid #03161c;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
    opacity: 0;
    transition: opacity 0.15s ease;
}
.check-row input[type="checkbox"]:hover { border-color: var(--cyan); }
.check-row input[type="checkbox"]:checked {
    background: var(--cyan);
    border-color: var(--cyan);
    box-shadow: 0 0 12px -2px rgba(43, 212, 238, 0.6);
}
.check-row input[type="checkbox"]:checked::after { opacity: 1; }
.check-row input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

button,
.button-link {
    position: relative;
    display: inline-block;
    margin-top: 1.4rem;
    padding: 0.7rem 1.5rem;
    border: 0;
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--btn-top), var(--btn));
    color: #03161c;
    font-family: var(--mono);
    font-weight: 700;
    font-size: 0.86rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 0 22px -6px rgba(43, 212, 238, 0.65);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}
/* Play-driehoek als marker op de primaire acties (knipoog naar de screenshot). */
button:not(.secondary)::before,
.button-link::before {
    content: '\25B6';
    margin-right: 0.6em;
    font-size: 0.78em;
    vertical-align: 0.04em;
}
button:hover,
.button-link:hover {
    background: linear-gradient(180deg, var(--btn-hover-top), var(--btn-hover));
    box-shadow: 0 0 30px -3px rgba(43, 212, 238, 0.8);
}
button:active,
.button-link:active { transform: translateY(1px); box-shadow: 0 0 16px -6px rgba(43, 212, 238, 0.6); }
button:disabled { opacity: 0.55; cursor: wait; box-shadow: none; }
/* Herstel het hidden-attribuut: de display-regel hierboven zou het anders
   overschrijven (author-CSS wint van de browser-default). */
button[hidden],
.button-link[hidden] { display: none; }

button.secondary {
    background: transparent;
    color: var(--cyan-text);
    padding: 0.5rem 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.74rem;
    box-shadow: none;
    border: 1px solid var(--field-border);
}
button.secondary:hover {
    background: rgba(43, 212, 238, 0.1);
    border-color: var(--cyan);
    box-shadow: none;
}

:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

.link-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    margin-top: 0.5rem;
}
.link-row input {
    flex: 1;
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--cyan-text);
}
.link-row button { margin-top: 0; white-space: nowrap; align-self: stretch; padding-top: 0; padding-bottom: 0; }

.warning {
    position: relative;
    background: var(--glass-warn);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--warn-border);
    border-left: 2px solid var(--magenta);
    border-radius: var(--radius);
    padding: 0.8rem 1rem;
    color: var(--text);
}

.file-info {
    display: none;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.6rem;
    color: var(--muted);
    font-size: 0.9rem;
}
.file-info:not([hidden]) { display: flex; }
.file-info button { margin-top: 0; }

.hint-inline { font-weight: 400; color: var(--muted); font-size: 0.9rem; letter-spacing: 0; text-transform: none; }

#progress-row { margin-top: 1.2rem; }
#send-progress {
    width: 100%;
    height: 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
}
#send-progress::-webkit-progress-bar { background: rgba(255, 255, 255, 0.05); }
/* Segment-LED look: cyaan->magenta verloop met donkere segmentnaden. */
#send-progress::-webkit-progress-value {
    background:
        repeating-linear-gradient(90deg,
            transparent 0 7px, rgba(4, 8, 12, 0.55) 7px 9px),
        linear-gradient(90deg, var(--cyan), var(--magenta));
    transition: width 0.2s ease;
}
#send-progress::-moz-progress-bar {
    background:
        repeating-linear-gradient(90deg,
            transparent 0 7px, rgba(4, 8, 12, 0.55) 7px 9px),
        linear-gradient(90deg, var(--cyan), var(--magenta));
}

#message-output {
    background: rgba(255, 255, 255, 0.025);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border);
    border-left: 2px solid var(--cyan);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--text);
    margin: 0;
}

.error { color: var(--error); margin-top: 1rem; font-family: var(--mono); font-size: 0.9rem; }
.hint { color: var(--muted); font-size: 0.9rem; }

.noscript-note {
    margin: 0 0 1.25rem;
    background: var(--glass-warn);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--warn-border);
    border-left: 2px solid var(--magenta);
    border-radius: var(--radius);
    padding: 0.8rem 1rem;
    color: var(--text);
}

footer { margin-top: 1.75rem; }
.privacy {
    color: var(--muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
    padding-top: 0.9rem;
    margin-bottom: 0;
}
.privacy::before {
    content: '// ';
    color: var(--cyan);
    font-family: var(--mono);
}

/* ---------------------------------------------------------------------------
   Menubalk (gedeeld via partials/nav.php)
   --------------------------------------------------------------------------- */
.topnav {
    max-width: 40rem;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.topnav .brand { margin: 0; max-width: none; text-decoration: none; }

.nav-links {
    display: flex;
    gap: 0.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-links a {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    padding: 0.42rem 0.75rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.nav-links a:hover {
    color: var(--cyan-text);
    border-color: var(--field-border);
    background: rgba(43, 212, 238, 0.06);
}
.nav-links a.active {
    color: var(--heading);
    border-color: var(--field-border);
    background: rgba(43, 212, 238, 0.09);
    box-shadow: 0 0 16px -6px rgba(43, 212, 238, 0.5);
}

/* ---------------------------------------------------------------------------
   Homepage: twee tool-cards naast elkaar
   --------------------------------------------------------------------------- */
/* Homepage verticaal centreren: body als flex-kolom, .home vult de
   resthoogte onder de menubalk en centreert titel, subtext en cards. */
body.home-page { display: flex; flex-direction: column; }
body.home-page .home {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

/* Extra ademruimte onder de menubalk op de tool-pagina's. */
body.tool-page main.card { margin-top: 5vh; }

.home { max-width: 54rem; margin: 0 auto; }
.home-hero { text-align: center; margin-bottom: 1.6rem; }
.home-hero h1 { display: inline-block; }
.home-hero .intro { margin-top: 0.3rem; }

.home-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: stretch;
    justify-content: center;
}
.home-card {
    position: relative;
    flex: 1 1 14rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 1.6rem 1.5rem 1.4rem;
    text-decoration: none;
    color: var(--text);
    background: var(--glass-card);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow:
        0 24px 60px -34px rgba(0, 0, 0, 0.85),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.home-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), var(--magenta), transparent);
    opacity: 0.6;
}
.home-card:hover {
    border-color: rgba(43, 212, 238, 0.4);
    box-shadow:
        0 30px 70px -30px rgba(0, 0, 0, 0.9),
        0 0 30px -8px rgba(43, 212, 238, 0.4);
}
.home-card:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.home-card-icon {
    width: 2.6rem;
    height: 2.6rem;
    color: var(--cyan);
    filter: drop-shadow(0 0 8px rgba(43, 212, 238, 0.4));
    margin-bottom: 0.2rem;
}
.home-card-icon svg { width: 100%; height: 100%; display: block; }

.home-card h2 { margin: 0; }
.home-card h2::before { content: none; } /* geen // prefix op card-titels */
.home-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.home-card-cta {
    margin-top: auto;
    padding-top: 0.7rem;
    font-family: var(--mono);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cyan-text);
}
.home-card:hover .home-card-cta { text-shadow: 0 0 12px rgba(43, 212, 238, 0.5); }

/* ---------------------------------------------------------------------------
   QR-generator: preview + doel-URL
   --------------------------------------------------------------------------- */
.qr-frame {
    display: inline-block;
    margin-top: 1.3rem;
    padding: 0.9rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 0 26px -6px rgba(43, 212, 238, 0.4);
    line-height: 0;
}
#qr-canvas {
    display: block;
    width: 15rem;
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
}
#qr-result:not([hidden]) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}
#qr-target {
    margin: 0.7rem 0 0;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--cyan-text);
    word-break: break-all;
}

/* ---------------------------------------------------------------------------
   Afbeelding-optimizer: bredere layout met drie uploadkaarten
   --------------------------------------------------------------------------- */
.optimizer { max-width: 62rem; margin: 5vh auto 0; }
.optimizer-intro { margin-bottom: 1.6rem; }
.optimizer-intro .intro { margin-top: 0.3rem; }
.optimizer-retina { margin: 0 0 1.5rem; }

.upload-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
}
.upload-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.4rem 1.3rem;
    background: var(--glass-card);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow:
        0 24px 60px -34px rgba(0, 0, 0, 0.85),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.upload-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), var(--magenta), transparent);
    opacity: 0.6;
}
.upload-card h2 { margin: 0; font-size: 1rem; }
.upload-card h2::before { content: none; } /* geen // prefix op kaart-titels */
.upload-card-desc { margin: 0; color: var(--muted); font-size: 0.9rem; }

.maatlabel {
    align-self: flex-start;
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--cyan-text);
    background: rgba(43, 212, 238, 0.08);
    border: 1px solid var(--field-border);
    border-radius: var(--radius-pill);
    padding: 0.15rem 0.6rem;
}

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    margin-top: 0.5rem;
    padding: 1.5rem 1rem;
    min-height: 8.5rem;
    border: 1px dashed var(--field-border);
    border-radius: var(--radius);
    background: var(--glass-field);
    color: var(--muted);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.dropzone:hover,
.dropzone.dragover,
.dropzone.focus {
    border-color: var(--cyan);
    color: var(--cyan-text);
    background: var(--glass-field-focus);
}
.dropzone.focus { box-shadow: 0 0 0 2px rgba(43, 212, 238, 0.35); }
.dropzone-icon { width: 2rem; height: 2rem; color: var(--cyan); }
.dropzone-icon svg { width: 100%; height: 100%; display: block; }
.dropzone-text { font-size: 0.9rem; }

.preview-error {
    margin: 0.8rem 0 0;
    font-family: var(--mono);
    font-size: 0.74rem;
    color: var(--error);
}
.preview-status {
    margin: 0.8rem 0 0;
    font-family: var(--mono);
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    color: var(--cyan-text);
}
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
    gap: 0.6rem;
    margin-top: 0.6rem;
}
.preview-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}
.preview-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}
.preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.preview-thumb-error {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--error);
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1.4rem;
    border-color: var(--warn-border);
    background: var(--glass-warn);
}
.preview-name {
    margin: 0;
    font-family: var(--mono);
    font-size: 0.66rem;
    line-height: 1.3;
    color: var(--muted);
    word-break: break-all;
}
.preview-item-status {
    margin: 0;
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.03em;
    color: var(--cyan-text);
}
.preview-size {
    margin: 0;
    font-family: var(--mono);
    font-size: 0.6rem;
    color: var(--muted);
}

/* ✕-knop op de thumbnail: reset van de globale button-stijl. */
button.preview-remove {
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    width: 1.5rem;
    height: 1.5rem;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 7, 11, 0.72);
    border: 1px solid var(--field-border);
    border-radius: 50%;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.7rem;
    line-height: 1;
    box-shadow: none;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
button.preview-remove::before { content: none; } /* geen play-driehoek */
button.preview-remove:hover {
    border-color: var(--error);
    color: var(--error);
    background: rgba(4, 7, 11, 0.85);
    box-shadow: none;
}
.preview-item.is-processing .preview-item-status { color: var(--muted); }
.preview-item.is-error .preview-item-status { color: var(--error); }
.preview-item.is-ready .preview-item-status { color: var(--green); }
.preview-item.is-review .preview-item-status { color: var(--review); }
.preview-item.is-review .preview-thumb { border-color: rgba(244, 181, 60, 0.5); }
.preview-reason {
    margin: 0;
    font-family: var(--mono);
    font-size: 0.6rem;
    line-height: 1.3;
    color: var(--review);
}

.preview-download {
    display: block;
    margin-top: 0.1rem;
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    color: var(--cyan-text);
    border: 1px solid var(--field-border);
    border-radius: var(--radius);
    padding: 0.25rem 0.4rem;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.preview-download:hover {
    border-color: var(--cyan);
    background: rgba(43, 212, 238, 0.08);
}

/* Tegel-knop "Uitsnede aanpassen": reset van de globale button-stijl. */
.preview-adjust {
    display: block;
    width: 100%;
    margin-top: 0.1rem;
    padding: 0.25rem 0.4rem;
    background: transparent;
    border: 1px solid var(--field-border);
    border-radius: var(--radius);
    color: var(--cyan-text);
    font-family: var(--mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: none;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
button.preview-adjust::before { content: none; } /* geen play-driehoek */
.preview-adjust:hover {
    border-color: var(--cyan);
    background: rgba(43, 212, 238, 0.08);
    box-shadow: none;
}

/* ---------------------------------------------------------------------------
   "Uitsnede aanpassen"-modal
   --------------------------------------------------------------------------- */
.opt-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.opt-modal[hidden] { display: none; }
.opt-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 7, 11, 0.78);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.opt-modal-panel {
    position: relative;
    width: 100%;
    max-width: 54rem;
    max-height: 92vh;
    overflow: auto;
    padding: 1.6rem;
    background: var(--card-solid);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9);
}
.opt-modal-panel h2 { margin: 0 0 0.2rem; }
.opt-modal-hint {
    margin: 0 0 1rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--cyan-text);
}
.opt-modal-body {
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
}
.opt-modal-original { flex: 1 1 60%; min-width: 0; }
.opt-modal-result { flex: 0 0 auto; }
.opt-orig-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    line-height: 0;
    border-radius: var(--radius);
    cursor: crosshair;
}
.opt-orig-img { display: block; max-width: 100%; max-height: 58vh; }
.opt-crop-overlay {
    position: absolute;
    box-sizing: border-box;
    border: 2px solid var(--cyan);
    box-shadow: 0 0 0 9999px rgba(4, 7, 11, 0.55);
    pointer-events: none;
}
.opt-focus-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    background: var(--magenta);
    box-shadow: 0 0 10px var(--magenta);
    pointer-events: none;
}
.opt-modal-label {
    margin: 0 0 0.4rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.opt-result-canvas {
    display: block;
    width: 16rem;
    max-width: 100%;
    height: auto;
    background: #0b0f15;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.opt-modal-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    margin-top: 1.3rem;
}
.opt-modal-actions button { margin-top: 0; }

@media (max-width: 40rem) {
    .opt-modal-body { flex-direction: column; }
    .opt-modal-result { width: 100%; }
    .opt-result-canvas { width: 100%; }
}
.download-preset { align-self: flex-start; }

.optimizer-actions { margin-top: 1.6rem; text-align: center; }

@media (max-width: 52rem) {
    .upload-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 34rem) {
    .upload-cards { grid-template-columns: 1fr; }
}

/* Zachte intro van panelen die na een handeling verschijnen. */
@keyframes panel-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
#result, #display, #unavailable, #bad-link, #gate {
    animation: panel-in 0.35s ease both;
}

@media (max-width: 30rem) {
    body { padding: 1.25rem 0.75rem 2rem; }
    .card { padding: 2.9rem 1.25rem 1.25rem; border-radius: var(--radius); }
    .card::before { font-size: 0.55rem; letter-spacing: 0.16em; }
    h1 { font-size: 1.3rem; }
    .link-row { flex-direction: column; }
    .link-row button { padding: 0.7rem 1.5rem; }
    .topnav { flex-wrap: wrap; gap: 0.6rem; }
    .nav-links { width: 100%; }
    .nav-links a { flex: 1; text-align: center; }
    .home-grid { flex-direction: column; }
    .home-card { flex: 0 0 auto; }
}

/* Respecteer de voorkeur voor minder beweging. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
