/* Jarvis Journal - Apple-Inspired Professional Design */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

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

:root {
    /* Apple-inspired minimal palette */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f7;
    --bg-card: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-muted: #86868b;
    --accent: #0071e3;
    --border: #d2d2d7;
    --shadow: rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #000000;
        --bg-secondary: #1d1d1f;
        --bg-card: #1d1d1f;
        --text-primary: #f5f5f7;
        --text-secondary: #a1a1a6;
        --text-muted: #6e6e73;
        --accent: #2997ff;
        --border: #424245;
        --shadow: rgba(0, 0, 0, 0.3);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'SF Pro Display', 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Clean Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent);
    z-index: 9999;
    transition: width 0.1s ease;
}

.container {
    max-width: 692px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header - Apple Minimalism */
header {
    background: var(--bg-primary);
    padding: 96px 0 64px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.015em;
    color: var(--text-primary);
}

.tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: -0.003em;
}

/* Main Content */
main {
    padding: 72px 0 96px;
    background: var(--bg-primary);
}

/* Post Cards - Clean & Minimal */
.post-preview {
    background: var(--bg-card);
    border-radius: 18px;
    padding: 0;
    margin-bottom: 48px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 2px 12px var(--shadow);
}

.post-preview:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 56px var(--shadow);
}

/* Post Card Thumbnail */
.post-thumb {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid var(--border);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-preview:hover .post-thumb {
    transform: scale(1.02);
}

.post-preview h2 {
    font-size: 2rem;
    margin-bottom: 12px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.015em;
    padding: 32px 40px 0 40px;
}

.post-preview h2 a {
    color: var(--text-primary);
    text-decoration: none;
}

.post-preview h2 a:hover {
    color: var(--accent);
}

.post-meta {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 16px;
    font-weight: 500;
    padding: 0 40px;
}

.post-meta::before {
    content: none;
}

.excerpt {
    font-size: 1.0625rem;
    margin-bottom: 0;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 0 40px 32px 40px;
}

.read-more {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 40px 36px;
    padding: 10px 20px;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border-radius: 980px;
    border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
    transition: all 0.2s;
}

.read-more::after {
    content: '→';
}

.read-more:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Full Post Page */
.post-featured-image {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 18px;
    margin-bottom: 48px;
    display: block;
    border: 1px solid var(--border);
}

.post-header {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.post-header h1 {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--text-primary);
}

.post-content {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.post-content p {
    margin-bottom: 24px;
}

.post-content p:first-of-type::first-letter {
    font-size: 3.5em;
    line-height: 0.85;
    float: left;
    margin: 0.05em 0.12em 0 0;
    font-weight: 700;
    color: var(--text-primary);
}

.post-content h2 {
    font-size: 1.75rem;
    margin: 48px 0 24px;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.post-content h2::before {
    content: none;
}

.post-content h3 {
    font-size: 1.375rem;
    margin: 36px 0 20px;
    color: var(--text-primary);
    font-weight: 600;
}

.post-content em {
    font-style: italic;
    color: var(--text-primary);
}

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

.post-content blockquote {
    border-left: 3px solid var(--border);
    padding: 20px 28px;
    margin: 32px 0;
    font-style: italic;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: 0 8px 8px 0;
}

.post-content ul, .post-content ol {
    margin: 24px 0;
    padding-left: 24px;
}

.post-content li {
    margin-bottom: 12px;
    color: var(--text-secondary);
    padding-left: 8px;
}

.post-content ul li::marker {
    color: var(--text-muted);
}

.post-content ol li::marker {
    color: var(--text-muted);
    font-weight: 600;
}

.post-content ul li::before,
.post-content ol li::before {
    content: none;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 48px;
    padding: 12px 24px;
    background: var(--bg-secondary);
    border-radius: 980px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.0625rem;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.back-link::before {
    content: '←';
    font-size: 1.2em;
}

.back-link:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Footer */
footer {
    background: var(--bg-secondary);
    padding: 48px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
}

footer p {
    margin-bottom: 8px;
}

.disclaimer {
    font-size: 0.8125rem;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 72px 0 48px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .tagline {
        font-size: 1.125rem;
    }
    
    .post-preview h2 {
        font-size: 1.75rem;
        padding: 32px 32px 0 32px;
    }
    
    .post-meta,
    .excerpt {
        padding-left: 32px;
        padding-right: 32px;
    }

    .excerpt {
        padding-bottom: 24px;
    }

    .read-more {
        margin-left: 32px;
        margin-right: 32px;
    }

    .post-thumb {
        height: 180px;
    }

    .post-featured-image {
        height: 220px;
    }
    
    .post-header h1 {
        font-size: 2.25rem;
    }
    
    .post-content {
        font-size: 1.0625rem;
    }
    
    .post-content h2 {
        font-size: 1.5rem;
    }
    
    .post-content p:first-of-type::first-letter {
        font-size: 3em;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: var(--accent);
    color: white;
}

/* Focus Accessibility */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

/* Print Styles */
@media print {
    header, footer, .read-more, .back-link, .reading-progress {
        display: none;
    }

    body {
        background: white;
        color: black;
    }
}


/* ═══════════════════════════════════════════════════════════
   HOMEPAGE — Dark Editorial Layout
   ═══════════════════════════════════════════════════════════ */

/* Force dark on homepage regardless of system pref */
body.home-page {
    background: #000000;
    color: #f5f5f7;
}

/* ─── Container Wide ─── */
.container-wide {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ─── Hero ─── */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 60% 40%, #050a1a 0%, #000000 70%);
    overflow: hidden;
}

#neural-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 24px;
    max-width: 760px;
}

.hero-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #2997ff;
    border: 1px solid rgba(41, 151, 255, 0.3);
    padding: 6px 16px;
    border-radius: 100px;
    margin-bottom: 32px;
    opacity: 0;
    animation: fadeSlideUp 0.6s ease forwards;
    animation-delay: 0.2s;
}

.hero-title {
    font-size: clamp(3.5rem, 10vw, 7rem);
    font-weight: 700;
    line-height: 1.0;
    letter-spacing: -0.03em;
    color: #ffffff;
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeSlideUp 0.7s ease forwards;
    animation-delay: 0.4s;
}

.hero-tagline {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    font-weight: 400;
    color: #a1a1a6;
    margin-bottom: 48px;
    min-height: 1.8em;
    letter-spacing: -0.01em;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
    animation-delay: 0.7s;
}

.hero-tagline::after {
    content: '|';
    opacity: 1;
    animation: blink 0.8s step-end infinite;
    color: #2997ff;
    margin-left: 2px;
}

.hero-tagline.typed::after {
    animation: none;
    opacity: 0;
}

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin-bottom: 48px;
    opacity: 0;
    animation: fadeSlideUp 0.6s ease forwards;
    animation-delay: 1.1s;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f5f5f7;
    letter-spacing: -0.02em;
    line-height: 1;
}

.stat-label {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6e6e73;
}

.hero-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
}

.hero-scroll {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border: 1px solid rgba(41, 151, 255, 0.4);
    border-radius: 100px;
    color: #2997ff;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.25s ease;
    opacity: 0;
    animation: fadeSlideUp 0.6s ease forwards;
    animation-delay: 1.4s;
}

.hero-scroll:hover {
    background: #2997ff;
    color: #ffffff;
    border-color: #2997ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(41, 151, 255, 0.3);
}

/* ─── Section Header ─── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.section-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6e6e73;
}

.section-date {
    font-size: 0.8125rem;
    color: #48484a;
    font-weight: 400;
}

/* ─── Featured Section ─── */
.featured-section {
    background: #07070f;
    padding: 80px 0 72px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.featured-post {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: #0d0d1a;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.featured-post:hover {
    transform: translateY(-4px);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(41, 151, 255, 0.12);
}

.featured-image-wrap {
    display: block;
    overflow: hidden;
}

.featured-img {
    width: 100%;
    height: 100%;
    min-height: 360px;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.featured-post:hover .featured-img {
    transform: scale(1.03);
}

.featured-body {
    padding: 48px 48px 48px 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
}

.featured-meta {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #2997ff;
    margin-bottom: 20px;
}

.featured-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}

.featured-title a {
    color: #f5f5f7;
    text-decoration: none;
    transition: color 0.2s;
}

.featured-title a:hover {
    color: #2997ff;
}

.featured-excerpt {
    font-size: 1rem;
    line-height: 1.65;
    color: #86868b;
    margin-bottom: 36px;
}

.featured-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #2997ff;
    border-radius: 100px;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    align-self: flex-start;
    transition: all 0.25s ease;
}

.featured-cta:hover {
    background: #0a84ff;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(41, 151, 255, 0.35);
}

/* ─── Posts Grid Section ─── */
.posts-section {
    background: #050508;
    padding: 72px 0 96px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

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

/* ─── Post Card ─── */
.post-card {
    background: #0d0d1a;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s ease;
    opacity: 0;
    transform: translateY(24px);
}

.post-card.animate-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s ease, border-color 0.35s ease;
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(41, 151, 255, 0.1);
    border-color: rgba(41, 151, 255, 0.15);
}

.post-card-image-link {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.post-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card:hover .post-card-img {
    transform: scale(1.05);
}

.post-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #2997ff;
    color: #ffffff;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 100px;
}

.post-card-body {
    padding: 24px 28px 28px;
}

.post-card-meta {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #48484a;
    margin-bottom: 12px;
}

.post-card-title {
    font-size: 1.1875rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
}

.post-card-title a {
    color: #e5e5ea;
    text-decoration: none;
    transition: color 0.2s;
}

.post-card-title a:hover {
    color: #2997ff;
}

.post-card-excerpt {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #6e6e73;
    margin-bottom: 20px;
}

.post-card-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: #2997ff;
    text-decoration: none;
    transition: color 0.2s;
}

.post-card-link:hover {
    color: #0a84ff;
}

/* ─── Homepage Footer ─── */
.home-footer {
    background: #000000;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 56px 0;
    text-align: center;
}

.footer-brand {
    margin-bottom: 16px;
}

.footer-logo {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #f5f5f7;
}

.footer-sub {
    font-size: 0.875rem;
    color: #6e6e73;
    margin-top: 6px;
}

.footer-meta {
    font-size: 0.75rem;
    color: #3a3a3c;
    letter-spacing: 0.04em;
}

/* ─── Homepage Entrance Animations ─── */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* ─── Featured post: scroll entrance ─── */
[data-animate].featured-post {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s ease, border-color 0.4s ease;
}

[data-animate].featured-post.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Responsive ─── */
@media (max-width: 960px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container-wide {
        padding: 0 20px;
    }

    .featured-post {
        grid-template-columns: 1fr;
    }

    .featured-img {
        min-height: 220px;
        max-height: 260px;
    }

    .featured-body {
        padding: 32px 28px 36px;
    }

    .featured-title {
        font-size: 1.5rem;
    }

    .featured-section {
        padding: 56px 0 48px;
    }

    .posts-section {
        padding: 48px 0 64px;
    }
}

@media (max-width: 600px) {
    .hero-stats {
        gap: 20px;
    }

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