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

:root {
    /* Colors - matching the Next.js site */
    --bg: #FEFFFC;
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6B7280;
    --text-light: #9CA3AF;
    --border: #E5E7EB;
    --border-light: #D1D5DB;
    --surface: #F9FAFB;

    /* Typography */
    --font-sans: 'Figtree', system-ui, -apple-system, sans-serif;
    --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-14: 3.5rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
}

html {
    height: 100%;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior: none;
}

html::-webkit-scrollbar {
    display: none;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-secondary);
    background-color: var(--bg);
    min-height: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
}

::selection {
    background-color: var(--text-primary);
    color: var(--bg);
}

a {
    text-decoration: none;
    color: inherit;
}

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

/* ========================================
   Floating Pill Navbar (matching liquid-glass-nav)
======================================== */
.navbar {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 112;
    transition: top 0.3s ease;
}

.nav-pill {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 9999px;

    /* Liquid glass effect */
    background: linear-gradient(135deg,
            rgba(31, 31, 41, 0.8) 0%,
            rgba(31, 31, 41, 0.6) 50%,
            rgba(31, 31, 41, 0.75) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.nav-logo {
    display: block;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.nav-logo:hover {
    transform: scale(1.05);
}

.nav-logo svg {
    display: block;
}

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

.nav-links a {
    color: white;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* ========================================
   Article Header
======================================== */
.article-header {
    padding-top: 4rem;
    padding-bottom: 2.5rem;
}

@media (min-width: 640px) {
    .article-header {
        padding-top: 5rem;
    }
}

@media (min-width: 1024px) {
    .article-header {
        padding-bottom: 4rem;
    }
}

.header-container {
    max-width: 64rem;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

@media (min-width: 640px) {
    .header-container {
        padding: 0 1.5rem;
    }
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 2.5rem;
    transition: color 0.2s ease;
}

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

.article-header h1 {
    font-family: var(--font-serif);
    font-size: 1.875rem;
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .article-header h1 {
        font-size: 2.25rem;
    }
}

@media (min-width: 768px) {
    .article-header h1 {
        font-size: 3rem;
    }
}

@media (min-width: 1024px) {
    .article-header h1 {
        font-size: 3.25rem;
    }
}

.article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .article-meta {
        font-size: 1rem;
    }
}

.article-meta .separator {
    color: var(--border-light);
}

/* ========================================
   Cover Image Section (wider than content)
======================================== */
.cover-section {
    padding-bottom: 3rem;
}

@media (min-width: 1024px) {
    .cover-section {
        padding-bottom: 4rem;
    }
}

.cover-container {
    max-width: 64rem;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .cover-container {
        padding: 0 1.5rem;
    }
}

.cover-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 1rem;
    overflow: hidden;
}

.cover-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

/* ========================================
   Article Body
======================================== */
.article-body {
    padding-bottom: 4rem;
}

@media (min-width: 1024px) {
    .article-body {
        padding-bottom: 6rem;
    }
}

.content-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .content-container {
        padding: 0 1.5rem;
    }
}

.article-body p {
    font-size: 1.125rem;
    line-height: 1.85;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.article-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.article-body em {
    font-style: italic;
}

.article-body h3 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .article-body h3 {
        font-size: 1.5rem;
    }
}

/* ========================================
   Author Sign-off
======================================== */
.sign-off {
    margin-top: 4rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
}

.sign-off p {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0;
}

/* ========================================
   Footer
======================================== */
.site-footer {
    margin-top: auto;
    width: 100%;
}

/* Color Lines */
.color-lines {
    width: 100%;
}

.color-lines .line {
    width: 100%;
}

.line-blue {
    height: 0.5rem;
    background: #93c5fd;
}

.line-white {
    height: 0.375rem;
    background: white;
}

.line-sky {
    height: 0.5rem;
    background: #bae6fd;
}

.line-cyan {
    height: 0.25rem;
    background: #cffafe;
}

/* Footer Image */
.footer-image {
    width: 100%;
    height: 350px;
}

@media (min-width: 640px) {
    .footer-image {
        height: 450px;
    }
}

@media (min-width: 1024px) {
    .footer-image {
        height: 600px;
    }
}

.footer-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* ========================================
   Animations
======================================== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.article-header {
    animation: fadeUp 0.6s ease-out;
}

.cover-section {
    animation: fadeUp 0.6s ease-out 0.1s both;
}

.article-body {
    animation: fadeUp 0.6s ease-out 0.2s both;
}

/* ========================================
   Mobile Navigation (hamburger hidden for simplicity)
======================================== */
@media (max-width: 480px) {
    .nav-links {
        display: none;
    }

    .nav-pill {
        padding: 0.5rem;
    }
}