/* ==========================================
   1. RESET & BASE STYLES
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    background-color: #0b0f19; /* Edler Dark-Mode-Hintergrund */
    color: #f1f5f9;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==========================================
   Hintergrundmusik
   ========================================== */
#music-container {
    position: fixed;
    width: 1px;
    height: 1px;
    right: 0;
    bottom: 0;
    overflow: visible;
    z-index: 5000;
}

#background-music {
    position: absolute;
    width: 1px;
    height: 1px;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

/* Gemeinsame Button-Styles */
.music-toggle-btn {
    position: fixed;
    z-index: 5001;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid rgba(125, 211, 252, 0.4);
    border-radius: 12px;
    background: rgba(8, 17, 32, 0.5);
    color: #cbd5e1;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: color 0.3s, border-color 0.3s, background-color 0.3s, box-shadow 0.3s;
    perspective: 400px;
}

/* Positionierung */
.music-toggle-btn.top-left {
    top: 20px;
    left: 20px;
}

.music-toggle-btn.bottom-right {
    bottom: 20px;
    right: 20px;
}

/* Hover-Zustand (Inaktiv) */
.music-toggle-btn:hover {
    border-color: #38bdf8;
    color: #ffffff;
    background: rgba(23, 40, 61, 0.5);
}

/* Icon innerhalb des Buttons (Ebene für 3D-Animation) */
.music-toggle-btn .btn-icon {
    display: inline-block;
    font-size: 18px;
    transform-style: preserve-3d;
}

/* Aktiver Zustand: Grün leuchtend & 3D-Rotation */
.music-toggle-btn.is-active {
    border-color: #22c55e;
    background: rgba(20, 83, 45, 0.5);
    color: #4ade80;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

.music-toggle-btn.is-active .btn-icon {
    animation: rotate3D 6s linear infinite;
}

/* 3D-Drehanimation */
@keyframes rotate3D {
    0% {
        transform: rotateY(0deg) rotateX(0deg);
    }
    50% {
        transform: rotateY(180deg) rotateX(15deg);
    }
    100% {
        transform: rotateY(360deg) rotateX(0deg);
    }
}

/* ==========================================
   2. HERO SECTION & CANVAS
   ========================================== */
.hero-container {
    position: absolute;
    bottom: 40px; /* Abstand vom unteren Rand */
    left: 40px;   /* Abstand vom linken Rand */
    z-index: 10;
    pointer-events: none; /* Klicks gehen durch auf den Canvas */
    text-align: left;
    color: #ffffff;
    background: rgba(13, 19, 33, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.hero-container h1 {
    font-size: 24px;
    margin: 0 0 10px 0;
}

.hero-container p {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.hero-container * {
    pointer-events: auto; /* Buttons/Links bleiben klickbar */
}

/* CANVAS VOLLBILD */
#bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 150%;
    height: 150%;
    z-index: 1;
}

/* ==========================================
   3. FROSTED GLASS HERO CARD
   ========================================== */
.hero-card {
    position: relative;
    z-index: 2;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 3.5rem 3rem;
    max-width: 650px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.badge {
    display: inline-block;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 1rem;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.hero-card h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.8rem;
    background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 2rem;
}

/* ==========================================
   4. BUTTONS
   ========================================== */
.cta-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    text-decoration: none;
    padding: 0.8rem 1.6rem;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.25s ease-in-out;
}

.btn-primary {
    background: #38bdf8;
    color: #0f172a;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
}

.btn-primary:hover {
    background: #7dd3fc;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

/* ==========================================
   5. CONTENT CONTAINER & CARDS
   ========================================== */
.content-container {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 2rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(56, 189, 248, 0.4);
}

.card h3 {
    color: #38bdf8;
    margin-bottom: 0.5rem;
}

/* ==========================================
   6. ALPHA-INDEX / FISHEYE-MENÜ
   ========================================== */
.alpha-side-container {
    position: fixed;
    z-index: 100;
    pointer-events: none;
}

/* Container Links (0-9, A, B) */
.alpha-side-container.left {
    left: 0;
    top: 0;
    height: 100vh;
    width: 120px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* Container Oben (Zentriert am oberen Rand) */
.alpha-side-container.top {
    top: 0;
    left: 0;
    width: 100vw;
    height: 90px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* Container Rechts */
.alpha-side-container.right {
    right: 0;
    top: 0;
    height: 100vh;
    width: 120px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.alpha-list {
    pointer-events: auto;
}

.alpha-list.vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 20px 0;
}

#alpha-list-left {
    flex-direction: column-reverse; /* 0-G von unten nach oben */
}

.alpha-list.horizontal {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: auto;
    flex-wrap: nowrap;
    overflow: visible;
}

.alpha-item {
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    color: #7dd3fc;
    font-size: 26px;
    margin: 2px;
    cursor: pointer;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    width: 45px;
    height: 44px;
    flex-shrink: 0;

    position: relative;
    z-index: 1;
    overflow: visible;

    /* Fisheye-Vergrößerung */
    transform: scale(var(--fisheye-scale, 1));
    transform-origin: center center;

    transition:
        transform 80ms linear,
        color 100ms ease,
        text-shadow 100ms ease;

    will-change: transform;
}

/* Der Anker-Buchstabe */
.alpha-letter {
    display: block;
    line-height: 1;
    position: relative;
}

/* Standard-Beschreibung (Linkes Menü) */
.alpha-suffix {
    position: absolute;
    left: calc(100% - 12px);
    top: 50%;
    transform: translateY(-50%);

    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.2;
    color: #ffffff;

    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    text-shadow: 0 0 8px #38bdf8;

    transition:
        opacity 150ms ease,
        visibility 150ms ease;
}

/* Hover-Status allgemein */
.alpha-item.is-hovered .alpha-suffix {
    opacity: 1;
    visibility: visible;
}

.alpha-item.is-hovered {
    color: #ffffff;
    text-shadow: 0 0 16px #38bdf8;
    z-index: 10;
}

/* ==========================================
   SPEZIELLE REGELN FÜR DAS OBERE MENÜ (.top)
   ========================================== */

/* 1. Buchstaben im oberen Menü beim Hover um 90° drehen */
.alpha-side-container.top .alpha-item.is-hovered {
    transform: scale(var(--fisheye-scale, 1)) rotate(90deg);
}

/* 2. Beschreibung exakt im gedrehten Raum des Buchstabens ausrichten */
.alpha-side-container.top .alpha-letter .alpha-suffix {
    position: absolute;
    top: 100%;                  /* Wandert im gedrehten Raum nach rechts */
    left: 50%;
    margin-top: 6px;            /* Fester Abstand hinter jedem Buchstaben (D, F, M etc.) */

    transform: translateX(-50%) rotate(-90deg); /* Text wieder gerade stellen */
    transform-origin: top center;
    white-space: nowrap;
}

/* ==========================================
   SPEZIELLE REGELN FÜR DAS RECHTE MENÜ (.right)
   ========================================== */

.alpha-side-container.right {
    right: 20px;
    top: 0;
    height: 100vh;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.alpha-side-container.right .alpha-item {
    position: relative;
    transform-origin: right center;
}

/* 1. Die Beschreibung nach links aufklappen lassen (verankert an der rechten Kante) */
.alpha-side-container.right .alpha-suffix {
    position: absolute;
    right: 0;                     /* Bündig an der rechten Kante des Buchstabens anlegen */
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    /* Fließender Übergang */
    transition: opacity 120ms ease, visibility 120ms ease;
}

/* 2. Beim Hovern: Den einzelnen Buchstaben ausblenden... */
.alpha-side-container.right .alpha-item.is-hovered .alpha-letter {
    opacity: 0;
}

/* 3. ...und die vollständige Beschreibung an exakt gleicher Stelle einblenden */
.alpha-side-container.right .alpha-item.is-hovered .alpha-suffix {
    opacity: 1;
    visibility: visible;
}

/* ==========================================
   7. FOOTER & EXTRAS
   ========================================== */
footer {
    text-align: center;
    padding: 2rem;
    color: #64748b;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

#portal-preview {
    background: rgba(8, 17, 32, 0.55) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}