/**
 * Landing Page Styles — ai-unboxed
 *
 * Dark-mode landing page with constellation star-map,
 * starfield background, intro splash animation,
 * and shared styles for alle-inhalte / legal sub-pages.
 *
 * Token overrides are scoped to .landing-page so they
 * don't bleed into the light-theme app pages.
 *
 * @author Alexander Wolf
 * @version 2.0
 */

/* =========================================================
   0. LANDING-SCOPED DESIGN TOKENS
   ========================================================= */

.landing-page {
    /* Backgrounds */
    --landing-bg:            #060612;
    --landing-surface:       rgba(20, 18, 40, 0.65);
    --landing-surface-solid: #0f0d24;

    /* Text */
    --landing-text:          #e8e0f0;
    --landing-text-muted:    #a492c9;

    /* Accents */
    --landing-purple:        #5b13ec;
    --landing-cyan:          #00e5ff;
    --landing-orange:        #ff6b35;

    /* Cluster colours */
    --cluster-games:         #e67e22;
    --cluster-playground:    #3498db;
    --cluster-learn:         #2ecc71;
    --cluster-challenge:     #e74c3c;

    /* Glass */
    --landing-glass-bg:      rgba(20, 18, 40, 0.55);
    --landing-glass-border:  rgba(255, 255, 255, 0.08);
    --landing-glass-blur:    12px;

    /* Radii & shadows */
    --landing-radius:        12px;
    --landing-shadow:        0 8px 32px rgba(0, 0, 0, 0.45);

    /* Font */
    --landing-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}


/* =========================================================
   1. BASE LAYOUT
   ========================================================= */

.landing-page {
    margin: 0;
    padding: 0;
    background: var(--landing-bg);
    color: var(--landing-text);
    font-family: var(--landing-font);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.landing-page *,
.landing-page *::before,
.landing-page *::after {
    box-sizing: border-box;
}

.landing-section {
    position: relative;
    padding: 5rem 1.5rem;
}

.landing-section__inner {
    max-width: 1100px;
    margin: 0 auto;
}

.landing-section__header {
    text-align: center;
    margin-bottom: 3rem;
}

.landing-section__title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.75rem;
}

.landing-section__subtitle {
    font-size: 1.05rem;
    color: var(--landing-text-muted);
    max-width: 540px;
    margin: 0 auto;
}

.landing-section__divider {
    width: 60px;
    border: none;
    border-top: 3px solid var(--landing-purple);
    margin: 1rem auto 1.5rem;
}


/* =========================================================
   2. STARFIELD BACKGROUND
   ========================================================= */

.starfield {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.starfield__layer {
    position: absolute;
    inset: 0;
}

.starfield__star {
    position: absolute;
    border-radius: 50%;
    background: #fff;
}

.starfield__star--sm { width: 1px; height: 1px; opacity: 0.4; }
.starfield__star--md { width: 2px; height: 2px; opacity: 0.6; }
.starfield__star--lg { width: 3px; height: 3px; opacity: 0.8; }

.starfield__star--twinkle {
    animation: twinkle 3s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0%   { opacity: 0.2; }
    100% { opacity: 1; }
}


/* =========================================================
   3. INTRO SPLASH
   ========================================================= */

.intro-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--landing-bg);
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.intro-splash--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-splash__stage {
    text-align: center;
}

.intro-splash__svg {
    width: min(280px, 70vw);
    height: auto;
}

/* Box faces */
.intro-box-inside {
    fill: #1a1445;
    stroke: #3a2a8a;
    stroke-width: 1.5;
}

.intro-box-front {
    fill: #0f0d24;
    stroke: #2E427F;
    stroke-width: 2;
}

/* Network lines & nodes */
.intro-glow-orange {
    stroke: var(--landing-orange);
    stroke-width: 2;
    fill: var(--landing-orange);
}

.intro-glow-cyan {
    stroke: var(--landing-cyan);
    stroke-width: 2;
    fill: var(--landing-cyan);
}

.intro-net-line line {
    fill: none;
}

.intro-net-node circle {
    stroke: none;
}

/* --- Network appear animation --- */
.intro-network {
    opacity: 0;
    animation: net-appear 1.2s ease-out 1.0s forwards;
}

@keyframes net-appear {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

/* Flap / lid animation (open outward) */
.intro-flap {
    fill: #1c1654;
    stroke: #3a2a8a;
    stroke-width: 1.5;
    transform-origin: center top;
}

.intro-flap--left {
    animation: flap-left 1.0s ease-out 0.3s forwards;
}

.intro-flap--right {
    animation: flap-right 1.0s ease-out 0.3s forwards;
}

@keyframes flap-left {
    0%   { transform: rotateX(0deg); }
    100% { transform: rotateX(-140deg); opacity: 0.3; }
}

@keyframes flap-right {
    0%   { transform: rotateX(0deg); }
    100% { transform: rotateX(-140deg); opacity: 0.3; }
}

/* Brand text */
.intro-splash__brand {
    margin-top: 1.5rem;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #fff;
    opacity: 0;
    animation: brand-in 0.8s ease-out 1.6s forwards;
}

@keyframes brand-in {
    0%   { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Skip button */
.intro-splash__skip {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--landing-text-muted);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: color 0.2s, border-color 0.2s;
}

.intro-splash__skip:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.5);
}


/* =========================================================
   4. HERO SECTION
   ========================================================= */

.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem 4rem;
}

.hero__content {
    max-width: 700px;
}

.hero__headline {
    font-size: clamp(2rem, 5.5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
    margin: 0 0 1.5rem;
}

.hero__headline-accent {
    background: linear-gradient(135deg, var(--landing-cyan), var(--landing-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__mission {
    font-size: 1.1rem;
    color: var(--landing-text-muted);
    line-height: 1.7;
    margin: 0 0 2rem;
}

.hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 2rem;
    background: linear-gradient(135deg, var(--landing-purple), #8b5cf6);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(91, 19, 236, 0.35);
}

.hero__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(91, 19, 236, 0.5);
}

.hero__cta-icon {
    font-size: 1.2rem;
}

.hero__scroll-hint {
    position: absolute;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--landing-text-muted);
    font-size: 0.8rem;
    animation: scroll-bounce 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(8px); }
}


/* =========================================================
   5. CONSTELLATION MAP
   ========================================================= */

.constellation-section {
    z-index: 1;
}

.constellation-map {
    position: relative;
    margin: 0 auto;
    max-width: 960px;
}

.constellation-map__svg {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Connection lines --- */
.const-line {
    stroke-width: 1;
    opacity: 0.35;
    fill: none;
}

.const-line--games      { stroke: var(--cluster-games); }
.const-line--playground  { stroke: var(--cluster-playground); }
.const-line--learn       { stroke: var(--cluster-learn); }
.const-line--challenge   { stroke: var(--cluster-challenge); }

.const-line--cross {
    stroke: rgba(255, 255, 255, 0.15);
    stroke-dasharray: 6 4;
    stroke-width: 0.8;
    opacity: 0.4;
}

/* --- Region labels --- */
.const-region-label {
    font-family: var(--landing-font);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-anchor: middle;
    opacity: 0.7;
}

.const-region-label--games      { fill: var(--cluster-games); }
.const-region-label--playground  { fill: var(--cluster-playground); }
.const-region-label--learn       { fill: var(--cluster-learn); }
.const-region-label--challenge   { fill: var(--cluster-challenge); }

/* --- Star nodes --- */
.const-star {
    cursor: pointer;
    text-decoration: none;
}

.const-star__hit {
    fill: transparent;
    stroke: none;
    /* min 44px touch target via r=22 */
}

.const-star__dot {
    transition: r 0.25s ease;
}

.const-star__glow {
    opacity: 0.25;
    transition: opacity 0.25s ease, r 0.25s ease;
}

/* Cluster-specific fills */
.const-star--games .const-star__dot,
.const-star--games .const-star__glow   { fill: var(--cluster-games); }
.const-star--playground .const-star__dot,
.const-star--playground .const-star__glow { fill: var(--cluster-playground); }
.const-star--learn .const-star__dot,
.const-star--learn .const-star__glow   { fill: var(--cluster-learn); }
.const-star--challenge .const-star__dot,
.const-star--challenge .const-star__glow { fill: var(--cluster-challenge); }

/* Hover glow */
.const-star:hover .const-star__glow {
    opacity: 0.6;
}

.const-star:hover .const-star__dot {
    r: 6;
}

/* Label text */
.const-label {
    font-family: var(--landing-font);
    font-size: 12px;
    fill: var(--landing-text-muted);
    text-anchor: middle;
    pointer-events: none;
    transition: fill 0.2s;
}

.const-star:hover .const-label {
    fill: #fff;
}

/* Decorative background stars */
.const-star__decor {
    fill: rgba(255, 255, 255, 0.35);
}

/* --- Legend --- */
.constellation-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.constellation-legend__item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--landing-text-muted);
}

.constellation-legend__item::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.constellation-legend__item--games::before      { background: var(--cluster-games); }
.constellation-legend__item--playground::before  { background: var(--cluster-playground); }
.constellation-legend__item--learn::before       { background: var(--cluster-learn); }
.constellation-legend__item--challenge::before   { background: var(--cluster-challenge); }


/* =========================================================
   6. ABOUT & DONATION
   ========================================================= */

.about-section {
    z-index: 1;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.about-maker {
    background: var(--landing-glass-bg);
    border: 1px solid var(--landing-glass-border);
    backdrop-filter: blur(var(--landing-glass-blur));
    border-radius: var(--landing-radius);
    padding: 2rem;
    text-align: center;
}

.about-maker__avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--landing-purple);
    margin-bottom: 1rem;
}

.about-maker__name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.75rem;
}

.about-maker__bio {
    font-size: 0.95rem;
    color: var(--landing-text-muted);
    line-height: 1.65;
    margin: 0 0 1rem;
}

.about-maker__email {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--landing-cyan);
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.about-maker__email:hover {
    opacity: 0.8;
}

.donate-box {
    background: var(--landing-glass-bg);
    border: 1px solid var(--landing-glass-border);
    backdrop-filter: blur(var(--landing-glass-blur));
    border-radius: var(--landing-radius);
    padding: 2rem;
}

.donate-box__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.75rem;
}

.donate-box__text {
    font-size: 0.95rem;
    color: var(--landing-text-muted);
    line-height: 1.65;
    margin: 0 0 1.25rem;
}

.donate-box__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    background: linear-gradient(135deg, #ff6b35, #ff9f1c);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    border-radius: 50px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
}

.donate-box__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 107, 53, 0.45);
}

.donate-box__disclaimer {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(231, 76, 60, 0.08);
    border-left: 3px solid var(--cluster-challenge);
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--landing-text-muted);
    line-height: 1.55;
}


/* =========================================================
   7. FOOTER
   ========================================================= */

.landing-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 2rem 1.5rem;
    text-align: center;
}

.landing-footer__inner {
    max-width: 900px;
    margin: 0 auto;
}

.landing-footer__links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.landing-footer__link {
    color: var(--landing-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.landing-footer__link:hover {
    color: #fff;
}

.landing-footer__copy {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 0.5rem;
}

.landing-footer__doc-link {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.2);
    text-decoration: none;
    transition: color 0.2s;
}

.landing-footer__doc-link:hover {
    color: var(--landing-text-muted);
}


/* =========================================================
   8. EXPLORE CLUSTERS (alle-inhalte.html)
   ========================================================= */

.explore-cluster {
    background: var(--landing-glass-bg);
    border: 1px solid var(--landing-glass-border);
    backdrop-filter: blur(var(--landing-glass-blur));
    border-radius: var(--landing-radius);
    margin-bottom: 1rem;
    overflow: hidden;
}

.explore-cluster__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.explore-cluster__header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.explore-cluster__icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.explore-cluster__title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    flex: 1;
}

.explore-cluster__badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
    color: #fff;
}

.explore-cluster__badge--games      { background: var(--cluster-games); }
.explore-cluster__badge--playground  { background: var(--cluster-playground); }
.explore-cluster__badge--learn       { background: var(--cluster-learn); }
.explore-cluster__badge--challenge   { background: var(--cluster-challenge); }

.explore-cluster__toggle {
    font-size: 1.5rem;
    color: var(--landing-text-muted);
    transition: transform 0.3s ease;
}

.explore-cluster--open .explore-cluster__toggle {
    transform: rotate(180deg);
}

.explore-cluster__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.explore-cluster--open .explore-cluster__body {
    max-height: 800px;
}

.explore-cluster__content {
    padding: 0 1.25rem 1.25rem;
}

/* Galaxy list items */
.galaxy-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.galaxy-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.5rem;
    text-decoration: none;
    color: var(--landing-text);
    border-radius: 8px;
    transition: background 0.2s;
}

.galaxy-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.galaxy-item__icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    width: 2rem;
    text-align: center;
}

.galaxy-item__info {
    flex: 1;
    min-width: 0;
}

.galaxy-item__name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
}

.galaxy-item__desc {
    font-size: 0.82rem;
    color: var(--landing-text-muted);
    margin-top: 0.15rem;
}

.galaxy-item__arrow {
    font-size: 1.2rem;
    color: var(--landing-text-muted);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.galaxy-item:hover .galaxy-item__arrow {
    transform: translateX(3px);
    color: #fff;
}

/* Cross-reference links under items */
.galaxy-item__xref {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--landing-text-muted);
    text-decoration: none;
    margin-right: 0.75rem;
    margin-top: 0.3rem;
    transition: color 0.2s;
}

.galaxy-item__xref:hover {
    color: var(--landing-cyan);
}

.galaxy-item__xref .material-symbols-outlined {
    font-size: 0.85rem;
}


/* =========================================================
   9. PAGE NAVIGATION (sub-pages)
   ========================================================= */

.page-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0.75rem 1.5rem;
    background: rgba(6, 6, 18, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.page-nav__back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--landing-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.page-nav__back:hover {
    color: #fff;
}

.page-nav__back .material-symbols-outlined {
    font-size: 1.1rem;
}


/* =========================================================
   10. LEGAL PAGE STYLES (impressum / datenschutz)
   ========================================================= */

.page-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 6rem 1.5rem 3rem;
}

.page-content h1 {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.5rem;
}

.page-content h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin: 2rem 0 0.75rem;
}

.page-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--landing-text);
    margin: 1.5rem 0 0.5rem;
}

.page-content p,
.page-content li {
    font-size: 0.95rem;
    color: var(--landing-text-muted);
    line-height: 1.7;
}

.page-content ul {
    padding-left: 1.25rem;
}

.page-content a {
    color: var(--landing-cyan);
    text-decoration-color: rgba(0, 229, 255, 0.3);
    transition: text-decoration-color 0.2s;
}

.page-content a:hover {
    text-decoration-color: var(--landing-cyan);
}

.page-content hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 2rem 0;
}


/* =========================================================
   11. SCROLL ANIMATIONS
   ========================================================= */

.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-in--visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-children > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.stagger-children--visible > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: none; }
.stagger-children--visible > *:nth-child(2) { transition-delay: 0.12s; opacity: 1; transform: none; }
.stagger-children--visible > *:nth-child(3) { transition-delay: 0.19s; opacity: 1; transform: none; }
.stagger-children--visible > *:nth-child(4) { transition-delay: 0.26s; opacity: 1; transform: none; }
.stagger-children--visible > *:nth-child(5) { transition-delay: 0.33s; opacity: 1; transform: none; }
.stagger-children--visible > *:nth-child(6) { transition-delay: 0.40s; opacity: 1; transform: none; }


/* =========================================================
   12. RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .constellation-map__svg {
        /* On small screens, allow horizontal scroll or scale */
        min-width: 600px;
    }

    .constellation-map {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }

    .hero__headline {
        font-size: clamp(1.6rem, 7vw, 2.4rem);
    }

    .landing-section {
        padding: 3rem 1rem;
    }
}

@media (max-width: 480px) {
    .constellation-legend {
        gap: 0.75rem;
    }

    .constellation-legend__item {
        font-size: 0.75rem;
    }

    .hero__cta {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    .intro-splash__skip {
        bottom: 1rem;
        right: 1rem;
    }
}
