/* 
  Global CSS Variables and Custom Utilities for EURONORI 
*/

:root {
    /* Refined Dark Theme (Premium, slightly lighter than #000) */
    --color-primary: #00669F;
    --color-accent: #DE3B30;
    --color-bg: #0F172A;
    /* Lighter dark */
    --color-surface: #16213E;
    /* Slightly elevated */
    --color-border: #2A3B63;

    /* PART D: Readability Tweak */
    --color-text: #EEF5FF;
    /* Brighter, crisper white */
    --color-muted: #C0CCDA;
    /* Brighter slate for subtext */

    /* Typography Scale */
    --font-base: clamp(16px, 1.2vw, 18px);
    /* Increased */
    --font-h1: clamp(32px, 5vw, 52px);
    --font-h2: clamp(24px, 3.5vw, 32px);
    --font-h3: clamp(20px, 2.5vw, 24px);
    --font-small: clamp(12px, 0.9vw, 14px);
}

/* Light Theme overrides (kept elegant) */
.light {
    --color-bg: #F3F6FA;
    --color-surface: #FFFFFF;
    --color-border: #D6DEE8;
    --color-text: #0B1220;
    --color-muted: #3E4C5F;
}

/* Base resets */
body {
    background-color: var(--color-bg);
    color: var(--color-text);
    min-height: max(100vh, 100dvh);
    overflow-x: hidden;
    font-size: var(--font-base);
    line-height: 1.7;
    /* Increased for readability */
    transition: background-color 0.3s ease, color 0.3s ease;

    /* Subtle depth: radial gradient */
    background-image: radial-gradient(circle at 50% 0%, rgba(20, 31, 58, 0.5) 0%, transparent 60%);
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Typography Enhancements */
h1,
.text-h1 {
    font-size: var(--font-h1);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
}

h2,
.text-h2 {
    font-size: var(--font-h2);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.01em;
}

h3,
.text-h3 {
    font-size: var(--font-h3);
    line-height: 1.3;
    font-weight: 700;
}

p,
.text-body {
    font-size: var(--font-base);
    line-height: 1.7;
    max-width: 70ch;
}

.text-small {
    font-size: var(--font-small);
    line-height: 1.5;
}

/* Utilities */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Glass Header enhancements */
.glass-header {
    background: rgba(15, 23, 42, 0.4);
    /* clearer glass initially */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(36, 52, 85, 0.3);
    transition: background-color 0.5s ease, box-shadow 0.5s ease, backdrop-filter 0.5s ease, padding 0.5s ease;
}

.light .glass-header {
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.glass-header.scrolled {
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.3);
    background: rgba(15, 23, 42, 0.85);
    /* more opaque on scroll */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    padding-top: 0.75rem;
    /* shrinks slightly */
    padding-bottom: 0.75rem;
}

.light .glass-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
}

/* Premium Motion System - "Crazier" but Elegant */
.reveal {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
        transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Staggered children */
.reveal-stagger>* {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
        transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-stagger.is-visible>* {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Stagger Delays (Up to 8 items) */
.reveal-stagger>*:nth-child(1) {
    transition-delay: 50ms;
}

.reveal-stagger>*:nth-child(2) {
    transition-delay: 150ms;
}

.reveal-stagger>*:nth-child(3) {
    transition-delay: 250ms;
}

.reveal-stagger>*:nth-child(4) {
    transition-delay: 350ms;
}

.reveal-stagger>*:nth-child(5) {
    transition-delay: 450ms;
}

.reveal-stagger>*:nth-child(6) {
    transition-delay: 550ms;
}

.reveal-stagger>*:nth-child(7) {
    transition-delay: 650ms;
}

.reveal-stagger>*:nth-child(8) {
    transition-delay: 750ms;
}

/* Cinematic Hero Intro overlay */
.vignette-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(15, 23, 42, 0.9) 100%);
    opacity: 0;
    animation: vignetteIn 2s ease-out 0.5s forwards;
    pointer-events: none;
    z-index: 1;
}

@keyframes vignetteIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Page Load Fade */
.page-fade-in {
    animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Drifting Floating Accents */
.floating-accent {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: floatDrift 20s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes floatDrift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -40px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    100% {
        transform: translate(40px, 10px) scale(1.05);
    }
}

/* Custom Micro-interactions */
.hover-card {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.5s ease;
    transform-style: preserve-3d;
}

/* Shine effect on hover */
.hover-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    w: 50%;
    h: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.03) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-20deg);
    transition: none;
}

.hover-card:hover::after {
    animation: shineSweep 1.5s ease-in-out;
}

@keyframes shineSweep {
    0% {
        left: -100%;
    }

    100% {
        left: 200%;
    }
}

/* Inner image zoom on card hover */
.hover-card .hover-img-zoom {
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-card:hover {
    transform: translateY(-6px) translateZ(0);
    /* Z fixes rendering glitches */
    border-color: rgba(0, 102, 159, 0.6);
    box-shadow: 0 15px 40px -10px rgba(0, 102, 159, 0.25), 0 0 20px rgba(0, 102, 159, 0.05);
}

.hover-card:hover .hover-img-zoom {
    transform: scale(1.03);
    /* subtle, not 1.05 for premium feel */
}

/* Premium Buttons */
.btn-premium {
    padding: 1rem 2rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}

.btn-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: all 0.5s;
    z-index: -1;
}

.btn-premium:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -4px rgba(0, 102, 159, 0.4);
}

.btn-premium:hover::before {
    left: 100%;
}

.btn-premium:active {
    transform: translateY(1px);
}

/* Bottom Nav highlight */
.nav-item {
    position: relative;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-item:hover::after,
.nav-item.active::after {
    width: 60%;
}

/* Parallax Container */
.parallax-container {
    overflow: hidden;
}

/* Responsive Layout Container */
.container-resp {
    width: 100%;
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

@media (min-width: 768px) {
    .container-resp {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (min-width: 1024px) {
    .container-resp {
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

/* Logos */
.header-brand-mark {
    height: 28px;
    width: auto;
}

.header-brand-wordmark {
    height: 40px;
    width: auto;
}

.footer-brand-mark {
    height: 20px;
    width: auto;
}

.footer-brand-wordmark {
    height: 28px;
    width: auto;
}

@media (min-width: 1024px) {
    .header-brand-mark {
        height: 36px;
    }

    .header-brand-wordmark {
        height: 56px;
    }

    .footer-brand-mark {
        height: 24px;
    }

    .footer-brand-wordmark {
        height: 36px;
    }
}

/* Grid Layouts */
.grid-desktop-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .grid-desktop-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 4rem;
        align-items: start;
    }
}

.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* Reduce Motion Accessibility */
@media (prefers-reduced-motion: reduce) {

    .reveal,
    .reveal-stagger>*,
    .floating-accent,
    .hover-card::after,
    .page-fade-in,
    .parallax-bg {
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
        transition-delay: 0ms !important;
        animation: none !important;
    }
}