.skip-link {
    position: fixed;
    top: 12px;
    left: 16px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--panel-bg);
    transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
    position: fixed;
    z-index: 40;
    inset: 0 0 auto;
    transition: transform 360ms cubic-bezier(.22, 1, .36, 1);
}

.header-bar {
    width: 100%;
    max-width: 1800px;
    margin-inline: auto;
    border: 1px solid transparent;
    border-radius: 0;
    background: var(--header-bg);
    transition: width 360ms ease, max-width 360ms ease, border-radius 360ms ease,
        background-color 240ms ease, box-shadow 240ms ease, border-color 240ms ease;
}

/* The full-width layer continues beyond the centred content on wide screens. */
.site-header::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background: var(--header-bg);
    transition: opacity 240ms ease;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 1440px;
    height: 104px;
    margin-inline: auto;
    padding-inline: 40px;
    transition: height 360ms ease, padding 360ms ease;
}

.brand {
    position: relative;
    display: block;
    flex: 0 0 228px;
    width: 228px;
    height: 48px;
    border-radius: 4px;
    transition: width 360ms ease, flex-basis 360ms ease;
}

.brand-wordmark, .brand-mark {
    position: absolute;
    inset: 0 auto 0 0;
    display: block;
    width: 228px;
    height: 48px;
    transition: transform 360ms cubic-bezier(.22, 1, .36, 1), opacity 240ms ease;
}

.brand-wordmark {
    animation: reveal-wordmark 650ms cubic-bezier(.22, 1, .36, 1) both;
}

.brand img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-wordmark img { animation: slide-wordmark 650ms cubic-bezier(.22, 1, .36, 1) both; }
@keyframes slide-wordmark {
    from { transform: translateX(-16px); }
    to { transform: translateX(0); }
}

.brand-dark { display: none; }
[data-theme="dark"] .brand-light { display: none; }
[data-theme="dark"] .brand-dark { display: block; }

.brand-mark { width: 44px; opacity: 0; transform: translateX(-12px); }

@keyframes reveal-wordmark {
    from { clip-path: inset(0 calc(100% - 44px) 0 0); }
    to { clip-path: inset(0); }
}

.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    max-width: 620px;
    margin-left: auto;
    opacity: 1;
    white-space: nowrap;
    transition: opacity 160ms ease, transform 240ms ease, max-width 360ms ease,
        visibility 160ms;
}

.desktop-nav a {
    position: relative;
    padding-block: 14px;
    color: var(--heading);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
}

.desktop-nav a::after {
    content: "";
    position: absolute;
    inset: auto 0 6px;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 180ms ease;
}

.desktop-nav a:hover::after, .desktop-nav a[aria-current]::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.theme-toggle {
    display: inline-grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--heading);
    background: transparent;
    cursor: pointer;
    transition: background-color 180ms ease;
}

.theme-toggle:hover { background: var(--hover); }
.theme-sun { display: none; }
[data-theme="dark"] .theme-moon { display: none; }
[data-theme="dark"] .theme-sun { display: block; }

.menu-toggle, .drawer-close {
    position: relative;
    display: inline-grid;
    flex: 0 0 44px;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: var(--heading);
    cursor: pointer;
    transition: background-color 180ms ease, opacity 180ms ease;
}

.menu-toggle:hover, .drawer-close:hover { background: var(--hover); }
.menu-toggle { display: none; }

.menu-toggle span, .drawer-close span {
    position: absolute;
    width: 18px;
    height: 1.5px;
    background: currentColor;
    transition: transform 180ms ease;
}

.menu-toggle span:first-child { transform: translateY(-3px); }
.menu-toggle span:last-child { transform: translateY(3px); }
.drawer-close span:first-child { transform: rotate(45deg); }
.drawer-close span:last-child { transform: rotate(-45deg); }

.site-header.is-compact { transform: translateY(16px); }
.site-header.is-compact::before { opacity: 0; }

.is-compact .header-bar {
    width: calc(100% - 48px);
    max-width: 1200px;
    border-color: var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    /* Opaque fallback is retained when backdrop-filter is unsupported. */
    background: var(--panel-bg);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .is-compact .header-bar {
        background: var(--glass-bg);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
    }
}

.is-compact .header-inner { height: 56px; padding-inline: 18px; }
.is-compact .brand { width: 32px; flex-basis: 32px; height: 40px; }
.is-compact .brand-mark { width: 32px; height: 40px; }
.is-compact .quotation-button { display: none; }
.is-compact .brand-wordmark { opacity: 0; transform: translateX(-24px); pointer-events: none; }
.is-compact .brand-mark { opacity: 1; transform: translateX(0); transition-delay: 100ms; }

.is-compact .desktop-nav {
    max-width: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transform: translateX(12px);
}

.is-compact .menu-toggle { display: inline-grid; }

.navigation-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(520px, 100%);
    height: 100dvh;
    max-width: 100%;
    max-height: 100dvh;
    margin: 0;
    padding: 32px 40px;
    border: 0;
    border-left: 1px solid var(--line);
    background: var(--panel-bg);
    color: var(--heading);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.navigation-drawer[open] {
    display: flex;
    flex-direction: column;
    animation: drawer-in 320ms cubic-bezier(.22, 1, .36, 1) both;
}

.navigation-drawer::backdrop { background: #030b1480; animation: backdrop-in 240ms ease both; }
.navigation-drawer.is-closing { animation: drawer-out 220ms ease both; }
.navigation-drawer.is-closing::backdrop { animation: backdrop-out 220ms ease both; }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes drawer-out { to { transform: translateX(100%); } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes backdrop-out { to { opacity: 0; } }

.drawer-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.drawer-top .eyebrow { margin: 0; }
.drawer-nav { display: grid; gap: 8px; margin-block: 48px; }

.drawer-nav a {
    width: fit-content;
    padding-block: 5px;
    color: var(--heading);
    font-size: clamp(1.75rem, 3vw, 2.4rem);
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: -.035em;
    text-decoration: none;
    transition: color 160ms ease, transform 160ms ease;
}

.drawer-nav a:hover { color: var(--accent); transform: translateX(5px); }
.drawer-nav a[aria-current] { color: var(--accent); }
.drawer-bottom { margin-top: auto; padding-top: 24px; border-top: 1px solid var(--line); }
.drawer-secondary { display: grid; gap: 14px; margin-bottom: 28px; }
.drawer-secondary a { width: fit-content; color: var(--text); font-size: 1rem; text-decoration: none; }
.drawer-secondary a:hover { color: var(--accent); }
.drawer-quotation { width: 100%; }
.drawer-company { margin: 24px 0 0; color: var(--muted); font-size: .875rem; }

.no-script-nav { position: relative; z-index: 45; padding: 16px; background: var(--panel-bg); }
.no-script-nav a { display: inline-block; margin: 8px; }
html:not([data-header-enhanced]) .theme-toggle,
html:not([data-header-enhanced]) .menu-toggle { display: none; }

@media (max-width: 1150px) {
    .desktop-nav { display: none; }
    .menu-toggle { display: inline-grid; }
    .header-inner { padding-inline: 32px; }
}

@media (max-width: 600px) {
    .header-inner { height: 84px; padding-inline: 16px; gap: 8px; }
    .brand { width: 136px; flex-basis: 136px; height: 40px; }
    .brand-wordmark { width: 136px; height: 40px; }
    .brand-mark { width: 36px; height: 40px; }
    .header-actions { gap: 8px; }
    .quotation-button { display: none; }
    .site-header.is-compact { transform: translateY(10px); }
    .is-compact .header-bar { width: calc(100% - 24px); border-radius: 16px; }
    .is-compact .header-inner { height: 56px; padding-inline: 14px; }
    .is-compact .brand { width: 32px; flex-basis: 32px; }
    .navigation-drawer { padding: 24px; }
    .drawer-nav { margin-block: 36px; }
}
