/*
 * Global site chrome — the sticky top header and the footer shared by every page
 * (catalog shell + single-column pages alike). Brand mark + wordmark, primary
 * nav, language + theme toggles, and the multi-column footer.
 *
 * Playground presentation only (the library ships no CSS). Everything re-themes
 * off the semantic tokens, so the chrome flips with the dogfooded stimeo--theme
 * toggle (data-theme on <html>).
 */

:root {
  --header-h: 62px;
  --shell-max: 1180px;
}

/* ── Brand (mark + wordmark text, reused in header / footer) ──────────── */
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex: none;
  text-decoration: none;
}

.site-brand__mark {
  display: block;
  width: 1.625rem;
  height: 1.625rem;
  flex: none;
}

.site-brand__text {
  font-size: 1.0625rem;
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
  white-space: nowrap;
}

.site-brand__accent {
  font-weight: var(--weight-medium);
  color: var(--color-primary);
}

/* ── Header ───────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface-page);
  border-bottom: 1px solid var(--border-default);
}

.site-header__inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 1.75rem;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.site-header__lead {
  display: flex;
  align-items: center;
  gap: 2.125rem;
  min-width: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.625rem;
}

.site-nav__link {
  position: relative;
  padding: 0.375rem 0;
  font-size: 0.875rem;
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav__link:hover {
  color: var(--color-text);
}

.site-nav__link[aria-current="page"] {
  color: var(--color-primary);
}

/* Active underline sits just beneath the link text (not at the header's bottom edge). */
.site-nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px 2px 0 0;
}

.site-nav__link:focus-visible,
.site-header__lang:focus-visible,
.site-header__icon:focus-visible,
.site-header__cta:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: none;
}

.site-header__lang {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.6875rem;
  text-decoration: none;
  white-space: nowrap;
}

.site-header__lang:hover {
  color: var(--color-text);
  border-color: var(--border-strong);
}

.site-header__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.125rem;
  height: 2.125rem;
  flex: none;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
}

.site-header__icon:hover {
  color: var(--color-text);
  border-color: var(--border-strong);
}

/* Theme toggle: swap sun/moon based on the resolved theme on <html>. Default
   (light / no attribute) shows the moon; dark shows the sun. */
.site-theme-toggle__icon {
  display: inline-flex;
}

.site-theme-toggle__sun {
  display: none;
}

[data-theme="dark"] .site-theme-toggle__sun {
  display: inline-flex;
}

[data-theme="dark"] .site-theme-toggle__moon {
  display: none;
}

.site-header__cta {
  font-size: 0.84375rem;
  font-weight: var(--weight-bold);
  color: var(--color-on-primary);
  background: var(--color-primary);
  border: 0;
  border-radius: var(--radius-md);
  padding: 0.5625rem 1rem;
  text-decoration: none;
  white-space: nowrap;
}

.site-header__cta:hover {
  background: var(--color-primary-hover);
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border-default);
  background: var(--surface-subtle);
}

.site-footer__inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 3rem 1.75rem 2.5rem;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 2rem;
}

.site-footer__brand .site-brand {
  margin-bottom: 0.875rem;
}

.site-footer__tagline {
  margin: 0 0 1rem;
  max-width: 22rem;
  font-size: 0.84375rem;
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

.site-footer__social {
  display: flex;
  gap: 0.625rem;
}

.site-footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--color-text-muted);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  text-decoration: none;
}

.site-footer__social-link:hover {
  color: var(--color-text);
  border-color: var(--border-strong);
}

.site-footer__col {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  align-items: flex-start;
}

.site-footer__heading {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-subtle);
}

.site-footer__link {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-decoration: none;
}

.site-footer__link:hover {
  color: var(--color-text);
}

.site-footer__stay {
  margin: 0 0 0.25rem;
  font-size: 0.84375rem;
  line-height: var(--leading-snug);
  color: var(--color-text-muted);
}

.site-footer__waitlist {
  font-size: 0.84375rem;
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0.5625rem 0.9375rem;
  text-decoration: none;
}

.site-footer__waitlist:hover {
  border-color: var(--color-primary);
}

.site-footer__social-link:focus-visible,
.site-footer__link:focus-visible,
.site-footer__waitlist:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.site-footer__bar {
  border-top: 1px solid var(--border-default);
}

.site-footer__bar-inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 1.125rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer__bar-inner span {
  font-size: 0.78125rem;
  color: var(--color-text-subtle);
}

/* Copyright group: a list of items, separated by a slim hairline rule. */
.site-footer__legal > span:not(:first-child)::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 0.85em;
  margin: 0 0.6875rem;
  background: var(--border-strong);
  vertical-align: -0.12em;
}

/* Motto reads as a formula in mono — (name) = (meaning) — so an equals sign pairs
   with the "+" and states the etymological equivalence directly. */
.site-footer__motto > span:not(:first-child)::before {
  content: "=";
  margin: 0 0.4375rem;
}

.site-footer__motto {
  font-family: var(--font-mono);
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem 1.5rem;
  }

  .site-footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .site-header__inner {
    padding: 0 1rem;
    gap: 0.75rem;
  }

  .site-header__lead {
    gap: 1rem;
    overflow: hidden;
  }

  /* Keep all primary links reachable on narrow screens by letting the nav scroll. */
  .site-nav {
    gap: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  /* The Install CTA duplicates the Install nav link; drop it when space is tight. */
  .site-header__cta {
    display: none;
  }
}

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