/* ============================================
   Base Utilities – Shared across all components
   ============================================ */

/* Reset & base body styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    color: var(--color-ink);
    background-color: var(--color-paper);
    background-image: var(--bg-paper-dots), var(--bg-paper-gradient);
    background-size: var(--bg-dots-size), 100% 100%;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--color-otto-green-30);
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ---- Handwritten border ---- */
.hand-border {
    border: 2px solid var(--color-ink);
    border-radius: var(--radius-hand);
}

/* ---- Wobbly box (radius only, no border) ---- */
.wobbly-box {
    border-radius: var(--radius-hand);
}

/* ---- Sticky tape ---- */
.tape {
    background-color: var(--color-tape);
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
    position: absolute;
    height: 30px;
    width: 100px;
    top: -10px;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    z-index: 10;
    backdrop-filter: blur(2px);
    border-left: 1px solid var(--color-tape-border);
    border-right: 1px solid var(--color-tape-border);
}

.tape-corner {
    background-color: rgba(255, 255, 255, 0.5);
    width: 40px;
    height: 15px;
    position: absolute;
    transform: rotate(45deg);
    z-index: 20;
    backdrop-filter: blur(1px);
}

/* ---- Button bounce ---- */
.btn-bounce:active {
    transform: scale(0.98) translate(2px, 2px);
    box-shadow: none;
}

/* ---- Polaroid ---- */
.polaroid {
    transition: all 0.4s var(--transition-bounce);
}

.polaroid-stack:hover .polaroid:nth-child(1) {
    transform: rotate(-5deg) translate(-10px, -5px);
}

.polaroid-stack:hover .polaroid:nth-child(2) {
    transform: rotate(2deg) translate(0px, -10px) scale(1.05);
    z-index: 10;
}

.polaroid-stack:hover .polaroid:nth-child(3) {
    transform: rotate(8deg) translate(10px, -5px);
}

/* ---- Jagged / torn paper bottom edge ---- */
.jagged-bottom {
    position: relative;
}

.jagged-bottom::after {
    content: "";
    position: absolute;
    bottom: -25px;
    left: 0;
    width: 100%;
    height: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23ffffff' fill-opacity='1' d='M0,224L60,213.3C120,203,240,181,360,186.7C480,192,600,224,720,218.7C840,213,960,171,1080,160C1200,149,1320,171,1380,181.3L1440,192L1440,0L1380,0C1320,0,1200,0,1080,0C960,0,840,0,720,0C600,0,480,0,360,0C240,0,120,0,60,0L0,0Z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: cover;
    transform: rotate(180deg);
}

/* ---- Brush stroke divider ---- */
.brush-divider {
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 1200 60' preserveAspectRatio='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,56.5c0,0,298.666,0,399.333,0C448.336,56.5,513.994,46,597,46c77.327,0,135,10.5,200.999,10.5c95.996,0,402.001,0,402.001,0' fill='none' stroke='%23d98e73' stroke-width='4' stroke-dasharray='15 15' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

/* ---- Dashed path animation (for map) ---- */
.dashed-path {
    stroke-dasharray: 10;
    animation: dash 3s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -100;
    }
}

/* ---- Showcase layout (for component preview pages) ---- */
.showcase {
    max-width: 960px;
    margin: 0 auto;
    padding: var(--space-8) var(--space-4);
}

.showcase h1 {
    font-family: var(--font-heading);
    font-size: var(--text-4xl);
    font-weight: 700;
    margin-bottom: var(--space-8);
    border-bottom: 2px dashed var(--color-ink);
    padding-bottom: var(--space-2);
    display: inline-block;
}

.showcase h2 {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-6);
    margin-top: var(--space-12);
}

.showcase p {
    font-size: var(--text-lg);
}
