/* ============================================================
   CROSSOVER X — skilltree.css
   Arcane Skill Tree — Leistungen & Services
   ============================================================ */

/* ============================================================
   1. PAGE BASE
   ============================================================ */
.st-page {
    position: relative;
    min-height: 100vh;
    background: #000;
    overflow-x: hidden;
}

/* ============================================================
   2. VIDEO BACKGROUND
   ============================================================ */
.st-video-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.st-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.18;
}

.st-video--mobile  { display: none; }
.st-video--desktop { display: block; }

@media (max-width: 768px) {
    .st-video--desktop { display: none; }
    .st-video--mobile  { display: block; }
}

.st-video-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.75) 100%);
}

/* Everything above video */
.st-hero, .st-selector, .st-active-path {
    position: relative;
    z-index: 1;
}

/* ============================================================
   3. HERO — Haupttitel
   ============================================================ */
.st-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px 20px;
    gap: 20px;
}

.st-hero-title {
    max-width: min(700px, 90vw);
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(180,0,0,0.4));
}

/* Mobile Navigation Pfeile */
.st-mobile-nav {
    display: none;
    align-items: center;
    gap: 24px;
}

.st-nav-btn {
    background: rgba(180,0,0,0.15);
    border: 1px solid rgba(180,0,0,0.5);
    color: #ff2222;
    font-size: 22px;
    width: 48px;
    height: 48px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.st-nav-btn:hover {
    background: rgba(180,0,0,0.35);
    transform: scale(1.1);
}

.st-mobile-path-indicator {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    letter-spacing: 0.15em;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .st-mobile-nav { display: flex; }
    .st-hero { padding: 40px 20px 10px; }
}

/* ============================================================
   4. PATH SELECTOR — 4 Rune-Nodes oben
   ============================================================ */
.st-selector {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: clamp(20px, 4vw, 60px);
    padding: 20px 20px 0;
    flex-wrap: wrap;
}

/* Selector Node */
.st-selector-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.st-selector-node:hover {
    transform: translateY(-4px);
}

.st-selector-rune-wrap {
    position: relative;
    width: clamp(70px, 8vw, 110px);
    height: clamp(70px, 8vw, 110px);
}

.st-selector-rune-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.st-sel-off { opacity: 1; }
.st-sel-on  { opacity: 0; }

.st-selector-node.is-active .st-sel-off { opacity: 0; }
.st-selector-node.is-active .st-sel-on  { opacity: 1; }
.st-selector-node.is-active {
    filter: drop-shadow(0 0 16px rgba(200,0,0,0.7));
}

.st-selector-label {
    font-family: 'Inter', sans-serif;
    font-size: clamp(9px, 0.9vw, 11px);
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
}

.st-selector-node.is-active .st-selector-label {
    color: #ff2222;
}

/* Mobile: Selector ausblenden (Navigation via Pfeile) */
@media (max-width: 768px) {
    .st-selector { display: none; }
}

/* ============================================================
   5. ACTIVE PATH SECTION
   ============================================================ */
.st-active-path {
    padding: 20px 20px 140px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Path Title PNG */
.st-path-title-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px 20px;
    gap: 4px;
    text-align: center;
}

.st-path-title-img {
    max-width: min(420px, 80vw);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(180,0,0,0.3));
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.st-path-title-img.is-switching {
    opacity: 0;
    transform: translateY(-10px);
}


/* Path Subtitle — tagline ÜBER dem Title-PNG */
.st-path-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: clamp(9px, 0.85vw, 11px);
    font-weight: 600;
    color: rgba(255,255,255,0.38);
    letter-spacing: 0.28em;
    text-transform: uppercase;
    text-align: center;
    padding: 0 0 6px;
    transition: opacity 0.4s ease;
    margin: 0;
    display: block;
    width: 100%;
}

.st-path-subtitle.is-switching {
    opacity: 0;
}

/* ============================================================
   6. SKILL TREE
   ============================================================ */
.st-tree-wrap {
    position: relative;
    width: 100%;
    min-height: 500px;
    padding: 20px 0 40px;
}

@media (max-width: 768px) {
    .st-tree-wrap {
        min-height: 300px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* SVG lines on mobile — thicker for visibility */
    .st-lines-svg {
        position: absolute;
        top: 0; left: 0;
        width: 100%;
        height: 100%;
    }

    .st-line {
        stroke-width: 4;
    }

    /* Root centered */
    .st-tree-root {
        padding-left: 0;
        justify-content: center;
        width: 100%;
    }
}

/* SVG Lines Overlay */
.st-lines-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

/* SVG Line base style */
.st-line {
    stroke: #333;
    stroke-width: 3;
    fill: none;
    stroke-linecap: square;
    stroke-linejoin: miter;
    transition: stroke 0.3s ease;
}

/* Active line — fills with red glow */
.st-line.is-active {
    stroke: #cc0000;
    filter: drop-shadow(0 0 6px rgba(200,0,0,0.8));
}

/* Animated fill: stroke-dashoffset animation */
.st-line.is-filling {
    animation: lineFill 0.6s ease-out forwards;
}

@keyframes lineFill {
    from { stroke-dashoffset: var(--line-length); }
    to   { stroke-dashoffset: 0; }
}

/* Root Node */
.st-tree-root {
    display: flex;
    justify-content: flex-start;
    padding-left: clamp(20px, 8vw, 120px);
    position: relative;
    z-index: 2;
}

/* Children Row */
.st-tree-children {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    gap: clamp(20px, 5vw, 80px);
    padding: 80px 0 0 clamp(20px, 8vw, 120px);
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

/* ============================================================
   7. NODE COMPONENT
   ============================================================ */
.st-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease;
}

.st-node:hover {
    transform: scale(1.06);
}

/* Rune image wrapper */
.st-node-rune-wrap {
    position: relative;
    width: clamp(80px, 9vw, 130px);
    height: clamp(80px, 9vw, 130px);
}

.st-rune {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.35s ease, filter 0.35s ease;
}

.st-rune--off { opacity: 1; }
.st-rune--on  { opacity: 0; }

/* Active state: ON-Rune sichtbar, Glow */
.st-node.is-active .st-rune--off { opacity: 0; }
.st-node.is-active .st-rune--on  {
    opacity: 1;
    filter: drop-shadow(0 0 12px rgba(200,0,0,0.9)) drop-shadow(0 0 25px rgba(200,0,0,0.4));
}

/* Pulsing glow ring on active node */
.st-node.is-active .st-node-rune-wrap::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(200,0,0,0.5);
    animation: nodePulse 2s ease-in-out infinite;
}

@keyframes nodePulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50%       { opacity: 1; transform: scale(1.08); }
}

.st-node-label {
    font-family: 'Inter', sans-serif;
    font-size: clamp(10px, 1vw, 13px);
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-align: center;
}

.st-node.is-active .st-node-label {
    color: #ff2222;
    text-shadow: 0 0 12px rgba(200,0,0,0.6);
}

/* Root node slightly bigger */
.st-node--root .st-node-rune-wrap {
    width: clamp(100px, 11vw, 150px);
    height: clamp(100px, 11vw, 150px);
}

/* ============================================================
   8. PERGAMENT MODAL (inline unter dem Baum)
   ============================================================ */
.st-modal {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 50px auto 0;
    opacity: 0;
    transform: translateY(30px);
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.st-modal.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.st-modal-inner {
    position: relative;
}

.st-modal-bg {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Text Content über dem Pergament */
.st-modal-content {
    position: absolute;
    top: 14%;
    left: 15%;
    right: 15%;
    bottom: 16%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
}

.st-modal-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(17px, 2.4vw, 28px);
    font-weight: 700;
    color: #1a0a00;
    letter-spacing: 0.08em;
    margin: 0;
    line-height: 1.2;
}

.st-modal-divider {
    width: 80%;
    height: 1px;
    background: rgba(80,40,0,0.4);
}

.st-modal-text {
    font-family: 'Inter', sans-serif;
    font-size: clamp(12px, 1.15vw, 15px);
    color: #2a1500;
    line-height: 1.75;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
}

.st-modal-text::-webkit-scrollbar { display: none; }

/* CTA Button — roter Balken wie im Mockup */
.st-modal-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #cc0000;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: clamp(10px, 1vw, 13px);
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 10px 20px;
    border-radius: 2px;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    text-decoration: none;
    width: fit-content;
    margin-top: auto;
    box-shadow: 0 0 12px rgba(200,0,0,0.5);
}

.st-modal-cta:hover {
    background: #ff1111;
    transform: translateX(4px);
    box-shadow: 0 0 20px rgba(200,0,0,0.8);
}

/* ============================================================
   9. MOBILE TREE — vertikales Layout
   ============================================================ */
@media (max-width: 768px) {
    .st-path-title-wrap {
        justify-content: center;
        padding: 20px 20px 10px;
    }

    .st-tree-root {
        justify-content: center;
        padding-left: 0;
    }

    .st-tree-children {
        flex-direction: column;
        align-items: center;
        padding: 50px 0 0;
        gap: 40px;
    }

    .st-node-rune-wrap {
        width: 95px;
        height: 95px;
    }

    .st-node--root .st-node-rune-wrap {
        width: 115px;
        height: 115px;
    }

    .st-node-label {
        font-size: 11px;
        letter-spacing: 0.12em;
    }

    .st-modal {
        max-width: 95vw;
        margin: 30px auto 0;
    }

    /* Mobile: Querformat-Pergament bleibt, aber Rolle kleiner + besser positioniert */
    .st-modal {
        max-width: 92vw;
        margin: 24px auto 0;
    }

    /* Bleibt Querformat-Bild auf Mobile — nur kleiner */
    .st-modal-content {
        top: 13%;
        left: 14%;
        right: 14%;
        bottom: 15%;
        gap: 10px;
    }

    .st-modal-title {
        font-size: clamp(14px, 4vw, 19px);
    }

    .st-modal-text {
        font-size: clamp(11px, 2.8vw, 14px);
        line-height: 1.6;
    }

    .st-modal-cta {
        font-size: 10px;
        padding: 9px 16px;
        margin-top: 6px;
    }
}

/* ============================================================
   10. PATH SWITCH ANIMATION
   ============================================================ */
.st-active-path.is-switching {
    opacity: 0.3;
    pointer-events: none;
}

/* ============================================================
   11. DEKO RUNES (Hintergrund-Deko, optional)
   ============================================================ */
.st-deko-rune {
    position: absolute;
    pointer-events: none;
    opacity: 0.08;
    animation: dekoFloat 8s ease-in-out infinite;
}

@keyframes dekoFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%       { transform: translateY(-15px) rotate(8deg); }
}

/* ============================================================
   SWORD VIDEO — hinter dem Modal
   ============================================================ */
.st-sword-wrap {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    height: 0;
    overflow: visible;
    pointer-events: none;
    /* Erscheint wenn Modal sichtbar */
    opacity: 0;
    transition: opacity 0.8s ease;
}

.st-sword-wrap.is-visible {
    opacity: 1;
}

/* Video als weicher Hintergrund-Effekt */
.st-sword-video {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(200px, 40vw, 380px);
    height: auto;
    object-fit: contain;
    opacity: 0.35;
    filter: sepia(0.4) saturate(0.8) brightness(0.7);
    /* Blur für Traumhaftigkeit */
    filter: blur(1px) brightness(0.6) sepia(0.3);
    mix-blend-mode: screen;
}

/* ============================================================
   NODE DIMMED STATE
   Vorheriger Node bleibt schwach sichtbar
   ============================================================ */
.st-node.is-dimmed {
    opacity: 0.45;
    transform: scale(0.96);
}

.st-node.is-dimmed .st-rune--on {
    opacity: 0 !important;
}

.st-node.is-dimmed .st-rune--off {
    opacity: 1 !important;
}

.st-node.is-dimmed .st-node-label {
    color: rgba(255,255,255,0.35);
}

/* Smooth dimming transition */
.st-node {
    transition: opacity 0.4s ease, transform 0.3s ease;
}

/* ============================================================
   PAGE TRANSITION OVERLAY — Celtic Runes Video
   ============================================================ */
#st-transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#st-transition-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

#st-transition-overlay.is-leaving {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.6s ease;
}

#st-transition-overlay.is-leaving.is-leaving-done {
    opacity: 0;
}

#st-transition-overlay video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 50% Opacity auf Schwarz = Video bei 50% */
    opacity: 0.50;
}

@media (max-width: 768px) {
    .st-path-title-wrap {
        padding: 10px 20px 10px;
    }

    .st-path-subtitle {
        font-size: 9px;
        letter-spacing: 0.18em;
    }

    .st-path-tagline {
        font-size: 10px;
        letter-spacing: 0.18em;
    }
}

/* Tagline UNTER dem Title-PNG — größer, sichtbarer */
.st-path-tagline {
    font-family: 'Inter', sans-serif;
    font-size: clamp(11px, 1.1vw, 14px);
    font-weight: 700;
    color: rgba(200,0,0,0.8);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    text-align: center;
    margin: 8px 0 0;
    transition: opacity 0.4s ease;
    width: 100%;
}

.st-path-tagline.is-switching {
    opacity: 0;
}

@media (max-width: 768px) {
    .st-path-tagline {
        font-size: 10px;
        letter-spacing: 0.18em;
        text-align: center;
    }
}