/*
 * Shared site header and footer for the Landing, tool, tutorial, and legal pages.
 * Markup lives in scripts/site-chrome/*.html and is written into each page by
 * `npm run sync:chrome`. Class names are prefixed `site-` so page-level styles
 * do not leak in; properties that page styles commonly set are declared explicitly.
 */

.site-head,
.site-foot {
  --site-fg: #0f172a;
  --site-muted: #475569;
  --site-muted-light: #64748b;
  --site-accent-focus: #0ea5e9;
  --site-card: #ffffff;
  --site-border: rgba(15, 23, 42, 0.08);
  --site-hover: rgba(15, 23, 42, 0.05);
  --site-shadow-hover: 0 24px 40px -28px rgba(15, 23, 42, 0.55);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  text-align: left;
  line-height: 1.5;
}

.site-head *,
.site-foot * {
  box-sizing: border-box;
}

.site-head a,
.site-foot a {
  text-decoration: none;
}

.site-head a:focus-visible,
.site-head summary:focus-visible,
.site-foot a:focus-visible {
  outline: 2px solid var(--site-accent-focus);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Header */
.site-head {
  position: relative; /* not sticky: the Landing embeds the editor below */
  z-index: 20;
  margin: 0;
  padding: 0;
  background: var(--site-card);
  border: 0;
  border-bottom: 1px solid var(--site-border);
  color: var(--site-fg);
}

.site-head-inner {
  margin: 0 auto;
  max-width: 1140px;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--site-fg);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.site-brand img {
  display: block;
  width: 32px;
  height: 32px;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.site-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.site-link,
.site-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--site-muted);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.site-link:hover,
.site-menu > summary:hover,
.site-menu[open] > summary,
.site-link[aria-current="page"],
.site-menu.is-active > summary {
  background: var(--site-hover);
  color: var(--site-fg);
}

.site-menu {
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.site-menu > summary {
  list-style: none;
}

.site-menu > summary::-webkit-details-marker {
  display: none;
}

.site-menu > summary::after {
  content: none;
}

.site-menu > summary svg {
  width: 14px;
  height: 14px;
  transition: transform 160ms ease;
}

.site-menu[open] > summary svg {
  transform: rotate(180deg);
}

.site-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 300px;
  margin: 0;
  padding: 8px;
  background: var(--site-card);
  border: 1px solid var(--site-border);
  border-radius: 16px;
  box-shadow: var(--site-shadow-hover);
}

.site-menu-label {
  margin: 6px 12px 4px;
  color: var(--site-muted-light);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.site-menu-panel a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 160ms ease;
}

.site-menu-panel a:hover,
.site-menu-panel a[aria-current="page"] {
  background: var(--site-hover);
}

.site-menu-panel strong {
  display: block;
  color: var(--site-fg);
  font-size: 0.9rem;
  font-weight: 700;
}

.site-menu-panel small {
  display: block;
  margin-top: 2px;
  color: var(--site-muted-light);
  font-size: 0.8rem;
}

.site-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin: 0 0 0 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--site-fg);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 12px 24px -16px rgba(15, 23, 42, 0.45);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.site-cta:hover {
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -18px rgba(15, 23, 42, 0.55);
}

/* Footer */
.site-foot {
  margin: 0;
  padding: 56px 24px 32px;
  border: 0;
  background: var(--site-fg);
  color: rgba(248, 250, 252, 0.7);
  font-size: 0.88rem;
}

.site-foot-inner {
  margin: 0 auto;
  max-width: 1080px;
}

.site-foot-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1.4fr repeat(3, 1fr);
}

.site-foot .site-brand {
  color: #ffffff;
}

.site-foot-brand p {
  margin: 14px 0 0;
  max-width: 280px;
  color: rgba(248, 250, 252, 0.7);
  font-size: 0.88rem;
  line-height: 1.6;
}

.site-foot-title {
  margin: 4px 0 14px;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.site-foot ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-foot li {
  margin: 0;
  padding: 0;
}

.site-foot li::before {
  content: none;
}

.site-foot-col a,
.site-foot-bottom a {
  color: rgba(248, 250, 252, 0.7);
  transition: color 160ms ease;
}

.site-foot-col a:hover,
.site-foot-bottom a:hover {
  color: #ffffff;
}

.site-foot-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(248, 250, 252, 0.12);
  font-size: 0.8rem;
  line-height: 1.6;
}

.site-foot-bottom p {
  margin: 0;
  color: rgba(248, 250, 252, 0.7);
  font-size: 0.8rem;
}

.site-foot-bottom a {
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 860px) {
  .site-foot-grid {
    grid-template-columns: 1fr 1fr;
  }

  .site-foot-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .site-head-inner {
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 8px 12px;
  }

  .site-links {
    order: 3;
    width: 100%;
    margin-left: -12px;
  }

  .site-cta {
    margin-left: 0;
  }

  .site-menu-panel {
    width: min(300px, calc(100vw - 32px));
  }

  .site-foot {
    padding: 44px 16px 28px;
  }
}
