/* 
   MIDNIGHT STEALTH - AWARD WINNING DESIGN SYSTEM
   Mustafa Arslan Özçelik Portfolio
*/

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

:root {
    /* Color Palette */
    --clr-bg: #050505;
    --clr-surface: #0a0a0a;
    --clr-surface-2: #141414;
    --clr-primary: #A7FF00;
    /* Neon Lime */
    --clr-primary-glow: rgba(167, 255, 0, 0.15);
    --clr-text-main: #FFFFFF;
    --clr-text-muted: #888888;
    --clr-border: rgba(255, 255, 255, 0.05);

    /* Typography */
    --font-heading: 'Syne', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Transitions */
    --e-out: cubic-bezier(0.33, 1, 0.68, 1);
    --e-in-out: cubic-bezier(0.76, 0, 0.24, 1);
    --t-fast: 0.2s var(--e-out);
    --t-base: 0.4s var(--e-out);
    --t-slow: 0.8s var(--e-out);
}

/* Advanced Visual Layers */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("https://grainy-gradients.vercel.app/noise.svg");
    opacity: 0.02;
    /* Reduced from 0.05 for clarity */
    pointer-events: none;
    z-index: 9998;
    animation: grain 8s steps(10) infinite;
}

@keyframes grain {

    0%,
    100% {
        transform: translate(0, 0);
    }

    10% {
        transform: translate(-5%, -10%);
    }

    20% {
        transform: translate(-15%, 5%);
    }

    30% {
        transform: translate(7%, -25%);
    }

    40% {
        transform: translate(-5%, 25%);
    }

    50% {
        transform: translate(-15%, 10%);
    }

    60% {
        transform: translate(15%, 0%);
    }

    70% {
        transform: translate(0%, 15%);
    }

    80% {
        transform: translate(3%, 35%);
    }

    90% {
        transform: translate(-10%, 10%);
    }
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
    /* Custom cursor will be implemented */
}

html.lenis {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

body {
    background-color: var(--clr-bg);
    color: var(--clr-text-main);
    font-family: var(--font-body);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Custom Cursor */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    /* Smaller default state */
    height: 8px;
    background-color: var(--clr-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: transform 0.2s var(--e-out), background-color 0.3s var(--e-out), width 0.3s, height 0.3s;
    transform: translate(-50%, -50%);
}

.custom-cursor.active {
    width: 60px;
    height: 60px;
    background-color: #ffffff;
}

/* Horizontal Progress Indicator */
.horizon-progress-wrap {
    position: absolute;
    top: 40px;
    left: 4vw;
    width: calc(100% - 8vw);
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 1001;
    overflow: hidden;
}

.horizon-progress-bar {
    width: 0%;
    height: 100%;
    background: var(--clr-primary);
    transition: width 0.1s linear;
}

/* Typography Utilities */
h1,
h2,
h3,
h4,
.font-heading {
    font-family: var(--font-heading);
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.0;
    /* Increased from 0.9 for surgical precision */
    letter-spacing: -0.02em;
    /* Relaxed from -0.04em */
}

.text-gradient {
    background: linear-gradient(180deg, #fff 40%, rgba(255, 255, 255, 0.4) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.text-primary {
    color: var(--clr-primary);
}

/* Horizontal Scroll */
.horizontal-scroll-container {
    width: max-content;
    /* Supports any number of panels dynamically */
    display: flex;
    flex-wrap: nowrap;
}

.horizontal-panel {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Horizon Flow Specifics */
.horizon-bg-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.horizon-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    scale: 1.1;
}

.horizon-bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* Guaranteed focal point */
    opacity: 0.6;
    scale: 1.06;
    /* Refined scale for "Cinematic Frame" fit */
}

.horizon-monument-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(4rem, 10vw, 8rem);
    /* Elite Scale Refinement */
    font-weight: 900;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.08);
    /* Slightly subtler stroke */
    white-space: nowrap;
    z-index: 2;
    pointer-events: none;
    line-height: 1;
    letter-spacing: -0.05em;
}

.horizon-card {
    position: relative;
    z-index: 3;
    width: clamp(400px, 60vw, 850px);
    /* Wide panoramic format for absolute fit */
    padding: clamp(40px, 6vw, 70px);
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(40px) saturate(1.8);
    -webkit-backdrop-filter: blur(40px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 40px;
    text-align: left;
    display: flex;
    flex-direction: column;
}

.horizon-card .project-number {
    font-size: 11px;
    letter-spacing: 4px;
    color: var(--clr-primary);
    margin-bottom: 24px;
    display: block;
    opacity: 0.8;
}

.horizon-card h3 {
    font-size: clamp(1.2rem, 1.8vw, 1.8rem);
    /* Surgical micro-scale */
    margin-bottom: 24px;
    line-height: 1.05;
    word-break: break-all;
    max-width: 100%;
}

.horizon-card p {
    color: var(--clr-text-muted);
    font-size: clamp(14px, 1.1vw, 16px);
    /* More surgical scale */
    margin-bottom: 48px;
    line-height: 1.6;
    max-width: 480px;
    /* More focused readability */
}

/* Kinetic Typography - Panoramic & Responsive */
.scramble-text {
    display: inline-block;
    max-width: 100%;
    /* Guarantee containment */
    white-space: normal;
    /* ALLOW WRAPPING for absolute fit */
    position: relative;
    vertical-align: bottom;
}

.kinetic-text {
    font-size: clamp(6rem, 18vw, 14rem);
    /* Scaled down texture */
    font-weight: 900;
    color: rgba(255, 255, 255, 0.03);
    position: absolute;
    white-space: nowrap;
    z-index: -1;
    pointer-events: none;
}

/* Layout Utilities */
.container-ultra {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 4vw;
}

.section-padding {
    padding: 180px 0;
    /* Significant increase in whitespace */
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-gap: 20px;
}

.bento-item {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 24px;
    padding: 40px;
    position: relative;
    overflow: hidden;
    transition: var(--t-base);
}

.bento-item:hover {
    border-color: var(--clr-primary);
}

/* Buttons */
.btn-ultra {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 20px 40px;
    background: var(--clr-primary);
    color: var(--clr-bg);
    border-radius: 100px;
    font-family: var(--font-heading);
    font-weight: 700;
    text-decoration: none;
    transition: var(--t-base);
}

.btn-ultra:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px var(--clr-primary-glow);
}

/* Hero CTA Buttons */
.cta-pulse:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px var(--clr-primary-glow);
}

.cta-pulse:first-child:hover {
    background: rgba(167, 255, 0, 0.2);
}

.cta-pulse:last-child:hover {
    background: #c4ff4d;
}

/* Nav Pill */
.nav-pill {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    padding: 8px;
    border-radius: 100px;
    border: 1px solid var(--clr-border);
    display: flex;
    gap: 8px;
    z-index: 1000;
}

.nav-pill-link {
    padding: 12px 24px;
    border-radius: 100px;
    color: var(--clr-text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--t-base);
}

.nav-pill-link:hover,
.nav-pill-link.active {
    color: var(--clr-text-main);
    background: var(--clr-surface-2);
}

/* Hero Prestige Frame */
.hero-prestige-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4/5;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
}

/* Hero Image Column - ensure it stays below text */
.hero-image-col {
    position: relative;
    z-index: 1;
}

/* Hero Text Column - ensure it stays above image */
.hero-text-col {
    position: relative;
    z-index: 2;
}

.hero-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
}

.hero-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(0.2) contrast(1.1);
    transition: transform 0.8s var(--e-out);
}

.hero-prestige-wrap:hover .hero-image-container img {
    transform: scale(1.05);
}

.prestige-label {
    position: absolute;
    bottom: -25px;
    right: 0;
    font-size: 9px;
    letter-spacing: 4px;
    color: var(--clr-primary);
    text-transform: uppercase;
    font-family: var(--font-heading);
    opacity: 0.6;
}

@media (max-width: 1024px) {
    .hero-prestige-wrap {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        margin-top: 60px;
        width: 100%;
        max-width: 400px;
    }
}

/* Prestige HUD Overlay */
.hero-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hud-item {
    font-size: 8px;
    letter-spacing: 5px;
    color: var(--clr-primary);
    text-transform: uppercase;
    font-family: var(--font-heading);
    opacity: 0.4;
    display: flex;
    align-items: center;
    gap: 15px;
}

.hud-item::before {
    content: '';
    width: 20px;
    height: 1px;
    background: var(--clr-primary);
}

.hud-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(167, 255, 0, 0.2);
}

.hud-tl {
    top: 40px;
    left: 40px;
    border-right: 0;
    border-bottom: 0;
}

.hud-tr {
    top: 40px;
    right: 40px;
    border-left: 0;
    border-bottom: 0;
}

.hud-bl {
    bottom: 40px;
    left: 40px;
    border-right: 0;
    border-top: 0;
}

.hud-br {
    bottom: 40px;
    right: 40px;
    border-left: 0;
    border-top: 0;
}

/* Hero Cinematic Backdrop */
.hero-bg-video-main-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.hero-bg-video-main {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    /* Definitive Flagship Visibility */
    filter: brightness(0.6) contrast(1.1) grayscale(0.2);
    scale: 1.1;
    /* Pre-scale for parallax */
}

/* Cinematic Overlays & Effects */
.anamorphic-bar {
    position: absolute;
    left: 0;
    width: 100%;
    height: 8vh;
    background: #000;
    z-index: 100;
    pointer-events: none;
    transition: transform 1.5s var(--e-out);
}

.bar-top {
    top: 0;
    transform: translateY(-100%);
}

.bar-bottom {
    bottom: 0;
    transform: translateY(100%);
}

.hero-ultra.cinematic-active .bar-top,
.hero-ultra.cinematic-active .bar-bottom {
    transform: translateY(0);
}

.cinematic-noise {
    position: absolute;
    inset: 0;
    z-index: 5;
    opacity: 0.05;
    pointer-events: none;
    background-image: url("https://grainy-gradients.vercel.app/noise.svg");
    mix-blend-mode: overlay;
}

.cinematic-vignette {
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent 20%, rgba(0, 0, 0, 0.8) 100%);
}

.hero-atmospheric-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: radial-gradient(circle at 20% 50%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.9) 100%);
    pointer-events: none;
}

/* Ensure Hero content stays above backdrop */
.hero-ultra .container-ultra {
    position: relative;
    z-index: 10;
}

/* ===========================================
   MOBILE RESPONSIVE STYLES
   =========================================== */

/* Tablet & Below */
@media (max-width: 1024px) {

    /* Hero Grid - Stack Vertically */
    .hero-grid-wrap {
        flex-direction: column !important;
        text-align: center;
        gap: 40px !important;
        min-height: auto !important;
        padding: 60px 0;
    }

    .hero-text-col {
        max-width: 100% !important;
        order: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-image-col {
        flex: 0 0 auto !important;
        order: 1;
        display: flex;
        justify-content: center;
    }

    .hero-prestige-wrap {
        max-width: 280px;
        margin: 0 auto;
    }

    .hero-top {
        margin-bottom: 30px !important;
    }

    .hero-tagline {
        margin-top: 30px !important;
    }

    .hero-cta-wrap {
        justify-content: center;
    }

    /* About Section Grid */
    #about>.container-ultra>div {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }

    /* Horizontal Scroll Panels */
    .horizon-card {
        width: 85vw !important;
        padding: 30px !important;
        border-radius: 24px;
    }

    .horizon-monument-text {
        font-size: clamp(3rem, 8vw, 5rem) !important;
    }

    /* HUD - Simplify on Tablet */
    .hero-hud {
        padding: 20px;
    }

    .hud-corner {
        display: none;
    }

    /* Section Padding */
    .section-padding {
        padding: 100px 0;
    }
}

/* Mobile Phones */
@media (max-width: 768px) {

    /* CRITICAL: Prevent horizontal overflow */
    html,
    body {
        overflow-x: hidden !important;
        max-width: 100vw;
    }

    /* Navigation Pill */
    .nav-pill {
        bottom: 20px;
        padding: 6px;
        gap: 4px;
    }

    .nav-pill-link {
        padding: 10px 16px;
        font-size: 12px;
    }

    /* Hero Section */
    .hero-ultra {
        min-height: auto !important;
        padding: 80px 0 120px !important;
    }

    .hero-prestige-wrap {
        max-width: 220px;
        aspect-ratio: 1/1;
    }

    .hero-image-container {
        border-radius: 24px;
    }

    .prestige-label {
        font-size: 8px;
        letter-spacing: 2px;
        bottom: -20px;
    }

    /* Hero Text */
    .hero-reveal-sub {
        font-size: 10px !important;
        letter-spacing: 3px !important;
    }

    .hero-tagline p {
        font-size: 14px !important;
    }

    /* CTA Buttons */
    .hero-cta-wrap {
        flex-direction: column;
        align-items: center;
        gap: 12px !important;
    }

    .hero-cta-wrap a {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    /* HUD - Hide on Mobile */
    .hero-hud {
        display: none;
    }

    /* Horizontal Scroll */
    .horizon-card {
        width: 90vw !important;
        padding: 24px !important;
    }

    .horizon-card h3 {
        font-size: 1.1rem !important;
    }

    .horizon-card p {
        font-size: 13px !important;
        margin-bottom: 30px;
    }

    .horizon-monument-text {
        font-size: clamp(2rem, 12vw, 4rem) !important;
    }

    /* About Section */
    #about p {
        font-size: clamp(1rem, 4vw, 1.5rem) !important;
    }

    #about .text-primary.font-heading[style*="44px"] {
        font-size: 32px !important;
    }

    /* Contact Section */
    #contact h2 {
        font-size: clamp(2rem, 10vw, 3rem) !important;
    }

    .btn-ultra {
        padding: 16px 32px;
        font-size: 14px;
    }

    /* Kinetic Text */
    .kinetic-text {
        font-size: clamp(3rem, 20vw, 8rem);
    }

    /* Section Padding */
    .section-padding {
        padding: 80px 0;
    }

    /* Footer */
    footer .container-ultra {
        flex-direction: column !important;
        gap: 20px;
        text-align: center;
    }

    /* Container Padding */
    .container-ultra {
        padding: 0 6vw;
    }
}

/* Small Mobile */
@media (max-width: 480px) {

    /* Navigation - Compact for Small Screens */
    .nav-pill {
        width: calc(100% - 40px);
        max-width: 340px;
        justify-content: center;
    }

    .nav-pill-link {
        padding: 8px 10px;
        font-size: 10px;
        letter-spacing: 0;
    }

    /* Hero Section - Prevent Overflow */
    .hero-ultra {
        padding: 60px 0 100px !important;
    }

    .hero-grid-wrap {
        padding: 40px 0 !important;
    }

    .hero-prestige-wrap {
        max-width: 160px;
    }

    /* Hero Text - Scale Down Further */
    .hero-main h1,
    .hero-text-col h1 {
        font-size: clamp(1.8rem, 10vw, 2.5rem) !important;
    }

    .hero-reveal-sub {
        font-size: 8px !important;
        letter-spacing: 2px !important;
    }

    .hero-tagline {
        margin-top: 24px !important;
    }

    .hero-tagline p {
        font-size: 13px !important;
        line-height: 1.5 !important;
    }

    /* CTA Buttons - Full Width */
    .hero-cta-wrap a {
        max-width: 100%;
        padding: 14px 20px !important;
        font-size: 11px !important;
    }

    /* Horizontal Scroll Panels */
    .horizon-card {
        width: 92vw !important;
        padding: 20px !important;
        border-radius: 20px;
    }

    .horizon-card .project-number {
        font-size: 9px;
        letter-spacing: 2px;
    }

    .horizon-card h3 {
        font-size: 1rem !important;
    }

    .horizon-card p {
        font-size: 12px !important;
        line-height: 1.5;
    }

    .horizon-monument-text {
        font-size: clamp(1.5rem, 15vw, 3rem) !important;
    }

    /* Buttons */
    .btn-ultra {
        padding: 12px 20px;
        font-size: 11px;
    }

    /* About Section */
    #about p[style*="clamp"] {
        font-size: clamp(0.9rem, 5vw, 1.2rem) !important;
    }

    /* Contact Section */
    #contact h2 {
        font-size: clamp(1.8rem, 12vw, 2.5rem) !important;
    }

    /* Footer */
    footer {
        padding: 40px 0 !important;
    }

    footer p {
        font-size: 9px !important;
    }
}

/* Extra Small Mobile (iPhone SE, etc.) */
@media (max-width: 375px) {
    .nav-pill {
        width: calc(100% - 24px);
    }

    .nav-pill-link {
        padding: 6px 8px;
        font-size: 9px;
    }

    .hero-main h1,
    .hero-text-col h1 {
        font-size: clamp(1.5rem, 12vw, 2rem) !important;
    }

    .hero-prestige-wrap {
        max-width: 140px;
    }

    .hero-cta-wrap a {
        padding: 12px 16px !important;
        font-size: 10px !important;
    }

    .container-ultra {
        padding: 0 5vw;
    }
}

/* Custom Cursor - Disable on Touch Devices */
@media (hover: none) and (pointer: coarse) {
    .custom-cursor {
        display: none;
    }

    * {
        cursor: auto;
    }
}