/* ─────────────────────────────────────────────
   Dr. Sirong Xu — Medical Practice Website
   Custom styles & animations
   ───────────────────────────────────────────── */

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

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

::selection {
    background: #b8284e;
    color: #fff;
}

/* ── Nav ── */
#site-header {
    background: transparent;
    transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

#site-header.scrolled {
    background: rgba(254, 247, 245, 0.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(123, 45, 59, 0.08);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #7B2D3B;
    transition: width 0.25s ease;
}

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

/* ── Mobile menu ── */
#mobile-menu {
    animation: slideDown 0.25s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mobile-link {
    display: block;
}

/* ── Geometric Decorations ── */
.geo-circle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.geo-circle--lg {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(184, 40, 78, 0.07) 0%, transparent 70%);
}

.geo-circle--md {
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(184, 40, 78, 0.06) 0%, transparent 70%);
}

.geo-circle--sm {
    width: 100px;
    height: 100px;
    background: rgba(184, 40, 78, 0.05);
}

.geo-square {
    position: absolute;
    pointer-events: none;
}

.geo-square--lg {
    width: 200px;
    height: 200px;
    background: rgba(232, 115, 77, 0.06);
    border-radius: 2rem;
}

.geo-square--sm {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
}

.geo-triangle {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 86px solid rgba(184, 40, 78, 0.05);
    pointer-events: none;
}

.geo-dots {
    position: absolute;
    width: 60px;
    height: 60px;
    background-image: radial-gradient(circle, rgba(184, 40, 78, 0.2) 1.5px, transparent 1.5px);
    background-size: 12px 12px;
    pointer-events: none;
}

/* ── Service Cards ── */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #7B2D3B, #e8734d);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover::before {
    opacity: 1;
}

/* ── Scroll Reveal ── */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }

    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }

    .reveal-delay-1 { transition-delay: 0.1s; }
    .reveal-delay-2 { transition-delay: 0.2s; }
    .reveal-delay-3 { transition-delay: 0.3s; }
    .reveal-delay-4 { transition-delay: 0.4s; }
    .reveal-delay-5 { transition-delay: 0.5s; }
    .reveal-delay-6 { transition-delay: 0.6s; }
}

/* ── Back to top ── */
#back-to-top {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

#back-to-top:hover {
    transform: translateY(-2px);
}

/* ── Form focus states ── */
input:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(123, 45, 59, 0.1);
}

/* ── Button hover lift ── */
button:hover,
a:hover {
    transform: translateY(-1px);
}

button:active,
a:active {
    transform: translateY(0);
}
