/* Mobile Menu Styles */
.mobile-menu-button {
    display: none;
}

.mobile-menu {
    display: none;
}

@media (max-width: 768px) {
    nav {
        padding: 0.5rem 1rem;
    }

    .logo img {
        height: 2.25rem;
    }

    .mobile-menu-button {
        display: block;
        position: relative;
        z-index: 50;
        padding: 0.5rem;
    }

    .md\:flex {
        display: none !important;
    }

    .mobile-menu {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--nav-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 40;
        padding: 7rem 2rem 2rem;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .mobile-menu.active {
        transform: translateX(0);
    }
}

.mobile-menu-panel {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    gap: 1rem;
    /* calm separation between groups */
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
    padding: 0 1rem;
}

.mobile-menu a {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.875rem 1.5rem;
    width: 100%;
    text-align: center;
    border-radius: 8px;
}

.mobile-menu a:not(.cta-button):hover {
    color: var(--primary-indigo);
    /* indigo-600 */
    background: rgba(79, 70, 229, 0.06);
}

.mobile-menu .cta-button {
    display: inline-block;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(45deg, #4338ca, #6b46c1);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.22);
    border: none;
    width: 100%;
    text-align: center;
    margin-top: 0.5rem;
}

.mobile-menu .cta-button.cta-button--indigo {
    background: #4f46e5;
    /* indigo-600 */
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.25);
}

.mobile-menu .cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -2px rgba(67, 56, 202, 0.32);
    background: linear-gradient(45deg, #3730a3, #5a3cbf);
    color: #ffffff;
    /* keep text white on hover */
}

.mobile-menu .cta-button.cta-button--indigo:hover {
    background: #4338ca;
    /* indigo-700 */
    box-shadow: 0 6px 12px -2px rgba(67, 56, 202, 0.35);
    color: #ffffff;
    /* keep text white on hover */
}

/* Actions block (CTA + Sign in) */
.mobile-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    /* slightly tighter within actions */
    padding: 0 1rem;
    margin-top: 1.25rem;
    padding-top: 0;
    /* cleaner look without divider */
}

/* Tall screens: center primary links vertically; keep actions pinned to bottom */
@media (min-height: 720px) {
    .mobile-menu-panel {
        display: grid;
        grid-template-rows: 1fr auto 1fr auto;
        /* [spacer] [links] [spacer] [actions] */
        min-height: 100%;
    }

    .mobile-menu-links {
        grid-row: 2;
    }

    .mobile-menu-actions {
        grid-row: 4;
    }
}

/* Mobile link + icon alignment and subtle tinting */
.mobile-menu .mobile-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* keep labels centered like original */
    gap: 0.625rem;
    /* 10px visual rhythm between icon and label */
}

/* Ensure icon sizing works pre/post Lucide replacement (i -> svg) */
.mobile-menu .mobile-link .mobile-link-icon,
.mobile-menu .mobile-link svg.mobile-link-icon,
.mobile-menu .mobile-link svg.lucide {
    width: 1.125rem;
    /* 18px */
    height: 1.125rem;
    color: var(--text-secondary);
    /* gray-600 base */
    transition: color 0.18s ease;
}

/* Respect hover tone from links while subtly tinting icon */
.mobile-menu .mobile-link:hover .mobile-link-icon,
.mobile-menu .mobile-link:hover svg.mobile-link-icon,
.mobile-menu .mobile-link:hover svg.lucide {
    color: var(--primary-indigo);
    /* indigo-600 */
}

/* Accessible focus outline without heavy glow */
.mobile-menu .mobile-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.14), 0 0 0 4px rgba(79, 70, 229, 0.08);
    border-radius: 8px;
}

/* Hamburger Icon */
.hamburger {
    width: 24px;
    height: 24px;
    position: relative;
    cursor: pointer;
    padding: 8px;
}

.hamburger span {
    display: block;
    position: absolute;
    height: 2px;
    width: 24px;
    background: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger span:nth-child(1) {
    top: 2px;
}

.hamburger span:nth-child(2) {
    top: 10px;
}

.hamburger span:nth-child(3) {
    top: 18px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 10px;
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg);
    top: 10px;
}

/* Navigation Styles */
nav {
    transition: background-color 0.3s ease;
}

/* Nav-specific glass to match draft header: crisp, neutral, minimal shadow */
nav.glass-effect {
    background: var(--nav-bg);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    border: none;
    /* reset base .glass-effect border */
    border-bottom: 1px solid var(--nav-border);
    /* gray-200 */
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

/* Anchor offset for fixed header */
section[id] {
    scroll-margin-top: 80px;
}

.nav-link {
    transition: color 0.3s ease;
    color: var(--text-secondary);
    padding: 0 12px;
}

.nav-link:hover {
    color: var(--primary-indigo);
}

[data-theme="dark"] .nav-link:hover {
    color: #818cf8;
    /* indigo-400 for more vibrancy */
}

nav .container>div:nth-child(2) {
    margin-left: 120px;
}

.sticky-nav {
    position: fixed;
    top: -100px;
    transition: top 0.3s ease;
    width: 100%;
    backdrop-filter: blur(10px);
}

.sticky-nav.visible {
    top: 0;
}

/* Scroll Indicator Styles */
.scroll-indicator {
    position: absolute;
    /* desktop: anchor to #hero so it scrolls away */
    bottom: 16px;
    left: 0;
    right: 0;
    transform: none;
    /* avoid transform conflicts with child animations */
    cursor: pointer;
    z-index: 10;
    display: flex;
    /* allow centering without transforms */
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .scroll-indicator {
        bottom: 24px;
        bottom: calc(24px + env(safe-area-inset-bottom));
    }
}

/* Mobile: disable arrow bounce animation to prevent jank when browser UI shows/hides */
@media (max-width: 768px) {

    .scroll-indicator .animate-bounce,
    .scroll-indicator .chevron-bounce {
        animation: none !important;
    }
}

/* Mobile: keep indicator fixed to the viewport bottom (CSS-only, no JS) */
@media (max-width: 768px) {
    .scroll-indicator {
        position: fixed;
        bottom: calc(16px + env(safe-area-inset-bottom));
        left: 0;
        right: 0;
        z-index: 20;
    }
}

/* Mobile: prefer stable viewport height for hero to reduce layout shifts during URL bar hide/show */
@media (max-width: 768px) {
    #hero {
        height: 100vh;
        /* fallback */
        height: 100svh;
        /* use small viewport height to avoid layout growth when URL bar hides */
    }
}

/* Scroll indicator base: avoid transform will-change and transitions that can conflict with keyframes */
.scroll-indicator {
    will-change: opacity;
    backface-visibility: hidden;
}

.scroll-indicator.is-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Subtle chevron bounce (smaller amplitude than Tailwind's animate-bounce) */
@keyframes chevron-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

.scroll-indicator svg {
    will-change: transform;
}

.scroll-indicator .chevron-bounce {
    animation: chevron-bounce 1.6s infinite cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Crisp, momentum-based dismiss that feels synced with section reveal */
@keyframes arrow-dismiss {
    0% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }

    55% {
        opacity: 0.12;
        transform: translate3d(0, 6px, 0);
    }

    100% {
        opacity: 0;
        transform: translate3d(0, 10px, 0);
    }
}

.scroll-indicator.is-dismissing {
    animation: arrow-dismiss 170ms cubic-bezier(0.20, 0.80, 0.20, 1) forwards;
    pointer-events: none;
    /* prevent clicks during the short dismiss window */
    transition: none !important;
    /* avoid opacity transition fighting keyframes */
    will-change: opacity, transform;
    /* ensure compositor promotion during dismiss */
    contain: paint;
    /* isolate painting to avoid flicker on viewport resize */
}

/* Pause bounce during dismiss for a crisp, Apple-like feel */
.scroll-indicator.is-dismissing .chevron-bounce {
    animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .scroll-indicator.is-dismissing {
        animation: none;
    }
}

/* Footer Styles */
.footer-section {
    padding: 60px 0;
    background-color: var(--footer-bg);
    color: var(--footer-text);
}

.footer-section a {
    color: var(--footer-text-muted);
    transition: color 0.18s ease;
}

.footer-section a:hover {
    color: var(--footer-text);
}

/* Animations */
@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(10px, 10px) rotate(5deg);
    }

    50% {
        transform: translate(20px, 0) rotate(10deg);
    }

    75% {
        transform: translate(10px, -10px) rotate(5deg);
    }
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #4338ca, #6b46c1);
    z-index: 1000;
    transition: width 0.1s ease;
}

/* Accessibility Styles */
/* Fallback focus outline for browsers without :focus-visible support */
a:focus,
button:focus {
    outline: 2px dashed #4f46e5;
    outline-offset: 4px;
}

/* Use :focus-visible when supported to limit outlines to keyboard navigation */
@supports selector(:focus-visible) {
    :focus:not(:focus-visible) {
        outline: none;
        box-shadow: none;
    }

    a:focus,
    button:focus {
        outline: none;
    }

    a:focus-visible,
    button:focus-visible {
        outline: 2px dashed #4f46e5;
        outline-offset: 4px;
    }
}

/* New styles for the expanded menu */
.cookie-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.3s;
}

.cookie-modal-content {
    background-color: var(--bg-card);
    margin: 10% auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cookie-close {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.cookie-close:hover,
.cookie-close:focus {
    color: var(--text-main);
    text-decoration: none;
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Tailwind doesn't have a built-in class for custom checkboxes, so we'll create our own */
.custom-checkbox {
    appearance: none;
    height: 1.25rem;
    /* h-5 */
    width: 1.25rem;
    /* w-5 */
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    /* rounded-md */
    outline: none;
    /* focus:outline-none */
    background-color: var(--bg-card);
    vertical-align: middle;
    display: inline-block;
}

.custom-checkbox:checked {
    background-color: #4f46e5;
    /* indigo-600 */
    border-color: transparent;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M5.707 7.293a1 1 0 0 0-1.414 1.414l2 2a1 1 0 0 0 1.414 0l4-4a1 1 0 0 0-1.414-1.414L7 8.586 5.707 7.293z'/%3e%3c/svg%3e");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

/* Cookie Styles */
@media (max-width: 768px) {
    #cookie-consent-desktop {
        text-align: left;
    }
}

#cookie-consent.hidden {
    display: none;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#cookie-consent-mobile {
    animation: fadeIn 0.3s ease-out;
}

#cookie-consent-mobile>div {
    animation: slideUp 0.5s ease-out forwards;
}

/* Ensure the desktop version is hidden on mobile */
@media (max-width: 640px) {
    #cookie-consent-desktop {
        display: none;
    }
}

.chevron-arrow {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    margin-right: -2px;
    transform: translateX(0);
    transition: all 0.3s ease;
    position: relative;
    width: 20px;
    height: 24px;
}

.chevron-arrow::before {
    content: '›';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 82%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.75em;
    line-height: 1;
    opacity: 1;
}

.chevron-arrow::after {
    content: '→';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 104%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.5em;
    line-height: 1;
    opacity: 0;
}

.cta-button:hover .chevron-arrow::before {
    opacity: 0;
    transform: translateX(6px);
}

.cta-button:hover .chevron-arrow::after {
    opacity: 1;
}

.cta-button:hover .chevron-arrow {
    transform: translateX(2px);
}

.cta-button {
    display: inline-flex;
    align-items: center;
}

@supports (-webkit-touch-callout: none) {
    .typed-cursor {
        display: none !important;
    }
}


#cookie-consent-desktop {
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1), 0 -2px 4px -1px rgba(0, 0, 0, 0.06);
    border-top: 1px solid var(--border-color);
}

#cookie-consent-desktop::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(to top, rgba(249, 250, 251, 0.1), rgba(249, 250, 251, 0));
    pointer-events: none;
}

#cookie-consent-desktop .container {
    max-width: 1200px;
}

#cookie-consent-desktop h3 {
    color: #4338ca;
}

#accept-cookies,
#customize-cookies {
    min-width: 160px;
}

@media (max-width: 768px) {
    #cookie-consent-desktop .container {
        flex-direction: column;
        align-items: stretch;
    }

    #cookie-consent-desktop .flex-grow {
        margin-bottom: 1rem;
    }

    #cookie-consent-desktop .flex-shrink-0 {
        flex-direction: row;
        justify-content: space-between;
    }

    #accept-cookies,
    #customize-cookies {
        min-width: 0;
        flex: 1;
    }
}