/* Navbar + footer (built by js/layout.js) */
.navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; justify-content: space-between; align-items: center; padding: 22px 4vw; transition: background .3s, padding .3s, border-color .3s; border-bottom: 1px solid transparent; }
.navbar.scrolled { background: var(--navbar-bg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: 14px 4vw; border-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-size: 1.5rem; letter-spacing: .06em; }
.brand-mark { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 8px; border: 1px solid var(--accent); color: var(--accent); font-size: .95rem; }
.nav-links { display: flex; gap: 34px; margin-left: auto; margin-right: 24px; }
.nav-links a { position: relative; font-size: .95rem; color: var(--muted); transition: color .2s; }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: -6px; width: 0; height: 2px; background: var(--accent); transition: width .25s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  transition: border-color .2s, color .2s, transform .2s, background-color .2s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.theme-toggle svg {
  width: 20px;
  height: 20px;
  position: absolute;
  transition: transform .35s cubic-bezier(0.4, 0, 0.2, 1), opacity .3s ease;
}
:root:not([data-theme="dark"]) .theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.4);
  pointer-events: none;
}
:root:not([data-theme="dark"]) .theme-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
[data-theme="dark"] .theme-toggle .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
[data-theme="dark"] .theme-toggle .icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.4);
  pointer-events: none;
}

.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.7rem; cursor: pointer; line-height: 1; padding: 4px; }

.footer { border-top: 1px solid var(--line); background: var(--bg-deep); padding: 60px 4vw 30px; }
.footer-top { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer p { color: var(--muted); max-width: 380px; margin-top: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.footer-links a { color: var(--muted); transition: color .2s; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { margin-top: 40px; font-family: var(--font-mono); font-size: .75rem; color: var(--muted); }

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; margin: 0; background: var(--bg-deep); border-bottom: 1px solid var(--line); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 16px 4vw; }
  .nav-links a::after { display: none; }
}