:root {
    --turquoise: #00E5FF;
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --bg-dark: #050505;

    /* Logo sizes */
    --logo-intro-size: 280px;
    --logo-corner-size: 80px;
}

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

body, html {
    width: 100%;
    font-family: 'Tajawal', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    scroll-snap-type: y mandatory; /* Locks sections in place for absolute mobile stability */
}

/* ─── LOGO (Animated SVG) ─────────────────── */
#kaf-logo-svg {
    position: fixed;
    /* Removed default top/left centering because GSAP handles it natively in JS */
    pointer-events: auto;
    cursor: pointer;
    z-index: 1000;
    will-change: transform; /* Hardware Acceleration for flawless mobile scrub */
    transition: filter 0.5s ease;
}

#kaf-logo-svg:hover {
    filter: drop-shadow(0 0 25px rgba(0, 229, 255, 0.6));
}

.kaf-text-path {
    fill: transparent;
    stroke: var(--turquoise);
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

/* ─── INTRO HERO ─────────────────────────────────*/
#panel-intro .content {
    /* Placed below the logo securely */
    position: absolute;
    top: 60%; /* Fixed relative to screen height */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    text-align: center;
    opacity: 0;
    z-index: 10; /* CRITICAL: Lifts the text above the scanlines and noise */
}


/* ─── SCROLL JOURNEY PANELS ──────────────────────*/
.scroll-container { width: 100%; }

.panel {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100svh; /* svh (Small Viewport Height) prevents the background from resizing/jumping when the mobile address bar hides */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* Cinematic background */
.bg-image {
    position: absolute;
    top: -10%;
    left: -5%;
    width: 110%;
    height: 120%;
    background-size: cover;
    background-position: center;
    filter: contrast(1.25) brightness(0.7) saturate(1.15);
    z-index: 0;
    will-change: transform;
}

/* Vignette */
.overlay-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at center, rgba(5,5,5,0) 25%, rgba(5,5,5,0.96) 88%),
        linear-gradient(270deg, rgba(5,5,5,0.65) 0%, rgba(5,5,5,0) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Film grain */
.noise-overlay {
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="n"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="4" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23n)"/%3E%3C/svg%3E');
    opacity: 0.12;
    z-index: 2;
    pointer-events: none;
    mix-blend-mode: overlay;
}

/* Scanlines */
.scanlines {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
        transparent,
        transparent 50%,
        rgba(0,0,0,0.18) 50%,
        rgba(0,0,0,0.18));
    background-size: 100% 4px;
    z-index: 3;
    pointer-events: none;
}

/* ─── LINK PANELS (all except intro) ────────────*/
.panel:not(#panel-intro) .content {
    position: relative;
    z-index: 10;
    width: 85%;
    max-width: 1200px;
    opacity: 0;
}

.align-right  { text-align: right; }
.align-left   { text-align: left;  }
.align-center { text-align: center;}

.panel-link {
    text-decoration: none;
    display: inline-flex;
    flex-direction: column;
    transition: transform 0.4s ease;
}

.align-right .panel-link:hover  { transform: translateX(-18px); }
.align-left  .panel-link:hover  { transform: translateX(18px);  }
.align-center .panel-link:hover { transform: scale(1.04);        }

.link-text {
    font-size: clamp(1.9rem, 6vw, 4.2rem);
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 4px 30px rgba(0,0,0,1), 0 2px 8px rgba(0,0,0,0.9);
    transition: color 0.3s ease, text-shadow 0.3s ease;
    line-height: 1.4;
}

.panel-link:hover .link-text {
    color: var(--turquoise);
    text-shadow: 0 0 50px rgba(0, 229, 255, 0.4), 0 2px 5px rgba(0,0,0,0.9);
}

.link-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.6rem);
    color: #ffffff;
    font-weight: 700;
    margin-top: 0.8rem;
    text-shadow: 0 3px 15px rgba(0, 0, 0, 1), 0 1px 4px rgba(0, 0, 0, 0.9);
    line-height: 1.6;
}

/* ─── CONTACT PANEL SPECIFICS ────────────*/
#panel-contact .content {
    gap: 1.5rem !important;
}

#panel-contact .link-text {
    font-size: clamp(1.6rem, 5vw, 3rem);
}

#panel-contact .link-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    margin-top: 0.2rem;
    line-height: 1.5;
}

/* ─── SUBTITLE + SCROLL ARROW (intro) ──────────*/
.subtitle {
    font-size: clamp(1.6rem, 5vw, 2.8rem);
    color: #ffffff;
    font-weight: 900;
    margin-bottom: 2rem;
    text-shadow: 0 4px 25px rgba(0, 0, 0, 1), 0 2px 10px rgba(0, 0, 0, 0.8);
    opacity: 1 !important;
    line-height: 1.5;
}

.scroll-indicator {
    font-size: clamp(1.2rem, 4vw, 1.4rem);
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    text-align: center;
    line-height: 1.6;
    opacity: 0;
    animation: bounce 2.2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0);    opacity: 0.55; }
    50%      { transform: translateY(12px); opacity: 1;    }
}


/* ─── DEVELOPER CREDIT ──────────────────────────*/
.developer-credit {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85rem;
    font-weight: 400;
    z-index: 100;
    text-align: center;
    pointer-events: auto;
}

.developer-credit a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

.developer-credit a:hover {
    color: var(--turquoise);
}

/* ─── RESPONSIVE ────────────────────────────────*/
@media (max-width: 768px) {
    .panel:not(#panel-intro) .content {
        width: 90%;
        text-align: center;
    }

    .align-right .panel-link:hover,
    .align-left  .panel-link:hover {
        transform: scale(1.04);
    }
    
    .developer-credit {
        bottom: 1.2rem;
        font-size: 0.75rem;
    }
}
