:root {
    --rice-white: #F5F0E6;
    --ink-black: #231F20;
    --cinnabar-red: #AD2B1E;
    --stone-grey: #8C8276;
    --serif-font: 'Palatino', 'Crimson Pro', serif;
    --sans-font: 'Avenir Next', 'Inter', sans-serif;
    --chinese-font: 'Songti SC', serif;
}

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

body {
    background-color: var(--rice-white);
    color: var(--ink-black);
    font-family: var(--serif-font);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography Helpers */
h1, h2, h3, .section-title {
    font-weight: normal;
}

.hero-title-chinese {
    font-family: var(--chinese-font);
    font-size: 4rem;
    color: var(--ink-black);
    margin-bottom: 0.5rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(245, 240, 230, 0.95);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.lang-toggle {
    font-family: var(--sans-font);
    font-size: 0.9rem;
}

.lang-toggle span {
    cursor: pointer;
    color: var(--stone-grey);
    padding: 0 0.5rem;
    transition: color 0.3s;
}

.lang-toggle span:hover {
    color: var(--ink-black);
}

.lang-toggle span.active {
    color: var(--cinnabar-red);
    font-weight: bold;
}

.cta-btn {
    background-color: var(--cinnabar-red);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    font-family: var(--sans-font);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.cta-btn:hover {
    background-color: #8a2117;
}

/* Hero Section */
.hero-section {
    display: flex;
    min-height: 100vh;
    padding: 6rem 2rem 2rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-left {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cover-img {
    max-width: 80%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.hero-right {
    flex: 1;
    padding-left: 4rem;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--stone-grey);
    margin-bottom: 2rem;
    font-style: italic;
}

.hero-snippet {
    font-size: 1.1rem;
    max-width: 500px;
}

/* Separator */
.taiji-sep {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 4rem 0;
}

.taiji-sep .dot {
    color: var(--cinnabar-red);
    font-size: 1.5rem;
    line-height: 0;
}

.taiji-sep .line {
    width: 60px;
    height: 1px;
    background-color: var(--ink-black);
    margin: 0 1rem;
}

/* Annotation Section */
.annotation-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    font-size: 1.25rem;
    line-height: 1.8;
}

/* Canon Section */
.canon-section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--cinnabar-red);
}

.canon-lines {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.canon-line {
    border-bottom: 1px solid rgba(140, 130, 118, 0.3);
    padding-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.canon-line:hover {
    border-bottom-color: var(--cinnabar-red);
}

.canon-line .chinese {
    font-family: var(--chinese-font);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.canon-line .details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    padding-left: 1rem;
    border-left: 2px solid var(--cinnabar-red);
    transition: max-height 1.2s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 1.2s ease, 
                margin-top 1.2s ease;
}

.canon-line.active .details {
    max-height: 500px;
    opacity: 1;
    margin-top: 1rem;
}

.canon-line .pinyin {
    font-family: var(--sans-font);
    font-size: 0.9rem;
    color: var(--stone-grey);
    margin-bottom: 0.5rem;
}

.canon-line .translation {
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 0.5rem;
}

.canon-line .essence {
    font-family: var(--sans-font);
    font-size: 0.95rem;
}

/* Demo Cards Section */
.demo-section {
    max-width: 1000px;
    margin: 4rem auto;
    padding: 0 2rem;
    text-align: center;
}

.demo-intro {
    max-width: 700px;
    margin: 0 auto 3rem;
    font-size: 1.1rem;
    color: var(--ink-black);
    line-height: 1.7;
}

.demo-grid-container {
    display: flex;
    justify-content: center;
}

.demo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 800px;
    text-align: left;
}

.demo-card {
    background: white;
    padding: 2.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border-top: 3px solid var(--cinnabar-red);
    display: flex;
    flex-direction: column;
    min-height: 280px;
}

.demo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.demo-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.demo-card p {
    font-size: 1rem;
    color: var(--stone-grey);
    flex-grow: 1;
}

.demo-card .read-more {
    margin-top: 1.5rem;
    font-family: var(--sans-font);
    font-size: 0.85rem;
    color: var(--cinnabar-red);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(35, 31, 32, 0.9);
    z-index: 2000;
    overflow-y: auto;
}

.lightbox.active {
    display: block;
}

.lightbox-content {
    background: var(--rice-white);
    max-width: 800px;
    margin: 4rem auto;
    padding: 4rem;
    position: relative;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 2rem;
    font-size: 2.5rem;
    cursor: pointer;
    color: var(--stone-grey);
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--cinnabar-red);
}

/* Book Page Simulation inside Lightbox */
.book-page {
    font-family: var(--serif-font);
    font-size: 1.1rem;
    line-height: 1.7;
}

.book-page h2 {
    font-size: 1.8rem;
    color: var(--cinnabar-red);
    margin-bottom: 1.5rem;
    text-align: center;
}

.book-page .chinese-text {
    font-family: var(--chinese-font);
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.book-page h3 {
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 2rem;
    color: var(--stone-grey);
    font-family: var(--sans-font);
    font-size: 0.9rem;
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        flex-direction: column;
        padding-top: 8rem;
        text-align: center;
    }
    .hero-left {
        margin-bottom: 2rem;
    }
    .hero-right {
        padding-left: 0;
    }
    .hero-title-chinese {
        font-size: 3rem;
    }
    .demo-grid {
        grid-template-columns: 1fr;
    }
    .lightbox-content {
        margin: 2rem 1rem;
        padding: 2rem 1rem;
    }
}
