:root {
    --blood: #8B0000;
    --ember: #C0392B;
    --ash: #1a1a1a;
    --bone: #d4c8b0;
    --fog: rgba(180,160,130,0.07);
    --void: #050505;
    --blood-glow: rgba(139,0,0,0.4);
    --bone-dim: rgba(212,200,176,0.55);
}

* {
    margin: 0; padding: 0;
    box-sizing: border-box;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cinzel', serif;
    background-color: var(--void);
    color: var(--bone);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    cursor: crosshair;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===== CANVAS ===== */
#spaceCanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===== VIGNETTE ===== */
.vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(ellipse at center,
            transparent 25%,
            rgba(0,0,0,0.45) 60%,
            rgba(0,0,0,0.95) 100%),
        radial-gradient(ellipse at top center,
            rgba(139,0,0,0.06) 0%,
            transparent 50%);
    pointer-events: none;
}

/* ===== SCRATCH OVERLAY ===== */
.scratches {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        87deg,
        transparent,
        transparent 2px,
        rgba(255,255,255,0.006) 2px,
        rgba(255,255,255,0.006) 3px
    );
}

/* ===== INTRO ===== */
.intro {
    position: relative;
    z-index: 10;
    text-align: center;
    padding-top: clamp(8vh, 12vw, 16vh);
    padding-bottom: clamp(2rem, 4vh, 5rem);
    width: 100%;
    max-width: 900px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.sigil {
    font-size: clamp(0.6rem, 1.2vw, 0.85rem);
    letter-spacing: clamp(0.4rem, 1.5vw, 0.8rem);
    color: var(--blood);
    text-transform: uppercase;
    margin-bottom: clamp(1rem, 2vh, 1.8rem);
    opacity: 0;
    animation: fadeIn 2s 0.5s forwards;
}

.main-title {
    font-family: 'UnifrakturMaguntia', cursive;
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 400;
    color: var(--bone);
    margin-bottom: 0.4rem;
    letter-spacing: clamp(3px, 0.8vw, 7px);
    text-shadow:
        0 0 30px rgba(139,0,0,0.7),
        0 0 70px rgba(139,0,0,0.25),
        0 0 120px rgba(139,0,0,0.1);
    opacity: 0;
    animation: fadeIn 2s 0.9s forwards;
    line-height: 1.1;
}

.title-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.8rem, 2vw, 1.5rem);
    margin: clamp(0.8rem, 2vh, 1.5rem) auto;
    width: fit-content;
    opacity: 0;
    animation: fadeIn 2s 1.2s forwards;
}

.title-divider::before,
.title-divider::after {
    content: '';
    width: clamp(50px, 8vw, 120px);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--blood), transparent);
}

.divider-rune {
    color: var(--blood);
    font-size: clamp(0.9rem, 1.5vw, 1.3rem);
    text-shadow: 0 0 12px var(--blood-glow);
}

.subtitle {
    font-size: clamp(0.82rem, 1.5vw, 1.05rem);
    font-weight: 400;
    color: var(--bone-dim);
    line-height: clamp(2, 2.5vw, 2.4);
    letter-spacing: 0.08em;
    opacity: 0;
    animation: fadeIn 2s 1.5s forwards;
    max-width: 640px;
    margin: 0 auto;
}

/* ===== HORIZONTAL RULE DECORATION ===== */
.intro::after {
    content: '⬧ ⬡ ⬧';
    display: block;
    margin-top: clamp(1.5rem, 3vh, 2.5rem);
    color: rgba(139,0,0,0.35);
    font-size: clamp(0.55rem, 1vw, 0.75rem);
    letter-spacing: 1.2rem;
    text-align: center;
    opacity: 0;
    animation: fadeIn 2s 1.8s forwards;
}

/* ===== NAV ===== */
.sections-nav {
    position: relative;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: clamp(0.7rem, 1.5vh, 1.2rem);
    align-items: center;
    width: 100%;
    max-width: 620px;
    padding: 0 clamp(1rem, 4vw, 2.5rem);
    padding-bottom: clamp(3rem, 8vh, 6rem);
}

.section-item {
    width: 100%;
    height: clamp(52px, 7vh, 68px);
    background: rgba(8,8,8,0.88);
    border: 1px solid rgba(139,0,0,0.28);
    cursor: pointer;
    transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-radius: 1px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 0 clamp(1rem, 2.5vw, 1.6rem);
    gap: clamp(0.8rem, 1.5vw, 1.2rem);
}

/* corner accents */
.section-item::before,
.section-item::after {
    content: '';
    position: absolute;
    width: clamp(7px, 1.2vw, 10px);
    height: clamp(7px, 1.2vw, 10px);
    border-color: var(--blood);
    border-style: solid;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.5;
}
.section-item::before {
    top: 4px; left: 4px;
    border-width: 1px 0 0 1px;
}
.section-item::after {
    bottom: 4px; right: 4px;
    border-width: 0 1px 1px 0;
}

.section-item:hover {
    border-color: rgba(139,0,0,0.65);
    box-shadow:
        0 0 30px rgba(139,0,0,0.2),
        0 0 60px rgba(139,0,0,0.08),
        inset 0 0 20px rgba(139,0,0,0.06);
}

.section-item:hover::before,
.section-item:hover::after {
    width: clamp(10px, 1.8vw, 16px);
    height: clamp(10px, 1.8vw, 16px);
    opacity: 1;
}

/* ghost variant */
.section-item--ghost {
    background: rgba(5,5,5,0.5) !important;
    border-color: rgba(139,0,0,0.15) !important;
}

.section-item--ghost.expanded,
.section-item--ghost:hover {
    background: rgba(139,0,0,0.04) !important;
    border-color: rgba(139,0,0,0.28) !important;
    box-shadow: 0 0 20px rgba(139,0,0,0.08) !important;
}

/* icon */
.section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: clamp(22px, 3vw, 28px);
    height: clamp(22px, 3vw, 28px);
    opacity: 0.6;
    transition: opacity 0.35s, filter 0.35s;
    filter: grayscale(1) brightness(0.75);
}

.section-icon svg {
    width: 100%;
    height: 100%;
}

.section-item:hover .section-icon {
    opacity: 1;
    filter: none;
}

/* text — always shown on this layout */
.section-text {
    font-size: clamp(0.78rem, 1.5vw, 0.95rem);
    font-weight: 400;
    white-space: nowrap;
    color: var(--bone-dim);
    letter-spacing: 0.07em;
    transition: color 0.35s;
    opacity: 1;
    display: block;
}

.section-item:hover .section-text {
    color: var(--bone);
}

/* expanded state — highlights with section color */
.section-item.expanded {
    border-radius: 1px;
}

.section-item.expanded .section-icon {
    opacity: 1;
    filter: none;
}

.section-item.expanded .section-text {
    color: var(--bone);
}

.section-item[data-section="social"].expanded {
    background: linear-gradient(135deg, rgba(50,60,75,0.92), rgba(25,32,45,0.96));
    border-color: rgba(90,115,155,0.55);
    box-shadow: 0 0 35px rgba(74,80,90,0.2), inset 0 0 20px rgba(74,80,90,0.05);
}
.section-item[data-section="lab"].expanded {
    background: linear-gradient(135deg, rgba(20,65,40,0.92), rgba(10,40,22,0.96));
    border-color: rgba(46,139,87,0.5);
    box-shadow: 0 0 35px rgba(46,139,87,0.18), inset 0 0 20px rgba(46,139,87,0.05);
}
.section-item[data-section="services"].expanded {
    background: linear-gradient(135deg, rgba(90,55,15,0.92), rgba(60,35,8,0.96));
    border-color: rgba(200,140,50,0.5);
    box-shadow: 0 0 35px rgba(200,140,50,0.18), inset 0 0 20px rgba(200,140,50,0.05);
}
.section-item[data-section="support"].expanded {
    background: linear-gradient(135deg, rgba(70,30,85,0.92), rgba(42,14,60,0.96));
    border-color: rgba(165,105,189,0.5);
    box-shadow: 0 0 35px rgba(165,105,189,0.18), inset 0 0 20px rgba(165,105,189,0.05);
}
.section-item[data-section="whoami"].expanded {
    background: linear-gradient(135deg, rgba(80,10,10,0.92), rgba(50,5,5,0.96));
    border-color: rgba(139,0,0,0.5);
    box-shadow: 0 0 35px rgba(139,0,0,0.18), inset 0 0 20px rgba(139,0,0,0.05);
}

/* pulse dot */
.section-item .pulse-dot {
    position: absolute;
    width: 4px; height: 4px;
    background: var(--blood);
    border-radius: 50%;
    top: clamp(6px, 1.2vh, 10px);
    right: clamp(6px, 1.5vw, 10px);
    animation: pulse 2.5s infinite;
    box-shadow: 0 0 6px var(--blood-glow);
}

/* ===== FOOTER ===== */
.footer {
    position: fixed;
    bottom: clamp(1rem, 2.5vh, 2rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
    pointer-events: none;
}

.footer p {
    font-size: clamp(0.65rem, 1.2vw, 0.82rem);
    color: rgba(212,200,176,0.5);
    background: rgba(5,5,5,0.8);
    padding: clamp(0.4rem, 1vh, 0.6rem) clamp(1rem, 3vw, 1.6rem);
    letter-spacing: 0.12em;
    border: 1px solid rgba(139,0,0,0.18);
    border-left: 2px solid rgba(139,0,0,0.6);
    white-space: nowrap;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    clip-path: polygon(
        0 0,
        calc(100% - 8px) 0,
        100% 8px,
        100% 100%,
        8px 100%,
        0 calc(100% - 8px)
    );
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 0.25; transform: scale(1); box-shadow: 0 0 4px var(--blood-glow); }
    50% { opacity: 1; transform: scale(1.7); box-shadow: 0 0 10px var(--blood-glow); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Small mobile: < 380px */
@media (max-width: 380px) {
    .sections-nav {
        max-width: 100%;
        padding: 0 1rem 4rem;
    }
    .section-item {
        height: 50px;
    }
    .main-title {
        font-size: 2.6rem;
    }
}

/* Standard mobile: 380–768px */
@media (min-width: 381px) and (max-width: 768px) {
    .sections-nav {
        max-width: 100%;
        padding: 0 1.5rem 4.5rem;
    }
}

/* Tablet: 768–1024px */
@media (min-width: 769px) and (max-width: 1024px) {
    .sections-nav {
        max-width: 580px;
    }
    .intro {
        padding-top: 10vh;
    }
}

/* Desktop: > 1024px */
@media (min-width: 1025px) {
    body {
        justify-content: center;
        min-height: 100vh;
    }

    .intro {
        padding-top: clamp(6vh, 10vh, 12vh);
        padding-bottom: clamp(1.5rem, 3vh, 3rem);
    }

    .sections-nav {
        max-width: 680px;
        gap: clamp(0.8rem, 1.4vh, 1.4rem);
        padding-bottom: clamp(1.5rem, 4vh, 3.5rem);
    }

    .section-item {
        height: clamp(60px, 7.5vh, 76px);
    }

    .section-text {
        font-size: clamp(0.9rem, 1.2vw, 1.05rem);
        letter-spacing: 0.09em;
    }

    .section-icon {
        width: clamp(24px, 2.2vw, 30px);
        height: clamp(24px, 2.2vw, 30px);
    }

    .footer p {
        font-size: 0.78rem;
    }
}

/* Large desktop: > 1440px */
@media (min-width: 1440px) {
    .intro {
        padding-top: 8vh;
    }

    .sections-nav {
        max-width: 780px;
    }

    .section-item {
        height: clamp(66px, 7vh, 84px);
    }

    .section-text {
        font-size: 1.05rem;
        letter-spacing: 0.1em;
    }
}
