/* ==========================================
   RESET & BASE STYLES
   ========================================== */
@font-face {
    font-family: 'Work Sans';
    src: url('work-sans.light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'Nasalization';
    src: url('Nasalization Rg.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Exo 2';
    src: url('Exo2-Thin.otf') format('opentype');
    font-weight: 100;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* ==========================================
       VISUAL CUSTOMIZATION VARIABLES
       ========================================== */

    /* Version Counter */
    --version-counter-display: none;
    /* Set to 'none' to hide */

    /* Spacing Configuration */
    --content-block-spacing: 5vh;

    /* Video Overlay Background */
    --video-overlay-color: 0, 214, 236;
    /* RGB values for cyan tint (kept as CSV for rgba usage) */
    --video-overlay-edge-opacity: 0.15;
    /* Opacity used at the top/bottom cyan edges (0.0 to 1.0) */
    --video-overlay-transparent-stop: rgba(255, 255, 255, 0);
    /* Fully transparent stop used for the middle band */
    --video-overlay-gradient: linear-gradient(to bottom,
            rgba(var(--video-overlay-color), var(--video-overlay-edge-opacity)) 0%,
            var(--video-overlay-transparent-stop) 15%,
            var(--video-overlay-transparent-stop) 85%,
            rgba(var(--video-overlay-color), var(--video-overlay-edge-opacity)) 100%);
    /* Gradient: cyan at 0% -> transparent by 20% (stay) -> cyan at 100% */

    /* Foreground layer opacity */

    /* Vignette Effect */
    --vignette-start: 50%;
    /* Where darkening starts (0% = center, 100% = edge) */
    --vignette-strength: 0.3;
    /* Darkness at edges (0.0 = none, 1.0 = black) */

    /* Blur Layer Effect */
    --blur-area-height: 20vh;
    /* Height of blurred area at top/bottom */
    --blur-strength: 100px;
    /* Blur intensity (higher = more blur) */
    --blur-opacity-start: 1.0;
    /* Blur opacity at edge (0.0 = invisible, 1.0 = full) */
    --blur-opacity-mid: 0.9;
    /* Blur opacity at 25% point */
    --blur-fade-point: 25%;
    /* Where blur starts fading (0% = edge, 100% = center) */

    /* Pixel Overlay Effect */
    --pixel-area-height: 20vh;
    /* Height of pixel overlay at top/bottom */
    --pixel-opacity-start: 0.8;
    /* Pixel overlay opacity at edge */
    --pixel-opacity-mid: 0.5;
    /* Pixel overlay opacity at middle of gradient */

    /* Parallax Scroll Speed Ratios */
    --scroll-speed-pixel: 0.1875;
    /* Pixel overlay scroll speed (slowest, half of HUD slow) */
    --scroll-speed-hud-slow: 0.375;
    /* HUD slow layer scroll speed (25% slower than medium) */
    --scroll-speed-hud-medium: 0.5;
    /* HUD medium layer scroll speed (base speed) */
    --scroll-speed-hud-fast: 0.625;
    /* HUD fast layer scroll speed (25% faster than medium) */
    /* HUD Parallax Layers Opacity */
    --hud-slow-opacity: 0.2;
    /* Background layer opacity */
    --hud-medium-opacity: 0.4;
    /* Middle layer opacity */
    --hud-fast-opacity: 0.8;
    /* HUD tile sizes (width & height in px). Used to compute centering offsets */
    --hud-slow-tile-size: 245px;
    --hud-medium-tile-size: 255px;
    --hud-fast-tile-size: 267px;

    /* Navigation Bar */
    --nav-bg-color: rgba(0, 0, 0, 0.9);
    /* Navigation background color and opacity */
    --nav-blur: 10px;
    /* Blur effect behind navigation */

    /* Vertical Scroll Rail */
    --scroll-rail-width: 3px;
    /* Thickness of the vertical line */
    --scroll-rail-dot-size: 11px;
    /* Size of each section marker */
    --scroll-rail-offset: 14px;
    /* Distance from the left screen edge */
    --scroll-rail-height: 50vh;
    /* Visible height of the rail */
    --scroll-rail-current-width: 3px;
    /* Width of the red position indicator */
    --scroll-rail-opacity-active: 0.7;
    /* Opacity while scrolling */
    --scroll-rail-opacity-idle: 0.3;
    /* Opacity when idle */

    /* Color Scheme */
    --accent-color: #c33;
    /* Red accent color for highlights and active states */
    --heading-color: #ffffff;
    /* White for headings and lines */
    --text-color: #eef;
    /* Light blue-gray for body text */
    --text-color-strong: #ffffff;
    /* Color for strong/bold text */

    /* Content Background Styling */
    --content-bg-color: rgba(0, 0, 0, 0.6);
    /* Background color of content boxes */
    --content-backdrop-blur: 10px;
    /* Blur strength behind content boxes */
    --content-border-width: 1px;
    /* Border width (0px = no border) */
    --content-border-color: rgba(230, 230, 255, 0.2);
    /* Border color */
    --content-border-radius: 10px;
    /* Rounded corners */
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    overflow-x: hidden;
    background: #000;
}

/* Version Counter */
.version-counter {
    position: fixed;
    top: 10px;
    left: 10px;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 1);
    background: rgba(0, 0, 0, 0.85);
    padding: 5px 8px;
    border-radius: 3px;
    z-index: 10000;
    display: var(--version-counter-display);
    pointer-events: none;
    max-width: 95%;
    overflow: visible;
    white-space: normal;
}

/* Custom scrollbar styling - Over navigation */
::-webkit-scrollbar {
    width: 12px;
    z-index: 1001;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.8);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 0, 0, 0.6);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 0, 0, 0.8);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 0, 0, 0.6) rgba(0, 0, 0, 0.8);
}

a {
    color: var(--accent-color);
}

a:visited {
    color: color-mix(in srgb, var(--accent-color) 75%, transparent);
}

a:hover {
    color: color-mix(in srgb, var(--accent-color) 85%, var(--heading-color));
}

/* ==========================================
   SECTIONS - Native Scroll with Parallax
   ========================================== */
.section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fixed background container for parallax effect */
.section-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    pointer-events: none;
    will-change: transform;
}

/* Video background inside section-background */
.section-background .section-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* Crossfade layers for mobile background rotation */
.section-background .bg-fade-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
    z-index: 1;
}

.section-background .bg-fade-layer.active {
    opacity: 1;
}

/* Blur layer - uses backdrop-filter */
.blur-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 3;
    pointer-events: none;
}

.blur-layer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--blur-area-height);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    mask-image: linear-gradient(to bottom,
            rgba(0, 0, 0, var(--blur-opacity-start)) 0%,
            rgba(0, 0, 0, var(--blur-opacity-mid)) var(--blur-fade-point),
            rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to bottom,
            rgba(0, 0, 0, var(--blur-opacity-start)) 0%,
            rgba(0, 0, 0, var(--blur-opacity-mid)) var(--blur-fade-point),
            rgba(0, 0, 0, 0) 100%);
}

.blur-layer::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--blur-area-height);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    mask-image: linear-gradient(to top,
            rgba(0, 0, 0, var(--blur-opacity-start)) 0%,
            rgba(0, 0, 0, var(--blur-opacity-mid)) var(--blur-fade-point),
            rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to top,
            rgba(0, 0, 0, var(--blur-opacity-start)) 0%,
            rgba(0, 0, 0, var(--blur-opacity-mid)) var(--blur-fade-point),
            rgba(0, 0, 0, 0) 100%);
}

/* Pixel overlay - only on top and bottom 20vh */
.pixel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 4;
    pointer-events: none;
    --pixel-bg-position: center center;
}

.pixel-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--pixel-area-height);
    background-image: url('bg_pixels.png');
    background-repeat: repeat;
    background-position: var(--pixel-bg-position);
    mask-image: linear-gradient(to bottom,
            rgba(0, 0, 0, var(--pixel-opacity-start)) 0%,
            rgba(0, 0, 0, var(--pixel-opacity-mid)) 50%,
            rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to bottom,
            rgba(0, 0, 0, var(--pixel-opacity-start)) 0%,
            rgba(0, 0, 0, var(--pixel-opacity-mid)) 50%,
            rgba(0, 0, 0, 0) 100%);
}

.pixel-overlay::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--pixel-area-height);
    background-image: url('bg_pixels.png');
    background-repeat: repeat;
    background-position: var(--pixel-bg-position);
    mask-image: linear-gradient(to top,
            rgba(0, 0, 0, var(--pixel-opacity-start)) 0%,
            rgba(0, 0, 0, var(--pixel-opacity-mid)) 50%,
            rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to top,
            rgba(0, 0, 0, var(--pixel-opacity-start)) 0%,
            rgba(0, 0, 0, var(--pixel-opacity-mid)) 50%,
            rgba(0, 0, 0, 0) 100%);
}

/* HUD Parallax Layers - scroll at different speeds with different scales */
.hud-parallax-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url('bg_hud.png');
    background-repeat: repeat;
    background-position: center center;
    z-index: 5;
    pointer-events: none;
    mix-blend-mode: screen;
    animation: holoShift 6s ease-in-out infinite alternate;
}

.hud-parallax-layer.hud-slow {
    background-size: var(--hud-slow-tile-size) var(--hud-slow-tile-size);
    /* 10% smaller - background layer */
    opacity: var(--hud-slow-opacity);
    /* initial centering handled by JS for pixel-perfect centering */
    /* disabled because of performance filter: url('#hud-holo-slow'); */
}

.hud-parallax-layer.hud-medium {
    background-size: var(--hud-medium-tile-size) var(--hud-medium-tile-size);
    /* original size - middle layer */
    opacity: var(--hud-medium-opacity);
    /* initial centering handled by JS for pixel-perfect centering */
    /* disabled because of performancefilter: url('#hud-holo-medium'); */
}

.hud-parallax-layer.hud-fast {
    background-size: var(--hud-fast-tile-size) var(--hud-fast-tile-size);
    /* 10% larger - foreground layer */
    opacity: var(--hud-fast-opacity);
    /* initial centering handled by JS for pixel-perfect centering */
    /* disabled because of performance filter: url('#hud-holo-fast'); */
}

/* Disable medium and fast HUD parallax layers on small screens to improve performance */
@media (max-width: 480px) {

    .hud-parallax-layer.hud-medium,
    .hud-parallax-layer.hud-fast {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

@keyframes holoShift {
    0% {
        transform: translateY(0) scale(1);
    }

    100% {
        transform: translateY(-2px) scale(1.01);
    }
}

/* Vignette overlay - darkens edges of screen */
.vignette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: radial-gradient(ellipse at center,
            transparent 0%,
            transparent var(--vignette-start),
            rgba(0, 0, 0, var(--vignette-strength)) 100%);
    z-index: 8;
    pointer-events: none;
}

.section-video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(var(--video-overlay-color), var(--video-overlay-edge-opacity));
    background: var(--video-overlay-gradient);
    z-index: 2;
    pointer-events: none;
}

.section-content {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 6rem 2rem 2rem;
}

#intro .section-content {
    padding-top: 0;
}

#intro .content-wrapper {
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    box-shadow: none;
    margin-bottom: 25vh;
    /* Half of default 75vh spacing */
}

.content-wrapper {
    max-width: 900px;
    margin: 10vh auto var(--content-block-spacing) auto;
    background: var(--content-bg-color);
    backdrop-filter: blur(var(--content-backdrop-blur));
    -webkit-backdrop-filter: blur(var(--content-backdrop-blur));
    padding: 3rem;
    border-radius: var(--content-border-radius);
    border: var(--content-border-width) solid var(--content-border-color);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    opacity: 0.1;
    transition: opacity 0.6s ease;
}

.section:last-of-type .content-wrapper {
    /* Half the default spacing on the final section only */
    margin-bottom: 10vh !important;
}

.content-wrapper.visible {
    opacity: 1;
}

.content-wrapper h1,
.content-wrapper h2,
.content-wrapper h3 {
    position: relative;
    isolation: isolate;
    padding: 0.75rem 0.85rem;
    line-height: 1.3;
    clip-path: none !important;
    background-repeat: no-repeat;
    background-image:
        /* top-left */
        linear-gradient(var(--heading-color), var(--heading-color)),
        linear-gradient(var(--heading-color), var(--heading-color)),
        /* top-right */
        linear-gradient(var(--heading-color), var(--heading-color)),
        linear-gradient(var(--heading-color), var(--heading-color)),
        /* bottom-left */
        linear-gradient(var(--accent-color), var(--accent-color)),
        linear-gradient(var(--accent-color), var(--accent-color)),
        /* bottom-right */
        linear-gradient(var(--heading-color), var(--heading-color)),
        linear-gradient(var(--heading-color), var(--heading-color));
    background-size:
        8px 1px,
        1px 8px,
        8px 1px,
        1px 8px,
        8px 1px,
        1px 8px,
        8px 1px,
        1px 8px;
    background-position:
        left top,
        left top,
        right top,
        right top,
        left bottom,
        left bottom,
        right bottom,
        right bottom;
}

.content-wrapper h3::before {
    background-image: none !important;
}

.content-wrapper h1,
.content-wrapper h2 {
    margin-bottom: 1.5rem;
    text-shadow: 3px 3px 6px #000;
}

.content-wrapper h1 {
    color: var(--heading-color);
    font-size: 2.5rem;
}

.content-wrapper h2 {
    color: var(--heading-color);
    font-size: 2rem;
}

.content-wrapper h3 {
    color: var(--heading-color);
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.content-wrapper h1::before,
.content-wrapper h2::before,
.content-wrapper h3::before {
    content: '';
    position: absolute;
    inset: 5px;
    background-image: repeating-linear-gradient(135deg,
            color-mix(in srgb, var(--accent-color) 5%, transparent),
            color-mix(in srgb, var(--accent-color) 5%, transparent) 12px,
            color-mix(in srgb, var(--accent-color) 25%, transparent) 12px,
            color-mix(in srgb, var(--accent-color) 25%, transparent) 24px);
    background-size: 34px 34px;
    background-repeat: repeat;
    background-position: 0 0;
    animation: headingStripes 2s linear infinite;
    pointer-events: none;
    z-index: -1;
    border-bottom: 1px solid color-mix(in srgb, var(--text-color) 60%, transparent);
}

.content-wrapper p {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-size: 1.1rem;
}

.content-wrapper p:last-child {
    margin-bottom: 0;
}

.content-wrapper strong {
    color: var(--text-color-strong);
    font-weight: 600;
}

@keyframes headingStripes {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 34px 0;
    }
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================
   PRINT STYLES
   ========================================== */
@media print {

    .main-nav,
    .back-to-top {
        display: none;
    }

    .section {
        page-break-inside: avoid;
        min-height: auto;
    }

    .section-background::after {
        display: none;
    }

    .content-wrapper {
        box-shadow: none;
        background: #fff;
    }
}

@media (max-width: 768px) {
    #intro .section-content {
        padding-top: 1.5rem;
    }

    #intro .content-wrapper {
        margin-top: 2vh;
        margin-bottom: 16vh;
        padding: 2.25rem 1.75rem;
    }
}

/* ==========================================
   ACTION BUTTON (Universeller Button-Stil)
   ========================================== */
.action-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 1.6rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--heading-color) !important;
    text-decoration: none;
    background: color-mix(in srgb, var(--heading-color) 4%, transparent);
    line-height: 1.1;
    border-left: 1px solid color-mix(in srgb, var(--heading-color) 99%, transparent);
    border-right: 1px solid color-mix(in srgb, var(--heading-color) 99%, transparent);
    border-bottom: none;
    border-top: none;
    border-radius: 0.5em;
    transition: background 9.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
    cursor: pointer;
}

.action-button::before {
    content: '';
    position: absolute;
    inset: 1px 4px;
    background: linear-gradient(90deg,
            color-mix(in srgb, var(--heading-color) 20%, transparent) 0%,
            color-mix(in srgb, var(--heading-color) 10%, transparent) 1.5em,
            color-mix(in srgb, var(--heading-color) 10%, transparent) calc(100% - 1.5em),
            color-mix(in srgb, var(--heading-color) 20%, transparent) 100%);
    border-radius: 0.5em;
    pointer-events: none;
    z-index: 0;
}

.action-button:hover,
.action-button:focus-visible {
    border-left-color: var(--accent-color);
    color: var(--accent-color) !important;
}

.action-button:hover::before,
.action-button:focus-visible::before {
    background: linear-gradient(90deg,
            color-mix(in srgb, var(--accent-color) 14%, transparent) 0%,
            color-mix(in srgb, var(--heading-color) 7%, transparent) 1.5em,
            color-mix(in srgb, var(--heading-color) 7%, transparent) calc(100% - 1.5em),
            color-mix(in srgb, var(--heading-color) 14%, transparent) 100%);
}

/* Smaller variant for compact buttons (calendar controls etc.) */
.action-button-small {
    padding: 0.32rem 0.6rem;
    font-size: 0.9rem;
}

/* ==========================================
   SCROLL HINT ARROWS
   ========================================== */
.scroll-hint {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.25rem;
    color: #fff;
    font-family: 'Exo 2', 'Nasalization', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
    opacity: 0;
    visibility: hidden;
    z-index: 9;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.scroll-hint__label {
    display: none;
}

.scroll-hint__icon {
    position: relative;
    width: 138px;
    height: 48px;
    background: url('ArrowDown.svg') center/contain no-repeat;
    opacity: 0.5;
}

.scroll-hint--top .scroll-hint__icon {
    transform: rotate(180deg);
}

.scroll-hint--top {
    top: 18px;
    animation: scroll-hint-down 1.6s ease-in-out infinite alternate;
}

.scroll-hint--bottom {
    bottom: 18px;
    animation: scroll-hint-up 1.6s ease-in-out infinite alternate;
}

.scroll-hint.visible {
    visibility: visible;
}

@media (max-width: 768px) {
    .scroll-hint__icon {
        width: 104px;
        height: 36px;
    }
}

@keyframes scroll-hint-down {
    0% {
        transform: translate(-50%, -2px);
        opacity: 0.5;
    }

    100% {
        transform: translate(-50%, 6px);
        opacity: 0.7;
    }
}

@keyframes scroll-hint-up {
    0% {
        transform: translate(-50%, 2px);
        opacity: 0.5;
    }

    100% {
        transform: translate(-50%, -6px);
        opacity: 0.7;
    }
}

/* Mobile adjustments: slightly smaller action buttons and stacked form fields on small phones */
@media (max-width: 420px) {
    .action-button {
        padding: 0.55rem 1.54rem;
        /* ~2px less height, ~1px less width compared to 0.7rem 1.6rem */
        font-size: 0.95rem;
    }

    /* Force inline form rows to stack on narrow screens (iPhone) to avoid layout breakage */
    .form-row-inline {
        grid-template-columns: 1fr !important;
    }

    /* Ensure problematic fields take full width */
    #res-phone,
    #res-date,
    #res-mode {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* Impressum / Datenschutzerklärung styles moved to resources/impressum.css */