/* ========================================
   CSS Variables & Base Styles
======================================== */
:root {
    /* Colors - Light Theme */
    --color-bg: #fafafa;
    --color-bg-alt: #ffffff;
    --color-text: #1a1a2e;
    --color-text-muted: #64748b;
    --color-text-light: #94a3b8;

    /* Gradient Colors */
    --gradient-start: #667eea;
    --gradient-mid: #764ba2;
    --gradient-end: #f093fb;
    --gradient-primary: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-mid) 50%, var(--gradient-end) 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);

    /* Accent Colors */
    --color-accent: #667eea;
    --color-accent-light: rgba(102, 126, 234, 0.1);
    --color-accent-dark: #5a67d8;

    /* Borders & Shadows */
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Space Grotesk', sans-serif;

    /* Spacing */
    --section-padding: 100px;
    --container-max: 1100px;
    --container-narrow: 720px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* Container */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   Navigation
======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px 0;
    transition: all var(--transition-base);
    background: rgba(250, 250, 250, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
    padding: 16px 0;
}

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

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-muted);
    position: relative;
    padding: 8px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-base);
}

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

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

/* ========================================
   Hero Section (Homepage)
======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 0 60px;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 60%;
    height: 80%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

.hero-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 80px;
}

.hero-image {
    position: relative;
    flex-shrink: 0;
}

.image-wrapper {
    width: 280px;
    height: 320px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--gradient-subtle);
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 2;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--color-text-muted);
}

.image-placeholder svg {
    opacity: 0.4;
}

.image-placeholder p {
    font-size: 0.875rem;
}

.image-decoration {
    position: absolute;
    width: 300px;
    height: 335px;
    border-radius: var(--radius-lg);
    background: var(--gradient-primary);
    opacity: 0.1;
    top: 16px;
    left: 16px;
    z-index: 1;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.hero-content {
    flex: 1;
}

.hero-name {
    font-family: var(--font-display);
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 12px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-tagline {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    font-weight: 500;
    margin-bottom: 16px;
}

.hero-description {
    font-size: 1.0625rem;
    color: var(--color-text-muted);
    margin-bottom: 28px;
    max-width: 400px;
}

.hero-cta {
    display: flex;
    gap: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md), 0 4px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 8px 30px rgba(102, 126, 234, 0.4);
}

/* ========================================
   Recent Posts Section
======================================== */
.recent-posts {
    padding: var(--section-padding) 0;
    background: var(--color-bg-alt);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
}

.view-all {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-accent);
}

.view-all:hover {
    text-decoration: underline;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.post-card {
    background: var(--color-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 28px;
    transition: all var(--transition-base);
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.post-card .post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.post-date {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.post-tag {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-accent);
    background: var(--color-accent-light);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.post-card .post-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.post-card .post-title a:hover {
    color: var(--color-accent);
}

.post-excerpt {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.post-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-accent);
}

.post-link:hover {
    text-decoration: underline;
}

/* ========================================
   Page Header (Posts page)
======================================== */
.page-header {
    padding: 140px 0 60px;
    text-align: center;
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
}

.page-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 12px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-description {
    font-size: 1.125rem;
    color: var(--color-text-muted);
}

/* ========================================
   Posts Section (Posts page)
======================================== */
.posts-section {
    padding: 60px 0 var(--section-padding);
}

.posts-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 48px;
}

.filter-btn {
    padding: 8px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.filter-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.year-group {
    margin-bottom: 48px;
}

.year-heading {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.posts-list {
    display: flex;
    flex-direction: column;
}

.post-item {
    display: flex;
    gap: 32px;
    padding: 24px 0;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.post-item:hover {
    background: var(--color-bg-alt);
    margin: 0 -16px;
    padding: 24px 16px;
    border-radius: var(--radius-md);
    border-color: transparent;
}

.post-date-col {
    flex-shrink: 0;
    width: 80px;
}

.post-date-col .post-date {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.post-content-col {
    flex: 1;
}

.post-content-col .post-tag {
    margin-bottom: 8px;
    display: inline-block;
}

.post-item .post-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.post-item .post-title a:hover {
    color: var(--color-accent);
}

.post-item .post-excerpt {
    font-size: 0.9375rem;
    margin-bottom: 0;
}

/* ========================================
   Footer
======================================== */
.footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* ========================================
   Animations
======================================== */
.animate-fade-up {
    opacity: 0;
    transform: translateY(24px);
    animation: fadeUp 0.6s ease forwards;
}

.animate-fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

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

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

@keyframes fadeIn {
    to { opacity: 1; }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Responsive Design
======================================== */
@media (max-width: 768px) {
    :root {
        --section-padding: 60px;
    }

    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 48px;
    }

    .hero-description {
        max-width: 100%;
    }

    .hero-cta {
        justify-content: center;
    }

    .image-wrapper {
        width: 200px;
        height: 200px;
    }

    .image-decoration {
        width: 220px;
        height: 220px;
    }

    .section-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .post-item {
        flex-direction: column;
        gap: 8px;
    }

    .post-date-col {
        width: auto;
    }

    .posts-filter {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 100px 0 40px;
    }

    .hero-name {
        font-size: 2.5rem;
    }

    .post-card {
        padding: 20px;
    }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}
