/* Layout — header, footer, grids */

/* ============ HEADER ============ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(11, 37, 69, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--color-text-on-dark);
  transition: background var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              height var(--dur-base) var(--ease-out);
}

.site-header.is-scrolled {
  background: rgba(11, 37, 69, 0.98);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  height: 60px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--sp-5);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: inherit;
  font-weight: 700;
  font-size: var(--fs-md);
  white-space: nowrap;
}

.brand-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-name strong {
  font-size: var(--fs-md);
  letter-spacing: 0.04em;
}

.brand-name small {
  font-size: 0.625rem;
  color: var(--color-text-on-dark-muted);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 2px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  flex: 1;
  justify-content: center;
}

.main-nav a {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-size: var(--fs-sm);
  padding: var(--sp-2) 0;
  position: relative;
  transition: color var(--dur-fast) var(--ease-out);
}

.main-nav a:hover,
.main-nav a.is-active {
  color: white;
}

.main-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.lang-switch {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  padding: 2px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.lang-switch button {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  color: rgba(255, 255, 255, 0.7);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.lang-switch button.is-active {
  background: white;
  color: var(--color-primary);
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: white;
}

.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform var(--dur-base) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out);
}

.menu-toggle span {
  position: relative;
}

.menu-toggle span::before,
.menu-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-toggle span::before { top: -7px; }
.menu-toggle span::after  { top: 7px; }

.menu-toggle.is-open span { background: transparent; }
.menu-toggle.is-open span::before { top: 0; transform: rotate(45deg); }
.menu-toggle.is-open span::after  { top: 0; transform: rotate(-45deg); }

/* Mobile drawer */
.mobile-drawer {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg-dark);
  padding: var(--sp-6) var(--container-pad);
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease-out);
  overflow-y: auto;
  z-index: 99;
}

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

.mobile-drawer nav {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.mobile-drawer nav a {
  color: white;
  font-size: var(--fs-lg);
  font-weight: 500;
  padding-block: var(--sp-2);
  border-bottom: 1px solid var(--color-border-dark);
}

/* ============ FOOTER ============ */
.site-footer {
  background: var(--color-bg-darker);
  color: var(--color-text-on-dark-muted);
  padding-block: var(--sp-8) var(--sp-5);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.4fr;
  gap: var(--sp-7);
  padding-bottom: var(--sp-7);
  border-bottom: 1px solid var(--color-border-dark);
}

.footer-grid h4 {
  color: white;
  margin-bottom: var(--sp-4);
  font-size: var(--fs-base);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer-grid ul {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.footer-grid a {
  color: var(--color-text-on-dark-muted);
  font-size: var(--fs-sm);
  transition: color var(--dur-fast) var(--ease-out);
}

.footer-grid a:hover {
  color: white;
}

.footer-about p {
  color: var(--color-text-on-dark-muted);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-4);
  max-width: 36ch;
}

.footer-contact .item {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  margin-bottom: var(--sp-4);
}

.footer-contact .item svg,
.footer-contact .item img {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-accent);
  display: block;
  object-fit: contain;
  /* Icons load as <img>, so CSS color cannot reach them. The SVG file uses
     stroke="currentColor" which falls back to black when external. Force
     white here so they read against the dark footer background. */
  filter: brightness(0) invert(1);
}

.footer-contact .item-text {
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--color-text-on-dark-muted);
}

.footer-contact .item-text strong {
  color: white;
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
}

.footer-bottom {
  padding-top: var(--sp-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  font-size: var(--fs-xs);
}

/* ICP placeholder is reserved for a future Chinese filing number;
   hide it until the real record exists. */
.footer-bottom [data-i18n="footer.icp"] {
  display: none;
}

.social-links {
  display: flex;
  gap: var(--sp-3);
}

.social-links a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-on-dark-muted);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.social-links a:hover {
  background: var(--color-accent);
  color: var(--color-primary);
}

.social-links svg,
.social-links img { width: 16px; height: 16px; display: block; object-fit: contain; }

/* Main content push down for fixed header */
main {
  padding-top: var(--header-height);
}

/* Page hero (sub-pages) */
.page-hero {
  background: linear-gradient(135deg, var(--color-bg-dark) 0%, var(--color-primary) 100%);
  color: white;
  padding-block: clamp(4rem, 9vw, 6rem);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(30, 91, 198, 0.3), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(242, 169, 59, 0.15), transparent 50%);
  pointer-events: none;
}

.page-hero > .container {
  position: relative;
}

.page-hero h1 {
  margin-bottom: var(--sp-3);
}

.page-hero p {
  color: rgba(255, 255, 255, 0.85);
  max-width: 60ch;
  margin-inline: auto;
}

.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: var(--sp-4);
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.85);
}

.breadcrumb span[aria-hidden] {
  opacity: 0.5;
}
