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

body {
    font-family: 'Nunito', sans-serif;
    background: #FAF5E8;
    color: #5A4A3A;
    line-height: 1.75;
    font-size: 16px;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 20px, rgba(90, 74, 58, 0.02) 20px, rgba(90, 74, 58, 0.02) 21px),
        repeating-linear-gradient(135deg, transparent, transparent 20px, rgba(90, 74, 58, 0.02) 20px, rgba(90, 74, 58, 0.02) 21px);
}

h1, h2, h3 {
    font-family: 'Caveat', cursive;
    color: #3A2A1A;
}

/* Header */
.notebook-header {
    text-align: center;
    padding: 80px 24px 40px;
    border-bottom: 2px dashed #C8A080;
}

.site-title {
    font-size: 64px;
    font-weight: 700;
    color: #3A2A1A;
    line-height: 1.1;
}

.site-subtitle {
    font-family: 'Nunito', sans-serif;
    font-size: 18px;
    color: #7A6A5A;
    margin-top: 8px;
}

/* Timeline */
.timeline-container {
    position: relative;
    max-width: 880px;
    margin: 0 auto;
    padding: 64px 24px;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    width: 100px;
    height: 100%;
    transform: translateX(-50%);
    z-index: 0;
}

.timeline-path {
    fill: none;
    stroke: #5A4A3A;
    stroke-width: 2;
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
    animation: drawLine 2s ease forwards;
}

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

/* Milestones */
.milestone {
    position: relative;
    width: 45%;
    margin-bottom: 48px;
    opacity: 0;
}

.milestone.left {
    margin-right: auto;
    padding-right: 40px;
    transform: rotate(-0.5deg);
}

.milestone.right {
    margin-left: auto;
    padding-left: 40px;
    transform: rotate(0.5deg);
}

.milestone.visible {
    opacity: 1;
}

.milestone.visible .milestone-card {
    animation: cardFlip 0.5s ease-out forwards;
}

.node {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #D4A84B;
    border: 3px solid #5A4A3A;
    border-radius: 50%;
    top: 24px;
    z-index: 2;
    opacity: 0;
    transform: scale(0);
}

.milestone.visible .node {
    animation: nodeAppear 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.milestone.left .node {
    right: -7px;
}

.milestone.right .node {
    left: -7px;
}

@keyframes nodeAppear {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes cardFlip {
    from { opacity: 0; transform: perspective(800px) rotateY(90deg); }
    to { opacity: 1; transform: perspective(800px) rotateY(0deg); }
}

.milestone.left .milestone-card {
    transform-origin: right center;
}

.milestone.right .milestone-card {
    transform-origin: left center;
}

.milestone-card {
    background: #FAF5E8;
    border: 2px solid #E8DCC8;
    border-radius: 4px;
    padding: 24px;
    position: relative;
    opacity: 0;
    box-shadow: 3px 3px 0 #E8DCC8;
}

.milestone-card:hover {
    border-color: #D4A84B;
    box-shadow: 3px 3px 0 #D4A84B;
}

.milestone-card:hover .milestone-formula {
    text-shadow: 0 0 4px rgba(212, 168, 75, 0.6);
}

.milestone-year {
    font-family: 'Caveat', cursive;
    font-size: 36px;
    font-weight: 700;
    color: #D4A84B;
    display: block;
    line-height: 1;
}

.milestone-title {
    font-size: 26px;
    font-weight: 700;
    margin: 8px 0;
    line-height: 1.3;
}

.milestone-desc {
    font-size: 15px;
    color: #5A4A3A;
    margin-bottom: 12px;
}

.milestone-formula {
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    color: #7A6A5A;
    display: block;
    padding: 8px 12px;
    background: rgba(184, 168, 136, 0.15);
    border-radius: 4px;
    transition: text-shadow 0.3s ease;
}

/* Sticky Note accent */
.milestone-card::before {
    content: '';
    position: absolute;
    top: -4px;
    right: 12px;
    width: 24px;
    height: 8px;
    background: #D4A84B;
    opacity: 0.6;
    border-radius: 0 0 2px 2px;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 48px 24px;
    border-top: 2px dashed #C8A080;
}

.footer-brand {
    font-family: 'Caveat', cursive;
    font-size: 28px;
    font-weight: 700;
    color: #3A2A1A;
    display: block;
}

.footer-note {
    font-size: 14px;
    color: #7A6A5A;
}

/* Palette: #B8A888 #E8DCC8 #5A8A5A #C87A5A */

@media (max-width: 768px) {
    .timeline-line { left: 24px; }
    .milestone { width: 85%; margin-left: 48px !important; margin-right: 0 !important; padding-left: 24px !important; padding-right: 0 !important; }
    .milestone .node { left: -31px !important; right: auto !important; }
    .milestone-card { transform-origin: left center !important; }
    .site-title { font-size: 44px; }
}
