/* Page transition styles */

/* Container for both sections */
#page-container {
    position: relative;
    width: 100%;
}

/* Hero wrapper - fixed fullscreen */
.hero-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 100;
    transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1);
    will-change: transform;
}

/* When showing section 2, slide hero up */
#page-container.show-section-2 .hero-wrapper {
    transform: translateY(-100vh);
}

/* Section wrapper - hidden until transition */
.section-wrapper {
    position: fixed;
    top: 100vh;
    left: 0;
    width: 100%;
    height: 100vh;
    visibility: hidden;
    pointer-events: none;
    z-index: 50;
    background: #0a1551;
    transition: top 0.7s cubic-bezier(0.65, 0, 0.35, 1), visibility 0s 0.7s;
}

/* When showing section 2, make it visible and scrollable */
#page-container.show-section-2 .section-wrapper {
    position: relative;
    top: 0;
    height: auto;
    min-height: 100vh;
    visibility: visible;
    pointer-events: auto;
    overflow: visible;
    transition: top 0.7s cubic-bezier(0.65, 0, 0.35, 1), visibility 0s 0s;
}

/* Allow body scroll when in section 2 */
body.section-2-active {
    overflow-y: auto;
}

/* Transition glitch effect - applied to hero during transition */
.transition-glitch {
    animation: transition-glitch-main 0.3s linear !important;
}

.transition-glitch .glitch__title {
    animation: transition-glitch-text 0.3s linear !important;
}

.transition-glitch .glitch__title:before {
    animation: transition-glitch-before 0.15s linear infinite !important;
    text-shadow: 4px 0 #00f !important;
}

.transition-glitch .glitch__title:after {
    animation: transition-glitch-after 0.18s linear infinite !important;
    text-shadow: -4px 0 #f00 !important;
}

.transition-glitch .figure,
.transition-glitch .figure-mask {
    animation: transition-glitch-triangle 0.3s linear !important;
}

.transition-glitch:before {
    animation: transition-glitch-bg 0.1s linear infinite !important;
    opacity: 1 !important;
}

.transition-glitch .hero-content {
    animation: transition-glitch-content 0.3s linear !important;
}

/* Main screen glitch during transition */
@keyframes transition-glitch-main {
    0% { filter: none; }
    10% { filter: hue-rotate(90deg) saturate(2); }
    20% { filter: hue-rotate(-90deg) brightness(1.5); }
    30% { filter: invert(1); }
    40% { filter: hue-rotate(180deg) saturate(3); }
    50% { filter: none; }
    60% { filter: hue-rotate(-45deg) contrast(2); }
    70% { filter: invert(1) hue-rotate(90deg); }
    80% { filter: saturate(0); }
    90% { filter: hue-rotate(45deg); }
    100% { filter: none; }
}

/* Text glitch during transition */
@keyframes transition-glitch-text {
    0% { transform: translate(0) scaleX(1) scaleY(1); opacity: 1; }
    5% { transform: translate(-20px, 10px) scaleX(0.5) scaleY(2); opacity: 0.8; }
    10% { transform: translate(15px, -8px) scaleX(2) scaleY(0.3); opacity: 1; }
    15% { transform: translate(-10px, 15px) scaleX(0.7) scaleY(1.8); opacity: 0.6; }
    20% { transform: translate(25px, -5px) scaleX(1.8) scaleY(0.2); opacity: 1; }
    25% { transform: translate(-15px, 8px) scaleX(0.4) scaleY(2.2); opacity: 0.7; }
    30% { transform: translate(18px, -12px) scaleX(1.6) scaleY(0.5); opacity: 1; }
    35% { transform: translate(-22px, 12px) scaleX(0.6) scaleY(1.9); opacity: 0.5; }
    40% { transform: translate(12px, -18px) scaleX(2.2) scaleY(0.1); opacity: 1; }
    45% { transform: translate(-25px, 6px) scaleX(0.3) scaleY(2.5); opacity: 0.8; }
    50% { transform: translate(14px, -3px) scaleX(1.5) scaleY(0.6); opacity: 1; }
    55% { transform: translate(-8px, 10px) scaleX(0.8) scaleY(1.6); opacity: 0.6; }
    60% { transform: translate(20px, -14px) scaleX(1.9) scaleY(0.4); opacity: 1; }
    65% { transform: translate(-18px, 8px) scaleX(0.5) scaleY(2.1); opacity: 0.7; }
    70% { transform: translate(10px, -10px) scaleX(1.4) scaleY(0.7); opacity: 1; }
    75% { transform: translate(-12px, 14px) scaleX(0.7) scaleY(1.7); opacity: 0.5; }
    80% { transform: translate(22px, -6px) scaleX(1.7) scaleY(0.5); opacity: 1; }
    85% { transform: translate(-16px, 4px) scaleX(0.6) scaleY(1.5); opacity: 0.8; }
    90% { transform: translate(8px, -8px) scaleX(1.2) scaleY(0.8); opacity: 1; }
    95% { transform: translate(-4px, 6px) scaleX(0.9) scaleY(1.2); opacity: 0.9; }
    100% { transform: translate(0) scaleX(1) scaleY(1); opacity: 1; }
}

/* Before pseudo-element glitch */
@keyframes transition-glitch-before {
    0% { clip: rect(20px, 9999px, 50px, 0); transform: translate(-10px, 0); }
    10% { clip: rect(80px, 9999px, 120px, 0); transform: translate(15px, 0); }
    20% { clip: rect(40px, 9999px, 90px, 0); transform: translate(-8px, 0); }
    30% { clip: rect(100px, 9999px, 150px, 0); transform: translate(12px, 0); }
    40% { clip: rect(10px, 9999px, 60px, 0); transform: translate(-15px, 0); }
    50% { clip: rect(130px, 9999px, 180px, 0); transform: translate(10px, 0); }
    60% { clip: rect(50px, 9999px, 100px, 0); transform: translate(-12px, 0); }
    70% { clip: rect(90px, 9999px, 140px, 0); transform: translate(8px, 0); }
    80% { clip: rect(30px, 9999px, 80px, 0); transform: translate(-6px, 0); }
    90% { clip: rect(120px, 9999px, 160px, 0); transform: translate(5px, 0); }
    100% { clip: rect(60px, 9999px, 110px, 0); transform: translate(-4px, 0); }
}

/* After pseudo-element glitch */
@keyframes transition-glitch-after {
    0% { clip: rect(70px, 9999px, 110px, 0); transform: translate(8px, 0); }
    15% { clip: rect(120px, 9999px, 160px, 0); transform: translate(-12px, 0); }
    30% { clip: rect(20px, 9999px, 70px, 0); transform: translate(14px, 0); }
    45% { clip: rect(90px, 9999px, 140px, 0); transform: translate(-10px, 0); }
    60% { clip: rect(45px, 9999px, 95px, 0); transform: translate(16px, 0); }
    75% { clip: rect(110px, 9999px, 155px, 0); transform: translate(-8px, 0); }
    90% { clip: rect(55px, 9999px, 105px, 0); transform: translate(6px, 0); }
    100% { clip: rect(85px, 9999px, 130px, 0); transform: translate(-4px, 0); }
}

/* Triangle glitch during transition */
@keyframes transition-glitch-triangle {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); }
    8% { transform: translate(-20px, 10px) rotate(-8deg) scale(1.3); }
    16% { transform: translate(15px, -8px) rotate(5deg) scale(0.7); }
    24% { transform: translate(-12px, 15px) rotate(-4deg) scale(1.4); }
    32% { transform: translate(25px, -6px) rotate(8deg) scale(0.6); }
    40% { transform: translate(-18px, 5px) rotate(-6deg) scale(1.2); }
    48% { transform: translate(10px, -12px) rotate(4deg) scale(0.8); }
    56% { transform: translate(-8px, 18px) rotate(-10deg) scale(1.5); }
    64% { transform: translate(14px, -4px) rotate(3deg) scale(0.75); }
    72% { transform: translate(-6px, 8px) rotate(-2deg) scale(1.1); }
    80% { transform: translate(18px, -10px) rotate(6deg) scale(0.85); }
    88% { transform: translate(-10px, 6px) rotate(-3deg) scale(1.05); }
    94% { transform: translate(4px, -2px) rotate(1deg) scale(0.95); }
    100% { transform: translate(0, 0) rotate(0deg) scale(1); }
}

/* Background glitch during transition */
@keyframes transition-glitch-bg {
    0% { background-position: 0 0; opacity: 1; }
    20% { background-position: -30px -15px; opacity: 0.8; }
    40% { background-position: 25px -10px; opacity: 1; }
    60% { background-position: -15px -25px; opacity: 0.9; }
    80% { background-position: 20px 10px; opacity: 1; }
    100% { background-position: 0 -12px; opacity: 0.85; }
}

/* Content shake during transition */
@keyframes transition-glitch-content {
    0% { transform: translate(0, 0); }
    5% { transform: translate(-5px, 3px); }
    10% { transform: translate(4px, -2px); }
    15% { transform: translate(-3px, 5px); }
    20% { transform: translate(6px, -4px); }
    25% { transform: translate(-4px, 2px); }
    30% { transform: translate(3px, -5px); }
    35% { transform: translate(-6px, 4px); }
    40% { transform: translate(5px, -3px); }
    45% { transform: translate(-2px, 6px); }
    50% { transform: translate(4px, -2px); }
    55% { transform: translate(-5px, 3px); }
    60% { transform: translate(3px, -4px); }
    65% { transform: translate(-4px, 5px); }
    70% { transform: translate(6px, -3px); }
    75% { transform: translate(-3px, 2px); }
    80% { transform: translate(2px, -5px); }
    85% { transform: translate(-4px, 4px); }
    90% { transform: translate(3px, -2px); }
    95% { transform: translate(-1px, 1px); }
    100% { transform: translate(0, 0); }
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    opacity: 0.12;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.scroll-indicator:hover {
    opacity: 0.3;
}

.scroll-indicator svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
}

/* Hide scroll indicator when on section 2 */
#page-container.show-section-2 .scroll-indicator {
    opacity: 0;
    pointer-events: none;
}
