:root {
    --espresso: #24120B;
    --milk: #FFF1D2;
    --paper: #F8E7B8;
    --brass: #D8A63A;
    --tomato: #E94E3D;
    --mint: #6FD6B5;
    --blueberry: #334B9B;
    --slate: #15171C;
}

/* Design vocabulary: Interactions emphasize tactile transformations—rewriting chalk sparingly for receipt totals. */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--milk);
    color: var(--espresso);
    font-family: "DM Sans", sans-serif;
    overflow-x: hidden;
}

a {
    color: inherit;
}

.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    opacity: .18;
    background-image:
        radial-gradient(circle at 12% 18%, #24120B 0 1px, transparent 1px),
        radial-gradient(circle at 62% 72%, #D8A63A 0 1px, transparent 1px),
        linear-gradient(115deg, transparent 0 48%, rgba(36, 18, 11, .08) 49% 51%, transparent 52%);
    background-size: 19px 23px, 31px 29px, 170px 170px;
    mix-blend-mode: multiply;
}

.counter-ribbon {
    position: fixed;
    left: -12vw;
    top: 70vh;
    width: 125vw;
    height: 14vh;
    background: linear-gradient(90deg, #6FD6B5, #F8E7B8 32%, #D8A63A 63%, #E94E3D);
    border: 5px solid var(--espresso);
    border-radius: 999px 28px 999px 40px;
    transform: rotate(var(--counter-rotate, -4deg)) translateY(var(--counter-y, 0));
    z-index: 1;
    box-shadow: 0 22px 0 rgba(36, 18, 11, .18);
}

.tab-journey {
    position: relative;
    z-index: 2;
}

.scene {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    padding: clamp(28px, 6vw, 76px);
    display: grid;
    align-items: center;
}

.eyebrow,
.stub-title,
.stamp-dot,
.ritual-link,
.menu-row b,
.ledger-lines b {
    font-family: "Space Mono", monospace;
    text-transform: uppercase;
    letter-spacing: .08em;
}

h1,
h2,
.sticker-wordmark,
.price-architecture,
.giant-cent,
.blueberry-window,
.final-sign,
.coin-bell {
    font-family: "Bungee", cursive;
    font-weight: 400;
    line-height: .95;
}

h1 {
    max-width: 760px;
    margin: 0 0 22px;
    font-size: clamp(3.4rem, 8vw, 8.9rem);
}

h2 {
    margin: 0 0 28px;
    font-size: clamp(2.5rem, 6vw, 6.8rem);
}

p {
    font-size: clamp(1.05rem, 1.6vw, 1.35rem);
    line-height: 1.45;
}

.fraunces-line,
.chalk-marginalia,
.rain-copy p,
.total-line b {
    font-family: "Fraunces", serif;
}

.receipt-progress {
    position: fixed;
    right: 18px;
    top: 50%;
    width: 98px;
    padding: 18px 12px 22px;
    transform: translateY(-50%) rotate(2deg);
    z-index: 40;
    background: var(--paper);
    border-left: 2px dashed var(--espresso);
    border-right: 2px dashed var(--espresso);
    box-shadow: 8px 10px 0 rgba(36, 18, 11, .18);
}

.receipt-progress::before,
.receipt-progress::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 12px;
    background: repeating-linear-gradient(90deg, transparent 0 7px, var(--espresso) 8px 10px, transparent 11px 18px);
}

.receipt-progress::before { top: -8px; }
.receipt-progress::after { bottom: -8px; }

.stub-title {
    font-size: .72rem;
    margin-bottom: 14px;
}

.stamp-dot {
    display: block;
    margin: 8px auto;
    padding: 7px 3px;
    color: rgba(36, 18, 11, .45);
    border: 2px solid rgba(36, 18, 11, .25);
    border-radius: 4px;
    font-size: .58rem;
    text-align: center;
    transform: rotate(-4deg);
    transition: .35s ease;
}

.stamp-dot.active {
    color: var(--tomato);
    border-color: var(--tomato);
    transform: rotate(5deg) scale(1.08);
    background: rgba(233, 78, 61, .08);
}

.penny-bell {
    background:
        radial-gradient(circle at 78% 14%, rgba(216, 166, 58, .5), transparent 26%),
        linear-gradient(155deg, #FFF1D2 0 55%, #F8E7B8 56%);
}

.slanted-counter {
    position: absolute;
    left: -10vw;
    bottom: -5vh;
    width: 92vw;
    height: 34vh;
    background: var(--mint);
    border: 6px solid var(--espresso);
    border-radius: 40px 80px 0 0;
    transform: rotate(-5deg);
    box-shadow: 0 -14px 0 var(--blueberry) inset;
}

.sticker-wordmark {
    position: absolute;
    top: 28px;
    left: 30px;
    display: flex;
    gap: 7px;
    font-size: clamp(1.4rem, 3vw, 3.2rem);
    z-index: 4;
}

.sticker-wordmark span,
.final-sign span {
    display: inline-block;
    padding: .2em .24em;
    background: var(--paper);
    border: 3px solid var(--espresso);
    box-shadow: 4px 5px 0 var(--tomato);
    transform: translateY(-120px) rotate(var(--r, -5deg));
    animation: slap .6s cubic-bezier(.2, 1.4, .35, 1) forwards;
}

.sticker-wordmark span:nth-child(2n) { --r: 6deg; animation-delay: .12s; }
.sticker-wordmark span:nth-child(3n) { --r: -10deg; animation-delay: .22s; }
.sticker-wordmark span:nth-child(4n) { --r: 4deg; animation-delay: .32s; }

@keyframes slap {
    0% { transform: translateY(-120px) rotate(-25deg) scale(1.4); }
    75% { transform: translateY(8px) rotate(var(--r)) scale(.92); }
    100% { transform: translateY(0) rotate(var(--r)) scale(1); }
}

.coin-bell {
    position: absolute;
    right: 10vw;
    bottom: 18vh;
    width: clamp(240px, 30vw, 430px);
    aspect-ratio: 1.25 / 1;
    display: grid;
    place-items: center;
    color: var(--espresso);
    border: 7px solid var(--espresso);
    border-radius: 50% 50% 42% 42%;
    background: radial-gradient(circle at 30% 22%, #FFF1D2 0 8%, transparent 9%), linear-gradient(135deg, #F8E7B8, #D8A63A 45%, #B87823);
    box-shadow: 16px 24px 0 rgba(36, 18, 11, .2);
    animation: ding 1.1s .4s ease both;
}

.bell-top {
    font-size: clamp(5rem, 12vw, 12rem);
}

.bell-base {
    position: absolute;
    bottom: 18px;
    left: 12%;
    right: 12%;
    padding: 10px;
    font-family: "Space Mono", monospace;
    font-size: .85rem;
    text-align: center;
    background: var(--tomato);
    color: var(--milk);
    border: 3px solid var(--espresso);
}

@keyframes ding {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-8deg) translateY(-10px); }
    42% { transform: rotate(7deg); }
    62% { transform: rotate(-3deg); }
}

.paper-note,
.torn-ticket,
.ledger-book {
    position: relative;
    max-width: 650px;
    padding: clamp(24px, 4vw, 46px);
    background: var(--paper);
    border: 4px solid var(--espresso);
    box-shadow: 12px 16px 0 rgba(36, 18, 11, .22);
    z-index: 5;
}

.tilt-left { transform: rotate(-2deg); }

.ritual-link {
    display: inline-block;
    margin-top: 10px;
    padding: 13px 18px;
    background: var(--tomato);
    color: var(--milk);
    border: 3px solid var(--espresso);
    text-decoration: none;
    box-shadow: 5px 6px 0 var(--espresso);
    transform: rotate(2deg);
}

.near-digit {
    position: absolute;
    user-select: none;
    transition: transform .18s ease-out;
    z-index: 3;
}

.price-architecture {
    right: -2vw;
    top: 2vh;
    font-size: clamp(12rem, 31vw, 32rem);
    color: rgba(51, 75, 155, .16);
    -webkit-text-stroke: 4px var(--blueberry);
}

.steam-svg {
    position: absolute;
    right: 29vw;
    top: 6vh;
    width: 220px;
    height: 360px;
    fill: none;
    z-index: 4;
}

.steam-line {
    stroke: var(--tomato);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 36 18;
    animation: steamDrift 5s linear infinite;
}

.steam-line.alt {
    stroke: var(--blueberry);
    animation-duration: 6.5s;
}

@keyframes steamDrift { to { stroke-dashoffset: -108; } }

.rolling-coin {
    position: absolute;
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 5px solid var(--espresso);
    background: var(--brass);
    font-family: "Bungee", cursive;
    font-size: 2rem;
    box-shadow: 8px 10px 0 rgba(36, 18, 11, .2);
    z-index: 9;
    transform: translateX(var(--roll-x, 0)) rotate(var(--roll-r, 0deg));
}

.coin-one { left: 4vw; bottom: 13vh; }
.coin-two { right: 9vw; top: 14vh; }

.chalk-menu {
    background: linear-gradient(120deg, #15171C 0 70%, #334B9B 70%);
    color: var(--milk);
}

.chalkboard {
    width: min(860px, 78vw);
    min-height: 66vh;
    padding: clamp(24px, 5vw, 58px);
    background: var(--slate);
    border: 16px solid var(--espresso);
    outline: 6px solid var(--brass);
    transform: rotate(1.5deg);
    box-shadow: 22px 22px 0 rgba(248, 231, 184, .16);
}

.menu-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 3px dashed rgba(255, 241, 210, .4);
    font-size: clamp(1.3rem, 2.4vw, 2.1rem);
}

.chalk-price {
    color: var(--tomato);
    position: relative;
}

.chalk-price.rewriting::after {
    content: attr(data-alt);
    position: absolute;
    right: 0;
    top: 0;
    color: var(--mint);
    background: var(--slate);
    animation: rewrite 1.25s ease both;
    white-space: nowrap;
}

@keyframes rewrite {
    0% { clip-path: inset(0 100% 0 0); filter: blur(3px); }
    35% { clip-path: inset(0 48% 0 0); }
    70%, 100% { clip-path: inset(0 0 0 0); filter: blur(0); }
}

.receipt-curtain {
    position: absolute;
    right: 6vw;
    top: 0;
    display: flex;
    gap: 16px;
}

.receipt-curtain div {
    width: 88px;
    min-height: 58vh;
    padding: 22px 10px;
    background: var(--paper);
    color: var(--espresso);
    border: 3px solid var(--espresso);
    font-family: "Space Mono", monospace;
    writing-mode: vertical-rl;
    box-shadow: 7px 10px 0 rgba(0,0,0,.28);
    transform: translateY(var(--curtain-y, -14px)) rotate(-2deg);
}

.giant-cent {
    right: 7vw;
    bottom: 2vh;
    font-size: clamp(10rem, 28vw, 29rem);
    color: rgba(216, 166, 58, .24);
}

.coffee-ring {
    position: absolute;
    border: 8px solid rgba(216, 166, 58, .65);
    border-radius: 50%;
    opacity: .55;
}
.ring-a { width: 250px; height: 190px; right: 26vw; bottom: 14vh; transform: rotate(24deg); }
.ring-b { width: 180px; height: 150px; right: 17vw; bottom: 25vh; transform: rotate(-17deg); }

.scale-costs {
    background: radial-gradient(circle at 18% 20%, rgba(111, 214, 181, .8), transparent 26%), var(--milk);
}

.scale-stage {
    max-width: 1050px;
    margin-left: auto;
    margin-right: auto;
}

.scale {
    position: relative;
    height: 360px;
    margin-top: 20px;
}

.beam {
    position: absolute;
    left: 15%;
    right: 15%;
    top: 120px;
    height: 18px;
    background: var(--espresso);
    transform: rotate(var(--scale-tilt, 0deg));
    transform-origin: center;
    border-radius: 999px;
}

.needle {
    position: absolute;
    left: 50%;
    top: 72px;
    width: 8px;
    height: 110px;
    background: var(--tomato);
    transform-origin: 50% 12px;
    transform: rotate(var(--needle, 0deg));
    z-index: 4;
}

.post {
    position: absolute;
    left: calc(50% - 16px);
    top: 118px;
    width: 32px;
    height: 230px;
    background: var(--blueberry);
    border: 5px solid var(--espresso);
}

.pan {
    position: absolute;
    top: 174px;
    width: 250px;
    height: 92px;
    display: grid;
    place-items: center;
    background: var(--mint);
    border: 5px solid var(--espresso);
    border-radius: 0 0 90px 90px;
    font-family: "Fraunces", serif;
    font-size: 2rem;
    box-shadow: 8px 10px 0 rgba(36,18,11,.2);
}
.left-pan { left: 7%; transform: translateY(var(--left-pan, 0)); }
.right-pan { right: 7%; background: var(--brass); transform: translateY(var(--right-pan, 0)); }

.saucer-equation {
    position: absolute;
    right: 7vw;
    bottom: 9vh;
    padding: 22px 34px;
    background: var(--milk);
    border: 5px solid var(--espresso);
    border-radius: 50%;
    font-family: "Space Mono", monospace;
    transform: rotate(-11deg);
}

.sugar-cubes {
    position: absolute;
    left: 8vw;
    top: 13vh;
    display: flex;
    gap: 8px;
}
.sugar-cubes span {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    background: #FFF1D2;
    border: 3px solid var(--espresso);
    font-family: "Bungee", cursive;
    transform: rotate(var(--cube, 7deg));
}
.sugar-cubes span:nth-child(2) { --cube: -8deg; }

.receipt-rain {
    background: linear-gradient(180deg, #334B9B 0%, #15171C 100%);
    color: var(--milk);
}

.receipt-rain-field {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.receipt-rain-field span {
    position: absolute;
    left: var(--x);
    top: -35vh;
    width: 116px;
    min-height: 260px;
    padding: 18px 11px;
    color: var(--espresso);
    background: var(--paper);
    border: 3px solid var(--espresso);
    font-family: "Space Mono", monospace;
    text-align: center;
    animation: fall 7s var(--d) linear infinite;
}

.receipt-rain-field em {
    display: block;
    margin-top: 22px;
    color: var(--tomato);
    font-family: "Fraunces", serif;
    writing-mode: vertical-rl;
}

@keyframes fall {
    0% { transform: translateY(-20vh) rotate(-8deg); }
    100% { transform: translateY(145vh) rotate(16deg); }
}

.rain-copy {
    max-width: 560px;
    margin-left: 7vw;
    color: var(--espresso);
}

.blueberry-window {
    right: -3vw;
    bottom: 5vh;
    font-size: clamp(6rem, 18vw, 19rem);
    color: rgba(111, 214, 181, .18);
    -webkit-text-stroke: 3px var(--mint);
}

.last-ledger {
    background:
        radial-gradient(circle at 76% 46%, rgba(216, 166, 58, .7), transparent 17%),
        linear-gradient(140deg, #F8E7B8, #FFF1D2 55%, #6FD6B5 55%);
}

.ledger-book {
    width: min(730px, 86vw);
    transform: rotate(2deg);
}

.ledger-lines p {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 2px dashed rgba(36,18,11,.35);
    margin: 0;
    padding: 15px 0;
}

.total-line {
    color: var(--tomato);
    font-size: 1.35rem;
}

.quiet-cup {
    position: absolute;
    right: 11vw;
    bottom: 18vh;
    width: 260px;
    height: 210px;
    border: 6px solid var(--espresso);
    border-top: 0;
    border-radius: 0 0 80px 80px;
    background: var(--milk);
    overflow: hidden;
    box-shadow: 14px 16px 0 rgba(36,18,11,.18);
}

.quiet-cup::after {
    content: "";
    position: absolute;
    right: -54px;
    top: 45px;
    width: 86px;
    height: 92px;
    border: 18px solid var(--espresso);
    border-left: 0;
    border-radius: 0 60px 60px 0;
}

.gold-fill {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--gold, 38%);
    background: linear-gradient(#FFF1D2, #D8A63A 36%, #B87823);
    transition: height .4s ease;
}

.cup-steam {
    position: absolute;
    left: 50%;
    top: -34px;
    font-family: "Bungee", cursive;
    color: var(--tomato);
    font-size: 6rem;
    animation: floatQ 3.5s ease-in-out infinite;
}

@keyframes floatQ {
    50% { transform: translateY(-18px) rotate(12deg); }
}

.final-sign {
    position: absolute;
    right: 6vw;
    top: 8vh;
    font-size: clamp(2rem, 5vw, 5rem);
    display: flex;
    gap: 10px;
}

.final-sign span {
    animation: none;
    transform: rotate(-4deg);
}
.final-sign span:nth-child(2) { transform: rotate(7deg); background: var(--tomato); color: var(--milk); }
.final-sign span:nth-child(3) { transform: rotate(3deg); background: var(--mint); }

@media (max-width: 760px) {
    .receipt-progress { display: none; }
    .scene { padding: 88px 22px 44px; }
    .coin-bell { position: relative; right: auto; bottom: auto; margin: 250px 0 30px auto; }
    .paper-note { margin-top: -40px; }
    .receipt-curtain { opacity: .32; right: -20vw; }
    .chalkboard { width: 100%; }
    .scale { transform: scale(.72); transform-origin: left top; }
    .quiet-cup { position: relative; right: auto; bottom: auto; margin-left: auto; }
    .final-sign { top: 22px; right: 20px; }
}
