/* Layout — Header, Footer, Navigation (light theme) */

/* ============ Header ============ */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1002;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-normal), background var(--transition-normal);
}

/* Add top spacing so content isn't hidden under the fixed header */
body { padding-top: 68px; }
@media (max-width: 768px) { body { padding-top: 64px; } }

header.is-scrolled {
    border-bottom-color: var(--color-border);
    background: rgba(255, 255, 255, 0.92);
}

.header-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text-strong);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-blue) 0%, var(--color-purple) 100%);
}

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

.nav-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.9375rem;
    letter-spacing: -0.005em;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-links a:hover {
    color: var(--color-text-strong);
}

.nav-links a.active {
    color: var(--color-text-strong);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown > a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.nav-dropdown > a::after {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform var(--transition-fast);
    margin-top: -3px;
}

.nav-dropdown:hover > a::after {
    transform: rotate(225deg);
    margin-top: 2px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    margin-top: 0.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    min-width: 240px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-lg);
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 0.625rem 0.875rem;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9375rem;
    font-family: var(--font-display);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.dropdown-menu a:hover {
    background: var(--color-bg-soft);
    color: var(--color-text-strong);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1003;
    position: relative;
    width: 44px;
    height: 44px;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--color-text-strong);
    transition: all var(--transition-fast);
    border-radius: 2px;
    display: block;
    position: absolute;
}

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

.hamburger.active span:nth-child(1) {
    top: 21px;
    transform: rotate(45deg);
}
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) {
    top: 21px;
    transform: rotate(-45deg);
}

/* Mobile Nav */
.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: var(--color-bg);
    z-index: 1001;
    padding: 100px 2rem 2rem;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease-out-expo);
    overflow-y: auto;
}

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

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 2rem;
}

.mobile-nav-links a {
    color: var(--color-text-strong);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.5rem;
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.mobile-nav-links a:hover {
    background: var(--color-bg-soft);
}

/* ============ Footer ============ */
footer {
    background: var(--color-bg-soft);
    padding: 4rem 2rem 2rem;
    border-top: 1px solid var(--color-border);
}

.footer-content {
    max-width: var(--container-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .footer-content { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .footer-content { grid-template-columns: 1fr; }
}

.footer-brand .logo {
    margin-bottom: 1rem;
}

.footer-brand p {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    max-width: 320px;
}

.footer-section h4 {
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-faint);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color var(--transition-fast);
}

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

.footer-bottom {
    max-width: var(--container-max);
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    color: var(--color-text-faint);
    font-size: 0.875rem;
}

@media (max-width: 640px) {
    .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
}

/* ============ Mobile responsive ============ */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
}
