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

/* ============ Header ============ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1002;
    background: rgba(250, 246, 240, 0.25);
    backdrop-filter: saturate(160%) blur(32px);
    -webkit-backdrop-filter: saturate(160%) blur(32px);
    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: 88px; }
@media (max-width: 768px) { body { padding-top: 72px; } }

/* ===== Header over dark sections — invert nav link + button colours ===== */
.site-header.on-dark-bg {
    background: rgba(10, 10, 15, 0.45);
}
.site-header.on-dark-bg .nav-links a,
.site-header.on-dark-bg .logo {
    color: #FFFFFF;
}
.site-header.on-dark-bg .nav-links a:hover {
    color: #FFFFFF;
    opacity: 0.85;
}
/* Dropdown panel stays on its white background — keep dark text inside it */
.site-header.on-dark-bg .dropdown-menu a {
    color: var(--color-text-muted);
    opacity: 1;
}
.site-header.on-dark-bg .dropdown-menu a:hover {
    color: var(--color-text-strong);
    opacity: 1;
}
.site-header.on-dark-bg .header-cta {
    background: transparent;
    color: #FFFFFF !important;
    border-color: rgba(255, 255, 255, 0.4);
}
.site-header.on-dark-bg .header-cta:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF !important;
    border-color: rgba(255, 255, 255, 0.65);
}
.site-header .logo-img {
    transition: filter 0.3s ease;
}
.site-header.on-dark-bg .logo-img {
    filter: brightness(0) invert(1);
}
/* Smooth transition for all header colour-swappable properties */
.site-header,
.site-header .nav-links a,
.site-header .header-cta,
.site-header .logo {
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Once scrolled, even more see-through with a whisper border */
.site-header.is-scrolled {
    background: rgba(250, 246, 240, 0.15);
    border-bottom-color: rgba(15, 39, 70, 0.05);
}

.header-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1.5rem;
}
.header-container > .logo { justify-self: start; }
.header-container > .nav-links { justify-self: center; }
.header-container > .header-right { justify-self: end; }
.header-container > .hamburger { justify-self: end; grid-column: 3; }

.header-right {
    display: inline-flex;
    align-items: center;
    gap: 1.25rem;
}

.header-side-link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    transition: color 0.2s ease;
}
.header-side-link:hover { color: var(--color-text-strong); }

.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-img {
    height: 64px;
    width: auto;
    display: block;
}

footer .logo-img { height: 80px; }

@media (max-width: 768px) {
    .logo-img { height: 48px; }
}

.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,
.nav-dropdown > .nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* Button trigger — inherit all nav-link typography/colour so it looks identical to <a> siblings */
.nav-dropdown > .nav-dropdown-trigger {
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: var(--color-text-muted);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.9375rem;
    letter-spacing: -0.005em;
    transition: color var(--transition-fast);
}
.nav-dropdown > .nav-dropdown-trigger:hover,
.nav-dropdown:hover > .nav-dropdown-trigger {
    color: var(--color-text-strong);
}
.site-header.on-dark-bg .nav-dropdown > .nav-dropdown-trigger {
    color: #FFFFFF;
}

.nav-dropdown > a::after,
.nav-dropdown > .nav-dropdown-trigger::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,
.nav-dropdown:hover > .nav-dropdown-trigger::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,
.nav-dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.nav-dropdown:focus-within > a::after,
.nav-dropdown:focus-within > .nav-dropdown-trigger::after {
    transform: rotate(225deg);
    margin-top: 2px;
}

.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);
}

/* Non-link section header (e.g. "Services") on mobile nav */
.mobile-nav-section {
    display: block;
    padding: 1rem 1.25rem 0.5rem;
    margin-top: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text-faint);
}
.mobile-nav-section:first-child { margin-top: 0; }

/* Indented sub-link under a section header */
.mobile-nav-links a.mobile-nav-sub {
    padding-left: 2rem;
    font-size: 1.25rem;
    color: var(--color-text);
}
.mobile-nav-links a.mobile-nav-sub:hover {
    color: var(--color-text-strong);
}

/* ============ 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; }
    .header-right { display: none; }
    .hamburger { display: flex; }
}
