/* ==========================================================================
   disketa.hr — retro arcade + cyberpunk layer
   Loaded after style.css. Preserves brand palette (cyan / pink / purple).
   ========================================================================== */

:root {
    --pixel-size: 4px;
    --pixel-shadow: var(--pixel-size) var(--pixel-size) 0 0;
    --pixel-shadow-sm: 2px 2px 0 0;

    --glow-cyan: 0 0 12px rgba(34, 211, 238, 0.65), 0 0 32px rgba(34, 211, 238, 0.25);
    --glow-pink: 0 0 12px rgba(236, 72, 153, 0.65), 0 0 32px rgba(236, 72, 153, 0.25);
    --glow-purple: 0 0 12px rgba(168, 85, 247, 0.65), 0 0 32px rgba(168, 85, 247, 0.25);

    --scanline-opacity: 0.04;
    --crt-vignette: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.45) 100%);
}

.dark {
    --scanline-opacity: 0.06;
    --bg-0: #020408;
    --bg-1: #050810;
    --bg-2: #0a0f18;
}

/* Typography — readable body, sci-fi display, mono accents only ------------ */
html.arcade-mode {
    font-family: var(--font-sans);
    font-size: 16px;
    letter-spacing: -0.005em;
}

html.arcade-mode body {
    font-family: var(--font-sans);
    letter-spacing: -0.005em;
}

html.arcade-mode h1,
html.arcade-mode h2,
html.arcade-mode h3,
html.arcade-mode .section-heading,
html.arcade-mode .font-display {
    font-family: var(--font-display);
    letter-spacing: 0.04em;
    line-height: 1.25;
}

html.arcade-mode .section-heading {
    text-shadow: 0 0 20px rgba(34, 211, 238, 0.12);
}

html.arcade-mode .btn,
html.arcade-mode .nav-link,
html.arcade-mode .field-label {
    font-family: var(--font-sans);
    letter-spacing: 0.02em;
}

html.arcade-mode .eyebrow,
html.arcade-mode .arcade-tag,
html.arcade-mode .arcade-section::before,
html.arcade-mode .arcade-loader__text {
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
}

html.arcade-mode .eyebrow {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    border-radius: 0;
    border: 1px solid var(--accent-border, rgba(34, 211, 238, 0.35));
    box-shadow: var(--pixel-shadow-sm) rgba(34, 211, 238, 0.25);
}

/* CRT overlay -------------------------------------------------------------- */
.crt-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9990;
}

.crt-scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, var(--scanline-opacity)) 2px,
        rgba(0, 0, 0, var(--scanline-opacity)) 4px
    );
    mix-blend-mode: multiply;
}

.dark .crt-scanlines {
    mix-blend-mode: screen;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(34, 211, 238, 0.03) 2px,
        rgba(34, 211, 238, 0.03) 4px
    );
}

.crt-vignette {
    position: absolute;
    inset: 0;
    background: var(--crt-vignette);
}

.crt-flicker {
    position: absolute;
    inset: 0;
    background: transparent;
    opacity: 0;
}

html.arcade-booting .crt-flicker {
    animation: crtBootFlicker 0.55s steps(8) forwards;
}

@keyframes crtBootFlicker {
    0%   { opacity: 0.12; background: rgba(34, 211, 238, 0.04); }
    15%  { opacity: 0; }
    30%  { opacity: 0.08; background: rgba(168, 85, 247, 0.03); }
    45%  { opacity: 0; }
    60%  { opacity: 0.06; }
    100% { opacity: 0; }
}

/* Boot loader -------------------------------------------------------------- */
.arcade-loader {
    position: fixed;
    inset: 0;
    z-index: 9995;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    background: var(--bg-0);
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.arcade-loader.is-done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.arcade-loader__logo {
    font-family: var(--font-display);
    font-size: clamp(1rem, 3vw, 1.35rem);
    font-weight: 600;
    color: var(--c-cyan);
    text-shadow: var(--glow-cyan);
    animation: loaderPulse 1.2s ease-in-out infinite;
}

.arcade-loader__bar {
    width: min(240px, 70vw);
    height: 12px;
    border: 2px solid rgba(34, 211, 238, 0.4);
    box-shadow: var(--pixel-shadow) rgba(34, 211, 238, 0.3);
    padding: 2px;
    background: var(--bg-2);
}

.arcade-loader__fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--c-cyan), var(--c-purple));
    box-shadow: var(--glow-cyan);
    animation: loaderFill 0.7s steps(12) forwards;
}

.arcade-loader__text {
    font-size: 0.8rem;
    color: var(--text-3);
}

@keyframes loaderPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

@keyframes loaderFill {
    to { width: 100%; }
}

/* Custom cursor — instant follow (no transform transition) ---------------- */
.arcade-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    border: 2px solid var(--c-cyan);
    box-shadow: var(--glow-cyan);
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    opacity: 0;
    will-change: transform;
    transform: translate3d(var(--cursor-x, -100px), var(--cursor-y, -100px), 0)
        translate(-50%, -50%)
        scale(var(--cursor-scale, 1));
    transition: border-color 0.12s ease, box-shadow 0.12s ease, opacity 0.1s ease;
}

.arcade-cursor.is-visible {
    opacity: 1;
}

.arcade-cursor.is-clicking {
    --cursor-scale: 0.75;
    border-color: var(--c-pink);
    box-shadow: var(--glow-pink);
}

@media (pointer: coarse), (prefers-reduced-motion: reduce) {
    .arcade-cursor {
        display: none !important;
    }
}

@media (pointer: fine) {
    html.arcade-cursor-active,
    html.arcade-cursor-active body,
    html.arcade-cursor-active a,
    html.arcade-cursor-active button,
    html.arcade-cursor-active summary,
    html.arcade-cursor-active label,
    html.arcade-cursor-active input,
    html.arcade-cursor-active textarea,
    html.arcade-cursor-active select {
        cursor: none !important;
    }
}

/* Header — arcade cabinet top bar ------------------------------------------ */
.arcade-header {
    border-bottom: 2px solid rgba(34, 211, 238, 0.25) !important;
    box-shadow: 0 4px 24px rgba(34, 211, 238, 0.08), inset 0 -1px 0 rgba(168, 85, 247, 0.15);
    background: rgba(5, 8, 16, 0.88) !important;
}

html:not(.dark) .arcade-header {
    background: rgba(247, 248, 250, 0.92) !important;
    border-bottom-color: rgba(34, 211, 238, 0.35) !important;
}

.arcade-brand {
    font-family: var(--font-display) !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.06em !important;
}

.arcade-brand-dot {
    color: var(--c-cyan);
    text-shadow: 0 0 8px rgba(34, 211, 238, 0.8);
}

.arcade-logo-frame {
    border: 2px solid rgba(34, 211, 238, 0.45);
    box-shadow: var(--pixel-shadow-sm) rgba(34, 211, 238, 0.35);
    border-radius: 0 !important;
    image-rendering: pixelated;
}

/* Buttons — arcade cabinet ------------------------------------------------- */
html.arcade-mode .btn {
    border-radius: 0;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    box-shadow: var(--pixel-shadow) rgba(0, 0, 0, 0.55);
    border: 2px solid transparent;
}

html.arcade-mode .btn-primary {
    border-color: rgba(34, 211, 238, 0.6);
    box-shadow: var(--pixel-shadow) rgba(6, 182, 212, 0.5), var(--glow-cyan);
}

html.arcade-mode .btn-primary:hover {
    animation: arcadeBtnPulse 1.4s ease-in-out infinite;
    transform: translate(-1px, -1px);
    box-shadow: calc(var(--pixel-size) + 1px) calc(var(--pixel-size) + 1px) 0 0 rgba(6, 182, 212, 0.5), var(--glow-cyan);
}

html.arcade-mode .btn-primary:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 0 rgba(6, 182, 212, 0.5);
    animation: none;
}

html.arcade-mode .btn-ghost {
    border: 2px solid rgba(34, 211, 238, 0.35);
    box-shadow: var(--pixel-shadow-sm) rgba(34, 211, 238, 0.2);
    border-radius: 0;
}

html.arcade-mode .btn-ghost:hover {
    border-color: var(--c-cyan);
    box-shadow: var(--pixel-shadow) rgba(34, 211, 238, 0.35), 0 0 16px rgba(34, 211, 238, 0.25);
    animation: arcadeBtnPulse 1.6s ease-in-out infinite;
}

@keyframes arcadeBtnPulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.12); }
}

/* Nav links ---------------------------------------------------------------- */
html.arcade-mode .nav-link {
    border-radius: 0;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: border-color var(--dur-med) var(--ease-out), color var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out);
}

html.arcade-mode .nav-link::after {
    display: none;
}

html.arcade-mode .nav-link:hover,
html.arcade-mode .nav-link--active {
    border-color: rgba(34, 211, 238, 0.4);
    box-shadow: inset 0 0 12px rgba(34, 211, 238, 0.08);
    color: var(--c-cyan);
}

/* Surface cards — arcade cabinet panels ------------------------------------ */
html.arcade-mode .surface-card {
    border-radius: 0;
    border-width: 2px;
    box-shadow: var(--pixel-shadow) rgba(0, 0, 0, 0.4);
    image-rendering: auto;
}

html.arcade-mode .surface-card::after {
    height: 2px;
    opacity: 1;
    width: 100%;
    background: linear-gradient(90deg, var(--accent, var(--c-cyan)), transparent 80%);
}

html.arcade-mode .surface-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: calc(var(--pixel-size) + 2px) calc(var(--pixel-size) + 2px) 0 0 var(--accent-border, rgba(34, 211, 238, 0.35)), var(--accent-glow, var(--glow-cyan));
    animation: cardGlowPulse 2s ease-in-out infinite;
}

html.arcade-mode .surface-card--cyan:hover { --accent-glow: var(--glow-cyan); }
html.arcade-mode .surface-card--pink:hover { --accent-glow: var(--glow-pink); }
html.arcade-mode .surface-card--purple:hover { --accent-glow: var(--glow-purple); }

@keyframes cardGlowPulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.05); }
}

html.arcade-mode .surface-card .card-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.03em;
}

/* Hero --------------------------------------------------------------------- */
html.arcade-mode .hero-grid {
    background-image:
        linear-gradient(to right, rgba(34, 211, 238, 0.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(34, 211, 238, 0.06) 1px, transparent 1px);
    background-size: 32px 32px;
    image-rendering: pixelated;
}

html.arcade-mode .hero-backdrop {
    opacity: 0.12;
    image-rendering: pixelated;
}

html.arcade-mode .dark .hero-backdrop {
    opacity: 0.22;
}

html.arcade-mode .grad-text {
    animation: gradPan 6s linear infinite, arcadeTextGlow 3s ease-in-out infinite alternate;
}

@keyframes arcadeTextGlow {
    from { filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.4)); }
    to   { filter: drop-shadow(0 0 12px rgba(236, 72, 153, 0.5)); }
}

/* Section dividers — pixel wipe -------------------------------------------- */
.section-divider {
    width: 100%;
    max-width: 6rem;
    height: 4px;
    margin: 0 auto;
    background: repeating-linear-gradient(
        90deg,
        var(--c-cyan) 0,
        var(--c-cyan) 8px,
        var(--c-purple) 8px,
        var(--c-purple) 16px,
        var(--c-pink) 16px,
        var(--c-pink) 24px,
        transparent 24px,
        transparent 32px
    );
    opacity: 0;
    transform: scaleX(0);
    transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.section-divider.is-visible {
    opacity: 1;
    transform: scaleX(1);
}

.arcade-section {
    position: relative;
}

.arcade-section::before {
    content: attr(data-level);
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--text-3);
    opacity: 0.35;
    pointer-events: none;
}

/* Marquee tiles ------------------------------------------------------------ */
html.arcade-mode .marquee-tile {
    border-radius: 0;
    border-width: 2px;
    box-shadow: var(--pixel-shadow-sm) rgba(0, 0, 0, 0.35);
}

html.arcade-mode .marquee-tile:hover {
    border-color: var(--c-cyan);
    box-shadow: var(--pixel-shadow) rgba(34, 211, 238, 0.3), var(--glow-cyan);
}

html.arcade-mode .marquee-tile img {
    image-rendering: auto;
    filter: saturate(0.9) contrast(1.1);
}

/* Forms -------------------------------------------------------------------- */
html.arcade-mode .field-input,
html.arcade-mode .field-textarea {
    border-radius: 0;
    border-width: 2px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.05);
}

html.arcade-mode .field-input:focus,
html.arcade-mode .field-textarea:focus {
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15), var(--glow-cyan);
    border-color: var(--c-cyan);
}

/* Footer ------------------------------------------------------------------- */
.arcade-footer {
    border-top: 2px solid rgba(34, 211, 238, 0.2) !important;
    background: rgba(5, 8, 16, 0.9) !important;
    box-shadow: inset 0 1px 0 rgba(168, 85, 247, 0.12);
}

html:not(.dark) .arcade-footer {
    background: rgba(247, 248, 250, 0.95) !important;
}

html.arcade-mode .arcade-footer .social-arcade {
    border-radius: 0;
    border-width: 2px;
    box-shadow: var(--pixel-shadow-sm) rgba(0, 0, 0, 0.3);
}

html.arcade-mode .arcade-footer .social-arcade:hover {
    transform: translate(-1px, -1px);
    box-shadow: var(--pixel-shadow) currentColor;
}

/* Mobile menu -------------------------------------------------------------- */
html.arcade-mode .mobile-link {
    border-radius: 0;
    border-width: 2px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: var(--pixel-shadow-sm) rgba(0, 0, 0, 0.25);
}

html.arcade-mode #mobile-menu {
    border-top: 2px solid rgba(34, 211, 238, 0.2);
}

/* Blog cards --------------------------------------------------------------- */
.arcade-blog-card {
    background: var(--bg-1);
    border: 2px solid var(--border-1);
    border-radius: 0;
    box-shadow: var(--pixel-shadow) rgba(0, 0, 0, 0.35);
    overflow: hidden;
    transition: transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out), border-color var(--dur-med) var(--ease-out);
}

.arcade-blog-card:hover {
    transform: translate(-2px, -2px);
    border-color: rgba(34, 211, 238, 0.45);
    box-shadow: calc(var(--pixel-size) + 2px) calc(var(--pixel-size) + 2px) 0 0 rgba(34, 211, 238, 0.3), var(--glow-cyan);
}

.arcade-blog-card img {
    image-rendering: auto;
}

.arcade-tag {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    border-radius: 0;
    border: 1px solid rgba(34, 211, 238, 0.35);
    box-shadow: 1px 1px 0 rgba(34, 211, 238, 0.2);
}

/* Reveal — pixel step transition ------------------------------------------- */
html.arcade-mode [data-reveal] {
    transform: translateY(12px) scale(0.98);
    filter: contrast(0.9);
}

html.arcade-mode [data-reveal].is-visible {
    animation: pixelReveal 0.55s steps(6) forwards;
}

@keyframes pixelReveal {
    to {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

/* Trust strip status LED --------------------------------------------------- */
.status-led {
    width: 8px;
    height: 8px;
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.9), 0 0 16px rgba(52, 211, 153, 0.4);
    animation: ledBlink 2s step-end infinite;
}

@keyframes ledBlink {
    0%, 70% { opacity: 1; }
    71%, 100% { opacity: 0.4; }
}

/* Cookie / update banners — arcade styling --------------------------------- */
html.arcade-mode #cookie-banner {
    border-top: 2px solid rgba(236, 72, 153, 0.5);
    font-family: var(--font-sans);
}

html.arcade-mode .cookie-banner__actions button {
    border-radius: 0 !important;
    font-family: var(--font-sans);
    font-weight: 600;
    box-shadow: var(--pixel-shadow-sm) rgba(0, 0, 0, 0.4);
}

html.arcade-mode #app-update-banner {
    font-family: var(--font-sans);
    border-bottom: 2px solid rgba(34, 211, 238, 0.4);
}

html.arcade-mode #app-update-reload {
    border-radius: 0;
    font-family: var(--font-sans);
    font-weight: 600;
}

/* Reduced motion ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html.arcade-booting .crt-flicker,
    .arcade-loader__fill,
    .arcade-loader__logo,
    html.arcade-mode .btn-primary:hover,
    html.arcade-mode .btn-ghost:hover,
    html.arcade-mode .surface-card:hover,
    html.arcade-mode [data-reveal].is-visible,
    .status-led {
        animation: none !important;
    }

    .arcade-loader { display: none !important; }
}
