/* ── Header ── */

:root { --nav-height: 68px; }

header,
site-header {
  display: block;
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--bg-header);
  border-bottom: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background 0.25s, border-color 0.25s;
}

.nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

@media (min-width: 520px) {
  .nav { padding: 0 2rem; }
}

.nav-logo img {
  height: 42px;
  width: 42px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 0.1rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.55rem;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}

@media (min-width: 520px) {
  .nav-links { gap: 0.25rem; }
  .nav-links a { font-size: 0.92rem; padding: 0.45rem 1rem; }
}

.nav-links a:hover {
  color: var(--text);
  background: var(--accent-dim);
}

.nav-links a.active {
  color: #fff;
  background: var(--gradient);
}

/* ── Theme toggle ── */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--orange-dim);
  color: var(--orange);
  border-color: var(--orange);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.icon-sun  { display: none; }
.icon-moon { display: block; }

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

/* ── Hamburger button ── */

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.nav-hamburger:hover {
  border-color: var(--orange);
}

.nav-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--muted);
  border-radius: 2px;
  pointer-events: none;
  transition: transform 0.2s, opacity 0.2s;
}

/* ── Mobile nav ── */

@media (max-width: 860px) {
  .nav-hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 1.5rem 1.25rem;
    background: var(--bg-header);
    border-bottom: 1.5px solid var(--border);
    box-shadow: var(--shadow-md);
    z-index: 99;
  }

  site-header.nav-open .nav-links {
    display: flex;
  }

  .nav-links a {
    display: block;
    border-radius: 10px;
    padding: 0.6rem 1rem !important;
    font-size: 0.9rem !important;
  }

  site-header.nav-open .nav-hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  site-header.nav-open .nav-hamburger span:nth-child(2) {
    opacity: 0;
  }
  site-header.nav-open .nav-hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* ── Main ── */

main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}

@media (min-width: 520px) {
  main { padding: 4rem 2rem; }
}

/* ── Footer ── */

footer,
site-footer {
  display: block;
  border-top: 3px solid var(--orange);
  background: var(--bg-footer);
  position: relative;
  z-index: 1;
  transition: background 0.25s, border-color 0.25s;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 520px) {
  .footer-inner {
    padding: 3rem 2rem;
    flex-direction: row;
    gap: 4rem;
  }
}

.footer-brand {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 0.4rem;
}

.footer-name {
  font-size: 0.92rem;
  font-weight: 700;
}

.footer-tagline {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-social {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color 0.2s;
}

.footer-social-link:hover {
  color: var(--fg);
}

.footer-social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer-nav h4 {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.footer-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-nav a {
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s;
}

.footer-nav a:hover {
  color: var(--orange);
}

.footer-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0;
}

.footer-nav-secondary {
  font-size: 0.78rem !important;
  opacity: 0.65;
}

.footer-bottom {
  border-top: 1.5px solid var(--border);
  padding: 1.25rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  font-size: 0.73rem;
  color: var(--muted);
}
