/* Containers & sections */
.container {
  width: min(1100px, 90vw);
  margin: 0 auto;
}

.section {
  padding: 64px 0;
  background: var(--color-bg);
}

.section.alt {
  background: var(--color-bg);
}

.section-header {
  margin-bottom: 24px;
}

/* Account page: tighten stacked section rhythm */
.account-page main > .section {
  padding-top: 56px;
  padding-bottom: 56px;
}

.account-page main > .section + .section {
  padding-top: 36px;
}

.section-header h2 {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 2vw + 1rem, 2.4rem);
}

.section-header p {
  margin: 0;
  color: var(--color-muted);
  max-width: 640px;
}

html {
  height: 100%;
}

body {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

main,
.site-footer {
  position: relative;
  z-index: 1;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(16px);
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
  transition: opacity 0.25s ease;
  flex-shrink: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  position: relative;
}

.header-menu {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
  min-width: 0;
}

a.brand {
  display: inline-flex;
  align-items: baseline;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text-invert);
  letter-spacing: 0.03em;
  text-decoration: none;
  text-decoration-line: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a.brand:hover,
a.brand:focus-visible {
  color: var(--color-text-invert);
  opacity: 0.88;
  text-decoration: none;
  text-decoration-line: none;
}

a.brand:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.65);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

a.brand span {
  color: var(--color-accent);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.4);
  color: var(--color-text-invert);
  padding: 0;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.6);
  text-decoration: none;
}

.nav-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35);
}

.nav-toggle__bar {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.nav-toggle__bar::before,
.nav-toggle__bar::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle__bar::before {
  transform: translateY(-6px);
}

.nav-toggle__bar::after {
  transform: translateY(6px);
}

body.mobile-nav-open .nav-toggle__bar {
  background: transparent;
}

body.mobile-nav-open .nav-toggle__bar::before {
  transform: rotate(45deg);
}

body.mobile-nav-open .nav-toggle__bar::after {
  transform: rotate(-45deg);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.main-nav a {
  color: var(--color-text-invert);
  font-weight: 500;
  white-space: nowrap;
}

.main-nav a:hover {
  color: var(--color-accent);
}

.auth-status {
  --auth-plan-accent: #94a3b8;
  --auth-plan-surface: rgba(148, 163, 184, 0.12);
  --auth-plan-border: rgba(148, 163, 184, 0.45);
  --auth-plan-text: rgba(226, 232, 240, 0.92);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 1 1 0;
  min-width: 0;
  color: var(--color-text-invert);
  font-size: 0.95rem;
}

.auth-status #auth-status-text {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  flex: 1 1 auto;
  min-width: 0;
  max-inline-size: min(22rem, 34vw);
  overflow: hidden;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid var(--auth-plan-border);
  background: var(--auth-plan-surface);
  color: var(--auth-plan-text);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.auth-status__prefix {
  flex: 0 0 auto;
}

.auth-status__email {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-status .button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.auth-status .button.button-outline {
  border-color: color-mix(in srgb, var(--auth-plan-border) 85%, transparent);
  color: var(--auth-plan-text);
}

.auth-status .button.button-outline:hover {
  background: color-mix(in srgb, var(--auth-plan-surface) 82%, transparent);
  border-color: var(--auth-plan-border);
}

.auth-status.is-signed-out {
  --auth-plan-accent: #94a3b8;
  --auth-plan-surface: rgba(148, 163, 184, 0.12);
  --auth-plan-border: rgba(148, 163, 184, 0.45);
  --auth-plan-text: rgba(226, 232, 240, 0.92);
}

.auth-status.is-free {
  --auth-plan-accent: #38bdf8;
  --auth-plan-surface: rgba(14, 165, 233, 0.14);
  --auth-plan-border: rgba(56, 189, 248, 0.46);
  --auth-plan-text: #e0f2fe;
}

.auth-status.is-basic {
  --auth-plan-accent: #22c55e;
  --auth-plan-surface: rgba(34, 197, 94, 0.16);
  --auth-plan-border: rgba(34, 197, 94, 0.5);
  --auth-plan-text: #dcfce7;
}

.auth-status.is-pro {
  --auth-plan-accent: #a78bfa;
  --auth-plan-surface: rgba(139, 92, 246, 0.18);
  --auth-plan-border: rgba(167, 139, 250, 0.5);
  --auth-plan-text: #ede9fe;
}

/* Inline glossary terms */
.hero-term-help {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

/* Footer */
.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  color: rgba(248, 250, 252, 0.8);
  padding: 32px 0;
  transition: opacity 0.25s ease;
  flex-shrink: 0;
}

body.visual-explorer-fullscreen-active .site-header,
body.visual-explorer-fullscreen-active .site-footer {
  opacity: 0;
  pointer-events: none;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.footer-links a {
  color: rgba(248, 250, 252, 0.8);
}

.footer-links a:hover {
  color: var(--color-accent);
}

/* Docs */
.docs-hero {
  padding-bottom: 32px;
}
