/* ============================================
   CSS CUSTOM PROPERTIES (Theme Colors)
   ============================================ */

:root {
    /* Background */
    --bg-primary: #faf8f5;
    --bg-hover: rgba(0, 0, 0, 0.015);

    /* Text */
    --text-primary: #1a1a1a;
    --text-secondary: #3a3a3a;
    --text-muted: #666;
    --text-subtle: #888;
    --text-faint: #999;
    --text-fainter: #aaa;

    /* Accent */
    --accent: #006B54;

    /* Borders */
    --border-color: #e8e4df;
    --border-light: #ccc;

    /* Nav */
    --nav-text: #888;
    --nav-separator: #ccc;

    /* Selection */
    --selection-bg: #006B54;
    --selection-text: #fff;

    /* Bookshelf specific */
    --shelf-wood: #5c4a3a;
    --shelf-shadow: #4a3c2e;
    --book-bg: #e8e0d4;
    --book-overlay: #2c2418;
    --book-title: #f5f0e6;
    --book-author: #b8a890;
    --bookshelf-bg: #f7f3eb;
    --bookshelf-bg-edge: #f0e9dc;
}

/* Dark mode colors */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-hover: rgba(255, 255, 255, 0.03);

    --text-primary: #e8e4df;
    --text-secondary: #c5c0b8;
    --text-muted: #9a958d;
    --text-subtle: #7a756d;
    --text-faint: #6a655d;
    --text-fainter: #5a554d;

    --accent: #4ecca3;

    --border-color: #333;
    --border-light: #444;

    --nav-text: #7a756d;
    --nav-separator: #444;

    --selection-bg: #4ecca3;
    --selection-text: #1a1a1a;

    --shelf-wood: #2a2520;
    --shelf-shadow: #1a1510;
    --book-bg: #2a2520;
    --book-overlay: #1a1510;
    --book-title: #e8e4df;
    --book-author: #7a756d;
    --bookshelf-bg: #1a1a1a;
    --bookshelf-bg-edge: #151515;
}

/* ============================================
   NAVIGATION
   ============================================ */

.site-nav {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    gap: 0.5rem;
    z-index: 100;
}

.site-nav a {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.8rem;
    color: var(--nav-text);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.15s ease;
}

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

.site-nav a.active {
    color: var(--text-primary);
}

.nav-separator {
    color: var(--nav-separator);
    font-size: 0.8rem;
}

/* Dark mode toggle */
.theme-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.8rem;
    color: var(--accent);
    transition: opacity 0.15s ease;
}

.theme-toggle:hover {
    opacity: 0.7;
}

.theme-toggle svg {
    width: 14px;
    height: 14px;
}

/* Show sun by default (light mode), hide moon */
.theme-toggle .icon-sun {
    display: block;
}

.theme-toggle .icon-moon {
    display: none;
}

/* In dark mode, show moon and hide sun */
[data-theme="dark"] .theme-toggle .icon-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: block;
}

/* ============================================
   BASE
   ============================================ */

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

html {
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'EB Garamond', Georgia, serif;
    background-color: var(--bg-primary);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)'/%3E%3C/svg%3E");
    background-blend-mode: soft-light;
    color: var(--text-primary);
    line-height: 1.65;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] body {
    background-image: none;
}

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

/* ============================================
   LINKS
   ============================================ */

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--border-light);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s ease;
}

a:hover {
    text-decoration-color: var(--accent);
}

/* ============================================
   LAYOUT
   ============================================ */

main {
    max-width: 620px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 4rem 0;
}

.work {
    position: relative;
}

.podcast {
    border-top: 1px solid var(--border-color);
}

.section-mark {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1rem;
    color: var(--accent);
    pointer-events: none;
}

/* ============================================
   HERO
   ============================================ */

.hero {
    min-height: 100vh;
    padding: 12rem 0 6rem;
    position: relative;
    display: flex;
    flex-direction: column;
}

.animation-container {
    position: absolute;
    left: -140px;
    top: 10rem;
    width: 160px;
    height: 160px;
    pointer-events: none;
}

/* Scroll indicator arrow */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-faint);
    animation: bounce 2s ease-in-out infinite;
}

.scroll-indicator svg {
    width: 24px;
    height: 24px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-8px);
    }
    60% {
        transform: translateX(-50%) translateY(-4px);
    }
}

/* Author photo floating left of writing section */
.author-photo-float {
    position: absolute;
    left: -240px;
    top: 4rem;
    width: 200px;
    pointer-events: none;
}

.author-photo-float img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.blob-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    filter: url(#goo);
}

.blob {
    position: absolute;
    border-radius: 50%;
}

/* Blob 1 - Terracotta/Pink */
.blob-1 {
    width: 100px;
    height: 100px;
    top: 20%;
    left: 10%;
    background: rgba(195, 125, 105, 0.7);
    animation: blob-morph-1 16s ease-in-out infinite;
}

/* Blob 2 - Teal */
.blob-2 {
    width: 90px;
    height: 90px;
    top: 35%;
    left: 30%;
    background: rgba(120, 160, 150, 0.65);
    animation: blob-morph-2 18s ease-in-out infinite;
}

@keyframes blob-morph-1 {
    0%, 100% {
        border-radius: 70% 30% 30% 70% / 70% 30% 70% 30%;
        transform: translate(0, 0) scale(1, 1.1) rotate(0deg);
    }
    20% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
        transform: translate(8px, -10px) scale(1.15, 0.9) rotate(5deg);
    }
    40% {
        border-radius: 50% 50% 20% 80% / 25% 80% 20% 75%;
        transform: translate(-5px, 5px) scale(0.95, 1.2) rotate(-3deg);
    }
    60% {
        border-radius: 80% 20% 60% 40% / 40% 60% 30% 70%;
        transform: translate(10px, 8px) scale(1.1, 0.95) rotate(8deg);
    }
    80% {
        border-radius: 25% 75% 40% 60% / 70% 25% 75% 30%;
        transform: translate(-8px, -5px) scale(0.9, 1.05) rotate(-5deg);
    }
}

@keyframes blob-morph-2 {
    0%, 100% {
        border-radius: 30% 70% 70% 30% / 60% 40% 60% 40%;
        transform: translate(0, 0) scale(1.1, 1) rotate(0deg);
    }
    25% {
        border-radius: 75% 25% 40% 60% / 30% 70% 25% 75%;
        transform: translate(-10px, 8px) scale(0.9, 1.15) rotate(-8deg);
    }
    50% {
        border-radius: 40% 60% 80% 20% / 70% 30% 70% 30%;
        transform: translate(8px, -8px) scale(1.2, 0.9) rotate(5deg);
    }
    75% {
        border-radius: 60% 40% 30% 70% / 25% 75% 40% 60%;
        transform: translate(-5px, -10px) scale(0.95, 1.1) rotate(-3deg);
    }
}

.hero-content {
    position: relative;
}

h1 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.intro {
    font-size: 1.25rem;
    line-height: 1.55;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.current {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.current-now {
    margin-bottom: 1.5rem;
}

.current a {
    color: var(--text-muted);
}

.cta {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 1.5rem;
}

.cta-link {
    color: var(--accent);
    text-decoration: none;
    background: linear-gradient(to right, var(--accent), var(--accent)) no-repeat;
    background-size: 100% 1px;
    background-position: 0 100%;
    padding-bottom: 2px;
    transition: background-size 0.3s ease, color 0.2s ease;
}

.cta-link:hover {
    background-size: 100% 100%;
    color: var(--bg-primary);
}

/* ============================================
   WORK SECTION
   ============================================ */

.work h2,
.podcast h2 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    margin-bottom: 2rem;
}

.pieces {
    display: flex;
    flex-direction: column;
}

.piece {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 2rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.piece:first-child {
    border-top: 1px solid var(--border-color);
}

.piece:hover {
    background-color: var(--bg-hover);
    margin: 0 -1.5rem;
    padding: 1.25rem 1.5rem;
}

.piece-main {
    flex: 1;
}

.piece h3 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    line-height: 1.35;
    transition: color 0.15s ease;
}

.piece:hover h3 {
    color: var(--accent);
}

.piece p {
    font-size: 0.9rem;
    color: var(--text-subtle);
    line-height: 1.5;
}

.piece-meta {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.7rem;
    color: var(--text-fainter);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    flex-shrink: 0;
}

.more {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-subtle);
}

.more a {
    color: var(--text-subtle);
}

.more a:hover {
    color: var(--text-primary);
}

/* ============================================
   PODCAST SECTION
   ============================================ */

.podcast {
    padding-bottom: 3rem;
}

.podcast-intro {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.podcast-intro a {
    color: var(--text-muted);
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 2rem 0 4rem;
    border-top: 1px solid var(--border-color);
}

.footer-left p {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.75rem;
    color: var(--text-fainter);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-right {
    display: flex;
    gap: 1.5rem;
}

.footer-right a {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.8rem;
    color: var(--text-subtle);
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-right a:hover {
    color: var(--text-primary);
}

/* ============================================
   PODCAST PAGE
   ============================================ */

.podcast-header {
    padding: 6rem 0 3rem;
}

.podcast-header h1 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.podcast-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 1rem;
}

.podcast-links {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.podcast-links a {
    color: var(--text-muted);
}

.episodes {
    padding: 2rem 0 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.episode-card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.25rem;
    text-decoration: none;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s ease;
}

.episode-card:first-child {
    border-top: 1px solid var(--border-color);
}

.episode-card:hover {
    background-color: var(--bg-hover);
    margin: 0 -1rem;
    padding: 1rem;
}

.episode-card img {
    width: 110px;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    align-self: stretch;
}

.episode-card-content {
    flex: 1;
    min-width: 0;
}

.episode-date {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.7rem;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 0.35rem;
}

.episode-card h2 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 0.25rem;
    transition: color 0.15s ease;
}

.episode-card:hover h2 {
    color: var(--accent);
}

.episode-guest {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.7rem;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.5rem;
}

.episode-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Legacy episode styles (kept for episode detail pages) */
.episode {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.episode:first-child {
    border-top: 1px solid var(--border-color);
}

.episode-header {
    margin-bottom: 0.75rem;
}

.episode-header h2 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.35;
    margin-bottom: 0.25rem;
}

.episode-intro {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.episode-details {
    margin-top: 1rem;
}

.episode-details summary {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.8rem;
    color: var(--text-subtle);
    cursor: pointer;
    transition: color 0.15s ease;
}

.episode-details summary:hover {
    color: var(--text-primary);
}

.episode-content {
    padding: 1.5rem 0 0.5rem;
}

.episode-content h4 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin-bottom: 0.75rem;
    margin-top: 1.25rem;
}

.episode-content h4:first-child {
    margin-top: 0;
}

.timestamps,
.resources {
    list-style: none;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.timestamps li,
.resources li {
    margin-bottom: 0.25rem;
}

.timestamps strong {
    color: var(--text-primary);
    font-weight: 500;
}

.resources a {
    color: var(--text-muted);
}

/* ============================================
   EPISODE PAGE
   ============================================ */

.episode-page {
    padding: 6rem 0 4rem;
}

.episode-page-header {
    margin-bottom: 3rem;
}

.back-link {
    display: inline-block;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.8rem;
    color: var(--text-subtle);
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color 0.15s ease;
}

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

.episode-page-header h1 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.episode-page-guest {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.8rem;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.episode-player {
    margin: 2rem 0 2.5rem;
}

.episode-player iframe {
    border-radius: 8px;
}

.episode-listen-links {
    margin: 1.5rem 0 2.5rem;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.episode-listen-links a {
    color: var(--accent);
}

.episode-section {
    margin-bottom: 2.5rem;
}

.episode-section h2 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    margin-bottom: 1rem;
}

.episode-section h3 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.episode-section p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 1rem;
}

.episode-section ul,
.episode-section ol {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.episode-section li {
    margin-bottom: 0.5rem;
}

.time-map {
    list-style: none;
    padding-left: 0;
}

.time-map li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.time-map li:first-child {
    border-top: 1px solid var(--border-color);
}

.time-map strong {
    color: var(--text-primary);
    font-weight: 500;
}

.time-map blockquote {
    margin: 0.75rem 0 0 0;
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
    font-style: italic;
    color: var(--text-muted);
}

.episode-links {
    list-style: none;
    padding-left: 0;
}

.episode-links li {
    padding: 0.5rem 0;
}

.episode-links a {
    color: var(--text-secondary);
}

.episode-link {
    display: inline-block;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.8rem;
    color: var(--text-subtle);
    text-decoration: none;
    transition: color 0.15s ease;
}

.episode-link:hover {
    color: var(--accent);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 700px) {
    .site-nav {
        top: 1.5rem;
        right: 1.5rem;
        gap: 0.4rem;
    }

    .podcast-header {
        padding: 5rem 0 2.5rem;
    }

    .episode-card img {
        width: 90px;
    }

    .episode-card:hover {
        margin: 0 -0.75rem;
        padding: 1rem 0.75rem;
    }

    .animation-container {
        position: relative;
        left: 0;
        top: 0;
        width: 120px;
        height: 120px;
        margin-bottom: 2rem;
    }

    .hero {
        min-height: auto;
        padding: 4rem 0 3rem;
    }

    .scroll-indicator {
        display: none;
    }

    .author-photo-float {
        display: none;
    }

    h1 {
        font-size: 1.75rem;
    }

    .intro {
        font-size: 1.15rem;
    }

    .piece {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .piece:hover {
        margin: 0 -1rem;
        padding: 1.25rem 1rem;
    }

    .piece-meta {
        order: -1;
    }

    footer {
        flex-direction: column;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    body {
        background-image: none;
    }

    body:has(.bookshelf) {
        background: var(--bookshelf-bg);
    }

    .site-nav {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.3rem 0.5rem;
    }

    .site-nav a {
        font-size: 0.85rem;
        padding: 0.25rem 0;
    }

    main {
        padding: 0 1.25rem;
    }

    section {
        padding: 3rem 0;
    }

    .hero {
        padding: 3rem 0 2.5rem;
    }

    .podcast-header {
        padding: 4rem 0 2rem;
    }

    .podcast-header h1 {
        font-size: 1.75rem;
    }
}

/* ============================================
   ESSAY PAGE
   ============================================ */

.essay {
    padding: 6rem 0 4rem;
}

.essay-header {
    margin-bottom: 3rem;
}

.essay-header h1 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.essay-date {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.8rem;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.essay-content {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.75;
}

.essay-content p {
    margin-bottom: 1.5rem;
}

.essay-content h2 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 500;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.essay-content h3 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 500;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.essay-content blockquote {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
    border-left: 3px solid var(--border-color);
    font-style: italic;
    color: var(--text-muted);
}

.essay-content ul,
.essay-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.essay-content li {
    margin-bottom: 0.5rem;
}

.essay-content img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
}

.essay-content figure {
    margin: 2rem 0;
}

.essay-content figcaption {
    font-size: 0.85rem;
    color: var(--text-subtle);
    text-align: center;
    margin-top: 0.5rem;
}

.essay-content a {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

.essay-content a:hover {
    text-decoration-color: var(--accent);
    opacity: 0.8;
}

/* Handle Webflow rich text classes */
.w-richtext-figure-type-image {
    margin: 2rem 0;
}

.w-richtext-align-fullwidth {
    width: 100%;
}

.w-richtext-align-center {
    text-align: center;
}

/* ============================================
   BLOG ARCHIVE PAGE
   ============================================ */

.blog-header {
    padding: 6rem 0 2rem;
}

.blog-header h1 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.blog-description {
    font-size: 1rem;
    color: #666;
    line-height: 1.55;
}

.title-aside {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}

.blog-posts {
    padding: 2rem 0 4rem;
    display: flex;
    flex-direction: column;
}

.blog-post {
    display: block;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.blog-post:first-child {
    border-top: 1px solid var(--border-color);
}

.blog-post:hover {
    background-color: var(--bg-hover);
    margin: 0 -1rem;
    padding: 1rem;
}

.blog-date {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.7rem;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: block;
    margin-bottom: 0.3rem;
}

.blog-title {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1.05rem;
    color: var(--text-primary);
    line-height: 1.4;
    transition: color 0.15s ease;
}

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

.blog-description {
    font-size: 0.9rem;
    color: var(--text-subtle);
    line-height: 1.5;
    margin-top: 0.25rem;
}

@media (max-width: 600px) {
    .blog-post {
        flex-direction: column;
        gap: 0.25rem;
    }

    .blog-date {
        width: auto;
    }

    .blog-post:hover {
        margin: 0 -0.75rem;
        padding: 0.75rem;
    }
}

/* ============================================
   BOOKSHELF PAGE
   ============================================ */

/* Warm parchment background for the library */
body:has(.bookshelf) {
    background:
        /* Subtle paper grain texture */
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E"),
        /* Warm gradient from edges */
        radial-gradient(ellipse at center, var(--bookshelf-bg) 0%, var(--bookshelf-bg-edge) 100%);
    background-blend-mode: overlay, normal;
}

.bookshelf-header {
    padding: 6rem 0 2.5rem;
}

.bookshelf-header h1 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 400;
    font-style: italic;
    color: var(--text-muted);
    letter-spacing: -0.01em;
}

.bookshelf {
    padding: 2rem 0 4rem;
    /* Break out of main's max-width */
    width: calc(100vw - 4rem);
    max-width: 960px;
    margin-left: calc((100% - min(960px, 100vw - 4rem)) / 2);
}

.book-grid {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.book-row {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 40px;
    /* Warm wood shelf */
    border-bottom: 10px solid var(--shelf-wood);
    box-shadow:
        0 4px 0 var(--shelf-shadow),
        0 8px 16px rgba(60, 45, 30, 0.2);
    padding-bottom: 0;
    position: relative;
}

.book {
    position: relative;
    width: 140px;
    overflow: hidden;
    text-decoration: none;
    background: var(--book-bg);
    box-shadow:
        2px 4px 12px rgba(60, 45, 30, 0.25),
        -1px 0 4px rgba(60, 45, 30, 0.1);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    margin-bottom: -1px; /* Sit flush on shelf */
}

/* Vary book heights for organic feel - all align at bottom */
.book { height: 200px; }
.book:nth-child(5n+1) { height: 220px; }
.book:nth-child(5n+2) { height: 190px; }
.book:nth-child(5n+3) { height: 210px; }
.book:nth-child(5n+4) { height: 185px; }
.book:nth-child(5n+5) { height: 215px; }

.book:hover {
    transform: translateY(-10px);
    box-shadow:
        4px 12px 24px rgba(60, 45, 30, 0.35),
        -2px 0 8px rgba(60, 45, 30, 0.15);
    z-index: 10;
}

.book img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom center;
    display: block;
    transition: opacity 0.15s ease;
}

.book-overlay {
    position: absolute;
    inset: 0;
    background: var(--book-overlay);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0.75rem;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.book:hover .book-overlay {
    opacity: 1;
}

.book:hover img {
    opacity: 0;
}

.book-title {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--book-title);
    line-height: 1.3;
    margin-bottom: 0.4rem;
}

.book-author {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.6rem;
    color: var(--book-author);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 900px) {
    .bookshelf {
        width: calc(100vw - 3rem);
        margin-left: calc((100% - (100vw - 3rem)) / 2);
    }

    .book-row {
        gap: 30px;
    }

    .book {
        width: 115px;
    }
    .book { height: 165px; }
    .book:nth-child(5n+1) { height: 180px; }
    .book:nth-child(5n+2) { height: 155px; }
    .book:nth-child(5n+3) { height: 170px; }
    .book:nth-child(5n+4) { height: 150px; }
    .book:nth-child(5n+5) { height: 175px; }

    .bookshelf-header {
        padding: 5rem 0 1.5rem;
    }
}

@media (max-width: 700px) {
    .book-grid {
        gap: 50px;
    }

    .book-row {
        flex-wrap: wrap;
        gap: 20px;
        border-bottom-width: 6px;
    }

    .book {
        width: 100px;
    }
    .book { height: 145px; }
    .book:nth-child(5n+1) { height: 158px; }
    .book:nth-child(5n+2) { height: 138px; }
    .book:nth-child(5n+3) { height: 150px; }
    .book:nth-child(5n+4) { height: 132px; }
    .book:nth-child(5n+5) { height: 155px; }

    .book-title {
        font-size: 0.8rem;
    }

    .book-author {
        font-size: 0.5rem;
    }
}

@media (max-width: 480px) {
    .book-grid {
        gap: 40px;
    }

    .book-row {
        gap: 12px;
        border-bottom-width: 5px;
    }

    .book {
        width: 80px;
    }
    .book { height: 118px; }
    .book:nth-child(5n+1) { height: 130px; }
    .book:nth-child(5n+2) { height: 112px; }
    .book:nth-child(5n+3) { height: 122px; }
    .book:nth-child(5n+4) { height: 108px; }
    .book:nth-child(5n+5) { height: 126px; }

    .bookshelf-header {
        padding: 4rem 0 1rem;
    }

    .book-title {
        font-size: 0.7rem;
    }

    .book-author {
        font-size: 0.45rem;
    }
}
