@import url('https://fonts.googleapis.com/css2?family=ZCOOL+KuaiLe&display=swap');

/* ==================== Reset & Base ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==================== Theme Variables ==================== */
:root {
    --bg-body: #F9F5F0;
    --bg-card: #FFF8F0;
    --text-primary: #4A3F35;
    --text-heading: #3D2B1F;
    --text-bio: #8B7355;
    --text-intro: #6B5E4F;
    --text-typewriter: #D4735E;
    --text-footer: #B8957A;
    --border-card: rgba(192,57,43,0.06);
    --border-card-hover: rgba(192,57,43,0.2);
    --shadow-card: 0 6px 24px rgba(139,90,43,0.08);
    --shadow-card-hover: 0 12px 30px rgba(192,57,43,0.12);
    --shadow-icon: rgba(0,0,0,0.08);
    --line-gradient: rgba(192,57,43,0.2);
    --line-footer: rgba(192,57,43,0.15);
    --wave-color: rgba(74,123,157,0.12);
    --scrollbar-thumb: #D4C4A0;
    --scrollbar-thumb-hover: #B8957A;
    --sparkle-shadow: rgba(232,168,72,0.4);
    --soot-shadow: rgba(0,0,0,0.12);
    --accent-brown: #8B6B4A;
    --accent-gold-light: #F0D080;
    --bg-glow: radial-gradient(ellipse 700px 500px at 50% 25%, rgba(232,168,72,0.07) 0%, rgba(232,168,72,0.02) 40%, transparent 70%);
    --dot-color: rgba(139,90,43,0.06);
}

[data-theme="dark"] {
    --bg-body: #1a1a1a;
    --bg-card: #2A2520;
    --bg-card-fold: #3A3028;
    --text-primary: #C4B8A0;
    --text-heading: #E8D5B7;
    --text-bio: #A08060;
    --text-intro: #B0A490;
    --text-typewriter: #E8A848;
    --text-footer: #8B7355;
    --border-card: rgba(255,255,255,0.06);
    --border-card-hover: rgba(232,168,72,0.3);
    --shadow-card: 0 6px 24px rgba(0,0,0,0.3);
    --shadow-card-hover: 0 12px 30px rgba(0,0,0,0.4);
    --shadow-icon: rgba(0,0,0,0.3);
    --line-gradient: rgba(232,168,72,0.2);
    --line-footer: rgba(232,168,72,0.12);
    --wave-color: rgba(232,168,72,0.08);
    --scrollbar-thumb: #4A4035;
    --scrollbar-thumb-hover: #5A5045;
    --sparkle-shadow: rgba(232,168,72,0.3);
    --soot-shadow: rgba(0,0,0,0.3);
    --accent-brown: #A08060;
    --accent-gold-light: #D4B068;
    --bg-glow: radial-gradient(ellipse 600px 450px at 50% 25%, rgba(232,168,72,0.10) 0%, rgba(232,168,72,0.03) 40%, transparent 70%);
    --dot-color: rgba(232,168,72,0.06);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'ZCOOL KuaiLe', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
    background: var(--bg-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

/* Warm glow overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-glow);
    pointer-events: none;
    z-index: 0;
}

/* Subtle dotted texture (Japanese paper feel) */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle, var(--dot-color) 1.2px, transparent 1.2px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ==================== Sparkle Container ==================== */
#sparkleContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.sparkle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-gold-light), #E8A848);
    box-shadow: 0 0 6px var(--sparkle-shadow);
    animation: sparkleFloat linear infinite;
    opacity: 0;
}

@keyframes sparkleFloat {
    0% { transform: translateY(0) scale(0.5); opacity: 0; }
    10% { opacity: 0.7; }
    80% { opacity: 0.7; }
    100% { transform: translateY(-100vh) scale(1); opacity: 0; }
}

/* ==================== Main Container ==================== */
.container {
    position: relative;
    z-index: 1;
    max-width: 820px;
    margin: 0 auto;
    padding: 24px 24px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ==================== Top Signature ==================== */
.top-signature {
    text-align: center;
    font-size: 15px;
    color: var(--text-typewriter);
    font-weight: 500;
    letter-spacing: 4px;
    margin-bottom: 36px;
    padding-top: 8px;
    min-height: 24px;
}

.top-signature .typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 18px;
    background: var(--text-typewriter);
    margin-left: 2px;
    animation: blink 0.8s step-end infinite;
    vertical-align: middle;
}

/* ==================== Avatar Section ==================== */
.avatar-section {
    text-align: center;
    margin-bottom: 52px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease forwards;
    position: relative;
}

.avatar-section::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(to right, transparent, #C0392B, transparent);
    opacity: 0.4;
}

.avatar-section::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 1px;
    background: linear-gradient(to right, transparent, #C0392B, transparent);
    opacity: 0.25;
}

.avatar-frame-wrap {
    position: relative;
    width: 170px;
    height: 170px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-frame-wrap::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232,168,72,0.15) 0%, transparent 70%);
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.avatar-frame-wrap .avatar-photo {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.avatar-frame-wrap .avatar-frame-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.avatar-section h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #C0392B, #E8A848, #5A7A5A, #E8A848, #C0392B);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: chromaticText 4s ease-in-out infinite;
}

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

.avatar-section .bio {
    font-size: 18px;
    color: #E8A848;
    margin-bottom: 12px;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(232,168,72,0.2);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ==================== Card Base ==================== */
.card {
    width: 100%;
    max-width: 680px;
    margin-bottom: 32px;
}

/* ==================== About Card ==================== */
.about-card {
    background: var(--bg-card);
    padding: 36px 40px 36px 44px;
    border: 1px solid var(--border-card);
    box-shadow: var(--shadow-card);
    border-radius: 20px;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

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

/* Left decorative bar — green to gold bamboo */
.about-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 4px;
    background: linear-gradient(to bottom, #5A7A5A 0%, #7BAE7F 30%, #E8A848 70%, #C0392B 100%);
    border-radius: 2px;
}

.about-card h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-heading);
    padding-left: 16px;
    letter-spacing: 1px;
}

.about-card p {
    font-size: 16px;
    color: var(--text-intro);
    line-height: 1.8;
    padding-left: 16px;
}

/* Japanese wave border at bottom */
.about-card .wave-border {
    position: absolute;
    bottom: 0;
    left: 3%;
    right: 0;
    height: 8px;
    background: repeating-linear-gradient(
        90deg,
        transparent, transparent 6px,
        var(--wave-color) 6px, var(--wave-color) 8px
    );
}

/* Soot Sprite */
.soot-sprite {
    position: absolute;
    bottom: 14px;
    right: 20px;
    width: 44px;
    height: 38px;
    z-index: 3;
    animation: sootBob 4s ease-in-out infinite;
}

.soot-sprite .ss-body {
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 50% 55%, #4D4D4D 30%, #1A1A1A 100%);
    border-radius: 50%;
    box-shadow: 0 2px 8px var(--soot-shadow);
    position: relative;
}

/* Fluff on top */
.soot-sprite .ss-body::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 8px;
    width: 10px;
    height: 12px;
    background: #3D3D3D;
    border-radius: 50%;
    transform: rotate(-15deg);
}

.soot-sprite .ss-body::after {
    content: '';
    position: absolute;
    top: -8px;
    right: 10px;
    width: 8px;
    height: 10px;
    background: #3D3D3D;
    border-radius: 50%;
    transform: rotate(10deg);
}

/* Eyes */
.soot-sprite .ss-eye {
    position: absolute;
    top: 12px;
    width: 9px;
    height: 11px;
    background: #fff;
    border-radius: 50%;
}

.soot-sprite .ss-eye.left {
    left: 9px;
}

.soot-sprite .ss-eye.right {
    right: 9px;
}

/* Pupils */
.soot-sprite .ss-eye::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 2px;
    width: 5px;
    height: 6px;
    background: #111;
    border-radius: 50%;
}

@keyframes sootBob {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-3px) rotate(1deg); }
    75% { transform: translateY(-1px) rotate(-1deg); }
}

/* Leaf decoration at bottom-right */
.about-card .leaf-cluster {
    position: absolute;
    bottom: 10px;
    right: 72px;
    width: 40px;
    height: 28px;
    z-index: 2;
    pointer-events: none;
}

.about-card .leaf {
    position: absolute;
    border-radius: 50% 0 50% 50%;
    width: 18px;
    height: 14px;
    opacity: 0.5;
}

.about-card .leaf-1 {
    background: #7BAE7F;
    bottom: 2px;
    right: 0;
    transform: rotate(-15deg);
}

.about-card .leaf-2 {
    background: #5A7A5A;
    bottom: 6px;
    right: 12px;
    width: 16px;
    height: 12px;
    transform: rotate(20deg);
}

.about-card .leaf-3 {
    background: #8FBC8F;
    bottom: 12px;
    right: 4px;
    width: 14px;
    height: 10px;
    transform: rotate(-40deg);
}

.about-card .leaf-stem {
    position: absolute;
    bottom: 0;
    right: 6px;
    width: 12px;
    height: 2px;
    background: #5A7A5A;
    border-radius: 1px;
    transform: rotate(-30deg);
    opacity: 0.4;
}

/* ==================== Buttons Card ==================== */
.buttons-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    max-width: 680px;
    width: 100%;
    margin-bottom: 32px;
}

.btn-block {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-block .btn-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.btn-block .btn-logo img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.btn-block .btn-text {
    flex: 1;
}

/* Glass */
.btn-glass {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--text-heading);
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.btn-glass:hover {
    background: rgba(255,255,255,0.85);
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

/* Shadow */
.btn-shadow {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    color: var(--text-heading);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.btn-shadow:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Outline */
.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-brown);
    color: var(--text-heading);
}
.btn-outline:hover {
    background: var(--accent-brown);
    color: #fff;
    transform: translateY(-2px);
}

/* Gradient */
.btn-gradient {
    background: linear-gradient(135deg, #C0392B, #E8A848);
    border: none;
    color: #fff;
    box-shadow: 0 4px 16px rgba(192,57,43,0.25);
}
.btn-gradient:hover {
    box-shadow: 0 8px 30px rgba(192,57,43,0.35);
    transform: translateY(-2px);
}

/* Minimal */
.btn-minimal {
    background: transparent;
    border: none;
    color: var(--text-heading);
    padding: 10px 20px;
}
.btn-minimal::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 24px;
    right: 24px;
    height: 2px;
    background: var(--accent-gold-light);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    border-radius: 1px;
}
.btn-minimal:hover::after {
    transform: scaleX(1);
}
.btn-minimal:hover {
    transform: translateY(-2px);
}

/* ==================== Quote Card ==================== */
.quote-card {
    width: 100%;
    max-width: 680px;
    margin-bottom: 32px;
    border-radius: 16px;
    border: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    min-height: 150px;
    background: linear-gradient(135deg, #8B6B4A, #C0392B, #E8A848);
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
}

.quote-card .quote-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1;
}

.quote-card .quote-inner {
    position: relative;
    z-index: 2;
    padding: 36px 32px;
    text-align: center;
}

.quote-card .quote-mark {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 52px;
    color: rgba(255,255,255,0.2);
    line-height: 1;
    margin-bottom: -8px;
}

.quote-card .quote-text {
    font-size: 18px;
    color: #fff;
    line-height: 1.9;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
    letter-spacing: 1px;
}

.quote-card .quote-author {
    font-size: 14px;
    color: rgba(255,255,255,0.65);
    margin-top: 14px;
    text-align: right;
    padding-right: 4px;
}

.quote-card .quote-refresh {
    position: absolute;
    bottom: 12px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.5);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 3;
    line-height: 1;
}

.quote-card .quote-refresh:hover {
    background: rgba(255,255,255,0.25);
    color: #fff;
    transform: rotate(180deg);
}

[data-theme="dark"] .quote-card {
    box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}

/* ==================== Social Row ==================== */
.social-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 8px 0 18px;
    width: 100%;
    max-width: 680px;
}

.social-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
    position: relative;
}

.social-icon-link:hover {
    transform: translateY(-4px) scale(1.08);
}

.social-icon-link .social-icon-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    box-shadow: 0 2px 8px var(--shadow-icon);
    transition: box-shadow 0.3s ease;
}

.social-icon-link:hover .social-icon-img {
    box-shadow: 0 4px 16px var(--shadow-icon);
}

.social-icon-fallback {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 2px 8px var(--shadow-icon);
}

/* Tooltip on hover */
.social-icon-link::after {
    content: attr(title);
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}

.social-icon-link:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* ==================== Footer ==================== */
.footer {
    text-align: center;
    padding: 24px 20px;
    color: var(--text-footer);
    font-size: 13px;
    margin-top: 16px;
    width: 100%;
    letter-spacing: 1px;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 30%;
    right: 30%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--line-footer), transparent);
}

/* ==================== Theme Toggle Button ==================== */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    box-shadow: var(--shadow-card);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text-heading);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-card-hover);
}

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

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

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

/* ==================== Theme Transition Overlay ==================== */
.theme-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
    will-change: clip-path;
}

/* ==================== Animations ==================== */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .theme-toggle {
        top: 12px;
        right: 12px;
        width: 34px;
        height: 34px;
    }

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

    .container {
        padding: 16px 16px 24px;
    }

    .top-signature {
        font-size: 12px;
        letter-spacing: 3px;
        margin-bottom: 28px;
    }

    .avatar-frame-wrap {
        width: 140px;
        height: 140px;
    }

    .avatar-frame-wrap .avatar-photo {
        width: 105px;
        height: 105px;
    }

    .avatar-section h1 {
        font-size: 28px;
    }

    .avatar-section .bio {
        font-size: 16px;
    }

    .about-card {
        padding: 28px 20px 28px 32px;
    }

    .about-card h2 { font-size: 18px; }
    .about-card p { font-size: 15px; }

    .soot-sprite {
        width: 34px;
        height: 30px;
        bottom: 8px;
        right: 12px;
    }

    .soot-sprite .ss-eye {
        top: 9px;
        width: 7px;
        height: 9px;
    }

    .soot-sprite .ss-eye.left { left: 6px; }
    .soot-sprite .ss-eye.right { right: 6px; }

    .soot-sprite .ss-eye::after {
        top: 2px;
        left: 1px;
        width: 4px;
        height: 5px;
    }

    .about-card .leaf-cluster {
        right: 54px;
    }

    .btn-block {
        padding: 12px 20px;
        font-size: 15px;
    }

    .btn-block .btn-logo img {
        width: 24px;
        height: 24px;
    }

    .social-row {
        gap: 12px;
    }

    .social-icon-link,
    .social-icon-link .social-icon-img,
    .social-icon-fallback {
        width: 38px;
        height: 38px;
    }

    .social-icon-fallback {
        font-size: 14px;
    }
}

@media (max-width: 420px) {
}
