/* undo.cafe — cottagecore pastoral cafe with undo-button whimsy */

:root {
    --espresso: #2c1810;
    --oat-milk: #faf3eb;
    --berry-jam: #a83248;
    --sage: #6b8f71;
    --cinnamon: #c47c4a;
    --chalk-white: #e8e0d4;

    --font-display: 'Caveat', 'Segoe Script', cursive;
    --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--oat-milk);
    color: var(--espresso);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    /* subtle paper-grain via tiny SVG noise */
    background-image:
        radial-gradient(circle at 20% 10%, rgba(196, 124, 74, 0.05), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(168, 50, 72, 0.04), transparent 50%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.17  0 0 0 0 0.09  0 0 0 0 0.06  0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-attachment: fixed;
}

.menu-board {
    max-width: 720px;
    margin: 0 auto;
    padding: 3rem 2rem 6rem;
    position: relative;
}

/* ======= Wavy dividers ======= */
.wavy-divider {
    display: block;
    width: 100%;
    height: 22px;
    margin: 1.4rem auto;
    opacity: 0.85;
}
.wavy-divider.small {
    height: 16px;
    margin: 0.6rem auto 1.6rem;
    max-width: 420px;
}

/* ======= Strike-through palimpsest motif ======= */
.undo-text {
    position: relative;
    display: inline-block;
    line-height: 1.25;
}
.undo-text .previous {
    position: absolute;
    top: -0.85em;
    left: 0;
    right: 0;
    color: var(--berry-jam);
    opacity: 0.42;
    font-size: 0.6em;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    pointer-events: none;
    /* wavy strike-through via SVG background */
    text-decoration: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 6' preserveAspectRatio='none'%3E%3Cpath d='M0,3 Q12.5,0 25,3 T50,3 T75,3 T100,3' stroke='%23a83248' stroke-width='1.4' fill='none' stroke-opacity='0.85'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 100% 0.55em;
    background-position: 0 60%;
    transform: rotate(-1.2deg);
    transform-origin: left center;
}
.undo-text .current {
    display: inline-block;
}

/* ======= Header ======= */
.cafe-header {
    text-align: center;
    padding-top: 2rem;
    position: relative;
}
.open-sign {
    display: inline-block;
    background: var(--berry-jam);
    color: var(--oat-milk);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    padding: 0.25rem 1.4rem;
    border-radius: 999px;
    letter-spacing: 0.18em;
    transform: rotate(-3deg);
    box-shadow: 0 3px 0 rgba(44, 24, 16, 0.18);
    cursor: pointer;
    user-select: none;
    margin-bottom: 1.5rem;
}
.open-sign.closed {
    background: var(--espresso);
    color: var(--chalk-white);
}
.cafe-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.6rem, 7vw, 4.4rem);
    color: var(--espresso);
    letter-spacing: 0.01em;
    margin-top: 0.4rem;
}
.cafe-name .previous {
    top: -0.5em;
    font-size: 0.45em;
}
.tagline {
    margin-top: 1.5rem;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.2rem, 2.6vw, 1.7rem);
    color: var(--cinnamon);
}
.tagline .previous {
    top: -0.7em;
    font-size: 0.55em;
}

/* ======= Sections ======= */
.section {
    padding: 2.5rem 0 1rem;
    position: relative;
}
.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.75rem, 3.5vw, 2.75rem);
    color: var(--espresso);
    text-align: center;
    line-height: 1.1;
}
.section-subtitle {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    font-variant: small-caps;
    letter-spacing: 0.08em;
    color: var(--cinnamon);
    margin-top: 0.4rem;
}

.lead {
    font-size: 1.05rem;
    margin-top: 1rem;
    text-align: center;
    max-width: 56ch;
    margin-left: auto;
    margin-right: auto;
}
.muted {
    color: rgba(44, 24, 16, 0.7);
}
.strike-count {
    color: var(--berry-jam);
    font-weight: 700;
    font-family: var(--font-display);
    font-size: 1.25em;
    padding: 0 0.1em;
}

/* ======= Menu list ======= */
.menu-list {
    list-style: none;
    margin-top: 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}
.menu-item {
    position: relative;
    padding: 0.4rem 0 0;
}
.menu-item-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--espresso);
    display: inline-block;
    line-height: 1.2;
}
.menu-item-name .previous {
    top: -0.5em;
    font-size: 0.45em;
}
.menu-item-dots {
    display: inline-block;
    flex: 1;
    border-bottom: 2px dotted rgba(196, 124, 74, 0.5);
    margin: 0 0.7rem 0.35rem;
    height: 0;
    min-width: 30px;
    vertical-align: bottom;
}
.menu-item-price {
    display: inline-block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--berry-jam);
    vertical-align: bottom;
}
.menu-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: end;
    column-gap: 0.6rem;
    row-gap: 0.4rem;
}
.menu-item-desc {
    grid-column: 1 / -1;
    font-size: 0.95rem;
    color: rgba(44, 24, 16, 0.78);
    margin-top: 0.2rem;
    max-width: 60ch;
}

/* ======= Counter-top tent cards ======= */
.counter-top { }
.tent-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 580px;
    margin: 1.8rem auto 0;
}
.tent-card {
    background: var(--oat-milk);
    border: 1px solid var(--cinnamon);
    border-radius: 14px 14px 3px 3px;
    padding: 1.5rem 1.1rem 1.3rem;
    text-align: center;
    box-shadow: 0 3px 10px rgba(44, 24, 16, 0.08);
    position: relative;
    transition: transform 200ms ease, box-shadow 200ms ease, background-color 200ms ease;
    cursor: default;
}
.tent-card::before {
    /* tiny easel "stand" line at bottom */
    content: "";
    position: absolute;
    bottom: -6px;
    left: 12%;
    right: 12%;
    height: 2px;
    background: rgba(196, 124, 74, 0.4);
    border-radius: 2px;
}
.tent-card:hover {
    background: #fdf7ee;
    transform: translateY(-2px) rotate(-0.4deg);
    box-shadow: 0 6px 16px rgba(44, 24, 16, 0.12);
}
.tent-card[data-card="2"] { transform: rotate(0.6deg); }
.tent-card[data-card="3"] { transform: rotate(-0.5deg); }
.tent-card[data-card="2"]:hover { transform: rotate(0.2deg) translateY(-2px); }
.tent-card[data-card="3"]:hover { transform: rotate(-0.1deg) translateY(-2px); }
.tent-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tent-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--espresso);
    margin-bottom: 0.4rem;
}
.tent-text {
    font-size: 0.92rem;
    color: rgba(44, 24, 16, 0.78);
    line-height: 1.5;
}

/* ======= Chalkboard section ======= */
.chalkboard {
    position: relative;
    background: var(--espresso);
    color: var(--chalk-white);
    padding: 3rem 2rem 3.5rem;
    margin: 3.5rem -2rem;
    width: calc(100% + 4rem);
    border-radius: 6px;
    box-shadow:
        inset 0 0 60px rgba(0, 0, 0, 0.35),
        0 6px 24px rgba(44, 24, 16, 0.25);
    overflow: hidden;
}
.chalkboard::before {
    /* wood-frame edge */
    content: "";
    position: absolute;
    inset: 6px;
    border: 2px solid rgba(196, 124, 74, 0.55);
    border-radius: 4px;
    pointer-events: none;
}
.chalk-dust {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.91  0 0 0 0 0.88  0 0 0 0 0.83  0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)'/%3E%3C/svg%3E");
    opacity: 0.08;
    mix-blend-mode: screen;
}
.chalkboard-inner {
    position: relative;
    text-align: center;
    z-index: 1;
}
.chalk-eyebrow {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--cinnamon);
    letter-spacing: 0.12em;
    margin-bottom: 0.6rem;
}
.chalk-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--chalk-white);
    line-height: 1.1;
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}
.chalk-heading::before {
    /* erased ghost text */
    content: attr(data-erased);
    position: absolute;
    top: -0.55em;
    left: 50%;
    transform: translateX(-50%) rotate(-1deg);
    font-size: 0.42em;
    color: var(--chalk-white);
    opacity: 0.18;
    filter: blur(1px);
    text-decoration: line-through;
    text-decoration-color: rgba(232, 224, 212, 0.5);
    white-space: nowrap;
    pointer-events: none;
}
.chalk-list {
    list-style: none;
    margin: 1rem auto 1.4rem;
    max-width: 460px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    font-family: var(--font-display);
    font-size: 1.4rem;
    line-height: 1.3;
}
.chalk-list li {
    border-bottom: 1px dashed rgba(232, 224, 212, 0.2);
    padding-bottom: 0.7rem;
}
.chalk-list li:last-child { border-bottom: none; }
.chalk-strike {
    display: block;
    color: var(--chalk-white);
    opacity: 0.4;
    font-size: 0.78em;
    text-decoration: line-through;
    text-decoration-color: rgba(168, 50, 72, 0.7);
    text-decoration-thickness: 1.5px;
}
.chalk-current {
    display: block;
    color: var(--chalk-white);
    margin-top: -0.1em;
}
.chalk-current::before {
    content: "→ ";
    color: var(--cinnamon);
    margin-right: 0.2em;
}
.chalk-footer {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: rgba(232, 224, 212, 0.7);
    font-variant: small-caps;
    letter-spacing: 0.08em;
    margin-top: 0.6rem;
}
#eraseCount {
    color: var(--cinnamon);
    font-weight: 700;
    font-size: 1.05em;
}
.chalk-erase-btn {
    margin-top: 1.2rem;
    background: transparent;
    color: var(--chalk-white);
    border: 1.5px dashed var(--cinnamon);
    border-radius: 999px;
    padding: 0.5rem 1.4rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-variant: small-caps;
    letter-spacing: 0.08em;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 180ms ease, color 180ms ease;
}
.chalk-erase-btn:hover {
    background: var(--cinnamon);
    color: var(--espresso);
}
.chalk-erase-btn.erasing {
    background: var(--berry-jam);
    border-color: var(--berry-jam);
    color: var(--oat-milk);
}

/* ======= Erasure poem ======= */
.erasure-poem {
    margin: 1.6rem auto 0;
    max-width: 56ch;
    font-family: var(--font-body);
    font-size: 1.15rem;
    line-height: 2.1;
    text-align: center;
    color: var(--espresso);
}
.erasure-poem p { margin-bottom: 1rem; }
.erasure-poem .word {
    display: inline-block;
    padding: 0 0.18em;
    margin: 0 0.04em;
    cursor: pointer;
    border-radius: 4px;
    transition: background 160ms ease, color 160ms ease, opacity 160ms ease;
    user-select: none;
}
.erasure-poem .word:hover {
    background: rgba(196, 124, 74, 0.18);
}
.erasure-poem .word.kept {
    color: var(--berry-jam);
    font-weight: 700;
    font-family: var(--font-display);
    font-size: 1.45rem;
    line-height: 1;
}
.erasure-poem .word.erased {
    color: var(--berry-jam);
    opacity: 0.35;
    text-decoration: line-through;
    text-decoration-color: var(--berry-jam);
    text-decoration-thickness: 1.5px;
}
.erasure-poem .word.kept.erased {
    color: var(--berry-jam);
    opacity: 0.3;
}
.poem-hint {
    text-align: center;
    margin-top: 1.2rem;
    font-size: 0.85rem;
    color: var(--sage);
    font-variant: small-caps;
    letter-spacing: 0.08em;
}

/* ======= Hours table ======= */
.hours-table {
    width: 100%;
    max-width: 520px;
    margin: 1.4rem auto 0;
    border-collapse: collapse;
    font-size: 1rem;
}
.hours-table th,
.hours-table td {
    padding: 0.6rem 0.4rem;
    text-align: left;
    border-bottom: 1px dashed rgba(196, 124, 74, 0.35);
    vertical-align: top;
}
.hours-table th {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--sage);
    width: 40%;
    white-space: nowrap;
}
.hours-table td {
    color: rgba(44, 24, 16, 0.85);
}
.hours-strike {
    color: var(--berry-jam);
    opacity: 0.55;
    text-decoration: line-through;
    text-decoration-color: var(--berry-jam);
    margin-right: 0.4em;
    font-style: italic;
}

/* ======= Footer ======= */
.cafe-footer {
    margin-top: 3rem;
    text-align: center;
    padding-top: 1rem;
}
.footer-line {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--espresso);
    margin: 1rem 0;
}
.footer-line.muted {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: rgba(44, 24, 16, 0.7);
    font-variant: small-caps;
    letter-spacing: 0.06em;
}
.footer-line.muted .previous { display: none; }
.footer-line .previous {
    top: -0.5em;
    font-size: 0.5em;
}
.undo-link {
    color: var(--berry-jam);
    text-decoration: underline;
    text-decoration-style: wavy;
    text-decoration-color: rgba(168, 50, 72, 0.7);
    text-underline-offset: 3px;
}
.undo-link:hover { color: var(--cinnamon); }
.footer-tiny {
    margin-top: 1rem;
    font-size: 0.78rem;
    color: rgba(44, 24, 16, 0.45);
}

/* ======= Floating undo button ======= */
.floating-undo {
    position: fixed;
    right: 1.4rem;
    bottom: 1.4rem;
    background: var(--berry-jam);
    color: var(--oat-milk);
    border: none;
    border-radius: 999px;
    padding: 0.7rem 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    font-variant: small-caps;
    letter-spacing: 0.08em;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(44, 24, 16, 0.25);
    z-index: 30;
    transition: transform 160ms ease, background 160ms ease;
}
.floating-undo:hover {
    background: var(--cinnamon);
    transform: translateY(-2px);
}
.floating-undo:active {
    transform: translateY(0) scale(0.96);
}
.floating-undo svg {
    display: block;
}
.floating-undo-label { line-height: 1; }

/* ======= Toast ======= */
.toast {
    position: fixed;
    left: 50%;
    bottom: 5rem;
    transform: translate(-50%, 30px);
    background: var(--espresso);
    color: var(--oat-milk);
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(44, 24, 16, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease, transform 220ms ease;
    z-index: 40;
    white-space: nowrap;
}
.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ======= Responsive ======= */
@media (max-width: 600px) {
    .menu-board {
        padding: 2rem 1.2rem 6rem;
    }
    .chalkboard {
        margin: 3rem -1.2rem;
        width: calc(100% + 2.4rem);
        padding: 2.4rem 1.2rem 2.6rem;
    }
    .tent-grid {
        grid-template-columns: 1fr;
        max-width: 360px;
    }
    .menu-item {
        grid-template-columns: 1fr auto;
    }
    .menu-item-dots { display: none; }
    .menu-item-name { font-size: 1.4rem; }
    .menu-item-price { font-size: 1.25rem; }
    .floating-undo-label { display: none; }
    .floating-undo {
        padding: 0.7rem;
        right: 1rem;
        bottom: 1rem;
    }
    .erasure-poem { font-size: 1.05rem; line-height: 2; }
    .erasure-poem .word.kept { font-size: 1.3rem; }
    .hours-table th { font-size: 1.1rem; }
    .cafe-name .previous { font-size: 0.4em; top: -0.5em; }
}

@media (max-width: 380px) {
    .undo-text .previous { font-size: 0.55em; }
    .menu-item-name .previous { font-size: 0.4em; }
}

/* honor reduced-motion (this design is already mostly static) */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
