:root {
    --bg: #e8f4f8;
    --text: #000000;
    --text-muted: #4a4a4a;
    --accent: #7ba3b0;
    --accent-dark: #1a3a5c;
    --floral: #a8c8d4;
    --quote-bg: #f0f7fa;
}

[data-theme="dark"] {
    --bg: #1a2a30;
    --text: #e8f0f2;
    --text-muted: #9ab0b8;
    --accent: #7ba3b0;
    --accent-dark: #a8c8d4;
    --floral: #4a6a72;
    --quote-bg: #243840;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 18px;
    line-height: 1.8;
    color: var(--text);
    background-color: var(--bg);
    min-height: 100vh;
    transition: background-color 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
}

/* Floral Decorations (Light Mode) */
.floral-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

[data-theme="dark"] .floral-container {
    display: none;
}

.floral {
    position: absolute;
    color: var(--floral);
    opacity: 0.5;
    transition: color 0.5s ease, opacity 0.5s ease;
}

.floral-1 {
    width: 120px;
    height: 200px;
    bottom: -20px;
    left: 5%;
    animation: sway 8s ease-in-out infinite;
}

.floral-2 {
    width: 100px;
    height: 180px;
    bottom: -15px;
    right: 8%;
    animation: sway 10s ease-in-out infinite reverse;
}

.floral-3 {
    width: 80px;
    height: 150px;
    bottom: -10px;
    left: 15%;
    animation: sway 12s ease-in-out infinite;
    animation-delay: -2s;
}

@keyframes sway {
    0%, 100% {
        transform: rotate(-3deg) translateX(0);
    }
    50% {
        transform: rotate(3deg) translateX(5px);
    }
}

.stem {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: draw 3s ease forwards;
}

.petal {
    transform-origin: center;
    animation: bloom 2s ease forwards;
    animation-delay: 1.5s;
    opacity: 0;
}

.leaf {
    animation: unfurl 2s ease forwards;
    animation-delay: 2s;
    opacity: 0;
}

@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes bloom {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0.6;
    }
}

@keyframes unfurl {
    0% {
        transform: scale(0) rotate(-20deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 0.5;
    }
}

/* Falling Flowers (Light Mode) */
.falling-flower {
    position: fixed;
    top: -40px;
    z-index: 0;
    pointer-events: none;
    animation: fall-flower linear forwards;
}

@keyframes fall-flower {
    0% {
        top: -40px;
        transform: rotate(0deg) translateX(0);
    }
    100% {
        top: 110vh;
        transform: rotate(720deg) translateX(100px);
    }
}

/* Cursor Trail */
.cursor-trail {
    position: fixed;
    pointer-events: none;
    z-index: 999;
    animation: trail-fade 1s ease-out forwards;
}

@keyframes trail-fade {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--drift-x), var(--drift-y)) rotate(var(--rotate)) scale(0.2);
    }
}

/* Falling Stars (Dark Mode) */
.falling-star {
    position: fixed;
    top: -30px;
    z-index: 0;
    pointer-events: auto;
    cursor: pointer;
    animation: fall linear forwards;
    text-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
    transition: transform 0.2s ease, text-shadow 0.2s ease;
}

.falling-star:hover {
    transform: scale(1.3);
    text-shadow: 0 0 15px currentColor, 0 0 30px currentColor, 0 0 45px currentColor;
}

@keyframes fall {
    0% {
        top: -30px;
        transform: rotate(0deg) translateX(0);
    }
    100% {
        top: 110vh;
        transform: rotate(360deg) translateX(50px);
    }
}

/* Sparkles (Dark Mode Click Effect) */
.sparkle {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    animation: sparkle-burst 0.8s ease-out forwards;
    text-shadow: 0 0 5px currentColor;
}

@keyframes sparkle-burst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

/* Main Content */
.content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-family: 'La Belle Aurore', cursive;
    font-size: 3.5rem;
    font-weight: 400;
    color: var(--accent-dark);
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
    animation: fadeIn 1.5s ease;
}

.tagline {
    font-style: italic;
    color: var(--text-muted);
    font-size: 1.1rem;
    text-align: center;
    animation: fadeIn 2s ease;
}

/* Navigation */
.links {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeIn 2.5s ease;
}

.links a {
    color: var(--text);
    text-decoration: none;
    font-size: 1rem;
    letter-spacing: 0.1em;
    position: relative;
    transition: color 0.3s ease;
}

.links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.links a:hover {
    color: var(--accent-dark);
}

.links a:hover::after {
    width: 100%;
}

.divider {
    margin: 0 1rem;
    color: var(--text-muted);
}

/* Sections */
.section {
    margin-bottom: 4rem;
    animation: fadeIn 3s ease;
}

h2 {
    font-family: 'La Belle Aurore', cursive;
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--accent-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--floral);
}

p {
    margin-bottom: 1rem;
    text-align: justify;
    hyphens: auto;
}

a {
    color: var(--accent-dark);
    text-decoration: none;
    border-bottom: 1px solid var(--accent);
    transition: border-color 0.3s ease;
}

a:hover {
    border-color: var(--accent-dark);
}

/* Post Page */
.post-page {
    max-width: 650px;
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-bottom: none;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--accent-dark);
    border-bottom: none;
}

/* Post Article */
.post {
    margin-bottom: 3rem;
}

.post-header {
    margin-bottom: 2.5rem;
    text-align: left;
}

.post-header .post-title {
    font-family: 'La Belle Aurore', cursive;
    font-size: 2.2rem;
    font-weight: 400;
    font-style: normal;
    color: var(--accent-dark);
    margin-bottom: 0.5rem;
    border-bottom: none;
}

.post-header .date {
    display: block;
}

.post-content p {
    margin-bottom: 1.25rem;
    text-indent: 0;
}

.post-content p.standalone-line {
    text-indent: 0;
    margin-bottom: 0.5rem;
}

/* Section Headings in Posts */
.section-heading {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--accent-dark);
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--floral);
}

/* Blockquotes */
blockquote {
    margin: 2rem 0;
    padding: 1.5rem;
    padding-left: 1.5rem;
    border-left: 3px solid var(--accent-dark);
    background-color: var(--quote-bg);
    font-style: italic;
}

blockquote p {
    margin-bottom: 0.75rem;
}

blockquote p:last-of-type {
    margin-bottom: 0;
}

blockquote cite {
    display: block;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: normal;
}


/* Section Break */
.section-break {
    border: none;
    text-align: center;
    margin: 2.5rem 0 3rem 0;
}

.section-break::before {
    content: '~';
    color: var(--floral);
    font-size: 1.5rem;
}

/* Footnotes - Hoverable */
.footnote-ref {
    position: relative;
    display: inline-block;
    cursor: help;
}

.footnote-ref sup {
    font-size: 0.8rem;
    color: var(--accent-dark);
    font-weight: 700;
    padding: 0 3px;
    transition: color 0.2s ease;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.footnote-ref:hover sup {
    color: var(--text);
}

.footnote-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    padding: 1rem 1.2rem;
    background: #ffffff;
    border: 2px solid var(--accent-dark);
    border-radius: 6px;
    font-size: 0.85rem;
    font-style: normal;
    line-height: 1.7;
    color: #000;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    pointer-events: none;
    text-align: left;
}

.footnote-tooltip::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0 10px;
    border-style: solid;
    border-color: var(--accent-dark) transparent transparent transparent;
}

.footnote-ref:hover .footnote-tooltip {
    display: block;
}

/* Static footnotes section (fallback) */
.footnotes {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--floral);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footnotes p {
    margin-bottom: 1rem;
    text-indent: 0;
}

.footnotes sup {
    color: var(--accent-dark);
    font-weight: 600;
}

sup {
    font-size: 0.7rem;
    color: var(--accent-dark);
}

/* Entry Titles (clickable links on main page) */
.entry-title {
    font-style: italic;
    margin-left: 1rem;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.entry-title:hover {
    border-bottom: 1px solid var(--accent);
}

/* Entries List */
.entries {
    list-style: none;
}

.entries li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.75rem 0;
    border-bottom: 1px dotted var(--floral);
    transition: background-color 0.3s ease;
}

.entries li:hover {
    background-color: rgba(196, 169, 143, 0.1);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.date {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.title {
    font-style: italic;
    margin-left: 1rem;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 4rem;
    padding-top: 2rem;
}

.signature {
    font-size: 1.5rem;
    color: var(--accent);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: 1px solid var(--floral);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
    z-index: 100;
}

.theme-toggle:hover {
    border-color: var(--accent-dark);
    color: var(--accent-dark);
}

.sun {
    display: inline;
}

.moon {
    display: none;
}

[data-theme="dark"] .sun {
    display: none;
}

[data-theme="dark"] .moon {
    display: inline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 600px) {
    body {
        font-size: 16px;
    }

    .content {
        padding: 3rem 1.5rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    .floral-1 {
        width: 80px;
        height: 140px;
        left: 2%;
    }

    .floral-2 {
        width: 70px;
        height: 120px;
        right: 3%;
    }

    .floral-3 {
        display: none;
    }

    .entries li {
        flex-direction: column;
        align-items: flex-start;
    }

    .title {
        margin-left: 0;
        margin-top: 0.25rem;
    }

    .footnote-tooltip {
        width: 260px;
        left: auto;
        right: -20px;
        transform: none;
    }

    .footnote-tooltip::before {
        left: auto;
        right: 25px;
        transform: none;
    }

    .entry-title {
        margin-left: 0;
        margin-top: 0.25rem;
    }
}
