@font-face {
    font-family: 'LushBrigade';
    src: url('../fonts/LushBrigade.woff2?v=39') format('woff2'),
         url('../fonts/LushBrigade.woff?v=39') format('woff'),
         url('../fonts/LushBrigade.ttf?v=39') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Lightning bolt container */
.lightning-container {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

/* Each layer contains the bolt pattern — use hi-res image */
.bolt-layer {
    position: absolute;
    inset: -100px;
    background-image: url('../images/logo_wallpaper.png');
    background-size: cover;
    background-position: center;
    will-change: transform;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* --- SLOW DRIFT ANIMATION --- */
.layer-1 {
    animation: drift1 30s ease-in-out infinite;
}

.layer-2 {
    display: block;
    opacity: 0;
    filter: brightness(0.6);
    animation: drift2 40s ease-in-out infinite;
}

.layer-3 {
    display: block;
    opacity: 0;
    filter: brightness(0.4);
    animation: drift3 50s ease-in-out infinite;
}

@keyframes drift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -15px) scale(1.02); }
    50% { transform: translate(-10px, 20px) scale(1.01); }
    75% { transform: translate(15px, 10px) scale(1.03); }
}

@keyframes drift2 {
    0%, 100% { transform: translate(0, 0) scale(1.05); }
    25% { transform: translate(-25px, 20px) scale(1.03); }
    50% { transform: translate(15px, -25px) scale(1.06); }
    75% { transform: translate(-20px, -10px) scale(1.04); }
}

@keyframes drift3 {
    0%, 100% { transform: translate(0, 0) scale(1.1); }
    25% { transform: translate(30px, 25px) scale(1.08); }
    50% { transform: translate(-20px, -30px) scale(1.12); }
    75% { transform: translate(25px, -15px) scale(1.09); }
}

/* --- ANIMATED REVEAL ON LOAD --- */
.bolt-layer {
    clip-path: circle(0% at 50% 50%);
}

body.revealed .layer-1 {
    opacity: 1;
    clip-path: circle(150% at 50% 50%);
    transition: clip-path 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.3s ease;
}

body.revealed .layer-2 {
    opacity: 0.3;
    clip-path: circle(150% at 50% 50%);
    transition: clip-path 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s,
                opacity 0.5s ease 0.15s;
}

body.revealed .layer-3 {
    opacity: 0.2;
    clip-path: circle(150% at 50% 50%);
    transition: clip-path 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s,
                opacity 0.7s ease 0.3s;
}

/* --- Procedural lightning canvas --- */
#lightning-canvas {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.revealed #lightning-canvas {
    opacity: 1;
    transition: opacity 0.5s ease 0.8s;
}

/* Text-shaped knockout: black text + massive shadow blocks bolts behind letters */
.text-mask {
    position: fixed;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.mask-text {
    font-family: 'LushBrigade', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(2rem, 12vw, 8rem);
    font-weight: 400;
    letter-spacing: -0.04em;
    color: #000;
    padding: 0.2em 0.6em;
    transform: rotate(-5deg) translateX(0.55em);
    white-space: nowrap;
    -webkit-text-stroke: 35px #000;
    paint-order: stroke fill;
    filter: url(#jagged);
}

/* Main content */
main {
    position: relative;
    z-index: 10;
    text-align: center;
}

.title-link {
    text-decoration: none;
}

.title {
    font-family: 'LushBrigade', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(2rem, 12vw, 8rem);
    font-weight: 400;
    letter-spacing: -0.04em;
    color: #fff;
    padding: 0.2em 0.6em;
    position: relative;
    transform: rotate(-5deg) translateX(0.55em);
}

/* Screen flash overlay (used by procedural lightning) */
.screen-flash {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.05s ease;
}

.screen-flash.active {
    opacity: 0.15;
    transition: opacity 0.02s ease;
}

/* --- AUDIO ICON --- */
.audio-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 200;
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.audio-toggle:hover {
    opacity: 1;
}

.audio-toggle svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

.audio-toggle.muted svg .sound-wave {
    display: none;
}

/* Letter kerning classes */
.tight-l {
    font-size: 1.4em;
    line-height: 0;
    vertical-align: -0.05em;
    position: relative;
    left: -0.25em;
    margin-left: -1.2em;
    margin-right: calc(-0.15em - 3px);
}

.tight-h {
    margin-left: 5px;
}

.tight-e {
    margin-left: 2px;
}

.word-space {
    display: inline-block;
    width: 0.3em;
}

.big-b {
    font-size: 1.1em;
    line-height: 0;
    vertical-align: -0.02em;
}

.alt-a {
    font-size: 1.5em;
    line-height: 0;
    vertical-align: -0.25em;
    margin-left: -0.05em;
    margin-right: -0.02em;
}

.alt-g {
    font-size: 2.0em;
    line-height: 0;
    vertical-align: -0.28em;
    margin-left: 0.02em;
    margin-right: -0.16em;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .bolt-layer {
        animation: none !important;
        clip-path: circle(150% at 50% 50%) !important;
        opacity: 1 !important;
    }
    .layer-2 { opacity: 0.4 !important; }
    .layer-3 { opacity: 0.25 !important; }
}
