/* 
 * Apple-inspired Design System
 * Focus: Minimalism, High Typography, Glassmorphism
 */

:root {
    --bg-color: #ffffff;
    --text-color: #1d1d1f;
    --secondary-text: #86868b;
    --accent-color: #0066cc;
    --nav-bg: rgba(251, 251, 253, 0.8);
    --border-color: rgba(0, 0, 0, 0.1);
    --card-bg: #f5f5f7;
    --max-width: 1200px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #000000;
        --text-color: #f5f5f7;
        --secondary-text: #a1a1a6;
        --accent-color: #2997ff;
        --nav-bg: rgba(22, 22, 23, 0.8);
        --border-color: rgba(255, 255, 255, 0.1);
        --card-bg: #1d1d1f;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Myriad Set Pro", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Navigation */
.apple-nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 44px;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    justify-content: center;
}

.nav-content {
    width: 100%;
    max-width: 1024px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 12px;
    font-weight: 400;
    opacity: 0.8;
    transition: var(--transition);
}

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

/* Hero Section */
.hero {
    padding: 120px 20px 60px;
    text-align: center;
    background: var(--bg-color);
}

.hero-title {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin-bottom: 15px;
}

.hero-subtitle {
    font-size: 24px;
    color: var(--secondary-text);
    max-width: 600px;
    margin: 0 auto;
}

/* Section Styling */
.section-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 20px;
}

.section-head {
    margin-bottom: 40px;
}

.section-title {
    font-size: 40px;
    font-weight: 600;
}

/* Cards Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.blog-card {
    background: var(--card-bg);
    border-radius: 18px;
    overflow: hidden;
    transition: transform 0.4s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

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

.card-image {
    width: 100%;
    aspect-ratio: 16/9;
    background: #ccc;
    object-fit: cover;
}

.card-content {
    padding: 25px;
}

.card-tag {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 10px;
    display: block;
}

.card-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.card-desc {
    font-size: 16px;
    color: var(--secondary-text);
}

/* Markdown Content Container Layout */
.markdown-body {
    max-width: 800px;
    margin: 44px auto 0; /* Align with nav height */
    padding: 80px 20px;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Custom premium touches for the markdown content */
.markdown-body img { 
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    margin: 48px auto; 
    display: block; 
}

/* Caption for images when followed by em */
.markdown-body img + em {
    display: block;
    text-align: center;
    margin-top: -30px;
    margin-bottom: 40px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .markdown-body {
        padding: 40px 20px;
    }
}

/* Footer */
footer {
    padding: 80px 20px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    margin-top: 80px;
}

.footer-content {
    max-width: 1024px;
    margin: 0 auto;
    color: var(--secondary-text);
    font-size: 12px;
}

.footer-links {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

/* Progress Bar */
.reading-progress-container {
    position: fixed;
    top: 44px; /* Below nav */
    left: 0;
    width: 100%;
    height: 1px;
    z-index: 1001;
    background: transparent;
}

.reading-progress-bar {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 0.1s ease-out;
}

/* Utilities */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
