@import "./tokens.css";

/* Site header / nav */
.site-nav,
.topbar-inner {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(243, 247, 245, 0.94);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar .topbar-inner {
  min-height: var(--header-height);
  padding: 14px 0;
}

.brand-link,
.brand {
  display: inline-flex;
  align-items: center;
  min-height: var(--brand-height);
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
}

.brand-link img,
.brand img {
  display: block;
  height: var(--brand-height);
  width: auto;
  mix-blend-mode: multiply;
}

.brand-word,
.brand-text {
  color: var(--ink);
  font-weight: 950;
  letter-spacing: -0.035em;
  font-size: 1.08rem;
}

.nav-actions,
.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-actions a:not(.btn):not(.nav-cta),
.nav a:not(.btn) {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--harbor);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.18s var(--ease-out),
    color 0.18s var(--ease-out),
    transform 0.18s var(--ease-out);
}

.nav-actions a:not(.btn):not(.nav-cta):hover,
.nav a:not(.btn):hover {
  background: rgba(10, 107, 120, 0.08);
  color: var(--primary);
  transform: translateY(-1px);
}

.nav-cta {
  min-height: var(--control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  box-shadow: var(--shadow-control);
  cursor: pointer;
  transition:
    transform 0.16s var(--ease-out),
    box-shadow 0.16s var(--ease-out);
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 17px 34px rgba(10, 107, 120, 0.28);
  color: #fff;
}

/* Footer */
.site-footer,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  border-top: 1px solid var(--line);
  margin-top: 24px;
}

.site-footer.compact,
.card-footer.compact {
  border-top: 0;
  margin-top: 0;
  padding: 24px 0 36px;
}

.site-footer-links,
.card-footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer-links a,
.card-footer-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.16s var(--ease-out);
}

.site-footer-links a:hover,
.card-footer-links a:hover {
  color: var(--ink);
}

/* Legal shell */
.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 32px;
}

.legal-header .brand-link {
  min-height: var(--brand-height);
}

.legal-back {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.legal-back:hover {
  text-decoration: underline;
}

.legal-page {
  padding: 48px 0 64px;
}

.legal-page h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 7vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin: 0 0 28px;
  text-wrap: balance;
}

.legal-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: 96px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.82);
}

.legal-toc strong {
  display: block;
  margin-bottom: 12px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.legal-toc a {
  display: block;
  padding: 8px 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.legal-toc a:hover {
  color: var(--primary);
}

.legal-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 5vw, 40px);
  box-shadow: var(--shadow-soft);
}

.legal-panel h2 {
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.03em;
  margin: 28px 0 10px;
  scroll-margin-top: 96px;
}

.legal-panel h2:first-child {
  margin-top: 0;
}

.legal-panel a {
  color: var(--primary);
  font-weight: 700;
}

@media (max-width: 860px) {
  .topbar .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-actions,
  .nav {
    justify-content: flex-start;
  }

  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-toc {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
  }

  .legal-toc strong {
    width: 100%;
  }

  .legal-toc a {
    padding: 4px 0;
  }

  .site-footer,
  .card-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 540px) {
  .site-nav,
  .topbar-inner {
    min-height: calc(var(--brand-height-compact) + 24px);
    padding: 12px 0;
  }

  .brand-link,
  .brand {
    min-height: var(--brand-height-compact);
  }

  .brand-link img,
  .brand img {
    height: var(--brand-height-compact);
  }

  .nav-cta {
    min-height: var(--control-height-compact);
    padding: 10px 16px;
    font-size: 0.9rem;
  }
}
