/* Reset and base styles — ink / sage / muted-tomato on ivory.
   Flat, hairline-bordered "Korean minimal" language: no gilding, no
   glass blur, decoration carried by crisp die-cut sticker shapes. */
:root {
    color-scheme: light;
    --color-deep: #1c201d;
    --color-ocean: #24372e;
    --color-sky: #4f7b67;
    --sky-rgb: 79, 123, 103;
    --color-ice: #e9eee9;
    --color-page: #faf9f6;
    /* Accent: muted tomato (site motif). Old --color-gold names kept so
       every existing usage picks up the new accent automatically. */
    --color-gold: #e2795b;
    --color-gold-soft: #f2b9a4;
    --theme-color: var(--color-ocean);
    --theme-color-rgb: 45, 74, 60;
    --color-text: var(--color-deep);
    --color-text-muted: rgba(var(--theme-color-rgb), 0.72);
    --color-muted: var(--color-text-muted);
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(23, 26, 24, 0.1);
    --card-shadow: 0 12px 28px -18px rgba(17, 22, 19, 0.22);
    --card-shadow-soft: 0 3px 14px -8px rgba(17, 22, 19, 0.1);
    --hairline: rgba(23, 26, 24, 0.08);
    --header-bg: rgba(253, 252, 250, 0.55);
    --footer-bg: rgba(36, 55, 46, 0.06);
    --surface-solid: #ffffff;
    --surface-raised: var(--color-ice);
    --surface-inset: rgba(255, 255, 255, 0.38);
    --pre-border: rgba(23, 26, 24, 0.45);
    --accent-hover-border: rgba(226, 121, 91, 0.45);
    /* Text sitting on a theme-coloured fill (skip link, active pills). */
    --on-theme: #fff;
    --thread-track: rgba(28, 32, 29, 0.09);
    --veil-bg:
        radial-gradient(44% 36% at 16% 6%, rgba(79, 123, 103, 0.34), transparent 68%),
        radial-gradient(50% 40% at 62% -4%, rgba(146, 168, 199, 0.3), transparent 70%),
        radial-gradient(36% 30% at 88% 16%, rgba(226, 121, 91, 0.17), transparent 70%),
        radial-gradient(40% 34% at 30% 96%, rgba(146, 168, 199, 0.17), transparent 74%),
        radial-gradient(34% 28% at 82% 88%, rgba(79, 123, 103, 0.15), transparent 72%);
    --aura-bg: radial-gradient(closest-side,
        rgba(79, 123, 103, 0.11),
        rgba(146, 168, 199, 0.07) 45%,
        transparent 72%);
}

/* ── Dark theme — the same ink / sage / muted-tomato language after
   nightfall: ivory becomes deep pine ink, the sage lifts to carry the
   text, tomato stays as the single warm ember. Opt-in only (lightbulb
   toggle); the site always wakes up in daylight. */
html[data-theme="dark"] {
    color-scheme: dark;
    --color-deep: #e8ebe5;
    --color-ocean: #a7c3b1;
    --color-sky: #7fae95;
    --sky-rgb: 127, 174, 149;
    --color-page: #131714;
    --color-gold: #e8886a;
    --theme-color: var(--color-ocean);
    --theme-color-rgb: 167, 195, 177;
    --glass-bg: rgba(31, 37, 33, 0.66);
    --glass-border: rgba(233, 238, 233, 0.1);
    --card-shadow: 0 12px 28px -18px rgba(0, 0, 0, 0.65);
    --card-shadow-soft: 0 3px 14px -8px rgba(0, 0, 0, 0.5);
    --hairline: rgba(233, 238, 233, 0.09);
    --header-bg: rgba(17, 21, 18, 0.55);
    --footer-bg: rgba(233, 238, 233, 0.04);
    --surface-solid: #1c221e;
    --surface-raised: #1f2521;
    --surface-inset: rgba(255, 255, 255, 0.05);
    --pre-border: rgba(233, 238, 233, 0.2);
    --on-theme: #131714;
    --thread-track: rgba(233, 238, 233, 0.1);
    --veil-bg:
        radial-gradient(44% 36% at 16% 6%, rgba(96, 150, 125, 0.2), transparent 68%),
        radial-gradient(50% 40% at 62% -4%, rgba(108, 130, 168, 0.16), transparent 70%),
        radial-gradient(36% 30% at 88% 16%, rgba(226, 121, 91, 0.12), transparent 70%),
        radial-gradient(40% 34% at 30% 96%, rgba(108, 130, 168, 0.09), transparent 74%),
        radial-gradient(34% 28% at 82% 88%, rgba(96, 150, 125, 0.11), transparent 72%);
    /* At night the cursor trails a warm tomato ember instead of sage. */
    --aura-bg: radial-gradient(closest-side,
        rgba(232, 136, 106, 0.1),
        rgba(226, 121, 91, 0.05) 45%,
        transparent 72%);
}

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

::selection {
    background: rgba(var(--theme-color-rgb), 0.4);
    color: #fff;
}

.skip-link {
    position: absolute;
    top: -120px;
    left: 16px;
    z-index: 10000;
    padding: 12px 20px;
    background: var(--color-ocean);
    color: var(--on-theme);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 8px;
    text-decoration: none;
    transition: top 0.2s ease, box-shadow 0.2s ease;
}

.skip-link:focus {
    top: 16px;
    outline: 2px solid var(--color-ice);
    outline-offset: 3px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-sky);
    outline-offset: 3px;
}

.site-title-link {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease, color 0.2s ease;
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
}

.site-title-link:hover {
    opacity: 0.9;
}

.site-title-logo {
    width: 1.4em;
    height: 1.4em;
    align-self: center;
    flex-shrink: 0;
    transform: translateY(-0.08em);
}

/* Text wrapping utilities */
.text-wrap {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.text-nowrap {
    white-space: nowrap;
}

.text-pre {
    white-space: pre;
}

.text-pre-wrap {
    white-space: pre-wrap;
}

.text-pre-line {
    white-space: pre-line;
}

/* Personal info styling */
.personal-info {
    margin: 2rem 0;
    padding: 3rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.personal-info:hover {
    transform: scale(1.01);
}

.personal-info p {
    color: var(--color-text);
    font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-align: center;
    font-size: 0.88em;
    letter-spacing: 0.02em;
    line-height: 2.3;
    white-space: pre-line;
    margin: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-page);
    font-size: 16px;
}

/* ── Atmospheric veil ─────────────────────────────────────────────
   The site's single visual gesture: a soft field of out-of-focus
   colour (sage / mist blue / faint blush) drifting very slowly behind
   everything. Deliberately ambiguous — it should read as weather, not
   as a graphic. All other surfaces stay quiet so this carries the
   mood alone. */
body::before {
    content: "";
    position: fixed;
    inset: -18% -12%;
    z-index: -2;
    pointer-events: none;
    background: var(--veil-bg);
    filter: blur(24px) saturate(120%);
    animation: veilDrift 52s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes veilDrift {
    from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
    to   { transform: translate3d(1.5%, 1.5%, 0) scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
    body::before {
        animation: none;
    }
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header — flat ivory band with a single hairline. Shared by the
   home/site header and the article (post-detail) header. */
.header,
.article-header {
    position: relative;
    isolation: isolate;
    background: var(--header-bg);
    border-bottom: 1px solid var(--hairline);
}

.header {
    padding: 3.25rem 0 2.75rem;
    margin-bottom: 4rem;
}

.header .container {
    position: relative;
}


.site-title {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-size: 3.1rem;
    font-weight: 500;
    color: var(--color-ocean);
    margin-bottom: 0.4rem;
    letter-spacing: 0.005em;
    line-height: 1.1;
}

.site-description {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 1.3rem;
    color: rgba(var(--theme-color-rgb), 0.66);
    margin-bottom: 1.6rem;
    line-height: 1.5;
    letter-spacing: 0.01em;
}

/* Self-proof tagline: clickable, and it flits up and back on each swap. */
.site-description.is-tease-tagline {
    display: inline-block;
    cursor: pointer;
    transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
}

.site-description.is-tease-tagline:hover {
    color: rgba(var(--theme-color-rgb), 0.85);
}

.site-description.is-swapping {
    opacity: 0;
    transform: translateY(-4px);
}

@media (prefers-reduced-motion: reduce) {
    .site-description.is-tease-tagline {
        transition: color 0.2s ease;
    }

    .site-description.is-swapping {
        opacity: 1;
        transform: none;
    }
}

.nav {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--color-ocean);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--theme-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--color-gold);
    transition: width 0.25s ease;
}

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link--current::after {
    width: 100%;
}

.nav-link--current {
    color: var(--theme-color);
}

/* Main content */
.main {
    margin-bottom: 4rem;
}

.section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--theme-color);
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
}

.page-hero-title {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 600;
    color: var(--theme-color);
    margin-bottom: 2rem;
    letter-spacing: -0.03em;
    font-variation-settings: 'opsz' 72;
}

/* Article layout */
.article-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2.5rem 0 2rem;
}

.author-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.author-logo {
    width: 40px;
    height: 40px;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.author-name {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--color-ocean);
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-style: italic;
}

.author-logo a {
    transition: opacity 0.2s ease;
}

.author-logo a:hover {
    opacity: 0.8;
}

.author-name a {
    transition: color 0.2s ease;
}

.author-name a:hover {
    color: var(--theme-color);
}

.article-title {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--theme-color);
    margin-bottom: 1rem;
    line-height: 1.1;
    font-variation-settings: 'opsz' 72;
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(var(--theme-color-rgb), 0.75);
    font-style: italic;
    margin-bottom: 1.5rem;
}

.article-header .post-meta {
    justify-content: center;
    gap: 1rem;
    font-size: 0.9rem;
}

.post-meta-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-ocean);
}

.post-meta-row .post-date {
    display: inline-flex;
    align-items: center;
    line-height: 1.4;
}

.post-meta-row .language-switcher {
    flex-shrink: 0;
}

.article-content {
    max-width: 800px;
    margin: 0 auto;
    /* Left gutter for 🍅 anchors (positioned at left: -1.75rem on headings). */
    padding: 0 1rem 0 2.25rem;
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--color-text);
    overflow: visible;
}

.article-content h2 {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-size: 1.9rem;
    font-weight: 600;
    color: var(--theme-color);
    margin: 2.5rem 0 1rem 0;
    padding-top: 1rem;
    position: relative;
}

.article-content h3 {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-size: 1.55rem;
    font-weight: 600;
    color: var(--theme-color);
    margin: 2rem 0 1rem 0;
    position: relative;
}

.article-content h4 {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--theme-color);
    margin: 1.8rem 0 0.9rem 0;
    position: relative;
}

.article-content h5 {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--theme-color);
    margin: 1.6rem 0 0.8rem 0;
    position: relative;
}

.article-content .anchor,
.article-content.markdown-content .anchor {
    position: absolute;
    left: -1.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    font-weight: 400;
    color: rgba(var(--theme-color-rgb), 0.6);
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.article-content h2:hover .anchor,
.article-content h3:hover .anchor,
.article-content h4:hover .anchor,
.article-content h5:hover .anchor,
.article-content .anchor:focus,
.article-content h2:focus-within .anchor,
.article-content h3:focus-within .anchor,
.article-content h4:focus-within .anchor,
.article-content h5:focus-within .anchor,
.article-content.markdown-content h2:hover .anchor,
.article-content.markdown-content h3:hover .anchor,
.article-content.markdown-content h4:hover .anchor,
.article-content.markdown-content h5:hover .anchor,
.article-content.markdown-content .anchor:focus,
.article-content.markdown-content h2:focus-within .anchor,
.article-content.markdown-content h3:focus-within .anchor,
.article-content.markdown-content h4:focus-within .anchor,
.article-content.markdown-content h5:focus-within .anchor {
    opacity: 1;
    color: var(--color-ocean);
}

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

.article-content code {
    background: rgba(var(--theme-color-rgb), 0.12);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: var(--theme-color);
}

.article-content pre {
    border: 1px solid var(--pre-border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    line-height: 1.65;
    box-shadow: var(--card-shadow-soft);
    -webkit-overflow-scrolling: touch;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    tab-size: 4;
}

.article-content blockquote {
    border-left: 4px solid var(--color-ocean);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--color-ocean);
}

.article-content ul,
.article-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.article-content li {
    margin: 0.5rem 0;
}

/* About section */
.about-content p {
    margin-bottom: 1rem;
    color: var(--color-text);
    font-size: 1.125rem;
    line-height: 1.7;
}

.tech-stack {
    margin: 0.5rem 0 2.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
}

.tech-stack .tech-stack-list {
    margin: 0;
    padding: 1.75rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow-soft);
}

.tech-stack-list {
    margin: 0;
    padding: 0;
}

.tech-stack-list > div {
    margin-bottom: 1rem;
}

.tech-stack-list > div:last-child {
    margin-bottom: 0;
}

.tech-stack-list dt {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-ocean);
    margin: 0 0 0.35rem 0;
}

.tech-stack-list dd {
    margin: 0;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--color-text);
}

@media (min-width: 560px) {
    .tech-stack-list > div {
        display: grid;
        grid-template-columns: minmax(10rem, 12.5rem) 1fr;
        gap: 0.35rem 1.25rem;
        align-items: baseline;
        margin-bottom: 0.85rem;
    }

    .tech-stack-list > div:last-child {
        margin-bottom: 0;
    }

    .tech-stack-list dt {
        margin-bottom: 0;
    }
}

/* Blog posts */
.blog-posts {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.blog-post {
    background: var(--glass-bg);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid var(--hairline);
    border-radius: 1.25rem;
    padding: 2rem;
    margin-bottom: 1rem;
    box-shadow: var(--card-shadow-soft);
    transition: all 0.3s ease;
}

.blog-post:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow);
    border-color: var(--accent-hover-border);
}

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

.post-title a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-title a:hover {
    color: var(--theme-color);
    text-decoration: underline dotted;
    text-decoration-thickness: 3px;
    text-underline-offset: 4px;
    text-decoration-color: rgba(var(--theme-color-rgb), 0.55);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--color-ocean);
    flex-wrap: wrap;
}

.article-header .post-meta {
    margin-bottom: 0;
    justify-content: center;
}

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

.tag {
    background: rgba(var(--sky-rgb), 0.08);
    color: var(--color-ocean);
    padding: 0.32rem 0.9rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid rgba(var(--sky-rgb), 0.22);
    transition: all 0.2s ease;
}

.tag:hover {
    background: rgba(var(--sky-rgb), 0.14);
    color: var(--color-ocean);
}

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

.blog-footer {
    display: flex;
    align-items: center;
    gap: 1rem 2rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(var(--theme-color-rgb), 0.18);
    flex-wrap: wrap;
}

/* Dotted underline text links (blog footer, author nav); solid on hover */
.text-link-dotted {
    color: var(--theme-color);
    text-decoration-line: underline;
    text-decoration-color: var(--theme-color);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.2em;
    text-decoration-skip-ink: auto;
    text-decoration-style: dotted;
    font-weight: 500;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.text-link-dotted:hover {
    text-decoration-style: solid;
    color: var(--theme-color);
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--hairline);
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: var(--card-shadow-soft);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow);
    border-color: var(--accent-hover-border);
}

.project-title {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-size: 1.55rem;
    font-weight: 600;
    color: var(--theme-color);
    margin-bottom: 0.75rem;
}

.project-description {
    color: var(--color-text);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.project-link {
    color: var(--theme-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.project-link:hover {
    color: rgba(var(--theme-color-rgb), 0.75);
}

/* Footer */
.footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--hairline);
    padding: 2rem 0;
    margin-top: 4rem;
    /* Anchor (and horizontally clip) the rare footer-cat walk-by. */
    position: relative;
    overflow-x: clip;
    overflow-y: visible;
}

/* Rare easter egg: a tiny pixel cat strolling along the footer's top border.
   It ignores everyone (pointer-events: none), just like a real cat. */
.footer-cat {
    position: absolute;
    left: 0;
    z-index: 3;
    pointer-events: none;
    color: var(--color-deep);
    will-change: transform;
}

.footer-cat-sprite {
    /* Pixel size is set from script.js (CAT_WALK_PIXEL_PX). */
    background: transparent;
}

/* Homepage side decorative monstera near the footer zone. */
.plant-fact-drop {
    position: fixed;
    z-index: 10004;
    max-width: min(460px, calc(100vw - 32px));
    padding: 0.78rem 0.96rem;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: var(--surface-solid);
    color: var(--color-ocean);
    font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.85rem;
    line-height: 1.5;
    letter-spacing: 0.01em;
    -webkit-backdrop-filter: blur(8px) saturate(112%);
    backdrop-filter: blur(8px) saturate(112%);
    box-shadow:
        0 10px 26px rgba(17, 22, 19, 0.12),
        inset 0 0 0 1px var(--surface-inset);
    transform: translate(-50%, -11px) scale(0.992);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.42s ease;
}

.plant-fact-drop.show {
    opacity: 1;
    transform: translate(-50%, 2px) scale(1);
}

.plant-fact-drop.hide {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.992);
}

body.page-has-signoff .footer {
    margin-top: 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-content p {
    color: var(--color-ocean);
    font-size: 0.875rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.social-link {
    color: var(--color-ocean);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.social-link:hover {
    color: var(--color-sky);
}

/* Author sign-off below page copy, above site footer bar (blog / some words) */
.main-author-signoff {
    max-width: 800px;
    margin: 0 auto;
    padding: 2.75rem 1rem 3.25rem;
    text-align: center;
}

.main-author-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.main-author-photo-link {
    flex-shrink: 0;
    border-radius: 50%;
    line-height: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.main-author-photo-link:hover {
    opacity: 0.92;
    transform: scale(1.03);
}

.main-author-photo-link:focus-visible {
    outline: 2px solid var(--color-sky);
    outline-offset: 4px;
}

.main-author-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 40%;
    border: 2px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 6px 24px -12px rgba(17, 22, 19, 0.45);
    display: block;
}

.main-author-text {
    max-width: 34rem;
}

.main-author-greeting {
    font-weight: 600;
    color: var(--theme-color);
}

.main-author-line {
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--color-deep);
    margin: 0 0 0.5rem;
}

.main-author-line a {
    color: var(--color-ocean);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--theme-color-rgb), 0.28);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.main-author-line a:hover {
    color: var(--theme-color);
    border-bottom-color: rgba(var(--theme-color-rgb), 0.45);
}

.main-author-bio {
    font-size: 0.92rem;
    line-height: 1.65;
    color: rgba(var(--theme-color-rgb), 0.82);
    margin: 0 0 0.85rem;
}

.main-author-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.main-author-nav a:not(.text-link-dotted) {
    color: var(--color-ocean);
    text-decoration: none;
    transition: color 0.2s ease;
}

.main-author-nav a:not(.text-link-dotted):hover {
    color: var(--color-sky);
}

.main-author-nav-sep {
    color: rgba(var(--theme-color-rgb), 0.35);
    user-select: none;
}

.plain-link {
    text-decoration: none;
    color: inherit;
}

.plain-link:hover {
    color: var(--theme-color);
}

/* Copy feedback toast (sits below the theme-toggle bulb) */
.copy-message {
    position: fixed;
    top: 72px;
    right: 20px;
    background: var(--color-ocean);
    color: var(--on-theme);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    max-width: min(340px, calc(100vw - 40px));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.copy-message.show {
    opacity: 1;
    transform: translateX(0);
}

.copy-message.hide {
    opacity: 0;
    transform: translateX(100%);
}

/* Contact modal */
.contact-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contact-overlay.show {
    opacity: 1;
}

.contact-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: var(--surface-raised);
    color: var(--color-deep);
    padding: 1.5rem 2rem;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 400;
    box-shadow: 0 20px 40px rgba(var(--theme-color-rgb), 0.2), 0 0 0 1px rgba(var(--theme-color-rgb), 0.12);
    z-index: 1000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 320px;
    text-align: center;
    border: 1px solid rgba(var(--theme-color-rgb), 0.25);
}

.contact-message.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.contact-message.hide {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.85);
}

.contact-content {
    position: relative;
}

.contact-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--color-ocean);
    animation: gentleFloat 3s ease-in-out infinite;
}

.contact-text {
    line-height: 1.5;
}

.contact-text h3 {
    margin: 0 0 0.75rem 0;
    color: var(--color-ocean);
    font-size: 1.2rem;
    font-weight: 500;
}

.contact-text p {
    margin: 0;
    color: var(--color-deep);
    font-size: 0.9rem;
    font-style: italic;
}

@keyframes gentleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Easter egg overlay */
.easter-egg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

.easter-egg.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.easter-egg.hide {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.85);
}

.easter-egg-content {
    position: relative;
    text-align: center;
}

.easter-egg-text {
    font-size: 80px;
    font-weight: bold;
    color: var(--color-ice);
    text-shadow: 0 0 10px rgba(var(--theme-color-rgb), 0.4),
                 0 0 20px rgba(var(--theme-color-rgb), 0.25),
                 0 0 30px rgba(var(--theme-color-rgb), 0.15),
                 2px 2px 4px rgba(0, 0, 0, 0.25);
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--color-ocean), var(--color-sky), var(--color-ocean));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: easterEggBounce 1.5s ease-in-out infinite alternate, gradientShift 3s ease-in-out infinite;
}

.easter-egg-ribbons {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    pointer-events: none;
}

.ribbon {
    position: absolute;
    width: 3px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-ocean), var(--color-sky));
    border-radius: 2px;
    animation: ribbonDance 2s ease-in-out infinite;
    opacity: 0.7;
}

.ribbon-1 { top: 20px; left: 30px; animation-delay: 0s; }
.ribbon-2 { top: 40px; left: 60px; animation-delay: 0.4s; }
.ribbon-3 { top: 60px; left: 90px; animation-delay: 0.8s; }
.ribbon-4 { top: 80px; left: 120px; animation-delay: 1.2s; }

.easter-egg-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    font-size: 20px;
    animation: sparkleFloat 2.5s ease-in-out infinite;
    opacity: 0.8;
    color: var(--color-ice);
}

.sparkle-1 { top: 25%; left: 25%; animation-delay: 0s; }
.sparkle-2 { top: 35%; right: 25%; animation-delay: 0.6s; }
.sparkle-3 { bottom: 35%; left: 35%; animation-delay: 1.2s; }
.sparkle-4 { bottom: 25%; right: 35%; animation-delay: 1.8s; }

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

@keyframes easterEggBounce {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-10px) scale(1.05); }
}

@keyframes ribbonDance {
    0%, 100% { transform: rotate(0deg) scaleY(1); }
    50% { transform: rotate(10deg) scaleY(1.2); }
}

@keyframes sparkleFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-20px) rotate(180deg) scale(1.2);
        opacity: 1;
    }
}

/* Vim-style secret command toast (editor easter egg) */
.vim-secret-toast {
    position: fixed;
    left: 50%;
    bottom: max(20px, env(safe-area-inset-bottom, 0px));
    z-index: 10001;
    max-width: min(420px, calc(100vw - 32px));
    padding: 14px 18px 16px;
    border-radius: 10px;
    font-family: ui-monospace, 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #b8e0b0;
    background:
        linear-gradient(145deg, rgba(18, 28, 22, 0.97) 0%, rgba(10, 14, 12, 0.98) 100%);
    border: 1px solid rgba(94, 152, 112, 0.35);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.35),
        0 18px 50px -24px rgba(0, 0, 0, 0.65),
        0 0 40px -12px rgba(79, 123, 103, 0.2);
    opacity: 0;
    transform: translate(-50%, 14px) scale(0.98);
    transition:
        opacity 0.38s ease,
        transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.vim-secret-toast.show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.vim-secret-toast.hide {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.98);
    transition-duration: 0.32s;
}

.vim-secret-chrome {
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(184, 224, 176, 0.55);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(94, 152, 112, 0.22);
    padding-bottom: 0.4rem;
}

.vim-secret-body {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    color: #c8ecc0;
    text-shadow: 0 0 24px rgba(79, 123, 103, 0.25);
}

@media (prefers-reduced-motion: reduce) {
    .vim-secret-toast {
        transition-duration: 0.05ms;
        transition-delay: 0s !important;
    }

    .vim-secret-toast.hide {
        transition-duration: 0.05ms;
    }
}

/* Lualine-flavoured statusline, summoned with `:set`. */
.vim-statusline {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: stretch;
    height: 26px;
    font-family: ui-monospace, 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 0.72rem;
    line-height: 26px;
    color: #b8e0b0;
    background: linear-gradient(180deg, rgba(16, 26, 20, 0.96) 0%, rgba(10, 14, 12, 0.97) 100%);
    border-top: 1px solid rgba(94, 152, 112, 0.3);
    box-shadow: 0 -10px 30px -18px rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transform: translateY(110%);
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    user-select: none;
}

.vim-statusline.show {
    transform: translateY(0);
}

.vim-sl-mode {
    padding: 0 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #0a0e0c;
    background: #8fd49a;
    transition: background 0.2s ease;
}

.vim-sl-mode[data-mode="command"] {
    background: #e6c07b;
}

.vim-sl-mode[data-mode="insert"] {
    background: #7fd6e0;
}

.vim-sl-file {
    padding: 0 12px;
    max-width: 50vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(200, 236, 192, 0.92);
    background: rgba(94, 152, 112, 0.16);
}

.vim-sl-spacer {
    flex: 1 1 auto;
}

.vim-sl-seg {
    padding: 0 10px;
    color: rgba(184, 224, 176, 0.62);
    border-left: 1px solid rgba(94, 152, 112, 0.18);
}

.vim-sl-pos {
    padding: 0 12px;
    min-width: 3.5em;
    text-align: center;
    font-weight: 600;
    color: #0a0e0c;
    background: #8fd49a;
}

@media (max-width: 520px) {
    .vim-sl-branch,
    .vim-sl-ff {
        display: none;
    }
    .vim-sl-file {
        max-width: 42vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vim-statusline {
        transition: none;
    }
}

/* `:wq` — the page pretends to save: one soft green flash around the viewport edge. */
.vim-save-flash {
    position: fixed;
    inset: 0;
    z-index: 10002;
    pointer-events: none;
    opacity: 0;
    box-shadow:
        inset 0 0 0 2px rgba(143, 212, 154, 0.9),
        inset 0 0 42px rgba(143, 212, 154, 0.35);
}

.vim-save-flash.run {
    animation: vim-save-flash 0.55s ease-out 1;
}

@keyframes vim-save-flash {
    0% {
        opacity: 0;
    }
    18% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vim-save-flash.run {
        animation: none;
    }
}

/* Type "tomato" → a soft 🍅 shower from the top of the viewport. */
.tomato-rain-layer {
    position: fixed;
    inset: 0;
    z-index: 10003;
    pointer-events: none;
    overflow: hidden;
}

.tomato-rain-drop {
    position: absolute;
    top: -8vh;
    left: var(--x);
    font-size: var(--size);
    line-height: 1;
    opacity: 0;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.32));
    animation: tomatoRainFall var(--fall) cubic-bezier(0.36, 0.02, 0.56, 1) var(--delay) forwards;
    will-change: transform, opacity;
}

@keyframes tomatoRainFall {
    0% {
        transform: translate3d(0, -10vh, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: var(--opacity);
    }
    90% {
        opacity: var(--opacity);
    }
    100% {
        transform: translate3d(var(--drift), 112vh, 0) rotate(var(--rot));
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tomato-rain-layer {
        display: none;
    }
}

/* Offer-style full-screen confetti — photos.html after ?party=1 */
.photo-confetti-layer {
    position: fixed;
    inset: 0;
    z-index: 10002;
    pointer-events: none;
    overflow: hidden;
}

.photo-confetti-burst-root {
    position: absolute;
    width: 0;
    height: 0;
    transform: translate(-50%, -50%);
}

.photo-confetti-burst-streamer,
.photo-confetti-burst-rect,
.photo-confetti-burst-dot {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--w);
    height: var(--h);
    margin-left: calc(var(--w) / -2);
    margin-top: calc(var(--h) / -2);
    border-radius: var(--br, 2px);
    opacity: 0;
    will-change: transform, opacity;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        0 5px 18px rgba(0, 0, 0, 0.16);
    animation: photoConfettiBurst var(--dur, 1.25s) var(--delay, 0s) cubic-bezier(0.2, 0.88, 0.34, 1) forwards;
}

.photo-confetti-rain-bit,
.photo-confetti-rain-streamer {
    position: absolute;
    width: var(--rw);
    height: var(--rh);
    margin-left: calc(var(--rw) / -2);
    border-radius: 2px;
    opacity: 0;
    will-change: transform, opacity;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.26),
        0 3px 12px rgba(0, 0, 0, 0.12);
    animation: photoConfettiRain var(--fall, 2.9s) linear var(--delay, 0s) forwards;
}

.photo-confetti-rain-streamer {
    border-radius: 3px;
}

@keyframes photoConfettiBurst {
    0% {
        opacity: 0;
        transform: translate(0, 0) rotate(var(--rot, 0deg)) scale(0.1);
    }
    11% {
        opacity: 1;
        transform: translate(calc(var(--dx) * 0.09), calc(var(--dy) * 0.07)) rotate(var(--rot, 0deg)) scale(1.06);
    }
    72% {
        opacity: 0.94;
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(calc(var(--rot, 0deg) + var(--spin, 400deg))) scale(0.78);
    }
}

@keyframes photoConfettiRain {
    0% {
        opacity: 0;
        transform: translateY(-8vh) translateX(0) rotate(0deg);
    }
    4% {
        opacity: 1;
    }
    90% {
        opacity: 0.9;
    }
    100% {
        opacity: 0;
        transform: translateY(112vh) translateX(var(--drift, 0px)) rotate(var(--endrot, 720deg));
    }
}

@media (prefers-reduced-motion: reduce) {
    .photo-confetti-layer {
        display: none !important;
    }
}

/* Scroll Reveal */
.reveal-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

.blog-post.reveal-hidden {
    transform: translateX(-20px);
}

.blog-post.reveal-visible {
    transform: translateX(0);
}

.project-card.reveal-hidden {
    transform: scale(0.95);
}

.project-card.reveal-visible {
    transform: scale(1);
}
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header {
        padding: 1.5rem 0;
        margin-bottom: 2rem;
    }
    
    .site-title {
        font-size: 2rem;
    }
    
    .site-description {
        font-size: 1rem;
    }
    
    .article-title {
        font-size: 2.2rem;
    }

    .author-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .author-logo {
        width: 32px;
        height: 32px;
    }

    .author-name {
        font-size: 1rem;
    }

    .article-content {
        font-size: 1rem;
    }

    .article-content h2 {
        font-size: 1.5rem;
    }

    .article-header .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav {
        gap: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .post-title {
        font-size: 1.25rem;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .blog-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .main-author-photo {
        width: 68px;
        height: 68px;
    }

    .main-author-signoff {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    
    .social-links {
        gap: 1rem;
    }

    .easter-egg-text {
        font-size: 80px;
    }
    
    .easter-egg-ribbons {
        width: 150px;
        height: 150px;
    }
    
    .ribbon {
        height: 40px;
    }
    
    .sparkle {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.75rem;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .nav-link {
        font-size: 0.875rem;
    }
    
    .section {
        margin-bottom: 3rem;
    }
    
    .blog-post {
        padding-bottom: 2rem;
    }
}

.language-switcher {
    display: flex;
    margin: 0;
}

.language-switcher--inline {
    justify-content: flex-end;
}

.language-switcher--inline .lang-toggle {
    background: transparent;
    border: 1px solid rgba(var(--theme-color-rgb), 0.18);
    box-shadow: none;
    padding: 0.1rem;
    gap: 0.1rem;
}

.language-switcher--inline .lang-btn {
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 0.28rem 0.5rem;
    color: rgba(var(--theme-color-rgb), 0.58);
}

.language-switcher--inline .lang-btn[aria-pressed="true"] {
    background: rgba(var(--theme-color-rgb), 0.12);
    color: var(--theme-color);
}

.language-switcher--inline .lang-btn:hover {
    color: var(--theme-color);
}

.lang-toggle {
    display: inline-flex;
    gap: 0.35rem;
    padding: 0.35rem;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    border-radius: 999px;
    box-shadow: var(--card-shadow);
}

.lang-btn {
    border: none;
    background: transparent;
    color: rgba(var(--theme-color-rgb), 0.85);
    font: inherit;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.lang-btn[aria-pressed="true"] {
    background: linear-gradient(135deg, var(--color-ocean), var(--color-sky));
    color: var(--on-theme);
}

.lang-btn:hover {
    color: var(--theme-color);
}

.lang-pane[hidden] {
    display: none;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.85rem;
    border: 1px solid rgba(var(--theme-color-rgb), 0.2);
}

.markdown-content h3,
.markdown-content h4 {
    color: var(--theme-color);
    margin-top: 1.8rem;
}

.post-title {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-size: 2.35rem;
    font-weight: 600;
    color: var(--color-deep);
    margin-bottom: 1rem;
    line-height: 1.18;
    letter-spacing: 0.002em;
}

.article-content.markdown-content {
    overflow-x: visible;
    overflow-y: visible;
}

.article-content.markdown-content table {
    width: max-content;
    max-width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.82rem;
    line-height: 1.45;
}

.article-content.markdown-content th,
.article-content.markdown-content td {
    border: 1px solid rgba(var(--theme-color-rgb), 0.22);
    padding: 0.45rem 0.55rem;
    text-align: left;
    vertical-align: top;
}

.article-content.markdown-content th {
    background: rgba(var(--theme-color-rgb), 0.08);
    font-weight: 600;
    color: var(--color-deep);
}

.article-content.markdown-content strong {
    font-weight: 600;
    color: var(--color-deep);
}

/* Inline emphasis: write <mark>…</mark> in a post to get accent-coloured,
   dotted-underlined text (solid underline on hover). Uses the site's
   muted-tomato accent so it matches the 🍅 motif. */
.markdown-content mark {
    background: none;
    color: var(--color-gold);
    text-decoration-line: underline;
    text-decoration-color: var(--color-gold);
    text-decoration-style: dotted;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.2em;
    text-decoration-skip-ink: auto;
}

.markdown-content mark:hover {
    text-decoration-style: solid;
}

/* --- Photography page (photos.html) --- */

.photos-section .page-hero-title,
.photos-section .photos-gallery-heading,
.blog-section .page-hero-title {
    position: relative;
}

.photos-section .page-hero-title .anchor,
.photos-section .photos-gallery-heading .anchor,
.blog-section .page-hero-title .anchor {
    position: absolute;
    left: -1.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    font-weight: 400;
    color: rgba(var(--theme-color-rgb), 0.6);
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.photos-section .page-hero-title:hover .anchor,
.photos-section .photos-gallery-heading:hover .anchor,
.blog-section .page-hero-title:hover .anchor,
.photos-section .page-hero-title:focus-within .anchor,
.photos-section .photos-gallery-heading:focus-within .anchor,
.blog-section .page-hero-title:focus-within .anchor,
.photos-section .page-hero-title .anchor:focus,
.photos-section .photos-gallery-heading .anchor:focus,
.blog-section .page-hero-title .anchor:focus {
    opacity: 1;
    color: var(--color-ocean);
}

@media (max-width: 520px) {
    .article-content {
        padding-left: 1.75rem;
    }

    .article-content h2 .anchor,
    .article-content h3 .anchor,
    .article-content h4 .anchor,
    .article-content.markdown-content h2 .anchor,
    .article-content.markdown-content h3 .anchor,
    .article-content.markdown-content h4 .anchor {
        left: 0;
    }

    .photos-section .page-hero-title,
    .photos-section .photos-gallery-heading,
    .blog-section .page-hero-title {
        padding-left: 0;
    }

    .photos-section .page-hero-title .anchor,
    .photos-section .photos-gallery-heading .anchor,
    .blog-section .page-hero-title .anchor {
        left: 0;
    }
}

.photos-section .photos-intro {
    max-width: 40rem;
    margin: 0 auto 2.5rem;
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--color-muted);
}

.photos-section .photos-intro p + p {
    margin-top: 1rem;
}

.photos-feature {
    margin: 0 auto 3rem;
    max-width: 44rem;
}

.photos-feature-frame {
    border-radius: 0.65rem;
    overflow: hidden;
    border: 1px solid rgba(var(--theme-color-rgb), 0.2);
    box-shadow: 0 12px 40px rgba(20, 30, 24, 0.08);
    background: rgba(var(--theme-color-rgb), 0.06);
}

.photos-feature-frame img {
    display: block;
    width: 100%;
    height: auto;
}

.photos-feature-caption {
    margin-top: 0.65rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--color-muted);
    text-align: center;
}

.photos-path-hint {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8125em;
    word-break: break-all;
}

.photos-gallery-heading {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-size: clamp(1.35rem, 2.5vw, 1.65rem);
    font-weight: 600;
    margin: 0 0 0.75rem;
    color: var(--color-deep);
}

.photos-gallery-note {
    max-width: 42rem;
    margin: 0 0 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--color-muted);
}

.photos-code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.84em;
    padding: 0.1em 0.35em;
    border-radius: 0.25rem;
    background: rgba(var(--theme-color-rgb), 0.08);
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 6.75rem), 1fr));
    gap: 0.4rem;
    align-items: stretch;
}

@media (min-width: 420px) {
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 7.25rem), 1fr));
        gap: 0.45rem;
    }
}

@media (min-width: 640px) {
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 8rem), 1fr));
        gap: 0.5rem;
    }
}

@media (min-width: 900px) {
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.75rem), 1fr));
        gap: 0.55rem;
    }
}

.photos-tile {
    position: relative;
    display: block;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0.4rem;
    overflow: hidden;
    cursor: zoom-in;
    background: rgba(var(--theme-color-rgb), 0.07);
    align-self: stretch;
    min-height: 0;
    aspect-ratio: 1 / 1;
    transition: box-shadow 0.35s ease;
}

.photos-tile--wide {
    grid-column: span 2;
    aspect-ratio: 2 / 1;
}

@media (max-width: 480px) {
    .photos-tile--wide {
        grid-column: span 1;
        aspect-ratio: 16 / 9;
    }
}

.photos-tile:focus {
    outline: none;
}

.photos-tile:focus-visible {
    box-shadow: 0 0 0 2px var(--color-page), 0 0 0 4px rgba(var(--theme-color-rgb), 0.65);
    z-index: 1;
}

.photos-tile:hover {
    box-shadow: 0 8px 28px rgba(20, 30, 24, 0.12);
    z-index: 1;
}

.photos-tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1);
    transform-origin: center center;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.photos-tile:hover img,
.photos-tile:focus-visible img {
    transform: scale(1.05);
}

.photos-lightbox {
    position: relative;
    padding: 0;
    border: none;
    margin: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    background: transparent;
    overflow: hidden;
}

.photos-lightbox::backdrop {
    background: rgba(12, 14, 13, 0.88);
    backdrop-filter: blur(4px);
}

.photos-lightbox-scrim {
    position: absolute;
    inset: 0;
    cursor: zoom-out;
}

.photos-lightbox-frame {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: clamp(1rem, 4vw, 2.5rem);
    pointer-events: none;
}

.photos-lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.12);
    pointer-events: auto;
    transition: background 0.2s ease, transform 0.2s ease;
}

.photos-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.photos-lightbox-close:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}

.photos-lightbox-img {
    max-width: min(92vw, 1120px);
    max-height: min(86vh, 1120px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.35rem;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .reveal-hidden {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .main-author-photo-link:hover {
        transform: none;
    }

    .photos-tile:hover img,
    .photos-tile:focus-visible img {
        transform: none;
    }

    .photos-lightbox::backdrop {
        backdrop-filter: none;
    }

    .ambient-particle {
        animation: none;
    }

    .side-dot-mark,
    .side-dot-label {
        transition: none;
    }
}

/* ── Side ornaments (wide screens only) ──────────────────────────── */

/* Right-edge scrollspy dots. */
.side-dot-nav {
    position: fixed;
    top: 50%;
    right: clamp(16px, 2.2vw, 38px);
    transform: translateY(-50%);
    z-index: 60;
    display: none;
}

.side-dot-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.05rem;
}

.side-dot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.side-dot-mark {
    flex: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1.5px solid rgba(var(--theme-color-rgb), 0.4);
    background: var(--color-page);
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.side-dot-label {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
    max-width: clamp(140px, 15vw, 260px);
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
    color: var(--color-text-muted);
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.side-dot:hover .side-dot-label,
.side-dot:focus-visible .side-dot-label,
.side-dot.is-active .side-dot-label {
    opacity: 1;
    transform: translateX(0);
}

.side-dot:hover .side-dot-mark,
.side-dot:focus-visible .side-dot-mark {
    border-color: var(--color-sky);
    transform: scale(1.25);
}

.side-dot.is-active .side-dot-mark {
    background: var(--color-gold);
    border-color: var(--color-gold);
    transform: scale(1.15);
    box-shadow: 0 0 0 4px rgba(226, 121, 91, 0.16);
}

/* Scroll-progress thread running through the dot nav: a hairline that
   fills sage-to-tomato as the reader moves down the page. */
.side-dot-thread {
    position: absolute;
    top: -16px;
    bottom: -16px;
    left: 50%;
    width: 1px;
    transform: translateX(-50%);
    background: var(--thread-track);
    z-index: -1;
    pointer-events: none;
}

.side-dot-thread::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(var(--thread-progress, 0) * 100%);
    background: linear-gradient(180deg, rgba(79, 123, 103, 0.55), rgba(226, 121, 91, 0.6));
    transition: height 0.25s ease-out;
}

/* ── Margin atmosphere ────────────────────────────────────────────
   Two quiet layers for the outer space on wide screens: a soft aura
   that trails the cursor with a dreamlike lag, and a few out-of-focus
   orbs drifting at different depths (gentle float + scroll parallax).
   Both sit behind content and defer to prefers-reduced-motion. */
.cursor-aura {
    position: fixed;
    top: 0;
    left: 0;
    width: 560px;
    height: 560px;
    margin: -280px 0 0 -280px;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    background: var(--aura-bg);
    opacity: 0;
    transition: opacity 1.4s ease;
    will-change: transform;
}

.cursor-aura.is-on {
    opacity: 1;
}

.depth-orbs {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    display: none;
}

@media (min-width: 1180px) {
    .depth-orbs {
        display: block;
    }
}

.depth-orb {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
}

.depth-orb span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: orbFloat var(--dur, 36s) ease-in-out var(--delay, 0s) infinite alternate;
}

@keyframes orbFloat {
    from { transform: translate3d(0, -12px, 0) scale(1); }
    to   { transform: translate3d(0, 16px, 0) scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
    .cursor-aura {
        display: none;
    }

    .depth-orb span {
        animation: none;
    }

    .side-dot-thread::after {
        transition: none;
    }
}

/* Left-edge vertical tagline watermark. */
.side-tagline {
    position: fixed;
    top: 50%;
    left: clamp(12px, 1.8vw, 32px);
    transform: translateY(-50%);
    z-index: 40;
    display: none;
    pointer-events: none;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.side-tagline-text {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 0.82rem;
    letter-spacing: 0.3em;
    white-space: nowrap;
    color: rgba(var(--theme-color-rgb), 0.3);
}

/* Drifting ambient motes living in the side margins. */
.ambient-particles {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    display: none;
}

.ambient-particle {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: radial-gradient(circle at 32% 30%,
        rgba(124, 173, 152, 0.95) 0%,
        rgba(79, 123, 103, 0.32) 62%,
        transparent 78%);
    opacity: var(--opacity);
    will-change: transform;
    animation: ambientFloat var(--dur) ease-in-out var(--delay) infinite;
}

@keyframes ambientFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(var(--drift), -46px) scale(1.18); }
}

/* Dark mode only: two or three motes are secretly fireflies. Most of the
   time they drift like the rest; every so often they breathe up into the
   warm tomato ember — same nighttime story as the bulb ember and the
   cursor aura — then dim back to sage. Never present in daylight. */
.ambient-particle.is-firefly::after {
    content: '';
    position: absolute;
    inset: -170%;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(255, 196, 148, 0.95) 0%,
        rgba(232, 136, 106, 0.55) 34%,
        rgba(226, 121, 91, 0.18) 60%,
        transparent 76%);
    opacity: 0;
}

html[data-theme="dark"] .ambient-particle.is-firefly {
    /* The mote itself must brighten too — its resting opacity is far too
       faint for the halo alone to read as a firefly. */
    animation:
        ambientFloat var(--dur) ease-in-out var(--delay) infinite,
        fireflyLift var(--breath-dur, 14s) ease-in-out var(--breath-delay, 0s) infinite;
}

html[data-theme="dark"] .ambient-particle.is-firefly::after {
    animation: fireflyBreath var(--breath-dur, 14s) ease-in-out var(--breath-delay, 0s) infinite;
}

@keyframes fireflyLift {
    0%, 72% { opacity: var(--opacity); }
    80% { opacity: 0.9; }
    84% { opacity: 0.7; }
    88% { opacity: 0.9; }
    100% { opacity: var(--opacity); }
}

@keyframes fireflyBreath {
    0%, 72% { opacity: 0; }
    80% { opacity: 1; }
    84% { opacity: 0.85; }
    88% { opacity: 1; }
    100% { opacity: 0; }
}

/* Placed after the particle animations so the cascade actually wins. */
@media (prefers-reduced-motion: reduce) {
    .ambient-particle,
    html[data-theme="dark"] .ambient-particle.is-firefly,
    html[data-theme="dark"] .ambient-particle.is-firefly::after {
        animation: none;
    }
}

@media (min-width: 1024px) {
    .ambient-particles {
        display: block;
    }
}

@media (min-width: 1100px) {
    .side-dot-nav,
    .side-tagline {
        display: block;
    }
}

/* ── Code block copy button ──────────────────────────────────────── */
.code-block {
    position: relative;
}

.code-copy-btn {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 2;
    font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    padding: 0.28rem 0.62rem;
    color: var(--color-ice);
    background: rgba(23, 26, 24, 0.55);
    border: 1px solid rgba(233, 238, 233, 0.18);
    border-radius: 7px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.code-block:hover .code-copy-btn,
.code-copy-btn:focus-visible {
    opacity: 1;
    transform: translateY(0);
}

.code-copy-btn:hover {
    background: rgba(23, 26, 24, 0.8);
    border-color: var(--color-gold-soft);
    color: #fff;
}

.code-copy-btn.is-copied {
    opacity: 1;
    transform: translateY(0);
    border-color: var(--color-gold);
    color: var(--color-gold-soft);
}

@media (hover: none) {
    .code-copy-btn {
        opacity: 0.82;
        transform: none;
    }
}


/* Hanabi corner easter egg — a brief festival dusk falls over the page,
   fireworks are drawn on the canvas above it. Both ignore the pointer. */
.hanabi-night {
    position: fixed;
    inset: 0;
    z-index: 10006;
    background: radial-gradient(120% 90% at 50% 112%,
        rgba(27, 36, 44, 0.88),
        rgba(9, 12, 16, 0.94));
    opacity: 0;
    transition: opacity 0.7s ease;
    pointer-events: none;
}

.hanabi-night.show {
    opacity: 1;
}

.hanabi-canvas {
    position: fixed;
    inset: 0;
    z-index: 10007;
    pointer-events: none;
}

/* ── Theme toggle — a small lightbulb in the top-right corner. Lit
   (rays out) in daylight; click to blow it out and let dusk fall.
   A faint tomato ember stays in the glass at night, asking to be
   relit. Same hairline-and-glass language as everything else. */
.theme-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 950;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: rgba(var(--theme-color-rgb), 0.78);
    cursor: pointer;
    box-shadow: var(--card-shadow-soft);
    transition: color 0.25s ease, border-color 0.25s ease,
        background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.theme-toggle:hover {
    color: var(--color-gold);
    border-color: var(--accent-hover-border);
    box-shadow: var(--card-shadow);
    transform: translateY(-1px);
}

.theme-toggle svg {
    width: 21px;
    height: 21px;
    display: block;
}

.theme-toggle .bulb-glass {
    fill: rgba(226, 121, 91, 0.14);
    transition: fill 0.35s ease;
}

.theme-toggle .bulb-rays {
    transform-origin: 12px 9.7px;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

html[data-theme="dark"] .theme-toggle .bulb-rays {
    opacity: 0;
    transform: scale(0.55);
}

html[data-theme="dark"] .theme-toggle .bulb-glass {
    fill: rgba(232, 136, 106, 0.3);
}

.theme-toggle.is-popped svg {
    animation: bulbPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bulbPop {
    0% { transform: scale(1); }
    35% { transform: scale(0.8) rotate(-6deg); }
    70% { transform: scale(1.08) rotate(3deg); }
    100% { transform: scale(1); }
}

/* Toggled too many times in a row, the bulb gets tired: two stuttering
   dips like an old fluorescent tube warming up, then business as usual. */
.theme-toggle.is-tired svg {
    animation: bulbTiredFlicker 0.95s linear;
}

@keyframes bulbTiredFlicker {
    0%, 100% { opacity: 1; }
    8% { opacity: 0.2; }
    14% { opacity: 0.85; }
    20% { opacity: 0.3; }
    28% { opacity: 1; }
    52% { opacity: 1; }
    60% { opacity: 0.25; }
    66% { opacity: 0.9; }
    72% { opacity: 0.35; }
    82% { opacity: 1; }
}

@media (max-width: 768px) {
    .theme-toggle {
        top: 14px;
        right: 14px;
        width: 38px;
        height: 38px;
    }

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

/* Brief cross-fade while the theme flips; the class is added by the
   toggle handler and removed right after. */
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
    transition: background-color 0.4s ease, background 0.4s ease,
        color 0.4s ease, border-color 0.4s ease, fill 0.4s ease,
        box-shadow 0.4s ease !important;
}

@media (prefers-reduced-motion: reduce) {
    .theme-toggle,
    .theme-toggle .bulb-rays,
    .theme-toggle .bulb-glass {
        transition: none;
    }

    .theme-toggle:hover {
        transform: none;
    }

    .theme-toggle.is-popped svg,
    .theme-toggle.is-tired svg {
        animation: none;
    }

    html.theme-switching *,
    html.theme-switching *::before,
    html.theme-switching *::after {
        transition: none !important;
    }
}
