html { -webkit-tap-highlight-color: transparent; }

/* Fine paper grain so flat colours feel tactile rather than digital. */
.bg-grain {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E");
}

/* Paw watermark: tinted emoji (transparent glyph + coloured text-shadow) scattered by two rotated pseudo-elements. */
.paw-field { position: relative; isolation: isolate; overflow: hidden; }
.paw-field::before,
.paw-field::after {
    position: absolute;
    inset: -20% -10%;
    z-index: -1;
    pointer-events: none;
    white-space: pre;
    color: transparent;
    font-family: system-ui, sans-serif;
}
.paw-field::before {
    content: "🐾            ✦                🐾\A\A        🐾                    🐾\A\A  ✦                🐾          ✦\A\A🐾          🐾                    🐾\A\A            ✦          🐾";
    font-size: 2.4rem;
    line-height: 2.6;
    text-shadow: 0 0 0 rgba(245, 240, 232, 0.09);
    transform: rotate(-16deg);
}
.paw-field::after {
    content: "      🐾          ✦\A\A🐾                🐾\A\A          ✦        🐾\A\A    🐾                  ✦";
    font-size: 1.5rem;
    line-height: 3.4;
    text-align: right;
    text-shadow: 0 0 0 rgba(212, 139, 46, 0.12);
    transform: rotate(13deg) translate(8%, 6%);
}

.blob { border-radius: 58% 42% 55% 45% / 48% 56% 44% 52%; }

/* Floating cards keep their tilt in --r so the bob animation doesn't overwrite it. */
.floaty { transform: rotate(var(--r, 0deg)); animation: floaty 5.5s ease-in-out infinite; }
@keyframes floaty {
    0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
    50% { transform: translateY(-7px) rotate(var(--r, 0deg)); }
}

.chip {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .8rem .55rem .55rem;
    border-radius: 1.1rem;
    background: rgba(251, 247, 240, .94);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    color: #3A3128;
    box-shadow: inset 0 1px 0 #fff, 0 12px 28px -10px rgba(20, 35, 29, .55);
}
.chip-icon { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: .8rem; font-size: 1rem; flex-shrink: 0; }

/* Placeholder shown until the matching file exists in /images. */
.img-slot {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
    padding: .75rem; text-align: center; overflow: hidden;
    background: repeating-linear-gradient(-45deg, #F5F0E8 0 14px, #EEE5D7 14px 28px);
    outline: 3px dashed #D48B2E; outline-offset: -9px;
    color: #2D4A3E; font-family: Nunito, sans-serif;
}
.img-slot .slot-no {
    display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 999px;
    background: #D48B2E; color: #fff; font-weight: 900; font-size: 1.5rem;
    box-shadow: 0 6px 14px -6px rgba(34, 58, 48, .6);
}
.img-slot .slot-file {
    font: 600 .78rem/1.3 ui-monospace, Menlo, Consolas, monospace;
    background: #2D4A3E; color: #F5F0E8; padding: .2rem .55rem; border-radius: .5rem;
}
.img-slot .slot-hint { font-size: .75rem; font-weight: 700; color: #6E6152; }

details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details[open] .faq-plus { transform: rotate(45deg); }

.btn-paw { box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 0 #B9741F, 0 16px 30px -10px rgba(34, 58, 48, 0.6); }
.btn-paw:hover { filter: brightness(1.04); }
.btn-paw:active { transform: translateY(4px); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 2px 0 #B9741F, 0 6px 14px -8px rgba(34, 58, 48, 0.5); }

.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ---------- Life: illustrations, reveal-on-scroll, hover lift ---------- */

/* Location pins breathe outward. transform-box makes SVG circles scale around their own centre. */
.pulse-ring { transform-box: fill-box; transform-origin: center; animation: pulse 2.4s ease-out infinite; }
@keyframes pulse {
    0%   { transform: scale(.6); opacity: .55; }
    100% { transform: scale(2.6); opacity: 0; }
}
.pin-bob { animation: pinbob 2.4s ease-in-out infinite; }
@keyframes pinbob { 50% { transform: translateY(-5px); } }

/* Dotted route on the map marches from "you" to the pet. */
.trail { animation: trail 1.1s linear infinite; }
@keyframes trail { to { stroke-dashoffset: -11; } }

/* Clouds drift sideways, the scene phone bobs gently. */
.drift { animation: drift 9s ease-in-out infinite; }
.drift-slow { animation-duration: 13s; animation-delay: -4s; }
@keyframes drift { 50% { transform: translateX(14px); } }
.bob { animation: bob 5s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }

/* Side-margin scenes fade softly into the page instead of ending in hard edges. */
.soft-edges {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 16%, #000 84%, transparent), linear-gradient(to top, transparent, #000 14%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent, #000 16%, #000 84%, transparent), linear-gradient(to top, transparent, #000 14%);
    mask-composite: intersect;
}

/* The scene card's landscape runs into the card edges; on wide layouts its left side fades into the text column. */
@media (min-width: 768px) {
    .md-soft-left { -webkit-mask-image: linear-gradient(to right, transparent, #000 14%); mask-image: linear-gradient(to right, transparent, #000 14%); }
}

.twinkle { animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .25; transform: scale(.7); } }

.sway { transform-box: fill-box; transform-origin: 50% 100%; animation: sway 6s ease-in-out infinite; }
@keyframes sway { 50% { transform: rotate(1.6deg); } }

/* Uses the independent `translate` property so elements keep their Tailwind tilt/offset transforms. */
.js .reveal { opacity: 0; translate: 0 22px; transition: opacity .8s ease, translate .8s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0s); }
.js .reveal.is-in { opacity: 1; translate: 0 0; }

.lift { transition: translate .3s ease, box-shadow .3s ease; }
@media (hover: hover) { .lift:hover, .js .reveal.is-in.lift:hover { translate: 0 -5px; transition-delay: 0s; } }

.tape { background: repeating-linear-gradient(90deg, rgba(242, 201, 143, .85) 0 6px, rgba(242, 201, 143, .65) 6px 12px); }

/* Cart drawer slides in from the right over a fading backdrop. */
.drawer-slide { animation: drawer-in .35s cubic-bezier(.2, .8, .2, 1); }
.drawer-fade { animation: fade-in .3s ease; }
@keyframes drawer-in { from { transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; } }

/* Legal pages */
.prose-legal p { white-space: pre-line; }

/* ---------- Cuteness: micro-interactions ---------- */

/* Buttons squish a little when pressed (independent `scale`, so Tailwind transforms stay intact). */
button:not(:disabled):not(.transition), .squish:not(.transition) { transition: scale .15s ease; }
button:not(:disabled):active, .squish:active { scale: .95; }

/* Paw icons wiggle when you hover the button or logo they sit in. */
@keyframes wiggle { 0%, 100% { rotate: 0deg; } 25% { rotate: -14deg; } 60% { rotate: 12deg; } 80% { rotate: -5deg; } }
.btn-paw:hover > svg:first-child, .wiggle-host:hover .wiggle-me { animation: wiggle .6s ease; }

/* Cart badge pops when something lands in the cart. */
@keyframes bump { 0% { scale: 1; } 35% { scale: 1.45; } 70% { scale: .9; } 100% { scale: 1; } }
.bump { animation: bump .5s cubic-bezier(.3, 1.6, .5, 1); }

/* Paw that flies from "Add to cart" to the cart icon, confetti paws and the desktop paw-print trail. */
.fly-paw, .confetti-paw, .trail-paw { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 90; }
.fly-paw { width: 34px; height: 34px; color: #D48B2E; filter: drop-shadow(0 4px 6px rgba(34,58,48,.35)); }
.confetti-paw { width: 22px; height: 22px; }
.trail-paw { width: 16px; height: 16px; color: #D48B2E; opacity: .5; animation: trail-fade 1.1s ease-out forwards; }
@keyframes trail-fade { to { opacity: 0; scale: .6; } }

/* ---------- Cuteness: living illustrations ---------- */

/* The cat in the bush blinks, twitches an ear and swishes its tail. */
.blink { transform-box: fill-box; transform-origin: center; animation: blink 4.6s infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.twitch { transform-box: fill-box; transform-origin: 50% 100%; animation: twitch 5.5s infinite; }
@keyframes twitch { 0%, 88%, 100% { transform: rotate(0); } 91% { transform: rotate(-12deg); } 94% { transform: rotate(4deg); } }
.swish { transform-box: fill-box; transform-origin: 0% 100%; animation: swish 2.6s ease-in-out infinite; }
@keyframes swish { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(14deg); } }

/* Wagging tail (loading animation, peeking dog). */
.wag { transform-box: fill-box; transform-origin: 0% 100%; animation: wag .32s ease-in-out infinite alternate; }
@keyframes wag { from { transform: rotate(-22deg); } to { transform: rotate(18deg); } }
.ear-flop { transform-box: fill-box; transform-origin: 50% 0%; animation: ear-flop 3.8s ease-in-out infinite; }
@keyframes ear-flop { 0%, 80%, 100% { transform: rotate(0); } 86% { transform: rotate(10deg); } 92% { transform: rotate(-4deg); } }
.peek { transform-box: fill-box; transform-origin: 50% 100%; animation: peek 6s ease-in-out infinite; }
@keyframes peek { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-5deg); } 55% { transform: rotate(4deg); } }

/* The sleepy pet breathes, and little z's float up. */
.breathe { animation: breathe 3.6s ease-in-out infinite; }
@keyframes breathe { 50% { scale: 1.045; } }
.zzz span { position: absolute; font-family: Nunito, sans-serif; font-weight: 900; color: #B9741F; opacity: 0; animation: zzz 3.6s ease-in infinite; }
.zzz span:nth-child(2) { animation-delay: 1.2s; font-size: 1.15em; }
.zzz span:nth-child(3) { animation-delay: 2.4s; font-size: 1.35em; }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 0) rotate(-10deg); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(26px, -46px) rotate(12deg); } }

/* ---------- Cuteness: soft page transitions (Chrome, Edge, Safari 18+; others just load normally) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .22s ease both; }
::view-transition-new(root) { animation: vt-in .38s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; translate: 0 10px; } }

@media (prefers-reduced-motion: reduce) {
    .floaty, .pulse-ring, .pin-bob, .trail, .twinkle, .sway, .drift, .bob, .drawer-slide, .drawer-fade,
    .blink, .twitch, .swish, .wag, .ear-flop, .peek, .breathe, .zzz span, .bump, .trail-paw { animation: none; }
    .btn-paw:hover > svg:first-child, .wiggle-host:hover .wiggle-me { animation: none; }
    ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
    .js .reveal { opacity: 1; translate: none; transition: none; }
    html { scroll-behavior: auto; }
}
