/* ============================================
   HEADER
   ============================================ */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

.brand a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--text-dark);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.brand-text {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: -0.01em;
    color: var(--text-dark);
}

.nav-links {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 3rem;
}

.nav-group {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-group > a {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dark);
    transition: color 0.2s ease;
    position: relative;
    line-height: 1;
}

.nav-group > a:hover {
    color: var(--accent-dark);
}

.nav-cta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light-default);
    background: transparent;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    position: relative;
    z-index: 1001;
}

.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--text-dark);
    position: relative;
    transition: all 0.3s ease;
}

.nav-toggle-bar::before,
.nav-toggle-bar::after {
    content: '';
    position: absolute;
    left: 0;
}

.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bar {
    background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after {
    transform: translateY(-6px) rotate(-45deg);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ============================================
   DROPDOWN NAVIGATION
   ============================================ */

.nav-dropdown {
    position: static;
}

.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.nav-dropdown-trigger:hover {
    color: var(--accent-dark);
}

.dropdown-arrow {
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .dropdown-arrow,
.nav-dropdown.is-open .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Mega menu (Product) - Full container width */
.mega-menu {
    max-width: min(1280px, 92vw);
    margin: 0 auto;
    padding: 1.5rem 2rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border-light-subtle);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.mega-menu-item {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.875rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background 0.15s ease;
}

.mega-menu-item:hover {
    background: var(--bg-light-surface);
}

.mega-menu-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dark-dim);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.mega-menu-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--accent-dark);
}

.mega-menu-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.mega-menu-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.mega-menu-desc {
    font-size: 0.85rem;
    color: var(--text-dark-muted);
    line-height: 1.4;
}

/* Simple menu (Resources) */
.simple-menu {
    max-width: min(1280px, 92vw);
    margin: 0 auto;
    padding: 1.5rem 2rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border-light-subtle);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 0.5rem;
}

.simple-menu a {
    display: block;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark-secondary);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.simple-menu a:hover {
    background: var(--bg-light-surface);
    color: var(--text-dark);
}

/* ============================================
   BUTTONS
   ============================================ */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.7rem 1.4rem;
    border-radius: 100px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.button:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.button.primary {
    background: var(--gradient-cta);
    color: #ffffff;
    border-color: var(--accent-primary-dark);
    font-weight: 600;
}

.button.primary:hover {
    background: var(--gradient-cta-hover);
    border-color: var(--accent-cta-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-cta);
}

.button.ghost {
    background: transparent;
    color: var(--text-dark);
    border-color: var(--border-light-default);
}

.button.ghost:hover {
    border-color: var(--accent-dark);
    color: var(--accent-dark);
    background: var(--accent-dark-dim);
}

.button.large {
    padding: 1.1rem 2.75rem;
    font-size: 1.1rem;
    box-shadow: 0 4px 14px rgba(var(--accent-primary-rgb), 0.3);
}

/* ============================================
   BASE CARD COMPONENT
   ============================================ */

.base-card {
    background: var(--bg-surface);
    padding: 2rem 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    text-align: center;
    transition: all 0.3s ease;
}

.base-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-4px);
}

.base-card--elevated {
    background: var(--bg-elevated);
}

.base-card--with-shadow:hover {
    box-shadow: var(--shadow-md);
}

.base-card--with-glow {
    position: relative;
    overflow: hidden;
}

.base-card--with-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.base-card--with-glow:hover::before {
    opacity: 1;
}

.base-card--with-glow:hover {
    box-shadow: var(--shadow-lg);
}

/* ============================================
   BASE ICON COMPONENT
   ============================================ */

.base-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary-dim);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.base-icon svg {
    stroke: var(--accent-primary);
}

.base-icon--sm {
    width: 36px;
    height: 36px;
}

.base-icon--sm svg {
    width: 18px;
    height: 18px;
}

.base-icon--md {
    width: 44px;
    height: 44px;
}

.base-icon--md svg {
    width: 20px;
    height: 20px;
}

.base-icon--lg {
    width: 48px;
    height: 48px;
}

.base-icon--lg svg {
    width: 22px;
    height: 22px;
}

.base-icon--xl {
    width: 56px;
    height: 56px;
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
}

.base-icon--xl svg {
    width: 26px;
    height: 26px;
}

.base-icon--centered {
    margin: 0 auto 1rem;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
    padding: 3rem 0 2rem;
    background: var(--bg-void);
    border-top: 1px solid var(--border-subtle);
    position: relative;
    z-index: 1;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text-primary);
}

.footer-logo .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 1rem;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 4rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-col .footer-heading {
    font-family: var(--font-display);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
}

.footer-col a {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.footer-col a:hover {
    color: var(--accent-primary);
}

/* App Store Badges */
.app-store-badges {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.store-badge {
    display: block;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.store-badge:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.store-badge img {
    height: 40px;
    width: auto;
    display: block;
}

/* Footer Social Icons */
.footer-social {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.footer-social a:hover {
    opacity: 0.8;
    transform: translateY(-2px);
    color: var(--accent-primary);
}

.footer-social svg {
    width: 20px;
    height: 20px;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================
   STAGGER ANIMATION UTILITY
   ============================================ */

.stagger-children > *:nth-child(1) { --stagger-delay: 0s; }
.stagger-children > *:nth-child(2) { --stagger-delay: 0.1s; }
.stagger-children > *:nth-child(3) { --stagger-delay: 0.2s; }
.stagger-children > *:nth-child(4) { --stagger-delay: 0.3s; }
.stagger-children > *:nth-child(5) { --stagger-delay: 0.4s; }
.stagger-children > *:nth-child(6) { --stagger-delay: 0.5s; }
.stagger-children > *:nth-child(n+7) { --stagger-delay: 0.6s; }

.stagger-children.animate-on-scroll > * {
    transition-delay: var(--stagger-delay, 0s);
}
