/* ========================================
   K's Sweets and Treats Bakery
   Custom Styles
======================================== */

/* --- Base & Typography --- */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Navigation --- */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #a11a3b, #db4465);
    border-radius: 1px;
    transition: width duration-300ms;
}

.nav-link:hover::after {
    width: 100%;
}

/* --- Hero Decorative Circles --- */
.deco-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.12;
    pointer-events: none;
}

.deco-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #ffecd2 0%, transparent 70%);
    top: -200px;
    right: -150px;
    animation: float-slow 20s ease-in-out infinite;
}

.deco-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #fbc2eb 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    animation: float-slow 15s ease-in-out infinite reverse;
}

.deco-3 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, #fff 0%, transparent 70%);
    top: 30%;
    left: 10%;
    animation: float-slow 12s ease-in-out infinite;
}

.deco-4 {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, #ffd89b 0%, transparent 70%);
    bottom: 20%;
    right: 15%;
    animation: float-slow 18s ease-in-out infinite reverse;
}

/* --- Sparkle Animation --- */
.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    animation: twinkle 3s ease-in-out infinite;
}

.sparkle-1 { top: 20%; left: 15%; animation-delay: 0s; opacity: 0.6; }
.sparkle-2 { top: 35%; right: 20%; animation-delay: 0.5s; opacity: 0.4; }
.sparkle-3 { bottom: 30%; left: 25%; animation-delay: 1s; opacity: 0.5; }
.sparkle-4 { top: 50%; right: 10%; animation-delay: 1.5s; opacity: 0.3; }
.sparkle-5 { bottom: 20%; right: 30%; animation-delay: 2s; opacity: 0.7; }

@keyframes twinkle {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.5); opacity: 0.8; }
}

/* --- Float Animation --- */
@keyframes float-slow {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, -30px) rotate(5deg); }
    50% { transform: translate(-10px, -50px) rotate(-3deg); }
    75% { transform: translate(-30px, -20px) rotate(2deg); }
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: bounce-down 2s ease-in-out infinite;
}

.scroll-dot {
    width: 4px;
    height: 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    animation: scroll-dot-anim 2s ease-in-out infinite;
}

@keyframes scroll-dot-anim {
    0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
    50% { transform: scaleY(1); transform-origin: top; opacity: 1; }
    51% { transform: scaleY(1); transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

@keyframes bounce-down {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* --- Scroll Reveal --- */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 1;
    transform: none;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

@media (prefers-reduced-motion: no-preference) {
    .reveal-up {
        opacity: 0;
        transform: translateY(40px);
    }
    .reveal-left {
        opacity: 0;
        transform: translateX(-40px);
    }
    .reveal-right {
        opacity: 0;
        transform: translateX(40px);
    }
    
    .reveal-up.revealed,
    .reveal-left.revealed,
    .reveal-right.revealed {
        opacity: 1;
        transform: none;
    }
}

/* --- Mobile Menu --- */
.mobile-link {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid #fce7eb;
}

.mobile-link:last-child {
    border-bottom: none;
}

/* --- Navbar Scroll State --- */
.nav-scrolled {
    background: rgba(255, 252, 248, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(161, 26, 59, 0.08);
}

.nav-scrolled .nav-text {
    color: #6f1c33 !important;
}

.nav-scrolled .nav-subtext {
    color: #db4465 !important;
}

.nav-scrolled .nav-link {
    color: #a11a3b !important;
}

/* --- Button Focus --- */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid #db4465;
    outline-offset: 2px;
}

/* --- Selection --- */
::selection {
    background: #fce7eb;
    color: #6f1c33;
}

/* --- Mobile Menu Transition --- */
#mobile-menu {
    animation: slide-down 0.3s ease;
}

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Back to Top --- */
#back-to-top {
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:not(.visible) {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
}

/* --- Form Input Autofill --- */
input:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
}
