:root {
    --bg-color: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --accent-red: #ff4d4d;
    --accent-blue: #007aff;
    --accent-yellow: #ffcc00;
    --accent-green: #34c759;
    --grid-size: 40px;
    --font-serif: 'EB Garamond', serif;
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
    --bg-color: #0f0f0f;
    --text-primary: #ededed;
    --text-secondary: #a0a0a0;
    --border-color: #333333;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Grid */
.viewport-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(to right, var(--border-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--border-color) 1px, transparent 1px);
    background-size: var(--grid-size) var(--grid-size);
    z-index: -1;
    opacity: 0.3;
}

.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.02) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 10;
    opacity: 0.5;
}

/* Container */
.ivan-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 80px 40px;
    position: relative;
    z-index: 1;
}

/* Header */
.header-section {
    text-align: center;
    margin-bottom: 100px;
    border-bottom: 2px solid var(--text-primary);
    padding-bottom: 60px;
}

.badge-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 4px 12px;
    border: 1px solid var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.badge.accent {
    background: var(--text-primary);
    color: var(--bg-color);
}

.glitch-title {
    font-size: clamp(3rem, 12vw, 8rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 0.9;
    margin-bottom: 10px;
    position: relative;
}

.subtitle-zh {
    font-size: 1.5rem;
    letter-spacing: 0.5em;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.main-motto {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.8rem;
    color: var(--text-primary);
    max-width: 700px;
    margin: 0 auto 10px;
}

.motto-sub {
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
}

.identity-tags {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-blue);
    background: rgba(0, 122, 255, 0.05);
    padding: 6px 14px;
    border-radius: 4px;
}

/* Philosophy Cards */
.philosophy-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 100px;
}

.block-card {
    border: 2px solid var(--text-primary);
    padding: 40px;
    position: relative;
    background: var(--bg-color);
    box-shadow: 10px 10px 0px var(--text-primary);
    transition: transform 0.2s, box-shadow 0.2s;
}

.block-card:hover {
    transform: translate(-4px, -4px);
    box-shadow: 14px 14px 0px var(--text-primary);
}

.block-label {
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--bg-color);
    border: 1px solid var(--text-primary);
    padding: 2px 10px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: bold;
}

.block-card h2,
.block-card h3 {
    font-family: var(--font-serif);
    margin-bottom: 20px;
}

.philosophy-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Lego Animation Box */
.lego-animation-box {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.lego-brick {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

.lego-brick::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
}

.lego-brick.red {
    background: var(--accent-red);
}

.lego-brick.blue {
    background: var(--accent-blue);
}

.lego-brick.yellow {
    background: var(--accent-yellow);
}

.lego-brick.green {
    background: var(--accent-green);
}

.comparison-list {
    list-style: none;
    margin-top: 10px;
}

.comparison-list li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

/* Timeline */
.timeline-section {
    margin-bottom: 120px;
}

.custom-timeline {
    margin-top: 60px;
    border-left: 4px solid var(--text-primary);
    padding-left: 40px;
}

.t-item {
    position: relative;
    margin-bottom: 60px;
}

.t-dot {
    position: absolute;
    left: -48px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--bg-color);
    border: 4px solid var(--text-primary);
    transition: all 0.3s;
}

.t-item:hover .t-dot {
    background: var(--accent-red);
    transform: scale(1.5);
}

.t-item::before {
    content: attr(data-year);
    position: absolute;
    left: -120px;
    top: 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 800;
}

.t-content h4 {
    margin-bottom: 8px;
    font-size: 1.3rem;
    font-weight: 700;
}

.t-content p {
    color: var(--text-secondary);
}

.t-item.highlight .t-content {
    background: rgba(0, 0, 0, 0.03);
    padding: 20px;
    border-left: 4px solid var(--accent-red);
}

/* Color Block Viz */
.color-block-section {
    margin-bottom: 120px;
}

.visualization-container {
    display: flex;
    gap: 40px;
    align-items: center;
    margin-top: 40px;
    background: rgba(0, 0, 0, 0.02);
    padding: 40px;
    border: 1px solid var(--border-color);
}

.viz-canvas {
    flex: 1;
    height: 300px;
    display: flex;
    align-items: flex-end;
    gap: 15px;
    padding: 20px;
    border-bottom: 2px solid var(--text-primary);
}

.viz-desc {
    width: 300px;
}

.bullet {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 8px;
}

.bullet.red {
    background: var(--accent-red);
}

.bullet.blue {
    background: var(--accent-blue);
}

.bullet.yellow {
    background: var(--accent-yellow);
}

/* Evolution Stages */
.evolution-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 120px;
}

.stage-card {
    border: 1px solid var(--border-color);
    padding: 30px;
    text-align: center;
    transition: all 0.3s;
}

.stage-card:hover {
    border-color: var(--text-primary);
    background: rgba(0, 0, 0, 0.02);
}

.stage-num {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.stage-card h4 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    margin-bottom: 10px;
}

/* AI Section */
.ai-section {
    background: var(--text-primary);
    color: var(--bg-color);
    padding: 100px 60px;
    position: relative;
    overflow: hidden;
    margin-bottom: 100px;
}

.ai-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at center, transparent 30%, rgba(0, 122, 255, 0.1));
    pointer-events: none;
}

.ai-section .block-label {
    background: var(--text-primary);
    color: var(--bg-color);
    border-color: var(--bg-color);
}

.ai-quotes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 40px 0;
}

.quote-box {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-style: italic;
    line-height: 1.4;
}

.ai-metaphor {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-blue);
    display: flex;
    justify-content: center;
    gap: 30px;
}

/* Footer */
.footer-section {
    text-align: center;
    padding: 100px 0;
    border-top: 2px solid var(--text-primary);
}

.final-motto {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    margin-bottom: 40px;
}

.footer-meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@media (max-width: 768px) {

    .philosophy-layout,
    .ai-quotes,
    .evolution-grid {
        grid-template-columns: 1fr;
    }

    .visualization-container {
        flex-direction: column;
    }

    .ivan-container {
        padding: 40px 20px;
    }

    .t-item::before {
        left: 0;
        top: -25px;
    }
}