* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--body-bg);
  color: var(--font-color);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.site-header {
  position: relative;
  z-index: 40;
}

.header-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header-accent {
  background: linear-gradient(90deg, var(--header-accent-start), var(--header-accent-mid) 55%, var(--header-accent-end));
  color: #fff;
}

.header-accent-meta {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 700;
  font-size: 0.82rem;
}

.header-accent-copy {
  font-size: 0.92rem;
  opacity: 0.92;
}

.topbar {
  background: var(--header-bg);
  color: var(--header-font);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.05);
}

.topbar-inner {
  min-height: 102px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr) auto;
  align-items: center;
  gap: 22px;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.brand img {
  width: auto;
  max-width: 94px;
  max-height: 84px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.site-name {
  font-size: clamp(1.15rem, 1.8vw, 1.6rem);
  line-height: 1.05;
  font-weight: 800;
  color: var(--header-font);
}

.tagline {
  font-size: 0.93rem;
  color: rgba(15, 23, 42, 0.68);
}

.header-search-box {
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 6px 8px 6px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.header-search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
}

.header-search-box input[type="text"] {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1f2937;
  font-size: 0.95rem;
  min-width: 0;
}

.header-search-box input::placeholder {
  color: #94a3b8;
}

.header-search-box button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 74%, #fff));
  color: #fff;
  cursor: pointer;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.header-secondary-cta,
.login-cta {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.header-secondary-cta {
  background: rgba(15, 23, 42, 0.06);
  color: var(--header-font);
}

.login-cta {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #fff));
  color: #fff;
}

.header-secondary-cta:hover,
.login-cta:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
}

.user-dropdown {
  position: relative;
}

.user-trigger {
  min-height: 48px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 16px;
  background: #fff;
  color: var(--header-font);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 8px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.user-trigger-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--header-accent-mid), var(--header-accent-end));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.82rem;
}

.user-trigger-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.user-trigger-copy strong {
  font-size: 0.92rem;
}

.user-trigger-copy small {
  font-size: 0.74rem;
  color: rgba(15, 23, 42, 0.62);
  text-transform: uppercase;
}

.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  background: var(--user-menu-bg);
  color: var(--user-menu-text);
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.14);
  padding: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.user-dropdown.is-open .user-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.user-menu-head {
  padding: 10px 12px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  margin-bottom: 6px;
}

.user-menu-head strong,
.user-menu-head span {
  display: block;
}

.user-menu-head span {
  margin-top: 4px;
  font-size: 0.82rem;
  opacity: 0.72;
}

.user-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}

.user-menu a:hover {
  background: rgba(15, 23, 42, 0.06);
}

.toggle {
  display: none;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  background: #fff;
  color: var(--header-font);
  cursor: pointer;
}

.mainnav {
  background: var(--nav-bg);
}

.mainnav .header-shell {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--header-accent-end) transparent;
}

.menu {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  margin: 0;
  padding: 0;
  min-height: 62px;
}

.menu > li {
  flex: 0 0 auto;
}

.menu > li > a {
  min-height: 62px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  color: var(--nav-link);
  text-decoration: none;
  font-weight: 700;
  position: relative;
}

.menu > li > a::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease;
}

.menu > li > a:hover {
  background: var(--nav-link-hover-bg);
}

.menu > li > a:hover::after {
  transform: scaleX(1);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.54);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 70;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 100%);
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  z-index: 80;
  display: flex;
  flex-direction: column;
}

.mobile-drawer-head {
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.mobile-drawer-head p {
  margin: 8px 0 0;
  color: rgba(226, 232, 240, 0.82);
  font-size: 0.92rem;
  line-height: 1.45;
}

.mobile-drawer-close {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--sidebar-text);
  cursor: pointer;
}

.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  overflow-y: auto;
}

.mobile-drawer-nav a {
  min-height: 52px;
  border-radius: 16px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--sidebar-text);
  background: rgba(255, 255, 255, 0.05);
}

.mobile-drawer-nav a small {
  margin-left: auto;
  color: var(--sidebar-accent);
  font-weight: 700;
}

.mobile-drawer-nav a:hover {
  background: rgba(255, 255, 255, 0.10);
}

.mobile-drawer-footer {
  margin-top: auto;
  padding: 18px 20px 24px;
  color: var(--sidebar-accent);
  font-weight: 700;
}

body.public-drawer-open .drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.public-drawer-open .mobile-drawer {
  transform: translateX(0);
}

.site-footer {
  margin-top: 48px;
  background: var(--footer-bg);
  color: var(--footer-text);
}

.site-footer-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 20px;
  align-items: center;
}

.site-footer-brand strong,
.site-footer-brand p,
.site-footer-brand a {
  display: block;
}

.site-footer-brand p,
.site-footer-brand a {
  margin-top: 8px;
  color: inherit;
  opacity: 0.84;
  text-decoration: none;
}

.site-footer-links {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.site-footer-links a {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  opacity: 0.9;
}

.site-footer-social {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.site-footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
}

.site-footer-social a:hover {
  background: rgba(255, 255, 255, 0.16);
}

@media (max-width: 1024px) {
  .topbar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .header-search-box {
    grid-column: 1 / -1;
    order: 3;
  }

  .header-actions {
    order: 2;
  }
}

@media (max-width: 980px) {
  .toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mainnav {
    display: none;
  }

  .header-secondary-cta {
    display: none;
  }
}

@media (max-width: 760px) {
  .header-shell,
  .site-footer-shell {
    width: min(100% - 24px, 1200px);
  }

  .header-accent-meta {
    justify-content: center;
  }

  .topbar-inner {
    min-height: auto;
    grid-template-columns: 1fr auto;
    gap: 16px;
    padding: 14px 0;
  }

  .brand img {
    max-width: 72px;
    max-height: 64px;
  }

  .site-name {
    font-size: 1.08rem;
  }

  .tagline {
    font-size: 0.84rem;
  }

  .header-search-box {
    order: 4;
    padding-left: 14px;
  }

  .login-cta,
  .user-dropdown {
    display: none;
  }

  .site-footer-shell {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .site-footer-links,
  .site-footer-social {
    justify-content: center;
  }
}
