﻿/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Focus Indicators for Keyboard Accessibility */
a:focus-visible,
button:focus-visible,
.social-card:focus-visible,
.home-card:focus-visible,
.arsenal-card:focus-visible,
.edu-card:focus-visible,
.volunteer-card:focus-visible,
.cta-button:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}

.nav-link:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 5px;
}

/* Skip to Content Link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 8px 16px;
    z-index: 9999;
    transition: top 0.3s ease;
    text-decoration: none;
    font-weight: 600;
}

.skip-to-content:focus {
    top: 0;
}

:root {
    /* Typography */
    --font-display: 'Syne', sans-serif;
    --font-body: 'Outfit', sans-serif;

    /* Black & White Theme */
    --bg-primary: #000000;
    --bg-primary-rgb: 0, 0, 0;
    --bg-secondary: #0a0a0a;
    --bg-card: #111111;
    --text-primary: #ffffff;
    --text-primary-rgb: 255, 255, 255;
    --text-secondary: #999999;
    --border: #222222;
    --accent: #ffffff;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(var(--bg-primary-rgb), 0.5);
    --shadow-md: 0 4px 16px rgba(var(--bg-primary-rgb), 0.6);
    --shadow-lg: 0 8px 32px rgba(var(--bg-primary-rgb), 0.7);
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Animated Background */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-primary);
}

.gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(var(--text-primary-rgb), 0.03) 0%, transparent 50%);
}

/* Enhanced animated gradient with breathing effect */
.gradient-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(var(--text-primary-rgb), 0.02) 0%, transparent 70%);
    animation: rotate 30s linear infinite, breathe 8s ease-in-out infinite;
}

.gradient-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(var(--text-primary-rgb), 0.015) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes breathe {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    33% {
        transform: translate(30px, -30px);
    }

    66% {
        transform: translate(-20px, 20px);
    }
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-md) clamp(1rem, 4vw, 3rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    background: rgba(var(--bg-primary-rgb), 0.8);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.header-logo {
    width: 45px;
    height: 45px;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.logo-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--text-primary);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: logoPulse 3s ease-in-out infinite;
}

.header-logo:hover .logo-img {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 30px rgba(var(--text-primary-rgb), 0.4);
    animation-play-state: paused;
}

@keyframes logoPulse {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(var(--text-primary-rgb), 0.1);
    }

    50% {
        box-shadow: 0 0 20px rgba(var(--text-primary-rgb), 0.2);
    }
}

.header-nav {
    display: contents;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    font-size: 0.95rem;
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link:hover::before {
    width: 100%;
}

.nav-link.active {
    color: var(--text-primary);
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--text-primary);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        width: 0;
        left: 50%;
    }

    to {
        width: 100%;
        left: 0;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    position: relative;
    z-index: 1;
    padding-top: 80px;
}

:is(.about-page, .gaming-page) .container {
    padding-top: 0;
}


/* Page Hero */
.page-hero {
    text-align: center;
    padding: var(--spacing-xl) 0;
    margin-bottom: var(--spacing-lg);
}


/* Social Links Section */
.social-links {
    /* Padding removed - spacing handled by .about-section class */
}

.social-links-header {
    max-width: 1400px;
    margin: 0 auto 2.5rem;
    padding: 0 clamp(1rem, 4vw, 3rem);
    text-align: center;
}

.social-links-header .section-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #fff;
    display: inline-block;
    text-shadow: 0 0 40px rgba(var(--text-primary-rgb), 0.12);
}

.social-links-header .section-title::after {
    content: '';
    display: block;
    margin-top: 0.5rem;
    height: 1px;
    width: 100%;
    background: linear-gradient(to right, transparent, rgba(var(--text-primary-rgb), 0.6), transparent);
}

.section-subtitle {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: rgba(var(--text-primary-rgb), 0.5);
    margin-top: 1rem;
    font-weight: 400;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

/* Social Cards */
.social-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.social-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--text-primary-rgb), 0.08), transparent);
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    padding: 1px;
    background: linear-gradient(135deg, transparent, var(--text-primary), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.social-card:hover::before {
    left: 100%;
}

.social-card:hover::after {
    opacity: 0.3;
}

.social-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 40px rgba(var(--text-primary-rgb), 0.15);
    border-color: var(--text-primary);
    animation-play-state: paused;
}

.card-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border-radius: var(--radius-sm);
    background: rgba(var(--text-primary-rgb), 0.05);
    flex-shrink: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(var(--text-primary-rgb), 0.1);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-card:hover .card-icon {
    transform: scale(1.15) rotate(8deg);
    background: rgba(var(--text-primary-rgb), 0.1);
}

.social-card:hover .card-icon::before {
    transform: translateY(0);
}

.card-icon i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.social-card:hover .card-icon i {
    transform: scale(1.1);
    animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {

    0%,
    100% {
        transform: scale(1.1) translateY(0);
    }

    50% {
        transform: scale(1.1) translateY(-4px);
    }
}

.card-content {
    flex: 1;
}

.card-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.card-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.card-arrow {
    font-size: 1.25rem;
    opacity: 0.5;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-card:hover .card-arrow {
    opacity: 1;
    transform: translateX(8px);
    animation: arrowSlide 0.8s ease infinite;
}

@keyframes arrowSlide {

    0%,
    100% {
        transform: translateX(8px);
    }

    50% {
        transform: translateX(12px);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll hint line — shared across pages */
.scroll-line {
    width: 1px;
    height: 40px;
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(var(--text-primary-rgb), 0.4), transparent);
    animation: scrollDrop 2s ease-in-out infinite;
}

@keyframes scrollDrop {
    0% {
        top: -100%;
    }

    100% {
        top: 100%;
    }
}

/* Loading Animation for Cards */
.social-card {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards, cardFloat 3s ease-in-out infinite;
}

.social-card:nth-child(1) {
    animation-delay: 0.1s, 0s;
}

.social-card:nth-child(2) {
    animation-delay: 0.15s, 0.3s;
}

.social-card:nth-child(3) {
    animation-delay: 0.2s, 0.6s;
}

.social-card:nth-child(4) {
    animation-delay: 0.25s, 0.9s;
}

.social-card:nth-child(5) {
    animation-delay: 0.3s, 1.2s;
}

.social-card:nth-child(6) {
    animation-delay: 0.35s, 1.5s;
}

.social-card:nth-child(7) {
    animation-delay: 0.4s, 1.8s;
}

.social-card:nth-child(8) {
    animation-delay: 0.45s, 2.1s;
}

@keyframes cardFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .container {
        padding: var(--spacing-md);
        padding-top: 80px;
    }

    .links-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 480px) {
    .nav-link {
        font-size: 0.85rem;
    }

    .social-card {
        padding: var(--spacing-sm);
    }

    .card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: var(--text-primary);
    color: var(--bg-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Mouse Trail Effect - Image Ghost Trail */
.mouse-trail-img {
    position: fixed;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    pointer-events: none;
    z-index: 9999;
    object-fit: cover;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    filter: grayscale(0.5);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

.mouse-trail-img.show {
    opacity: 0.15;
    transform: translate(-50%, -50%) scale(1);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

.mouse-trail-img.fade {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
    transition: opacity 0.6s ease-in, transform 0.6s ease-in;
}

/* Scroll Reveal */
.revealed {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Disable mouse trail on touch devices */
@media (hover: none) and (pointer: coarse) {
    .mouse-trail-img {
        display: none;
    }
}

/* ==============================
   SITE FOOTER
   ============================== */

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(var(--bg-primary-rgb), 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(var(--text-primary-rgb), 0.04);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem var(--spacing-lg);
    max-width: 1400px;
    margin: 0 auto;
}

.footer-copy {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: rgba(var(--text-primary-rgb), 0.6);
}

.footer-drive {
    color: rgba(var(--text-primary-rgb), 0.6);
    font-size: 0.85rem;
    transition: color 0.3s ease, transform 0.3s ease;
    text-decoration: none;
}

.footer-drive:hover {
    color: rgba(var(--text-primary-rgb), 1);
    transform: translateY(-1px);
}

/* ==============================
   MOBILE MENU — Cinematic Fullscreen
   ============================== */

/* Hamburger toggle — hidden on desktop */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 10002;
    position: relative;
    width: 36px;
    height: 28px;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    -webkit-tap-highlight-color: transparent;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
        opacity 0.3s ease,
        width 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    transform-origin: center;
}

.hamburger-line:last-child {
    width: 60%;
    margin-left: auto;
}

/* X state when menu is open */
.mobile-menu-toggle.is-active .hamburger-line:first-child {
    transform: translateY(4.5px) rotate(45deg);
}

.mobile-menu-toggle.is-active .hamburger-line:last-child {
    width: 100%;
    transform: translateY(-4.5px) rotate(-45deg);
}

/* Fullscreen overlay */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(var(--bg-primary-rgb), 0.97);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s cubic-bezier(0.23, 1, 0.32, 1),
        visibility 0.5s;
    overflow: hidden;
}

.mobile-menu.is-open {
    opacity: 1;
    visibility: visible;
}

/* Grain texture overlay */
.mobile-menu-grain {
    position: absolute;
    inset: -10px;
    pointer-events: none;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
    animation: grainShift 0.3s steps(6) infinite;
}

/* Vignette */
.mobile-menu-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 20%, rgba(var(--bg-primary-rgb), 0.8) 100%);
}

/* Vertical accent line */
.mobile-menu-line {
    position: absolute;
    left: 15%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(var(--text-primary-rgb), 0.06) 20%, rgba(var(--text-primary-rgb), 0.06) 80%, transparent);
    transform: scaleY(0);
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1) 0.15s;
}

.mobile-menu.is-open .mobile-menu-line {
    transform: scaleY(1);
}

/* Nav links container */
.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    padding: 0 5%;
    position: relative;
    z-index: 1;
}

/* Individual link */
.mobile-menu-link {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    text-decoration: none;
    color: var(--text-primary);
    padding: 1.2rem 0;
    border-bottom: 1px solid rgba(var(--text-primary-rgb), 0.04);
    position: relative;
    /* Staggered reveal */
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.5s cubic-bezier(0.23, 1, 0.32, 1),
        transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Stagger delays — applied when menu is open */
.mobile-menu.is-open .mobile-menu-link:nth-child(1) {
    transition-delay: 0.12s;
}

.mobile-menu.is-open .mobile-menu-link:nth-child(2) {
    transition-delay: 0.2s;
}

.mobile-menu.is-open .mobile-menu-link:nth-child(3) {
    transition-delay: 0.28s;
}

.mobile-menu.is-open .mobile-menu-link:nth-child(4) {
    transition-delay: 0.36s;
}

.mobile-menu.is-open .mobile-menu-link {
    opacity: 1;
    transform: translateX(0);
}

/* Hover sweep */
.mobile-menu-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(var(--text-primary-rgb), 0.03), transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.mobile-menu-link:hover::before,
.mobile-menu-link:focus::before {
    transform: translateX(0);
}

/* Number */
.mobile-link-number {
    font-family: var(--font-display);
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    color: rgba(var(--text-primary-rgb), 0.2);
    flex-shrink: 0;
    min-width: 1.8rem;
    transition: color 0.3s ease;
}

.mobile-menu-link:hover .mobile-link-number,
.mobile-menu-link:focus .mobile-link-number {
    color: rgba(var(--text-primary-rgb), 0.5);
}

/* Main text */
.mobile-link-text {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 4.5vw, 2.5rem);
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.1;
    transition: letter-spacing 0.4s cubic-bezier(0.23, 1, 0.32, 1),
        text-shadow 0.4s ease;
}

.mobile-menu-link:hover .mobile-link-text,
.mobile-menu-link:focus .mobile-link-text {
    letter-spacing: 0.1em;
    text-shadow: 0 0 40px rgba(var(--text-primary-rgb), 0.15);
}

/* Subtitle */
.mobile-link-sub {
    font-family: var(--font-body);
    font-size: clamp(0.5rem, 2vw, 0.7rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(var(--text-primary-rgb), 0.2);
    margin-left: auto;
    flex-shrink: 0;
    transition: color 0.3s ease;
}

.mobile-menu-link:hover .mobile-link-sub,
.mobile-menu-link:focus .mobile-link-sub {
    color: rgba(var(--text-primary-rgb), 0.45);
}

/* Footer inside mobile menu */
.mobile-menu-footer {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: rgba(var(--text-primary-rgb), 0.15);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease 0.4s, transform 0.5s ease 0.4s;
}

.mobile-menu.is-open .mobile-menu-footer {
    opacity: 1;
    transform: translateY(0);
}

/* Focus style for hamburger */
.mobile-menu-toggle:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 5px;
}

.mobile-menu-link:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Show hamburger, hide nav links on mobile */
@media (max-width: 600px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .header-nav {
        display: none;
    }
}

/* Film grain shift — shared across all pages */
@keyframes grainShift {
    0% {
        transform: translate(0, 0);
    }

    16% {
        transform: translate(-5px, 5px);
    }

    33% {
        transform: translate(5px, -5px);
    }

    50% {
        transform: translate(-3px, -3px);
    }

    66% {
        transform: translate(3px, 3px);
    }

    83% {
        transform: translate(-2px, 4px);
    }

    100% {
        transform: translate(0, 0);
    }
}

/* ==============================
   PAGE TRANSITION OVERLAY
   ============================== */

.page-transition {
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    visibility: hidden;
}

.page-transition.is-active {
    pointer-events: auto;
    visibility: visible;
}

/* Two blade panels — top and bottom halves */
.page-transition-blade {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    background: #000000;
    will-change: transform;
}

.page-transition-blade--top {
    top: 0;
    transform: translateY(-101%);
    transform-origin: bottom center;
}

.page-transition-blade--bottom {
    bottom: 0;
    transform: translateY(101%);
    transform-origin: top center;
}

/* Film grain on blades */
.page-transition-blade::before {
    content: '';
    position: absolute;
    inset: -10px;
    pointer-events: none;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
    animation: grainShift 0.3s steps(6) infinite;
}

/* Light leak flash */
.page-transition-flash {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 40% at 50% 50%,
            rgba(var(--text-primary-rgb), 0.15) 0%,
            rgba(var(--text-primary-rgb), 0.05) 40%,
            transparent 70%);
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

/* Seam line where blades meet */
.page-transition-seam {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right,
            transparent 5%,
            rgba(var(--text-primary-rgb), 0.3) 30%,
            rgba(var(--text-primary-rgb), 0.5) 50%,
            rgba(var(--text-primary-rgb), 0.3) 70%,
            transparent 95%);
    transform: translateY(-50%) scaleX(0);
    opacity: 0;
    z-index: 2;
}

/* EXIT: blades close */
.page-transition.exit-active .page-transition-blade--top {
    animation: bladeCloseTop 450ms cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.page-transition.exit-active .page-transition-blade--bottom {
    animation: bladeCloseBottom 450ms cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.page-transition.exit-active .page-transition-flash {
    animation: transitionFlash 450ms ease-out 300ms forwards;
}

.page-transition.exit-active .page-transition-seam {
    animation: seamReveal 450ms cubic-bezier(0.23, 1, 0.32, 1) 200ms forwards;
}

/* ENTER: blades open */
.page-transition.enter-active .page-transition-blade--top {
    animation: bladeOpenTop 500ms cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.page-transition.enter-active .page-transition-blade--bottom {
    animation: bladeOpenBottom 500ms cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.page-transition.enter-active .page-transition-flash {
    animation: transitionFlashOut 300ms ease-out forwards;
}

.page-transition.enter-active .page-transition-seam {
    animation: seamHide 300ms ease-out forwards;
}

/* ENTER-COVERING: blades static closed (before open animation) */
.page-transition.enter-covering .page-transition-blade--top {
    transform: translateY(0);
}

.page-transition.enter-covering .page-transition-blade--bottom {
    transform: translateY(0);
}

.page-transition.enter-covering .page-transition-seam {
    transform: translateY(-50%) scaleX(1);
    opacity: 1;
}

.page-transition.enter-covering .page-transition-flash {
    opacity: 1;
}

/* Body hidden during enter transition */
body.transition-entering {
    opacity: 0 !important;
}

@keyframes bladeCloseTop {
    0% {
        transform: translateY(-101%);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes bladeCloseBottom {
    0% {
        transform: translateY(101%);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes bladeOpenTop {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-101%);
    }
}

@keyframes bladeOpenBottom {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(101%);
    }
}

@keyframes transitionFlash {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

@keyframes transitionFlashOut {
    0% {
        opacity: 0.6;
    }

    100% {
        opacity: 0;
    }
}

@keyframes seamReveal {
    0% {
        transform: translateY(-50%) scaleX(0);
        opacity: 0;
    }

    100% {
        transform: translateY(-50%) scaleX(1);
        opacity: 1;
    }
}

@keyframes seamHide {
    0% {
        transform: translateY(-50%) scaleX(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-50%) scaleX(0);
        opacity: 0;
    }
}

/* Reduced motion: skip transition animations globally */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .page-transition-blade,
    .page-transition-flash,
    .page-transition-seam {
        animation: none !important;
        transition: none !important;
    }
}