/* Daniel Shapiro Law — additional styles on top of Tailwind */

/* Smooth scroll with header offset */
html { scroll-padding-top: 80px; }

/* Global no-horizontal-scroll safety net.
   Tailwind CDN was overriding plain html/body rules — use !important so this
   wins regardless of cascade order. Catches any future negative-positioned
   absolute element overflow. */
html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

/* Mobile nav overlay — full screen panel (high specificity to beat Tailwind .hidden) */
#nav.nav-open {
    position: fixed !important;
    top: 64px !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100vh - 64px) !important;
    height: calc(100dvh - 64px) !important;
    max-height: calc(100vh - 64px) !important;
    background: #FAFAF7 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    padding: 8px 20px 24px !important;
    padding-bottom: calc(24px + env(safe-area-inset-bottom)) !important;
    gap: 0 !important;
    z-index: 60 !important;
    overflow-y: auto !important;
}

/* Nav link — two-line item with title + description */
.nav-open a.nav-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 18px 4px;
    border-bottom: 1px solid rgba(10, 37, 64, 0.08);
    position: relative;
    transition: padding-left 0.2s;
}
.nav-open a.nav-link::before {
    content: "";
    position: absolute;
    left: 4px; top: 50%;
    width: 2px; height: 24px;
    margin-top: -12px;
    background: #DC2626;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}
.nav-open a.nav-link:active {
    padding-left: 16px;
}
.nav-open a.nav-link:active::before {
    opacity: 1;
}
.nav-open a.nav-link {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0A2540;
    letter-spacing: -0.025em;
    line-height: 1.1;
}
.nav-open a.nav-link::after {
    content: attr(data-desc);
    font-family: 'Onest', sans-serif;
    font-weight: 400;
    font-size: 0.8125rem;
    line-height: 1.3;
    color: rgba(10, 37, 64, 0.5);
    letter-spacing: 0;
    margin-top: 4px;
}

/* Mobile-only contact card — pushed to bottom */
.nav-open .mobile-only-contact {
    display: block;
    margin-top: auto;
    padding-top: 28px;
    margin-bottom: 14px;
}
.nav-open .mobile-contact-label {
    font-family: 'Onest', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(10, 37, 64, 0.45);
    margin-bottom: 8px;
}
.nav-open .mobile-contact-text {
    font-family: 'Onest', sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: #0A2540;
    font-weight: 500;
}
.nav-open .mobile-contact-hours {
    font-family: 'Onest', sans-serif;
    font-size: 13px;
    color: rgba(10, 37, 64, 0.6);
    margin-top: 6px;
}

/* Mobile-menu CTA — solid red button at the very bottom */
.nav-open .mobile-menu-cta {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    background: #DC2626;
    color: #fff;
    font-family: 'Onest', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 14px;
    text-align: center;
    letter-spacing: 0;
    box-shadow: 0 8px 22px -8px rgba(220, 38, 38, 0.5);
}
.nav-open .mobile-menu-cta:active {
    background: #B91C1C;
}

/* Body padding-bottom for mobile sticky CTA */
@media (max-width: 639px) {
    body { padding-bottom: 76px; }
}

/* Practice card spotlight follow-cursor effect */
.practice-card {
    position: relative;
    isolation: isolate;
}
.practice-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%),
                rgba(220, 38, 38, 0.18),
                transparent 45%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    border-radius: inherit;
    z-index: 0;
}
.practice-card:hover::after { opacity: 1; }
.practice-card > * { position: relative; z-index: 1; }

/* Apple-style stats — typographic hero numbers */
.stats-monumental {
    font-feature-settings: "lnum", "tnum", "ss01";
    font-variant-numeric: lining-nums tabular-nums;
}

.stat-mono {
    /* Apple-style fluid scale — calmer max so unit text isn't dwarfed */
    font-size: clamp(5rem, 3rem + 12vw, 14rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.075em;
    color: var(--ink, #0A2540);
    font-feature-settings: "lnum", "tnum";
    font-variant-numeric: lining-nums tabular-nums;
    transform: translateZ(0);
}

/* Soft layered shadow under number for depth — Apple "weight" trick */
.stat-mono-shadow {
    background: linear-gradient(180deg, #0A2540 0%, #1a3654 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

/* Counter scroll-tied number */
.stat-mono[data-counter] {
    display: inline-block;
}

/* Stat column: parallax different speed */
.stat-col {
    position: relative;
    text-align: center;
    padding: 0 1.5rem;
}

@media (min-width: 1024px) {
    .stat-col { padding: 0 3rem; }
    .stat-col + .stat-col {
        border-left: 1px solid rgba(10, 37, 64, 0.1);
    }
}

.stat-col__eyebrow {
    font-family: 'Onest', system-ui, sans-serif;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.32em;
    color: rgba(10, 37, 64, 0.45);
    text-transform: uppercase;
    margin-bottom: 2.5rem;
}

.stat-col__unit {
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.25rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    color: #0A2540;
    margin-top: 1.25rem;
    line-height: 1.1;
}

.stat-col__caption {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(10, 37, 64, 0.55);
    margin-top: 0.875rem;
    max-width: 30ch;
    margin-left: auto;
    margin-right: auto;
}

/* Number reveal — slide up with momentum.
   Wrap inherits the same font-size as .stat-mono so em-based padding
   measures from the glyph height (288px), not the inherited 16px body.
   Without this, em padding evaluates to ~3px and clips the $ descender. */
.stat-mono-wrap {
    overflow: hidden;
    line-height: 1;
    font-size: clamp(5rem, 3rem + 12vw, 14rem);
    padding: 0.18em 0.08em 0.22em;
    margin: -0.18em -0.08em -0.22em;
}

.stat-mono-inner {
    display: inline-block;
    transform: translateY(120%);
    transition: transform 1.1s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
}

.reveal.is-visible .stat-mono-inner {
    transform: translateY(0);
}

/* Subtle paper grain on cream — Apple "warm white" feel */
.stats-paper {
    background-color: #FAFAF7;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(10, 37, 64, 0.02) 0, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(10, 37, 64, 0.02) 0, transparent 50%);
}

/* Reveal on scroll */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.22,0.61,0.36,1), transform 0.6s cubic-bezier(0.22,0.61,0.36,1);
}
.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* About floating badges */
.float-badge {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 100px;
    box-shadow: 0 6px 20px rgba(10, 37, 64, 0.18), 0 1px 3px rgba(10, 37, 64, 0.08);
    font-family: 'Onest', system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #0A2540;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.float-badge--top-right { top: 14px; right: -16px; }
.float-badge--mid-left { top: 38%; left: -22px; }
.float-badge--bottom-right { bottom: 22%; right: -18px; }
.float-badge i { width: 14px; height: 14px; color: #DC2626; flex-shrink: 0; }

/* Animated phone icon on CTA buttons */
@keyframes phone-ring {
    0%, 78%, 100% { transform: rotate(0); }
    80%, 88% { transform: rotate(-14deg); }
    82%, 86% { transform: rotate(0); }
    84% { transform: rotate(14deg); }
    90% { transform: rotate(-8deg); }
    92% { transform: rotate(8deg); }
    94% { transform: rotate(-4deg); }
    96% { transform: rotate(4deg); }
}
.phone-anim {
    transform-origin: 50% 55%;
    animation: phone-ring 4s ease-in-out infinite;
}
.phone-anim-fast {
    animation: phone-ring 2.4s ease-in-out infinite;
}

/* Chat trigger pulse ring */
@keyframes chat-pulse {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.6); opacity: 0; }
}
.chat-pulse-ring {
    animation: chat-pulse 2s ease-out infinite;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print */
@media print {
    #chatWidget, header, .fixed { display: none !important; }
}

/* Header scrolled state */
.header-scrolled {
    background: rgba(255,255,255,0.95) !important;
    border-bottom-color: rgb(229,231,235) !important;
    box-shadow: 0 1px 3px rgba(10,37,64,0.04);
}

/* Legal pages typography */
.legal { max-width: 800px; margin: 0 auto; padding: 64px 24px 96px; }
.legal h1 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 2.5rem; font-weight: 700; letter-spacing: -0.03em; color: #0A2540; margin-bottom: 8px; }
.legal h2 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.5rem; font-weight: 700; color: #0A2540; letter-spacing: -0.025em; margin: 32px 0 12px; }
.legal h3 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.125rem; font-weight: 600; color: #0A2540; margin: 24px 0 8px; }
.legal p { margin-bottom: 12px; line-height: 1.7; color: #374151; }
.legal ul { margin: 12px 0 12px 24px; line-height: 1.7; color: #374151; }
.legal a { color: #DC2626; text-decoration: underline; text-underline-offset: 2px; }
.legal__updated { font-size: 0.875rem; color: #6B7280; margin-bottom: 32px; }
.legal__back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 32px; font-size: 0.875rem; color: #0A2540; font-weight: 600; }
.legal__back:hover { color: #DC2626; }
