/* Skeuomorphic Floating Header Plate */
header {
    position: sticky;
    top: 18px;
    width: min(1240px, calc(100% - 48px));
    height: 72px;
    margin: 18px auto 0;
    padding: 0 20px;
    border: 1px solid var(--border-line);
    border-radius: 22px;
    background: var(--bg-surface);
    color: var(--text-ink);
    box-shadow: var(--shadow-drop);
    z-index: 1000;
    transition: height .35s ease, top .35s ease, box-shadow .35s ease, background .35s ease, border-color .35s ease;
}

header.compact {
    height: 60px;
    top: 10px;
    box-shadow: var(--shadow-drop-hover);
}

header nav.container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Tactile 3D Carved Coin Brand Mark */
.brand-mark {
    width: 46px;
    height: 46px;
    min-width: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--brand-mark-bg);
    border: 1px solid var(--border-line);
    box-shadow: var(--shadow-drop);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.brand-mark:hover {
    transform: scale(1.06);
    box-shadow: var(--shadow-drop-hover);
}

.brand-mark:active {
    transform: scale(0.96);
    box-shadow: var(--shadow-pressed);
}

.brand-icon {
    grid-area: 1/1;
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.15));
}

.brand-icon--dark { display: none; }
.brand-icon--light { display: block; }

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

/* Navigation Links */
.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    padding: 8px 14px;
    color: var(--text-ink);
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 0 0 transparent;
    transition: all 0.25s ease;
}

.nav-links a:hover {
    box-shadow: var(--shadow-drop);
    color: var(--accent-cyan);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Tactile 3D Buttons & Switchers */
.theme-toggle, .mobile-toggle {
    color: var(--text-ink);
    background: var(--bg-surface);
    border: 1px solid var(--border-line);
    border-radius: 14px;
    box-shadow: var(--shadow-drop);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-width: 42px;
    font-size: 15px;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.theme-toggle:hover, .mobile-toggle:hover {
    box-shadow: var(--shadow-drop-hover);
    color: var(--accent-cyan);
}

.theme-toggle:active, .mobile-toggle:active {
    box-shadow: var(--shadow-pressed);
    transform: translateY(1px);
}

.mobile-toggle {
    display: none;
}

/* Carved Inset Language Switcher */
.lang-switcher {
    padding: 4px;
    gap: 3px;
    background: var(--bg-surface);
    border: 1px solid var(--border-line);
    border-radius: 14px;
    box-shadow: var(--shadow-inset);
    display: inline-flex;
    align-items: center;
}

.lang-btn {
    padding: 6px 10px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    transition: all 0.2s ease;
}

.lang-btn.active {
    background: var(--bg-surface);
    color: var(--accent-cyan);
    font-weight: 700;
    box-shadow: var(--shadow-drop);
}

/* Skeuomorphic Mobile Drawer Panel */
.mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 290px;
    height: 100%;
    background: var(--bg-surface);
    box-shadow: -15px 0 35px rgba(0, 0, 0, 0.35);
    z-index: 2001;
    padding: 35px 26px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

html[dir="ltr"] .mobile-drawer {
    right: auto;
    left: 0;
    transform: translateX(-100%);
}

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

.mobile-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-line);
}

.mobile-brand {
    font: 700 18px "IBM Plex Mono", monospace;
    color: var(--text-ink);
}

.mobile-close {
    font-size: 24px;
    line-height: 1;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    box-shadow: var(--shadow-drop);
}

.mobile-nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-nav-links a {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-ink);
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: var(--shadow-drop);
    display: block;
}

/* Tactile Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-surface);
    color: var(--text-ink);
    padding: 16px 32px;
    border-radius: 16px;
    box-shadow: var(--shadow-drop-hover), 0 0 15px var(--accent-glow);
    border: 1px solid var(--accent-cyan);
    font-size: 14px;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

@media(max-width:620px){
    .lang-switcher{padding:2px;gap:1px}
    .lang-btn{padding:5px 7px;font-size:10px}
    .nav-controls{gap:6px}
}

.mobile-drawer-overlay { visibility: hidden; }
.mobile-drawer-overlay.active { visibility: visible; }
.mobile-drawer { width: min(290px, 100vw); overflow-y: auto; }
