/* =========================================
   Universal Custom Styles — Always Loaded
   (Single source of truth for these utilities.
    Do NOT duplicate in main.css or input.css)
   ========================================= */

/* 1. Global Font Utility */
.font-outfit {
    font-family: 'DM Sans', sans-serif;
}
.font-epilogue {
    font-family: 'Epilogue', sans-serif;
    font-weight: 600;
}
.font-dm-sans {
    font-family: 'DM Sans', sans-serif;
}

/* 2. Hero Background Glow
      Performance optimized: hidden on mobile */
.hero-glow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 500px;
    background-color: rgba(217, 119, 6, 0.18);
    border-radius: 9999px;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
    will-change: transform, opacity;
    transform: translate3d(0, 0, 0);
    display: none;
}
@media (min-width: 768px) {
    .hero-glow { display: block; }
}

/* 2b. Hero Interactive Cursor Spotlight Glow */
.hero-interactive-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(550px circle at var(--mouse-x, -1000px) var(--mouse-y, -1000px), rgba(245, 158, 11, 0.14), rgba(217, 119, 6, 0.04) 45%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#hero-section:hover .hero-interactive-glow {
    opacity: 1;
}

/* 2c. Hero Spotlight Constellation & Badges */
.hero-spotlight-constellation {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    -webkit-mask-image: radial-gradient(300px circle at var(--mouse-x, -1000px) var(--mouse-y, -1000px), black 25%, transparent 95%);
    mask-image: radial-gradient(300px circle at var(--mouse-x, -1000px) var(--mouse-y, -1000px), black 25%, transparent 95%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
#hero-section:hover .hero-spotlight-constellation {
    opacity: 1;
}

@keyframes spotlight-float {
    0%   { transform: translate(-50%, -50%) translateY(0px); }
    100% { transform: translate(-50%, -50%) translateY(-10px); }
}

.spotlight-node {
    position: absolute;
    transform: translate(-50%, -50%);
    animation: spotlight-float 6s ease-in-out infinite alternate;
}
.spotlight-node:nth-child(2n) {
    animation-duration: 7.5s;
    animation-delay: -2s;
}
.spotlight-node:nth-child(3n) {
    animation-duration: 9s;
    animation-delay: -4s;
}
.spotlight-node:nth-child(4n) {
    animation-duration: 6.5s;
    animation-delay: -1.5s;
}

.spotlight-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fde68a;
    font-size: 0.725rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 14px rgba(245, 158, 11, 0.18);
    white-space: nowrap;
    user-select: none;
    pointer-events: none;
}
.spotlight-badge-emerald {
    border-color: rgba(16, 185, 129, 0.35);
    color: #a7f3d0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 14px rgba(16, 185, 129, 0.18);
}

@media (prefers-reduced-motion: reduce) {
    .spotlight-node { animation: none; }
}

/* 3. Pulse Animation (slow variant) */
@keyframes pulse-slow {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}
.animate-pulse-slow {
    animation: pulse-slow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 4. Voice / Sound Wave Animation */
@keyframes sound {
    0%   { height: 3px;  opacity: 0.35; }
    100% { height: 24px; opacity: 0.95; }
}
.animate-sound {
    animation: sound 800ms ease-in-out infinite alternate;
}

/* 5. Off-screen Section Rendering Deferral
      content-visibility skips layout/paint for hidden sections.
      Single definition here — do not add to main.css. */
.section-lazy {
    content-visibility: auto;
    contain-intrinsic-size: 1px 600px;
}

/* 6. Blog Index Grid */
.blog-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.blog-index-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
}
.blog-index-badge {
    margin-bottom: 1rem;
    font-size: 0.65rem;
    padding: 0.3rem 0.75rem;
}
.blog-index-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 1.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
}
.blog-index-cta-arrow {
    transition: transform 0.2s;
}
.blog-index-card:hover .blog-index-cta-arrow {
    transform: translateX(3px);
}

/* 7. Exit Intent Popup */
#exit-intent-popup.hidden {
    display: none !important;
}
#exit-intent-popup .bg-black {
    background-color: rgba(0, 0, 0, 0.5);
}
#exit-intent-popup .bg-white {
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* 8. Desktop Glassmorphic Navigation Dropdown */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}
.nav-dropdown-btn,
.nav-top-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.85rem !important;
    min-height: 0 !important;
    border-radius: 0.75rem;
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    line-height: 1.25;
    transition: color 0.15s ease, background-color 0.15s ease;
}
.nav-dropdown:hover .nav-dropdown-btn,
.nav-dropdown-btn:hover,
.nav-top-link:hover {
    color: var(--text-main);
    background-color: rgba(15, 23, 42, 0.05);
}
.theme-dark .nav-dropdown:hover .nav-dropdown-btn,
.theme-dark .nav-dropdown-btn:hover,
.theme-dark .nav-top-link:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.08);
}

.nav-dropdown-menu {
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%) translateY(6px);
    width: 360px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s ease;
    z-index: 50;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.nav-dropdown:hover .nav-dropdown-btn svg,
.nav-dropdown:focus-within .nav-dropdown-btn svg,
.nav-dropdown.is-open .nav-dropdown-btn svg {
    transform: rotate(180deg);
    opacity: 1;
}

/* Solid Glassmorphic Card Container with Guaranteed Background */
.nav-dropdown-card {
    background-color: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(226, 232, 240, 0.8));
    border-radius: 1.25rem;
    padding: 0.625rem;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.theme-dark .nav-dropdown-card {
    background-color: #0f172a;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Submenu Item — Regular State */
.nav-sub-link {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.875rem;
    text-align: left;
    text-decoration: none;
    transition: background-color 0.15s ease, transform 0.15s ease;
}
.nav-sub-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    background-color: rgba(15, 23, 42, 0.04);
    color: var(--text-light);
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.125rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.theme-dark .nav-sub-icon {
    background-color: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    border-color: rgba(255, 255, 255, 0.08);
}
.nav-sub-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.01em;
    transition: color 0.15s ease;
}
.nav-sub-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.35;
    margin-top: 0.15rem;
    font-weight: 400;
}
.nav-sub-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.45rem;
    border-radius: 0.375rem;
    background-color: rgba(15, 23, 42, 0.05);
    color: var(--text-muted);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.15s ease;
}
.theme-dark .nav-sub-badge {
    background-color: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    border-color: rgba(255, 255, 255, 0.08);
}
.nav-sub-arrow {
    width: 0.875rem;
    height: 0.875rem;
    color: var(--primary);
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    margin-top: 0.35rem;
}

/* Submenu Item — Interactive Hovered State */
.nav-sub-link:hover,
.nav-sub-link:focus {
    background-color: rgba(217, 119, 6, 0.07);
}
.theme-dark .nav-sub-link:hover,
.theme-dark .nav-sub-link:focus {
    background-color: rgba(255, 255, 255, 0.06);
}
.nav-sub-link:hover .nav-sub-icon {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}
.nav-sub-link:hover .nav-sub-title {
    color: var(--primary);
}
.nav-sub-link:hover .nav-sub-badge {
    background-color: rgba(217, 119, 6, 0.14);
    color: var(--primary);
    border-color: rgba(217, 119, 6, 0.25);
}
.nav-sub-link:hover .nav-sub-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* 9. Mobile Hamburger Toggle Button */
#nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0 !important;
    min-height: 0 !important;
    border-radius: 0.5rem;
    color: var(--text-main);
    background-color: transparent;
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    cursor: pointer;
    transition: all 0.15s ease;
}
.theme-dark #nav-toggle {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.12);
}
#nav-toggle:hover,
#nav-toggle:focus {
    background-color: rgba(15, 23, 42, 0.06);
    color: var(--primary);
}
.theme-dark #nav-toggle:hover,
.theme-dark #nav-toggle:focus {
    background-color: rgba(255, 255, 255, 0.08);
}
#nav-toggle svg {
    width: 1.35rem;
    height: 1.35rem;
    stroke: currentColor;
}
#nav-toggle svg.hidden {
    display: none !important;
}
@media (min-width: 768px) {
    #nav-toggle {
        display: none !important;
    }
}

/* 10. Platform Showcase Tab Buttons */
.showcase-tab-btn.is-active {
    background-color: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.3);
}
.showcase-tab-btn.is-active svg {
    color: #ffffff !important;
}

/* 11. macOS Window Traffic Light Controls */
.mac-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}
.mac-dot-red {
    background-color: #ff5f56 !important;
    border: 1px solid #e0443e !important;
    box-shadow: 0 0 4px rgba(255, 95, 86, 0.5);
}
.mac-dot-yellow {
    background-color: #ffbd2e !important;
    border: 1px solid #dea123 !important;
    box-shadow: 0 0 4px rgba(255, 189, 46, 0.5);
}
.mac-dot-green {
    background-color: #27c93f !important;
    border: 1px solid #1aab29 !important;
    box-shadow: 0 0 4px rgba(39, 201, 63, 0.5);
}
.mac-nav-icon {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(30, 41, 59, 0.4);
    color: #94a3b8;
    transition: all 0.15s ease;
    cursor: default;
}
.mac-nav-icon:hover {
    background-color: rgba(51, 65, 85, 0.8);
    color: #ffffff;
}