:root {
    /* --- DESIGN TOKENS --- */

    /* Fonts */
    --font-display: 'SF Pro Display', 'Inter', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;

    /* DARK THEME (Default) - "Onyx Luxury" */
    --bg-core: #050507;
    /* Deepest obsidian */
    --bg-surface: #0E0E12;
    /* Rich dark surface */
    --bg-glass: rgba(14, 14, 18, 0.7);

    --accent-primary: #8b5cf6;
    /* Vivid Lavender */
    --accent-glow: rgba(139, 92, 246, 0.4);
    --accent-dim: rgba(139, 92, 246, 0.1);

    --text-primary: #FFFFFF;
    --text-secondary: #9ca3af;
    --text-muted: #4b5563;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-highlight: rgba(139, 92, 246, 0.3);

    --shadow-card: 0 20px 40px -10px rgba(0, 0, 0, 0.5);

    /* Animation Timing */
    --ease-elastic: cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="light"] {
    /* LIGHT THEME - "Ceramic Luxury" */
    --bg-core: #F5F5F7;
    --bg-surface: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.8);

    --accent-primary: #7c3aed;
    /* Darker Lavender for contrast */
    --accent-glow: rgba(124, 58, 237, 0.2);
    --accent-dim: rgba(124, 58, 237, 0.05);

    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-highlight: rgba(124, 58, 237, 0.2);

    --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-core);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.6s var(--ease-elastic), color 0.6s;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(3rem, 6vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    /* Subtle gradient text */
    /* Solid color text */
    color: var(--text-primary);
}

/* Avoid relying on deprecated UA heading sizing inside sections */
section h1 {
    font-size: clamp(3rem, 6vw, 4.5rem);
    line-height: 1.1;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- HEADER --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 1.5rem 0;
    transition: all 0.3s;
}

.header.scrolled {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.logo img {
    height: 32px;
    width: auto;
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
    background: var(--bg-surface);
    padding: 0.5rem 2rem;
    border-radius: 100px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

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

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: flex-end;
}

/* --- HERO SECTION --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 80px;
    text-align: center;
    overflow: hidden;
}

/* SVG Background Animation */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

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

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-primary);
    top: -20%;
    right: -10%;
    opacity: 0.15;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: #4c1d95;
    bottom: -10%;
    left: -5%;
    opacity: 0.15;
    animation-delay: -5s;
}

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

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

.hero-content {
    max-width: 800px;
    z-index: 1;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s var(--ease-elastic) forwards 0.2s;
}

.tag-pill {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 100px;
    background: var(--accent-dim);
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-highlight);
}

.hero-desc {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s var(--ease-elastic);
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 8px 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--text-secondary);
    background: var(--border-subtle);
}

/* --- PROJECTS SECTION (Cards) --- */
.projects {
    padding: 6rem 0;
}

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

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 2.5rem;
    position: relative;
    transition: all 0.4s var(--ease-elastic);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 380px;
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--border-highlight);
    box-shadow: var(--shadow-card);
}

.card-glow {
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: var(--accent-primary);
    filter: blur(80px);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.card:hover .card-glow {
    opacity: 0.15;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.status {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
}

.status.live {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status.dev {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.card h3 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.card p {
    font-size: 1rem;
    line-height: 1.6;
}

.card-link {
    margin-top: 2rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-primary);
}

.card-link:hover {
    gap: 0.8rem;
}

/* --- FOOTER --- */
.footer {
    padding: 4rem 0;
    border-top: 1px solid var(--border-subtle);
    margin-top: 4rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

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

/* --- TRANSITION OVERLAY (Circular Reveal) --- */
.theme-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    pointer-events: none;
    background: var(--bg-core);
    /* Will be set via JS */
    clip-path: circle(0% at 50% 50%);
    transition: clip-path 0.7s ease-in-out;
}

/* --- UTILITIES --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--ease-elastic);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Lang Switcher */
.lang-toggle {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    gap: 0.5rem;
}

.lang-toggle:hover {
    border-color: var(--text-secondary);
}

.lang-active {
    font-weight: 700;
}

.lang-inactive {
    opacity: 0.5;
}

/* Theme Toggle Button */
.theme-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}

.theme-btn:hover {
    border-color: var(--accent-primary);
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    h1 {
        font-size: 3rem;
    }
}

/* --- DEVLOG SYSTEM --- */

/* Page Header */
.devlog-hero {
    padding: 10rem 0 4rem;
    text-align: center;
    position: relative;
}

.devlog-hero h1 {
    font-size: 3.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 5rem;
    flex-wrap: wrap;
    position: sticky;
    top: 90px;
    z-index: 90;
    padding: 1.5rem 0;
    transition: 0.3s;
}

.filter-bar.stuck {
    background: rgba(5, 5, 7, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

.filter-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.7rem 1.4rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
    box-shadow: 0 4px 20px var(--accent-glow);
}

/* Timeline Core */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0 6rem;
}

/* The Central Line */
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: var(--border-subtle); /* Subtler line */
    transform: translateX(-50%);
}

/* Timeline Item */
.timeline-item {
    position: relative;
    width: 100%;
    margin-bottom: 5rem;
    opacity: 1;
    transition: all 0.5s var(--ease-elastic);
}

.timeline-item.hidden {
    display: none;
}

/* Alternating Layout */
.timeline-content-wrapper {
    position: relative;
    width: 42%; /* Narrower for better readability */
}

.timeline-item:nth-child(odd) .timeline-content-wrapper {
    margin-left: auto; /* Right side */
    padding-left: 3rem;
}

.timeline-item:nth-child(even) .timeline-content-wrapper {
    margin-right: auto; /* Left side */
    padding-right: 3rem;
    text-align: right;
}

/* The Node (Dot) */
.timeline-marker {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: var(--bg-core);
    border: 2px solid var(--border-subtle); /* Inactive state */
    border-radius: 50%;
    z-index: 2;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.timeline-item:hover .timeline-marker {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateX(-50%) scale(1.3);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Date Label */
.timeline-date {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 0.2rem 0.8rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    z-index: 3;
    white-space: nowrap;
    opacity: 0; /* Hidden by default, shown on specific view or hover? Let's keep it simple: adjacent to node */
}

/* Date Display (Side) */
.timeline-item:nth-child(odd) .timeline-date-display {
    position: absolute;
    top: 20px;
    left: -130%;
    width: 115%;
    text-align: right;
    padding-right: 3rem;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.timeline-item:nth-child(even) .timeline-date-display {
    position: absolute;
    top: 20px;
    right: -130%;
    width: 115%;
    text-align: left;
    padding-left: 3rem;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}


/* Card Styling - Premium Look */
.dev-card {
    background: #0A0A0E; /* Solid, dark premium background */
    border: 1px solid rgba(255,255,255,0.08);
    padding: 2.5rem;
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.dev-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    opacity: 0.5;
}

/* Hover Effects */
.dev-card:hover {
    transform: translateY(-4px) scale(1.01);
    background: #0E0E12;
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.6);
}

.timeline-item:nth-child(odd) .dev-card:hover {
    /* Subtle shift towards center */
    transform: translateY(-4px) translateX(-5px);
}
.timeline-item:nth-child(even) .dev-card:hover {
    transform: translateY(-4px) translateX(5px);
}

.dev-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 1.2rem;
    padding: 0.3rem 0.8rem;
    border-radius: 100px;
    border: 1px solid transparent;
}

.tag-major { 
    background: rgba(139, 92, 246, 0.05); 
    color: var(--accent-primary); 
    border-color: rgba(139, 92, 246, 0.2);
}
.tag-news { 
    background: rgba(16, 185, 129, 0.05); 
    color: #10b981; 
    border-color: rgba(16, 185, 129, 0.2);
}
.tag-dev { 
    background: rgba(59, 130, 246, 0.05); 
    color: #3b82f6; 
    border-color: rgba(59, 130, 246, 0.2);
}

.dev-card h3 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: #fff;
    line-height: 1.3;
}

.dev-card p {
    font-size: 1.05rem;
    color: #888899;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.dev-card ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    color: #888899;
    list-style-type: disc;
}

.dev-card li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.dev-card strong {
    color: #e2e8f0;
}

.dev-card img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s;
}

.dev-card img:hover {
    transform: scale(1.02);
}

.dev-card a {
    color: var(--accent-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.dev-card a:hover {
    color: #fff;
}

/* Responsive Timeline */
@media (max-width: 768px) {
    .devlog-hero h1 {
        font-size: 2.5rem;
    }
    
    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        margin-bottom: 3rem;
    }

    .timeline-content-wrapper {
        width: 100%;
        padding-left: 60px !important;
        padding-right: 0 !important;
        text-align: left !important;
        margin: 0 !important;
    }

    .timeline-marker {
        left: 20px;
    }

    .timeline-date-display {
        position: static !important;
        display: block;
        text-align: left !important;
        padding: 0 0 0.5rem 0 !important;
        margin-bottom: 0.5rem;
        width: 100% !important;
    }
    
    .dev-card:hover {
         transform: translateY(-4px) !important;
    }
}

/* Language Dropdown */
.lang-dropdown {
    position: relative;
    display: inline-block;
}
.lang-dropbtn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}
.lang-dropbtn:hover {
    border-color: var(--accent-primary);
}
.lang-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #0a0a0c; /* Dark bg matching theme */
    min-width: 100px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    z-index: 100;
    margin-top: 5px;
}
/* Transparent bridge to fix hover gap issue */
.lang-dropdown-content::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 10px;
}
.lang-dropdown-content a {
    color: var(--text-secondary);
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.lang-dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--accent-primary);
}
.lang-dropdown:hover .lang-dropdown-content {
    display: block;
}
