/* ==========================================================================
   CSS Variables & Theme Setup
   ========================================================================== */
   :root {
    /* Color Palette */
    --bg-base: #0a0a0c;
    --bg-surface: rgba(20, 20, 24, 0.6);
    --bg-surface-hover: rgba(30, 30, 36, 0.8);
    
    --primary: #0ea5e9;
    --primary-glow: rgba(14, 165, 233, 0.5);
    --secondary: #8b5cf6;
    --secondary-glow: rgba(139, 92, 246, 0.5);
    --accent: #f59e0b;
    --danger: #ef4444;
    --success: #10b981;
    --purple: #d946ef;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Borders & Glass */
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
    
    /* Typography */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Layout */
    --max-width: 1280px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    /* Animation Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

/* ==========================================================================
   Ambient Background Effects
   ========================================================================== */
.ambient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
}

.orb-2 {
    bottom: -20%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--secondary-glow) 0%, transparent 70%);
    animation-delay: -5s;
}

.orb-3 {
    top: 40%;
    left: 40%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.2) 0%, transparent 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 10%) scale(1.1); }
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(10, 10, 12, 0.7);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.3);
}

.logo-mark.small {
    width: 32px;
    height: 32px;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--glass-border-hover);
}

.lang-switcher {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--glass-border);
}

.mobile-lang-switcher {
    display: none;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.lang-btn:hover, .lang-btn.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 2rem 4rem;
    position: relative;
}

.hero-content {
    max-width: 900px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 1rem;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 999px;
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
    animation: pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hero-title {
    font-size: clamp(3rem, 6vw, 5rem);
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}

.text-gradient {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-alt {
    background: linear-gradient(135deg, #a78bfa 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.35rem);
    color: var(--text-secondary);
    max-width: 800px;
    margin-bottom: 3rem;
    font-weight: 400;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-base);
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
    background: #e2e8f0;
}

/* ==========================================================================
   Story / About Section
   ========================================================================== */
.about-section {
    padding: 2rem 2rem 6rem;
    position: relative;
    z-index: 10;
}

.story-box {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 4rem;
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.story-glow {
    position: absolute;
    top: -50%;
    left: 50%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 60%);
    transform: translateX(-50%);
    opacity: 0.3;
    pointer-events: none;
}

.story-box h2 {
    font-size: clamp(2rem, 3.5vw, 3rem);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.story-box p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.story-box p strong {
    color: var(--text-primary);
    font-weight: 500;
}

@media (max-width: 768px) {
    .story-box {
        padding: 2rem 1.5rem;
    }
}

/* ==========================================================================
   Portfolio / Bento Grid Section
   ========================================================================== */
.portfolio {
    padding: 6rem 2rem;
    position: relative;
    z-index: 10;
}

.section-container {
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-header {
    margin-bottom: 4rem;
    text-align: center;
}

.section-header h2 {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 320px;
    gap: 1.5rem;
}

.bento-card {
    position: relative;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    transition: all var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.bento-card:hover {
    transform: translateY(-5px);
    border-color: var(--glass-border-hover);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    background: var(--bg-surface-hover);
}

.card-glass-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.03), transparent 60%);
    pointer-events: none;
    z-index: 1;
}

.card-content {
    position: relative;
    z-index: 2;
    padding: 2.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Specific Card Layouts */
.large-card { grid-column: span 12; grid-row: span 1; }
.medium-card { grid-column: span 6; grid-row: span 1; }
.small-card { grid-column: span 6; grid-row: span 1; }

@media (min-width: 992px) {
    .large-card { grid-column: span 6; grid-row: span 1; }
    .medium-card { grid-column: span 6; grid-row: span 1; }
    .small-card { grid-column: span 4; grid-row: span 1; }
    
    /* Balanced 2-row layout */
    .visual-snow { grid-column: 1 / 7; grid-row: 1 / 2; }
    .rescue-mode { grid-column: 7 / 13; grid-row: 1 / 2; }
    
    .szpeter { grid-column: 1 / 5; grid-row: 2 / 3; }
    .blockchain { grid-column: 5 / 9; grid-row: 2 / 3; }
    .urban-planning { grid-column: 9 / 13; grid-row: 2 / 3; }
}

@media (max-width: 991px) and (min-width: 768px) {
    .large-card { grid-column: span 12; grid-row: span 1; }
    .medium-card { grid-column: span 6; grid-row: span 1; }
    .small-card { grid-column: span 6; grid-row: span 1; }
}

@media (max-width: 767px) {
    .bento-card { grid-column: span 12 !important; grid-row: auto !important; height: auto; min-height: 300px; }
}

/* Card Elements */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary);
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.tag-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); border-color: rgba(239, 68, 68, 0.2); }
.tag-accent { background: rgba(245, 158, 11, 0.1); color: var(--accent); border-color: rgba(245, 158, 11, 0.2); }
.tag-purple { background: rgba(217, 70, 239, 0.1); color: var(--purple); border-color: rgba(217, 70, 239, 0.2); }
.tag-success { background: rgba(16, 185, 129, 0.1); color: var(--success); border-color: rgba(16, 185, 129, 0.2); }

.icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.icon-accent { background: rgba(245, 158, 11, 0.1); color: var(--accent); }
.icon-purple { background: rgba(217, 70, 239, 0.1); color: var(--purple); }
.icon-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }

.card-body {
    flex-grow: 1;
}

.card-body h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.card-body p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.card-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.card-link {
    font-weight: 600;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
}

.card-link:hover {
    color: var(--primary);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    border-top: 1px solid var(--glass-border);
    padding: 6rem 2rem 2rem;
    background: #050507;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-brand {
    margin-bottom: 4rem;
}

.footer-brand h3 {
    font-size: 1.5rem;
    margin: 1rem 0 0.5rem;
}

.footer-brand p {
    color: var(--text-secondary);
    max-width: 400px;
}

.footer-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer-col h4 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-col p, .footer-col a {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: block;
    line-height: 1.5;
}

.footer-col a:hover {
    color: var(--primary);
}

.highlight {
    color: var(--text-primary);
    font-weight: 500;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ==========================================================================
   Animations
   ========================================================================== */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }

@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-lang-switcher { display: flex; gap: 0.5rem; }
    .hero-title { font-size: 2.5rem; }
}
