/* ============================================
   UNDO.CAFE - Contemplative Cafe for Revision
   ============================================ */

:root {
    --chalkboard: #2d2926;
    --wood: #8b7355;
    --paper: #f5e6d0;
    --ink: #3b2f2a;
    --chalk: #e8dcc8;
    --coffee: #6b4226;
    --amber: #d4a847;
    --eraser: #c4a97d;
}

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

html {
    background: var(--wood);
}

body {
    font-family: 'Lora', serif;
    color: var(--ink);
    overflow-x: hidden;
    line-height: 1.75;
}

/* === Surfaces === */
.surface-chalkboard {
    background: var(--chalkboard);
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    overflow: hidden;
}

.surface-wood {
    background: var(--wood);
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(0,0,0,0.03) 0px,
            transparent 1px,
            transparent 6px,
            rgba(0,0,0,0.02) 7px,
            transparent 8px,
            transparent 18px
        );
    position: relative;
    min-height: 100vh;
    padding: 6rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.surface-linen {
    background: var(--paper);
    background-image: radial-gradient(circle, rgba(59,47,42,0.04) 1px, transparent 1px);
    background-size: 8px 8px;
    position: relative;
    min-height: 100vh;
    padding: 6rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* === Chalk Texture Noise === */
.chalk-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 3px 3px;
    pointer-events: none;
    z-index: 1;
}

/* === Chalkboard Content === */
.chalkboard-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 600px;
}

.chalk-title {
    font-family: 'Amatic SC', cursive;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    color: var(--chalk);
    letter-spacing: 0.02em;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.chalk-title.visible {
    opacity: 1;
}

.chalk-eraser-smudge {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 80px;
    background: rgba(45,41,38,0.5);
    filter: blur(20px);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 2s ease 2s;
}

.chalk-eraser-smudge.visible {
    opacity: 1;
}

.chalk-ghost {
    font-family: 'Amatic SC', cursive;
    font-size: 1.5rem;
    color: var(--chalk);
    opacity: 0.12;
    margin-top: 3rem;
    filter: blur(1px);
}

/* === Menu Items === */
.chalk-menu {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.menu-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.menu-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.struck-chalk {
    font-family: 'Amatic SC', cursive;
    font-size: 1.6rem;
    color: var(--chalk);
    opacity: 0.4;
    text-decoration: line-through;
    text-decoration-color: var(--eraser);
}

.corrected-chalk {
    font-family: 'Amatic SC', cursive;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--chalk);
}

/* === Eraser Trail === */
.eraser-trail {
    height: 20px;
    background: linear-gradient(90deg, transparent, rgba(196,169,125,0.15), transparent);
    filter: blur(6px);
}

/* === Paper Notes === */
.paper-note {
    background: var(--paper);
    padding: 3rem;
    max-width: 600px;
    width: 100%;
    position: relative;
    transform: rotate(var(--rotation, 0deg));
    clip-path: polygon(0% 2%, 3% 0%, 8% 1%, 15% 0%, 22% 1.5%, 30% 0%, 38% 0.5%, 45% 0%, 52% 1%, 60% 0%, 68% 0.5%, 75% 0%, 82% 1%, 90% 0%, 95% 1%, 100% 0%, 100% 98%, 97% 100%, 92% 99%, 85% 100%, 78% 99%, 70% 100%, 62% 99%, 55% 100%, 48% 99%, 40% 100%, 32% 99%, 25% 100%, 18% 99%, 10% 100%, 5% 99%, 0% 100%);
    box-shadow: 2px 4px 12px rgba(0,0,0,0.2);
}

.paper-centered {
    text-align: center;
}

.paper-heading {
    font-family: 'Amatic SC', cursive;
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 700;
    color: var(--coffee);
    margin-bottom: 1.5rem;
}

.body-text {
    font-family: 'Lora', serif;
    font-size: clamp(1rem, 1.15vw, 1.15rem);
    font-weight: 400;
    color: var(--ink);
    line-height: 1.75;
    margin-bottom: 1.2rem;
}

.body-text.fade-in {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.body-text.fade-in.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* === Undo Text (crossed-out + correction) === */
.undo-text {
    position: relative;
    display: inline;
}

.struck {
    text-decoration: line-through;
    text-decoration-color: var(--coffee);
    opacity: 0.5;
}

.correction {
    font-weight: 600;
    color: var(--coffee);
}

/* === Coffee Rings === */
.coffee-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.ring-xs {
    width: 40px;
    height: 40px;
    top: -10px;
    right: 15px;
    background: radial-gradient(circle, transparent 35%, rgba(139,105,20,0.1) 50%, transparent 65%);
    transform: rotate(15deg);
}

.ring-sm {
    width: 60px;
    height: 60px;
    top: -15px;
    right: 20px;
    background: radial-gradient(circle, transparent 30%, rgba(139,105,20,0.08) 48%, transparent 60%);
    transform: rotate(-10deg);
}

/* === Napkin Notes === */
.napkin-note {
    background: var(--paper);
    background-image: radial-gradient(circle, rgba(59,47,42,0.03) 1px, transparent 1px);
    background-size: 6px 6px;
    padding: 1.5rem;
    max-width: 320px;
    width: 100%;
    position: relative;
    transform: rotate(var(--rotation, 0deg));
    box-shadow: 1px 2px 6px rgba(0,0,0,0.1);
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.napkin-note.revealed {
    opacity: 1;
}

.napkin-slide {
    transform: translateX(40px) rotate(var(--rotation, 0deg));
}

.napkin-slide.revealed {
    transform: translateX(0) rotate(var(--rotation, 0deg));
}

.napkin-text {
    font-family: 'Caveat Brush', cursive;
    font-size: clamp(1.1rem, 1.3vw, 1.3rem);
    color: #5a4a3a;
    line-height: 1.5;
}

/* === Afternoon Light === */
.afternoon-light {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    background: radial-gradient(ellipse at 80% 30%, rgba(212,168,71,0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.afternoon-fading {
    transition: opacity 3s ease;
}

/* === Dried Flowers === */
.dried-flower {
    position: absolute;
    z-index: 1;
    opacity: 0.6;
}

.flower-left {
    left: 5%;
    top: 20%;
}

.flower-svg {
    width: 30px;
    height: 150px;
}

/* === Section Headings === */
.section-heading {
    font-family: 'Amatic SC', cursive;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    color: var(--coffee);
    margin-bottom: 3rem;
    text-align: center;
}

.chalk-on-wood {
    color: var(--chalk);
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* === Polaroid Gallery === */
.polaroid-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 800px;
    width: 100%;
}

.polaroid {
    background: #fff;
    padding: 1.5rem 1.5rem 3rem;
    box-shadow: 2px 4px 12px rgba(0,0,0,0.2);
    transform: rotate(var(--rotation, 0deg)) translateY(40px);
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.polaroid.revealed {
    opacity: 1;
    transform: rotate(var(--rotation, 0deg)) translateY(0);
}

.polaroid-text {
    font-family: 'Lora', serif;
    font-size: 0.95rem;
    color: var(--ink);
    line-height: 1.7;
}

/* === Napkin Grid === */
.napkin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 900px;
    width: 100%;
}

/* === Closing Section === */
#closing-time {
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.closing-text {
    font-size: 1.15rem;
    margin-bottom: 0.8rem;
}

.closing-chalkboard {
    background: var(--chalkboard);
    padding: 2rem 3rem;
    border-radius: 4px;
    margin-top: 4rem;
}

.chalk-footer {
    font-family: 'Amatic SC', cursive;
    font-size: 2rem;
    font-weight: 700;
    color: var(--chalk);
    text-align: center;
    opacity: 0.7;
}

/* === Responsive === */
@media (max-width: 768px) {
    .polaroid-gallery {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .napkin-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
    }

    .paper-note {
        transform: rotate(0deg);
    }

    .napkin-note {
        max-width: 100%;
    }

    .dried-flower {
        display: none;
    }

    .surface-wood,
    .surface-linen {
        padding: 4rem 1.5rem;
    }
}
