/*
 * A well-worn notebook
 * Dark but soft, cozy, book-like
 */

:root {
    --color-bg: #181b20;
    --color-bg-elevated: #1f2329;
    --color-text: #f0ebe0;
    --color-text-muted: #9a9590;
    --color-border: #2e333a;

    /* Accent palette — from Stack & Signal */
    --color-rust: #ef6461;
    --color-gold: #e4b363;
    --color-sage: #5db7a1;
    --color-lavender: #a78bba;

    --font-body: 'EB Garamond', Georgia, serif;
    --font-ui: 'EB Garamond', Georgia, serif;

    --measure: 1100px;
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
}

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

/* Color bars at top */
.color-bars {
    display: flex;
    height: 10px;
}

.color-bars span {
    flex: 1;
    transform: scaleX(0);
    transform-origin: left;
    animation: colorBarReveal 0.6s ease-out forwards;
}

.color-bars span:nth-child(1) { background: var(--color-rust); animation-delay: 0s; }
.color-bars span:nth-child(2) { background: var(--color-gold); animation-delay: 0.1s; }
.color-bars span:nth-child(3) { background: var(--color-sage); animation-delay: 0.2s; }
.color-bars span:nth-child(4) { background: var(--color-lavender); animation-delay: 0.3s; }

@keyframes colorBarReveal {
    to {
        transform: scaleX(1);
    }
}

html {
    font-size: 19px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 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.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-blend-mode: overlay;
    background-size: 150px 150px;
}


.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: var(--measure);
    margin: 0 auto;
    padding: var(--space-lg) var(--space-xl);
}

/* Navigation */
.site-header {
    padding: var(--space-md) 0 var(--space-lg);
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-lg);
}

.nav a:not(.nav-logo) {
    font-family: var(--font-ui);
    font-size: 1.1rem;
    text-decoration: none;
    position: relative;
}

.nav a:not(.nav-logo)::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.nav a:not(.nav-logo):hover::after,
.nav a:not(.nav-logo).active::after {
    transform: scaleX(1);
}

/* Stack logo in nav */
.nav-logo {
    margin-right: var(--space-md);
}

.stack-layers {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stack-layers .layer {
    height: 7px;
    border-radius: 2px;
    transition: transform 0.2s ease, margin-left 0.2s ease;
}

.stack-layers .layer:nth-child(1) { width: 38px; background: var(--color-rust); }
.stack-layers .layer:nth-child(2) { width: 30px; margin-left: 4px; background: var(--color-gold); }
.stack-layers .layer:nth-child(3) { width: 34px; margin-left: 2px; background: var(--color-sage); }
.stack-layers .layer:nth-child(4) { width: 24px; margin-left: 7px; background: var(--color-lavender); }

.nav-logo:hover .layer:nth-child(1) { transform: translateX(2px); }
.nav-logo:hover .layer:nth-child(2) { margin-left: 1px; }
.nav-logo:hover .layer:nth-child(3) { margin-left: 4px; }
.nav-logo:hover .layer:nth-child(4) { margin-left: 2px; }

/* Nav home link */
.nav-home {
    margin-right: auto;
    display: flex;
    align-items: center;
}

.nav-icon {
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    transition: transform 0.2s;
}

.nav-home:hover .nav-icon {
    transform: scale(1.1);
}

/* Nav link colors */
.nav a:nth-child(2) { color: var(--color-rust); }
.nav a:nth-child(3) { color: var(--color-gold); }
.nav a:nth-child(4) { color: var(--color-sage); }
.nav a:nth-child(5) { color: var(--color-lavender); }


/* Main content */
.main {
    flex: 1;
}

/* Homepage */
.home-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xl);
    margin-bottom: var(--space-md);
}

.intro-text {
    flex: 1;
}

.intro-greeting {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-text);
    margin: 0 0 var(--space-md) 0;
}

.intro-photo {
    width: 300px;
    height: 300px;
    border-radius: 16px;
    object-fit: cover;
    flex-shrink: 0;
}

.intro-bio {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--color-text);
}

.intro-link-write {
    color: var(--color-rust);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.intro-link-write:hover {
    color: var(--color-gold);
}

.intro-link-projects {
    color: var(--color-sage);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.intro-link-projects:hover {
    color: var(--color-gold);
}

.home-section {
    margin-bottom: 0;
    padding: var(--space-lg) 0;
}

.home-section:last-child {
    margin-bottom: var(--space-lg);
}

.home-section:nth-child(odd) {
    background-color: rgba(255, 255, 255, 0.015);
    margin-left: calc(-1 * var(--space-xl));
    margin-right: calc(-1 * var(--space-xl));
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
}

.section-label {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-muted);
    display: block;
    margin-bottom: var(--space-xs);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 var(--space-md) 0;
}

/* Latest post on homepage */
.latest-post {
    margin-top: var(--space-md);
}

.latest-post-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}

.latest-post-title a,
.latest-post-title a:link,
.latest-post-title a:visited {
    color: var(--color-rust);
    text-decoration: none;
}

.latest-post-title a:hover {
    color: var(--color-gold);
}

.latest-post-date {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.latest-post-excerpt {
    color: var(--color-text);
    max-width: var(--measure);
    font-size: 1.05rem;
    line-height: 1.6;
}

.latest-post-excerpt p {
    margin: 0;
}

.latest-post-excerpt a {
    color: var(--color-text);
    text-decoration: none;
}

.latest-post-excerpt a:hover {
    color: var(--color-gold);
}

.keep-reading {
    display: inline-block;
    margin-top: var(--space-sm);
    font-size: 0.95rem;
    color: var(--color-rust);
    text-decoration: none;
}

.keep-reading:hover {
    color: var(--color-gold);
}

.section-link {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--color-rust);
    text-decoration: none;
    display: inline-block;
    margin-top: var(--space-md);
}

.section-link:hover {
    color: var(--color-gold);
}

/* Search queries section */
.searches-section .section-title {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    font-weight: 400;
}

.search-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.search-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
}

.search-query {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.search-item.has-answer .search-query {
    color: var(--color-sage);
    cursor: help;
}

.search-indicator {
    width: 6px;
    height: 6px;
    background: var(--color-sage);
    border-radius: 50%;
    opacity: 0.6;
}

.search-tooltip {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    font-size: 0.85rem;
    color: var(--color-text);
    max-width: 350px;
    line-height: 1.5;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.search-item.has-answer:hover .search-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Project list */
.project-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md) var(--space-xl);
}

.project-list li {
    margin-bottom: 0;
}

.project-icon {
    width: 50px;
    height: 44px;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Joy Machines - sparkle star */
.icon-joy::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 12px;
    background: linear-gradient(90deg, #ff00ff, #00ffff, #ffff00, #ff00ff);
    border-radius: 2px;
}

.icon-joy::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 40px;
    background: linear-gradient(180deg, #ff00ff, #00ffff, #ffff00, #ff00ff);
    border-radius: 2px;
}

/* Coffee - cup with steam */
.icon-coffee::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 28px;
    background: var(--color-gold);
    border-radius: 0 0 8px 8px;
}

.icon-coffee::after {
    content: "";
    position: absolute;
    top: 50%;
    left: calc(50% + 16px);
    transform: translateY(-50%);
    width: 10px;
    height: 16px;
    border: 3px solid var(--color-gold);
    border-left: none;
    border-radius: 0 8px 8px 0;
}

/* SendReady - envelope */
.icon-sendready::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 32px;
    background: var(--color-rust);
    border-radius: var(--radius-sm);
}

.icon-sendready::after {
    content: "";
    position: absolute;
    top: calc(50% - 16px);
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 22px solid transparent;
    border-right: 22px solid transparent;
    border-top: 16px solid var(--color-bg-elevated);
}

/* Filament - spool */
.icon-filament::before {
    content: "";
    position: absolute;
    top: calc(50% - 14px);
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 8px;
    background: var(--color-sage);
    border-radius: 2px;
    box-shadow: 0 20px 0 var(--color-sage);
}

.icon-filament::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 12px;
    background: var(--color-sage);
    opacity: 0.6;
    border-radius: 2px;
}

/* Overengineering - nested boxes */
.icon-overengineering::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border: 3px solid var(--color-lavender);
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 8px var(--color-bg), inset 0 0 0 11px var(--color-rust);
}

.icon-overengineering::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: var(--color-gold);
    border-radius: 2px;
}

.project-info {
    flex: 1;
}

.project-list a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
}

.project-list a:hover {
    color: var(--color-rust);
}

.project-desc {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-top: 2px;
}
/* Footer */
.site-footer {
    margin-top: auto;
    padding: var(--space-xl) 0 var(--space-lg);
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm) var(--space-lg);
    margin-bottom: var(--space-md);
}

.footer-nav a {
    font-family: var(--font-ui);
    font-size: 0.95rem;
    color: var(--color-text-muted);
    text-decoration: none;
}

.footer-nav a:hover {
    color: var(--color-rust);
}

.footer-social {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-lg);
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-decoration: none;
}

.footer-social a:hover {
    color: var(--color-sage);
}

.footer-social svg {
    flex-shrink: 0;
}

.footer-copyright {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    opacity: 0.7;
}

/* Generic content pages */
.page-header {
    margin-bottom: var(--space-lg);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.page-description {
    color: var(--color-text-muted);
}

/* Blog post titles should be larger */
.post .page-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: var(--space-sm);
}

/* Links in body text */
.main :where(a:not([class])) {
    color: var(--color-rust);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.main :where(a:not([class]):hover) {
    color: var(--color-gold);
}

/* Post content */
.post-content p {
    margin-bottom: var(--space-md);
}

.post-content h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
}


.post-content ul,
.post-content ol {
    margin-bottom: var(--space-md);
    padding-left: var(--space-lg);
}

.post-content li {
    margin-bottom: var(--space-xs);
}

.post-content img,
.blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    margin: var(--space-lg) 0;
}

/* Pull quote - large accent text */
.pullquote {
    font-size: 1.25rem;
    line-height: 1.4;
    color: var(--color-rust);
    border: none;
    padding: var(--space-md) 0;
    margin: var(--space-md) 0;
    font-style: italic;
    text-align: center;
}

.pullquote p {
    margin: 0;
}

/* Aside/callout block */
.aside-callout {
    background: var(--color-bg-elevated);
    border-left: 3px solid var(--color-gold);
    padding: var(--space-md) var(--space-lg);
    margin: var(--space-lg) 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.95rem;
}

.aside-callout p {
    margin: 0;
}

.aside-callout p + p {
    margin-top: var(--space-sm);
}

/* Section divider */
.section-divider {
    text-align: center;
    margin: var(--space-xl) 0;
}

.section-divider::before {
    content: "···";
    color: var(--color-text-muted);
    letter-spacing: 0.5em;
    font-size: 1.2rem;
}

/* Now timeline */
.now-timeline {
    position: relative;
    padding-left: var(--space-xl);
}

.now-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-border);
}

.now-entry {
    position: relative;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--color-border);
}

.now-entry:last-child {
    border-bottom: none;
}

.now-marker {
    position: absolute;
    left: calc(-1 * var(--space-xl) + 2px);
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-bg);
    border: 3px solid var(--color-rust);
}

.now-entry:nth-child(4n+1) .now-marker { border-color: var(--color-rust); }
.now-entry:nth-child(4n+2) .now-marker { border-color: var(--color-gold); }
.now-entry:nth-child(4n+3) .now-marker { border-color: var(--color-sage); }
.now-entry:nth-child(4n+4) .now-marker { border-color: var(--color-lavender); }

.now-entry-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--color-text);
}


.now-entry-content {
    max-width: var(--measure);
}

/* Projects List (two-column rows) */
.projects-list {
    max-width: var(--measure);
}

.project-feature {
    display: flex;
    gap: var(--space-xl);
    align-items: center;
    margin-bottom: var(--space-xl);
}

.project-feature-image-link {
    flex-shrink: 0;
    width: 340px;
}

.project-feature-img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    object-position: top left;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.project-feature-image-link:hover .project-feature-img {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.project-feature-content {
    flex: 1;
}

.project-feature-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
}

.project-feature-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.project-feature-title a,
.project-feature-title a:link,
.project-feature-title a:visited {
    color: inherit;
    text-decoration: none;
}

.project-feature-title a:hover {
    color: var(--color-rust);
}

.project-feature-pitch {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

.project-feature-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
}

.project-feature-link {
    font-size: 1rem;
    color: var(--color-rust);
    text-decoration: none;
    font-weight: 600;
}

.project-feature-link:hover {
    color: var(--color-gold);
}

/* Joy Machines color leak easter egg */
.project-joy-image {
    position: relative;
}

.project-joy-image::before {
    content: "";
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    background: linear-gradient(
        45deg,
        #ff00ff,
        #00ffff,
        #ffff00,
        #ff6600,
        #ff00ff,
        #00ffff
    );
    background-size: 300% 300%;
    border-radius: 16px;
    filter: blur(12px);
    opacity: 0;
    z-index: -1;
    animation: joyLeak 4s ease-in-out infinite;
    transition: opacity 0.5s ease;
}

.project-joy:hover .project-joy-image::before {
    opacity: 0.6;
}

@keyframes joyLeak {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* SendReady - floating envelope */
.project-sendready-image {
    position: relative;
    overflow: visible;
}

.project-sendready-image::after {
    content: "✉️";
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 1.5rem;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: none;
}

.project-sendready:hover .project-sendready-image::after {
    animation: envelopeFloat 1s ease-out forwards;
}

@keyframes envelopeFloat {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -200%);
    }
}

/* Coffee - steam wisps */
.project-coffee-image {
    position: relative;
    overflow: visible;
}

.project-coffee-image::before,
.project-coffee-image::after {
    content: "";
    position: absolute;
    top: -10px;
    width: 20px;
    height: 30px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s;
}

.project-coffee-image::before {
    left: 30%;
}

.project-coffee-image::after {
    left: 55%;
    animation-delay: 0.3s;
}

.project-coffee:hover .project-coffee-image::before,
.project-coffee:hover .project-coffee-image::after {
    opacity: 1;
    animation: steam 2s ease-in-out infinite;
}

.project-coffee:hover .project-coffee-image::after {
    animation-delay: 0.5s;
}

@keyframes steam {
    0%, 100% {
        transform: translateY(0) scaleX(1);
        opacity: 0;
    }
    20% {
        opacity: 0.6;
    }
    50% {
        transform: translateY(-20px) scaleX(1.2);
        opacity: 0.4;
    }
    100% {
        transform: translateY(-40px) scaleX(0.8);
        opacity: 0;
    }
}

/* Overengineering - increasingly over-designed on hover */
.project-overengineering {
    transition: all 0.3s ease;
}

.project-overengineering:hover {
    background: linear-gradient(135deg, rgba(239, 100, 97, 0.05), rgba(228, 179, 99, 0.05), rgba(93, 183, 161, 0.05));
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: var(--space-md);
    margin: calc(-1 * var(--space-md));
    margin-bottom: var(--space-xl);
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.1),
        0 8px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.project-overengineering:hover .project-feature-title {
    text-shadow: 1px 1px 0 var(--color-rust);
}

.project-overengineering:hover .project-feature-img {
    border: 3px solid var(--color-gold);
    box-shadow: 0 0 0 3px var(--color-rust), 0 0 0 6px var(--color-lavender);
}

/* Flipper - RGB glitch effect */
.project-flipper-image {
    position: relative;
}

.project-flipper:hover .project-flipper-image .project-feature-img {
    animation: glitch 0.5s ease 3;
}

@keyframes glitch {
    0%, 100% {
        filter: none;
    }
    25% {
        filter: drop-shadow(-3px 0 0 rgba(255, 0, 0, 0.7)) drop-shadow(3px 0 0 rgba(0, 255, 255, 0.7));
    }
    50% {
        filter: drop-shadow(2px 0 0 rgba(255, 0, 255, 0.7)) drop-shadow(-2px 0 0 rgba(0, 255, 0, 0.7));
    }
    75% {
        filter: drop-shadow(-2px 0 0 rgba(0, 0, 255, 0.7)) drop-shadow(2px 0 0 rgba(255, 255, 0, 0.7));
    }
}

/* Blog filters */
.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
}

/* Blog feed */
.blog-feed {
    max-width: var(--measure);
}

.blog-post {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.blog-post:last-child {
    border-bottom: none;
}

.blog-post-header {
    margin-bottom: var(--space-md);
}

.blog-post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.blog-post-date {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.blog-post-reading-time {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.blog-post-reading-time::before {
    content: "·";
    margin-right: var(--space-sm);
}

.blog-post-excerpt {
    color: var(--color-text);
    font-size: 1rem;
    line-height: 1.6;
    max-width: var(--measure);
}

.blog-post-excerpt p {
    margin-bottom: var(--space-md);
}

.blog-post-excerpt p:last-child {
    margin-bottom: 0;
}

.blog-post-excerpt img {
    display: none;
}

.read-more,
.read-more:link,
.read-more:visited {
    display: inline-block;
    margin-top: var(--space-sm);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--color-rust);
    text-decoration: none;
}

.read-more:hover {
    color: var(--color-gold);
}

.blog-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.2s;
}

/* Cycle tag colors */
.tag:nth-child(4n+1) {
    color: var(--color-rust);
    background: rgba(239, 100, 97, 0.15);
    border-color: rgba(239, 100, 97, 0.3);
}

.tag:nth-child(4n+2) {
    color: var(--color-gold);
    background: rgba(228, 179, 99, 0.15);
    border-color: rgba(228, 179, 99, 0.3);
}

.tag:nth-child(4n+3) {
    color: var(--color-sage);
    background: rgba(93, 183, 161, 0.15);
    border-color: rgba(93, 183, 161, 0.3);
}

.tag:nth-child(4n+4) {
    color: var(--color-lavender);
    background: rgba(167, 139, 186, 0.15);
    border-color: rgba(167, 139, 186, 0.3);
}

.tag:hover {
    filter: brightness(1.2);
    border-color: currentColor;
}

/* Post subscribe section (end of blog posts) */
.post-subscribe {
    background: rgba(255, 255, 255, 0.03);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    text-align: center;
}

.post-subscribe-pitch {
    font-size: 1.05rem;
    color: var(--color-text);
    margin: 0 0 var(--space-md);
    line-height: 1.5;
}

.post-subscribe-form {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-sm);
}

.post-subscribe-input {
    padding: 0.6rem 0.9rem;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    width: 200px;
}

.post-subscribe-input::placeholder {
    color: var(--color-text-muted);
}

.post-subscribe-input:focus {
    outline: 2px solid var(--color-rust);
    outline-offset: 2px;
    border-color: var(--color-rust);
}

.post-subscribe-btn {
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 700;
    background: var(--color-rust);
    border: none;
    border-radius: var(--radius-md);
    color: var(--color-bg);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.post-subscribe-btn:hover {
    background: var(--color-gold);
    transform: translateY(-1px);
}

.post-subscribe-rss {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0;
}

.post-subscribe-rss a {
    color: var(--color-rust);
    text-decoration: none;
}

.post-subscribe-rss a:hover {
    color: var(--color-gold);
}

/* Newsletter CTA section */
.newsletter-cta {
    background: rgba(255, 255, 255, 0.03);
    margin: var(--space-xl) calc(-1 * var(--space-xl)) 0;
    padding: var(--space-xl);
    text-align: center;
    border-radius: var(--radius-lg);
}

.newsletter-pitch {
    font-size: 1.15rem;
    color: var(--color-text);
    max-width: 500px;
    margin: 0 auto var(--space-lg);
    line-height: 1.6;
}

.newsletter-form {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
}

.newsletter-input {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    width: 240px;
}

.newsletter-input::placeholder {
    color: var(--color-text-muted);
}

.newsletter-input:focus {
    outline: 2px solid var(--color-rust);
    outline-offset: 2px;
    border-color: var(--color-rust);
}

.newsletter-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 700;
    background: var(--color-rust);
    border: none;
    border-radius: var(--radius-md);
    color: var(--color-bg);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.newsletter-btn:hover {
    background: var(--color-gold);
    transform: translateY(-1px);
}

.newsletter-rss {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: 0;
}

.newsletter-rss a {
    color: var(--color-rust);
    text-decoration: none;
}

.newsletter-rss a:hover {
    color: var(--color-gold);
}

/* Post footer */
.post-footer {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
}


/* Tag archive pages */
.tag-posts {
    max-width: var(--measure);
}

.tag-post-item {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.tag-post-item:last-child {
    border-bottom: none;
}

.tag-post-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.tag-post-title a {
    color: var(--color-text);
    text-decoration: none;
}

.tag-post-title a:hover {
    color: var(--color-rust);
}

.tag-post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.tag-post-date {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.tag-post-description {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.blog-header {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.blog-post-title a,
.blog-post-title a:link,
.blog-post-title a:visited {
    color: var(--color-text);
    text-decoration: none;
}

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

.blog-post-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.3;
    margin-bottom: var(--space-sm);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-xs);
}

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

/* Post list items */
.post-item {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-border);
}

.post-item:last-child {
    border-bottom: none;
}

.post-item-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.post-item-title a {
    color: var(--color-text);
    text-decoration: none;
}

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

.post-item-date {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Library / Reading Page */
.reading-page {
    max-width: var(--measure);
}

/* Library Toggle - segmented control style */
.library-toggle {
    display: flex;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 0 auto var(--space-lg);
    width: fit-content;
}

.toggle-btn {
    background: transparent;
    border: none;
    padding: 0.6rem 1.25rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.toggle-btn:first-child {
    border-right: 1px solid var(--color-border);
}

.toggle-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-text);
}

.toggle-btn.active {
    background: var(--color-sage);
    color: var(--color-bg);
}

/* Stats row */
.library-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-bg-elevated);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Static book cards (wishlist - no click behavior) */
.book-card-static {
    text-align: left;
}

.book-card-static .book-cover {
    position: relative;
    aspect-ratio: 2/3;
    margin-bottom: var(--space-xs);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-bg-elevated);
}

.book-card-static .book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Book reason tag */
.book-reason {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.85);
    color: var(--color-sage);
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
    text-align: center;
    text-transform: lowercase;
}

/* Library sections */
.library-section {
    margin-bottom: var(--space-lg);
}

.library-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-md);
}

/* Currently Reading */
.currently-reading {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    align-items: flex-start;
}

.currently-reading .book-card {
    width: 150px;
}

.currently-reading .book-cover {
    aspect-ratio: 2/3;
    margin-bottom: var(--space-xs);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: transform 0.2s;
}

.currently-reading .book-card:hover .book-cover {
    transform: scale(1.03);
}

.currently-reading .book-info {
    text-align: center;
}

.currently-reading .book-title {
    font-size: 0.85rem;
    font-weight: 600;
    display: block;
    line-height: 1.3;
}

.currently-reading .book-author {
    font-size: 0.8rem;
    display: block;
}

/* Recommendations */
.recommendations-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.recommendation {
    display: flex;
    gap: var(--space-lg);
    align-items: flex-start;
    background: transparent;
    border: none;
    padding: 0;
    text-align: left;
    cursor: pointer;
    width: 100%;
    font-family: inherit;
}

.recommendation-cover {
    width: 100px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: transform 0.2s;
}

.recommendation:hover .recommendation-cover {
    transform: scale(1.03);
}

.recommendation-cover img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.recommendation-content {
    flex: 1;
}

.recommendation-title {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 2px 0;
}

.recommendation-author {
    display: block;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: 0 0 var(--space-sm) 0;
}

.recommendation-blurb {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text);
    margin: 0;
}

/* Finished section */
.reading-section {
    margin-bottom: var(--space-lg);
}

.reading-section h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-md);
}

.reading-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.filter-btn.active {
    background: var(--color-rust);
    border-color: var(--color-rust);
    color: var(--color-bg);
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: var(--space-sm) var(--space-md);
    align-items: start;
}

.book-card {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    transition: transform 0.2s ease;
}

.book-card:hover {
    transform: translateY(-2px);
}

.book-card.hidden {
    display: none;
}

.book-cover {
    position: relative;
    aspect-ratio: 2/3;
    margin-bottom: var(--space-xs);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-bg-elevated);
}

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

.book-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--color-text-muted);
    background: var(--color-bg-elevated);
}

.book-rating {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.8);
    color: var(--color-gold);
    font-size: 0.7rem;
    padding: 0.25rem;
    text-align: center;
    letter-spacing: 1px;
}

.half-star {
    clip-path: inset(0 50% 0 0);
    margin-right: -0.35em;
}

.book-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.book-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.book-cover.abandoned {
    opacity: 0.5;
}

/* Book Modal */
.book-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.book-modal.active {
    display: flex;
}

.book-modal-content {
    background: var(--color-bg-elevated);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    padding: var(--space-lg);
    position: relative;
    display: flex;
    gap: var(--space-lg);
}

.book-modal-close {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.book-modal-close:hover {
    color: var(--color-text);
}

.book-modal-cover {
    width: 120px;
    flex-shrink: 0;
}

.book-modal-cover img {
    width: 100%;
    border-radius: var(--radius-sm);
}

.book-modal-info {
    flex: 1;
}

.book-modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.book-modal-author {
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
}

.book-modal-rating {
    color: var(--color-gold);
    margin-bottom: var(--space-sm);
}

.book-modal-meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
}

.book-modal-meta span {
    display: block;
}

.book-modal-notes {
    font-size: 0.9rem;
    color: var(--color-text);
    font-style: italic;
}

/* 404 page */
.error-page {
    text-align: center;
    padding: var(--space-xl) 0;
}

.error-code {
    font-size: 6rem;
    font-weight: 700;
    color: var(--color-rust);
    line-height: 1;
    margin-bottom: var(--space-sm);
}

.error-message {
    font-size: 1.3rem;
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

.error-suggestion {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
}

.error-nav {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
}

.error-nav a {
    color: var(--color-sage);
    text-decoration: none;
    font-weight: 600;
}

.error-nav a:hover {
    color: var(--color-gold);
}

/* AI project card (no screenshot) */
.project-ai-full {
    max-width: 100%;
}

/* AI Page */
.ai-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
}

.ai-filter-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-filter-btn:hover {
    border-color: var(--color-rust);
    color: var(--color-text);
}

.ai-filter-btn.active {
    background: var(--color-rust);
    border-color: var(--color-rust);
    color: var(--color-bg);
}

.ai-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.ai-card {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    transition: border-color 0.2s;
}

.ai-card:hover {
    border-color: rgba(240, 235, 224, 0.15);
}

.ai-card-badge {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    margin-bottom: var(--space-xs);
}

.badge-professional {
    color: var(--color-sage);
    background: rgba(93, 183, 161, 0.15);
    border: 1px solid rgba(93, 183, 161, 0.3);
}

.badge-personal {
    color: var(--color-rust);
    background: rgba(239, 100, 97, 0.15);
    border: 1px solid rgba(239, 100, 97, 0.3);
}

.ai-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-xs);
    line-height: 1.3;
}

.ai-card-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: var(--space-sm);
}

.ai-tool-badge {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-gold);
    background: rgba(228, 179, 99, 0.12);
    border: 1px solid rgba(228, 179, 99, 0.25);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.ai-card-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-muted);
}

.ai-card-desc p {
    margin: 0;
}

.ai-prompt-section {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border);
}

.ai-prompt-toggle {
    background: transparent;
    border: none;
    color: var(--color-rust);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.ai-prompt-toggle:hover {
    color: var(--color-gold);
}

.ai-prompt-content {
    margin-top: var(--space-sm);
}

.ai-prompt-text {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--color-text);
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0 0 var(--space-xs) 0;
    overflow-x: auto;
}

.ai-copy-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-family: inherit;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.ai-copy-btn:hover {
    border-color: var(--color-sage);
    color: var(--color-sage);
}

/* Work With Me page */
.work-with-me {
    max-width: var(--measure);
    margin: 0 auto;
    padding: var(--space-lg) var(--space-sm);
}

.wwm-intro {
    margin-bottom: var(--space-xl);
    font-size: 1.15rem;
    line-height: 1.7;
}

.wwm-intro p {
    margin-bottom: var(--space-sm);
}

.wwm-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-lg) 0;
}

.wwm-trust-line {
    color: var(--color-gold);
    font-size: 1.15rem;
}

.wwm-services {
    margin-bottom: var(--space-xl);
}

.wwm-services h2 {
    margin-bottom: var(--space-lg);
}

.wwm-service {
    border-left: 3px solid var(--color-border);
    padding-left: var(--space-md);
    margin-bottom: var(--space-lg);
    transition: border-color 0.2s;
}

.wwm-service:hover {
    border-left-color: var(--color-lavender);
}

.wwm-service:nth-child(2) { border-left-color: var(--color-rust); }
.wwm-service:nth-child(3) { border-left-color: var(--color-gold); }
.wwm-service:nth-child(4) { border-left-color: var(--color-sage); }
.wwm-service:nth-child(5) { border-left-color: var(--color-lavender); }

.wwm-service h3 {
    font-size: 1.15rem;
    margin-bottom: var(--space-xs);
    color: var(--color-text);
}

.wwm-service p {
    color: var(--color-text-muted);
    line-height: 1.7;
}

.wwm-about {
    margin-bottom: var(--space-xl);
}

.wwm-about h2 {
    margin-bottom: var(--space-md);
}

.wwm-about p {
    line-height: 1.7;
    margin-bottom: var(--space-sm);
}

.wwm-form {
    background: var(--color-bg-elevated);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.wwm-form h2 {
    margin-bottom: var(--space-xs);
}

.wwm-form > p {
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
}

.wwm-form-success {
    color: var(--color-sage);
    font-size: 1.15rem;
    padding: var(--space-md) 0;
}

/* Native contact form */
.wwm-native-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.wwm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.wwm-form-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.wwm-form-field label {
    color: var(--color-text);
    font-size: 0.95rem;
}

.wwm-form-field input,
.wwm-form-field textarea {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.wwm-form-field input:focus,
.wwm-form-field textarea:focus {
    border-color: var(--color-lavender);
    outline: none;
}

.wwm-form-field textarea {
    resize: vertical;
    min-height: 120px;
}

.wwm-submit-btn {
    align-self: flex-start;
    background: var(--color-rust);
    color: var(--color-text);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.7rem 2rem;
    font-family: var(--font-body);
    font-size: 1.05rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.wwm-submit-btn:hover {
    opacity: 0.85;
}

.wwm-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wwm-form-error {
    color: var(--color-rust);
    font-size: 0.95rem;
    margin: 0;
}

.wwm-lower {
    margin-bottom: var(--space-lg);
}

.wwm-lower h2 {
    margin-bottom: var(--space-sm);
}

.wwm-lower p {
    color: var(--color-text-muted);
    line-height: 1.7;
}

.wwm-lower a {
    color: var(--color-rust);
}

/* Mobile adjustments */
@media (max-width: 600px) {
    html {
        font-size: 18px;
    }

    .page {
        padding: var(--space-sm);
    }

    /* Navigation - keep all items on one row */
    .nav {
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: var(--space-xs);
    }

    .nav a:not(.nav-logo) {
        font-size: 0.9rem;
    }

    .nav-home {
        margin-right: 0;
    }

    .site-header {
        padding: var(--space-sm) 0 var(--space-md);
    }

    /* Home intro - stack vertically */
    .home-intro {
        flex-direction: column-reverse;
        gap: var(--space-md);
        text-align: center;
    }

    .intro-photo {
        width: 150px;
        height: 150px;
    }

    .intro-greeting {
        font-size: 2rem;
    }

    .intro-bio {
        font-size: 1rem;
        max-width: none;
    }

    /* Home sections - fix negative margins for mobile padding */
    .home-section:nth-child(odd) {
        margin-left: calc(-1 * var(--space-sm));
        margin-right: calc(-1 * var(--space-sm));
        padding-left: var(--space-sm);
        padding-right: var(--space-sm);
    }

    .home-section {
        padding: var(--space-md) 0;
    }

    /* Latest post */
    .latest-post-title {
        font-size: 1.4rem;
    }

    /* Section titles */
    .section-title {
        font-size: 1.25rem;
    }

    /* Blog */
    .blog-post-title {
        font-size: 1.5rem;
    }

    .blog-header {
        margin-bottom: var(--space-md);
        padding-bottom: var(--space-md);
    }

    /* Tag archive */
    .tag-post-title {
        font-size: 1.2rem;
    }

    /* Projects list */
    .project-feature {
        flex-direction: column;
        gap: var(--space-md);
    }

    .project-feature-image-link {
        width: 100%;
    }

    .project-feature-title {
        font-size: 1.3rem;
    }

    /* Homepage project list */
    .project-list {
        grid-template-columns: 1fr;
    }

    /* Library stats */
    .library-stats {
        gap: var(--space-md);
        padding: var(--space-sm) var(--space-md);
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    /* Currently reading */
    .currently-reading {
        gap: var(--space-lg);
    }

    .currently-reading .book-card {
        width: 100px;
    }

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

    .currently-reading .book-author {
        font-size: 0.75rem;
    }

    /* Recommendations */
    .recommendation {
        gap: var(--space-md);
    }

    .recommendation-cover {
        width: 80px;
    }

    .recommendation-title {
        font-size: 1rem;
    }

    .recommendation-blurb {
        font-size: 0.9rem;
    }

    /* Book grid - 2 columns on mobile */
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

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

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

    /* Book modal - stack vertically */
    .book-modal {
        padding: var(--space-sm);
        align-items: flex-start;
        overflow-y: auto;
    }

    .book-modal-content {
        flex-direction: column;
        gap: var(--space-md);
        padding: var(--space-md);
        max-height: none;
    }

    .book-modal-cover {
        width: 100px;
        margin: 0 auto;
    }

    .book-modal-info {
        text-align: center;
    }

    .book-modal-title {
        font-size: 1.1rem;
    }

    /* Timeline */
    .now-timeline {
        padding-left: var(--space-lg);
    }

    .now-marker {
        left: calc(-1 * var(--space-lg) + 2px);
    }

    .now-entry-header h2 {
        font-size: 1.2rem;
    }

    .now-entry {
        margin-bottom: var(--space-lg);
        padding-bottom: var(--space-lg);
    }

    /* Footer */
    .site-footer {
        padding: var(--space-lg) 0 var(--space-md);
    }

    .footer-nav,
    .footer-social {
        gap: var(--space-xs) var(--space-md);
    }

    /* Page headers */
    .page-title {
        font-size: 1.3rem;
    }

    .post .page-title {
        font-size: 1.8rem;
    }

    /* Post content */
    .post-content h2 {
        font-size: 1.1rem;
    }

    .post-content ul,
    .post-content ol {
        padding-left: var(--space-md);
    }

    /* Filter buttons wrap better */
    .reading-filters,
    .blog-filters {
        gap: 0.4rem;
    }

    .filter-btn {
        font-size: 0.85rem;
        padding: 0.3rem 0.65rem;
    }

    /* Tags */
    .tag {
        font-size: 0.75rem;
        padding: 0.25rem 0.55rem;
    }

    /* Newsletter CTA */
    .newsletter-cta {
        margin-left: calc(-1 * var(--space-sm));
        margin-right: calc(-1 * var(--space-sm));
        padding: var(--space-lg) var(--space-sm);
    }

    .newsletter-pitch {
        font-size: 1rem;
    }

    .newsletter-input {
        width: 100%;
    }

    .newsletter-btn {
        width: 100%;
    }

    /* Post subscribe */
    .post-subscribe {
        padding: var(--space-md);
    }

    .post-subscribe-input {
        width: 100%;
    }

    .post-subscribe-btn {
        width: 100%;
    }

    .scroll-to-top {
        bottom: var(--space-sm);
        right: var(--space-sm);
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    /* AI page */
    .ai-grid {
        grid-template-columns: 1fr;
    }

    /* Work With Me */
    .wwm-form-row {
        grid-template-columns: 1fr;
    }

    .wwm-form {
        padding: var(--space-md);
    }

    .wwm-submit-btn {
        width: 100%;
    }
}

/* Skip to content */
.skip-to-content {
    position: absolute;
    left: var(--space-sm);
    background: var(--color-rust);
    color: var(--color-bg);
    padding: 0.5rem 1rem;
    border-radius: 0 0 6px 6px;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    text-decoration: none;
    z-index: 1001;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    overflow: hidden;
    width: 1px;
    height: 1px;
    white-space: nowrap;
}

.skip-to-content:focus {
    clip: auto;
    clip-path: none;
    overflow: visible;
    width: auto;
    height: auto;
    white-space: normal;
    top: 0;
}

/* Focus-visible styles for all interactive elements */
:focus-visible {
    outline: 2px solid var(--color-rust);
    outline-offset: 2px;
}

.toggle-btn:focus-visible,
.filter-btn:focus-visible {
    outline-offset: -2px;
}

.book-card:focus-visible {
    outline-offset: 4px;
    border-radius: 4px;
}

.nav a:focus-visible {
    outline-offset: 4px;
}

/* Scroll-to-top button */
.scroll-to-top {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, color 0.2s, border-color 0.2s;
    z-index: 100;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    color: var(--color-text);
    border-color: var(--color-rust);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .color-bars span {
        transform: scaleX(1);
    }
}

/* Print styles */
@media print {
    body {
        background: #fff;
        color: #000;
        background-image: none;
    }

    .color-bars,
    .site-header,
    .site-footer,
    .scroll-to-top,
    .skip-to-content,
    .newsletter-cta,
    .post-subscribe,
    .blog-filters,
    .reading-filters,
    .library-toggle,
    .book-modal {
        display: none !important;
    }

    .page {
        max-width: none;
        padding: 0;
    }

    .main a:not([class]) {
        color: #000;
        text-decoration: underline;
    }

    .main a:not([class])::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #555;
    }

    .post-content img {
        max-width: 100%;
        break-inside: avoid;
    }

    .tag {
        border-color: #999;
        color: #000;
        background: none;
    }
}

/* Focus states for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--color-sage);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* Specific focus overrides for elements with visual hover effects */
.nav a:not(.nav-logo):focus-visible::after {
    transform: scaleX(1);
}

.nav-home:focus-visible .nav-icon {
    transform: scale(1.1);
}

.project-feature-image-link:focus-visible .project-feature-img {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.newsletter-btn:focus-visible,
.post-subscribe-btn:focus-visible {
    background: var(--color-gold);
    transform: translateY(-1px);
}

.filter-btn:focus-visible {
    border-color: var(--color-rust);
    color: var(--color-text);
}

.toggle-btn:focus-visible:not(.active) {
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-text);
}

.book-card:focus-visible {
    transform: translateY(-2px);
}

.currently-reading .book-card:focus-visible .book-cover {
    transform: scale(1.03);
}

.recommendation:focus-visible .recommendation-cover {
    transform: scale(1.03);
}

.book-modal-close:focus-visible {
    color: var(--color-text);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .color-bars span {
        transform: scaleX(1);
    }
}
