:root {
    /* Default - Dark Theme: Deep Abyss Ink */
    --bg: #030305;
    --bg-grad: linear-gradient(135deg, #050508 0%, #000000 100%);
    --text: #f0f0f5;
    --text-muted: rgba(240, 240, 245, 0.5);
    --accent-phil: #c5a880;
    /* Brighter gold/parchment */
    --accent-tech: #5cadff;
    /* Electric ink blue */
    --card-bg: rgba(15, 15, 25, 0.6);
    --border: rgba(255, 255, 255, 0.08);
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Outfit', sans-serif;
    --ink-filter: url(#ink-bleed);
}

[data-theme="light"] {
    /* Light Theme: Premium Parchment */
    --bg: #f8f8f5;
    --bg-grad: linear-gradient(135deg, #ffffff 0%, #f0f0eb 100%);
    --text: #121215;
    --text-muted: rgba(18, 18, 21, 0.6);
    --accent-phil: #8b7355;
    --accent-tech: #0066cc;
    --card-bg: rgba(255, 255, 255, 0.4);
    --border: rgba(0, 0, 0, 0.06);
}

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

body {
    background: var(--bg-grad) fixed;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    transition: color 0.4s ease, background-color 0.4s ease;
}

/* Texture Overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    pointer-events: none;
    z-index: 1000;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

[data-theme="light"] body::before {
    opacity: 0.05;
}

/* Animated gradient orbs */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    z-index: -1;
    animation: float 20s infinite ease-in-out;
}

body::before {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-phil), transparent);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

body::after {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-tech), transparent);
    bottom: -150px;
    right: -150px;
    animation-delay: -10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(100px, -100px) scale(1.1);
    }

    66% {
        transform: translate(-50px, 100px) scale(0.9);
    }
}

/* Organic Ink Drops */
.ink-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.ink-drop {
    position: absolute;
    background: radial-gradient(circle, var(--accent-phil) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0.08;
    filter: blur(60px);
    animation: bleed 25s infinite ease-in-out;
}

.ink-drop:nth-child(even) {
    background: radial-gradient(circle, var(--accent-tech) 0%, transparent 70%);
}

@keyframes bleed {

    0%,
    100% {
        transform: scale(1) translate(0, 0);
        opacity: 0.05;
    }

    50% {
        transform: scale(1.5) translate(40px, -40px);
        opacity: 0.12;
    }
}

.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    z-index: 100;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(180deg);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.2);
}

.landing-container {
    max-width: 1100px;
    width: 90%;
    text-align: center;
    animation: fadeInUp 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-title {
    font-family: var(--font-serif);
    font-size: clamp(3.8rem, 14vw, 8rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.04em;
    font-style: italic;
    color: var(--text);
    filter: var(--ink-filter);
    transition: filter 0.3s ease;
}

.site-title:hover {
    filter: url(#ink-bleed-heavy);
}

.tagline {
    font-size: clamp(1rem, 2.8vw, 1.6rem);
    font-weight: 300;
    margin-bottom: 5rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.cursive {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    color: var(--text);
    opacity: 0.9;
}

.ink-seal {
    width: 60px;
    height: 60px;
    border: 2px solid var(--accent-phil);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem auto 2.5rem;
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--accent-phil);
    opacity: 0.6;
    filter: var(--ink-filter);
    transition: all 0.5s ease;
}

.ink-seal:hover {
    opacity: 1;
    transform: rotate(15deg) scale(1.1);
}

.choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .choices {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.choice-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 3.5rem 2rem;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text);
    backdrop-filter: blur(12px);
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.choice-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--accent-color) 0%, transparent 50%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.8s ease, opacity 0.8s ease;
    z-index: -1;
}

.choice-card.phil {
    --accent-color: var(--accent-phil);
}

.choice-card.tech {
    --accent-color: var(--accent-tech);
}

.choice-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-color);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.choice-card:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.1;
}

.choice-card .icon {
    font-size: 3.2rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.1));
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.choice-card:hover .icon {
    transform: scale(1.1) translateY(-5px);
}

.choice-card h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    margin-bottom: 0.8rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.choice-card p {
    font-size: clamp(0.9rem, 1.8vw, 1rem);
    color: var(--text-muted);
    font-weight: 400;
    max-width: 260px;
    line-height: 1.6;
    text-align: center;
}

.landing-footer {
    position: fixed;
    bottom: 2rem;
    width: 100%;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 300;
    z-index: 1;
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--accent-phil);
    border-radius: 5px;
}

/* Markdown Content Styling (Prose) */
.post-content {
    text-align: left;
    max-width: 800px;
    margin: 4rem auto;
    animation: fadeInUp 1s ease-out;
}

.post-content h1,
.post-content h2,
.post-content h3 {
    font-family: var(--font-serif);
    color: var(--text);
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    filter: var(--ink-filter);
}

.post-content h2 {
    font-size: 2.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.post-content h3 {
    font-size: 1.8rem;
}

.post-content p {
    margin-bottom: 2rem;
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text);
    opacity: 0.9;
    font-weight: 300;
}

.post-content ul,
.post-content ol {
    margin-bottom: 2rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.8rem;
    font-size: 1.15rem;
}

/* Inline Code */
.post-content :not(pre)>code {
    font-family: var(--font-sans);
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-tech);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
}

[data-theme="light"] .post-content :not(pre)>code {
    background: rgba(0, 0, 0, 0.05);
}

/* Copy Button */
.copy-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 10;
    backdrop-filter: blur(8px);
}

div:hover>.copy-button {
    opacity: 0.7;
}

.copy-button:hover {
    opacity: 1 !important;
    background: var(--accent-tech);
    color: white;
    border-color: var(--accent-tech);
    box-shadow: 0 0 20px rgba(92, 173, 255, 0.3);
}

.copy-button.copied {
    background: #238636;
    border-color: #2ea043;
    color: white;
    opacity: 1 !important;
}

/* Code Blocks */
.post-content pre {
    margin: 3rem 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    background: #0d1117;
    width: 100%;
}


[data-theme="light"] .post-content pre {
    background: #f6f8fa;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.post-content pre code {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    display: block;
    padding: 2rem;
}

/* Blockquotes */
.post-content blockquote {
    margin: 3rem 0;
    padding: 2rem 2.5rem;
    border-left: 4px solid var(--accent-phil);
    background: rgba(197, 168, 128, 0.05);
    border-radius: 0 12px 12px 0;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.3rem;
}

.post-content blockquote p {
    margin-bottom: 0;
    color: var(--accent-phil);
    opacity: 1;
}

/* Images */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    margin: 3rem 0;
    border: 1px solid var(--border);
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.2));
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Table of Contents */
.table-of-contents {
    margin: 2rem 0 3rem 0;
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

[data-theme="dark"] .table-of-contents {
    background: rgba(255, 255, 255, 0.03);
}

.table-of-contents h3 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--accent-phil);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.table-of-contents nav ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.table-of-contents nav li {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.table-of-contents a {
    text-decoration: none;
    border-bottom: none;
    color: var(--text);
    opacity: 0.8;
    transition: opacity 0.2s, color 0.2s;
}

.table-of-contents a:hover {
    opacity: 1;
    color: var(--accent-phil);
    border-bottom: 1px solid var(--accent-phil);
}

.toc-level-2 {
    margin-left: 0;
    font-weight: 700;
}


/* Collapsible Code Blocks */
pre.collapsed {
    max-height: 300px;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    border-bottom: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.expand-button {
    display: block;
    width: 100%;
    padding: 0.8rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    text-align: center;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border-radius: 0 0 16px 16px;
    margin-top: -1px;
    backdrop-filter: blur(10px);
}

.expand-button:hover {
    background: var(--border);
}