.siteheader { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; padding: 0.45rem 0; isolation: isolate; background: transparent; }
.siteheader::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4rem; background: rgba(6, 10, 18, 0.94); border-bottom: 1px solid rgba(255, 255, 255, 0.06); pointer-events: none; z-index: -2; }
.siteheader::after { display: none; }
.header-content { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.75rem; min-height: 3rem; padding-left: calc(42px + var(--space-md)); padding-right: 0; position: relative; }
.header-content.shell-frame-home { padding-left: calc(42px + clamp(0.875rem, 2.7vw, 2.5rem)); padding-right: clamp(0.875rem, 2.7vw, 2.5rem); }
.header-brand { text-align: left; min-width: 0; }
.brand-heading { font-family: var(--font-serif), serif; font-size: clamp(1.1rem, 4.6vw, 1.55rem); letter-spacing: -0.03em; margin: 0; line-height: 1; }
.logo-title { color: #ffffff; display: inline-flex; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); }
.logo-title span { transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1), text-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.logo-title:active span { color: var(--brand-primary); }
.site-description { display: none; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; margin-top: 0; flex-wrap: wrap; }
.header-search-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: var(--radius-full); color: rgba(255, 255, 255, 0.82); box-shadow: none; transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.header-search-btn:hover { background: rgba(255, 255, 255, 0.15); color: #fff; border-color: rgba(255, 255, 255, 0.2); }
.header-search-btn svg { width: 17px; height: 17px; }
.header-nav { margin-top: 0; }
.header-nav ul { display: flex; gap: 0; list-style: none; margin: 0; padding: 0; justify-content: center; background: rgba(255, 255, 255, 0.06); border-radius: var(--radius-full); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: none; overflow: hidden; flex-wrap: wrap; }
.header-nav li { display: flex; }
.header-nav li:not(:last-child) { border-right: 1px solid rgba(255, 255, 255, 0.08); }
.nav-link { font-weight: 600; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(255, 255, 255, 0.7); padding: 0.7rem 1rem; transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: block; white-space: nowrap; }
.nav-link:hover { color: #ffffff; background: rgba(255, 255, 255, 0.1); text-shadow: 0 0 10px rgba(255, 255, 255, 0.3); }
.logout-form { margin: 0; display: flex; }
.logout-btn { background: transparent; border: none; cursor: pointer; font-family: inherit; color: inherit; -webkit-appearance: none; appearance: none; }
@keyframes header-compact { from { transform: translateY(0) translateZ(0); } to { transform: translateY(-0.5rem) translateZ(0); } }
@keyframes nav-hide { from { opacity: 1; transform: translateY(0) scaleY(1) translateZ(0); } to { opacity: 0; transform: translateY(-10px) scaleY(0) translateZ(0); } }
@keyframes brand-shrink { from { transform: scale(1) translateZ(0); } to { transform: scale(0.72) translateZ(0); } }
@keyframes description-hide { from { opacity: 1; transform: translateY(0) scaleY(1) translateZ(0); } to { opacity: 0; transform: translateY(-5px) scaleY(0) translateZ(0); } }
@keyframes nav-compact { from { transform: translateY(0) translateZ(0); } to { transform: translateY(-0.5rem) translateZ(0); } }
@keyframes hamburger-compact { from { transform: scale(1) translateZ(0); } to { transform: scale(0.82) translateZ(0); } }
.category-nav { position: fixed; top: 0.55rem; left: max(var(--space-sm), env(safe-area-inset-left)); z-index: 1002; }
.hamburger { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; width: 38px; height: 38px; padding: 8px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: var(--radius-full); cursor: pointer; box-shadow: none; transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.hamburger:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.18); }
.hamburger-line { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1); transform-origin: center center; }
.hamburger.is-open .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open .hamburger-line:nth-child(2) { opacity: 0; }
.hamburger.is-open .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.category-menu { position: fixed; top: 0; left: 0; bottom: 0; width: min(24rem, 92vw); background: rgba(12, 13, 16, 0.98); border-right: 1px solid rgba(255, 255, 255, 0.06); z-index: 1001; transform: translateX(-100%); visibility: hidden; overflow-y: auto; display: none; flex-direction: column; }
.category-menu.menu-ready { display: flex; }
.category-menu.animated { transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s; }
.category-menu.is-open { transform: translateX(0); visibility: visible; }
.menu-header { padding: 4.9rem 1.4rem 1.4rem 4rem; border-bottom: none; position: relative; }
.menu-header::after { content: ''; position: absolute; bottom: 0; left: 2rem; right: 2rem; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent); }
.menu-title { font-family: var(--font-serif), serif; font-size: clamp(1.65rem, 7vw, 2rem); font-weight: 700; color: #fff; letter-spacing: -0.03em; }
.menu-nav { padding: 1.5rem 0; flex: 1; }
.menu-section-title { padding: 1.5rem 2rem 0.5rem; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em; color: rgba(255, 255, 255, 0.3); }
.category-link { display: flex; align-items: center; gap: 0.85rem; padding: 0.9rem 1.4rem; color: rgba(255, 255, 255, 0.72); font-size: 0.98rem; font-weight: 500; letter-spacing: 0.01em; text-decoration: none; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); position: relative; border: none; }
.category-link:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.category-link:hover::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 60%; background: var(--brand-primary); border-radius: 0 2px 2px 0; }
.category-link.active { color: #fff; font-weight: 500; }
.category-link.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 60%; background: var(--brand-primary); border-radius: 0 2px 2px 0; }
.category-link.search-link { margin: 0 1rem 1rem 1rem; padding: 1rem 1.25rem; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 12px; font-size: 0.9rem; color: rgba(255, 255, 255, 0.5); }
.category-link.search-link:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.1); color: #fff; }
.category-link.search-link:hover::before,
.category-link.search-link::before { display: none; }
.menu-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.menu-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.68); z-index: 1000; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.25s ease, visibility 0.25s ease; }
.menu-backdrop.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.sitefooter { background: rgba(15, 17, 21, 0.97); padding: clamp(2rem, 6vw, 3rem) 0 var(--space-lg); margin-top: clamp(3rem, 8vw, 5rem); position: relative; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.footer-content { display: flex; flex-direction: column; align-items: center; gap: var(--space-lg); text-align: center; }
.footer-brand { display: flex; flex-direction: column; gap: 0.25rem; }
.footer-logo { font-family: var(--font-serif), serif; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; color: #ffffff; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); }
.copyright { font-size: 0.7rem; color: rgba(255, 255, 255, 0.4); margin: 0; letter-spacing: 0.05em; }
.footer-nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; background: transparent; border-radius: var(--radius-full); border: none; overflow: visible; }
.footer-nav li { display: flex; }
.footer-nav li:not(:last-child) { border-right: none; }
.footer-nav a { color: rgba(255, 255, 255, 0.72); font-size: 0.72rem; font-weight: 600; transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1); padding: 0.65rem 0.9rem; display: block; letter-spacing: 0.08em; border-radius: var(--radius-full); background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.08); }
.footer-nav a:hover { color: #ffffff; background: rgba(255, 255, 255, 0.1); }

.app-shell:has(.article-header.has-hero) .siteheader::before,
.app-shell:has(.article-header.has-hero) .siteheader::after {
    display: none;
}

@media (prefers-color-scheme: dark) {
    .siteheader::before { background: rgba(5, 8, 15, 0.96); border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
}

@media (min-width: 768px) {
    .siteheader { padding: 0.45rem 0; }
    .siteheader::before { height: 4.1rem; }
    .header-nav ul { background: rgba(255, 255, 255, 0.12); }
    .header-content { grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-md); padding-left: calc(42px + var(--space-lg)); }
    .header-content.shell-frame-home { padding-left: calc(42px + clamp(1rem, 2.7vw, 2.5rem)); padding-right: clamp(1rem, 2.7vw, 2.5rem); }
    .header-brand { flex: 1; }
    .brand-heading { font-size: 1.75rem; }
    .header-content.shell-frame-home .brand-heading { font-size: clamp(1.7rem, 2.2vw, 2rem); }
    .header-actions { margin-top: 0; }
    .header-search-btn { display: inline-flex; }
    .nav-link { font-size: 0.75rem; padding: 0.7rem 1.1rem; }
    .site-description { display: block; font-size: 0.6rem; margin-top: 0.18rem; max-width: 28rem; }
    .footer-content { flex-direction: row; justify-content: space-between; }
}

@media (min-width: 1024px) {
    .siteheader { padding: 0.5rem 0; }
    .siteheader::before { height: 4.2rem; }
    .site-description { font-size: 0.66rem; }
}

@media (hover: hover) and (pointer: fine) {
    .logo-title:hover span { color: var(--brand-primary); text-shadow: 0 0 20px rgba(217, 4, 41, 0.5); }
    .logo-title:hover span:nth-child(odd) { transform: translateY(-3px); }
    .logo-title:hover span:nth-child(even) { transform: translateY(3px); }
}
