* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Alegreya', serif;
    background: #0a0a0a;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

/* First interlace layer - slower movement */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
            linear-gradient(rgba(0, 255, 157, 0.03) 2px, transparent 2px);
    background-size: 100% 4px;
    animation: interlaceSlow 1.5s linear infinite;
    opacity: 0.5;
    z-index: 0;
}

@keyframes interlaceSlow {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* Second interlace layer - faster movement for moiré effect */
body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
            linear-gradient(rgba(0, 255, 157, 0.03) 2px, transparent 2px);
    background-size: 100% 4px;
    animation: interlaceFast 0.5s linear infinite;
    opacity: 0.5;
    z-index: 0;
}

@keyframes interlaceFast {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* Glowing orbs behind the totem icon */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.2;
    animation: float 15s ease-in-out infinite;
    z-index: 0;
}

.orb-1 {
    width: min(60%, 65vmin);
    height: min(60%, 65vmin);
    background: #00ff9d;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 0s;
}

.orb-2 {
    width: min(45%, 50vmin);
    height: min(45%, 50vmin);
    background: #00d4ff;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 7s;
}

.orb-3 {
    width: min(50%, 55vmin);
    height: min(50%, 55vmin);
    background: #ff00d4;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 3.5s;
}

@keyframes float {
    0%, 100% {
        transform: translate(-50%, -50%);
    }
    33% {
        transform: translate(calc(-50% + min(80px, 10vw)), calc(-50% - min(80px, 10vw)));
    }
    66% {
        transform: translate(calc(-50% - min(40px, 5vw)), calc(-50% + min(40px, 5vw)));
    }
}

/* === Container now scales with height and has safe padding === */
.container {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 100%;
    max-width: min(700px, 85vw, 90dvh);
    max-height: 90dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 4vh, 3rem); /* responsive breathing room */
    box-sizing: border-box;
}

/* === Constrain logo wrapper to prevent overflow === */
.logo-wrapper {
    margin-bottom: clamp(1.5rem, 5vh, 4rem);
    position: relative;
    width: 100%;
    max-height: 65%; /* ensures space for H1 below */
    display: flex;
    justify-content: center;
}

/* === Logo now scales based on height as well as width === */
.logo {
    width: clamp(200px, min(75vw, 70dvh), 575px);
    /* 👆 This already had a 200px minimum, but we can nudge it higher if needed */
    max-height: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(0, 255, 157, 0.5));
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(0, 255, 157, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 35px rgba(0, 255, 157, 0.8));
    }
}

/* === Heading scales by height too === */
h1 {
    font-family: 'Alegreya', serif;
    font-weight: 600;
    font-size: clamp(2.2rem, min(8vw, 8dvh), 4rem);
    /* ↑ bump the minimum slightly too, so both scale down together */
    color: #fff;
    margin: 0;
    letter-spacing: clamp(0.1em, 0.25em, 0.25em);
    position: relative;
    text-shadow:
            0 0 8px rgba(0, 255, 157, 0.3),
            0 0 15px rgba(0, 255, 157, 0.2),
            0 0 20px rgba(0, 255, 157, 0.1);
    animation: glow 2s ease-in-out infinite alternate;
    white-space: nowrap;
}

@keyframes glow {
    from {
        text-shadow:
                0 0 8px rgba(0, 255, 157, 0.3),
                0 0 15px rgba(0, 255, 157, 0.2),
                0 0 20px rgba(0, 255, 157, 0.1);
    }
    to {
        text-shadow:
                0 0 12px rgba(0, 255, 157, 0.4),
                0 0 20px rgba(0, 255, 157, 0.3),
                0 0 28px rgba(0, 255, 157, 0.2);
    }
}

/* Ensure proper centering on very small screens */
@media (max-width: 320px) {
    body {
        padding: 0.5rem;
    }

    .logo {
        width: 70vw;
    }

    h1 {
        font-size: 2rem;
        letter-spacing: 0.08em;
    }
}
