:root {
  --radius-control: 1rem;
  --radius-card: 1.05rem;
  --max: 72rem;
  --prose: none;
  --font: 'Space Grotesk', ui-sans-serif, system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    'Noto Sans', sans-serif;
  --fs-body: 1.2rem;
  --fs-small: 1.0625rem;
  --fs-nav: 1.0625rem;
  /* Default = dark (matches landing / app dark) */
  color-scheme: dark;
  --bg: #050a08;
  --bg-deep: #030705;
  --surface: #0c1410;
  --elevated: #121c17;
  --text: #f6f8f4;
  --muted: #a8b5a4;
  --cool: #72c266;
  --cool-dim: rgba(114, 194, 102, 0.12);
  --on-primary: #07130b;
  --line: rgba(246, 248, 244, 0.12);
  --header-bg: rgba(5, 10, 8, 0.94);
  --link: #72c266;
}

[data-guide-theme='dark'] {
  color-scheme: dark;
  --bg: #050a08;
  --bg-deep: #030705;
  --surface: #0c1410;
  --elevated: #121c17;
  --text: #f6f8f4;
  --muted: #a8b5a4;
  --cool: #72c266;
  --cool-dim: rgba(114, 194, 102, 0.12);
  --on-primary: #07130b;
  --line: rgba(246, 248, 244, 0.12);
  --header-bg: rgba(5, 10, 8, 0.94);
  --link: #72c266;
}

[data-guide-theme='light'] {
  color-scheme: light;
  --bg: #f6f8f4;
  --bg-deep: #ffffff;
  --surface: #eef2ed;
  --elevated: #e4ebe2;
  --text: #050a08;
  --muted: #4a5b4a;
  --cool: #3f8f4e;
  --cool-dim: rgba(63, 143, 78, 0.12);
  --on-primary: #07130b;
  --line: rgba(5, 10, 8, 0.12);
  --header-bg: rgba(246, 248, 244, 0.94);
  --link: #2d7340;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 18px;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: var(--fs-body);
  overflow-x: clip;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 50;
  background: var(--elevated);
  padding: 0.5rem 0.75rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

[data-guide-theme='light'] .site-header {
  background-color: #3f8f4e;
  border-bottom-color: rgba(246, 248, 244, 0.2);
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1rem;
  padding: 0.9rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.02em;
  text-decoration: none;
  font-size: 1.05rem;
  min-width: 0;
  flex: 0 0 auto;
  height: 52px;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 190px;
  height: 52px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.brand span {
  display: inline-flex;
  align-items: center;
  height: 52px;
  margin: 0;
  color: var(--muted);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
  padding: 0 0 0 10px;
}

[data-guide-theme='light'] .site-header .brand,
[data-guide-theme='light'] .site-header .brand span {
  color: #f6f8f4;
}

#theme-toggle {
  background-color: #72c266;
  color: #07130b;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  flex: 0 0 auto;
  transition: background-color 0.2s ease;
}

#theme-toggle:hover {
  background-color: #5fb254;
  color: #07130b;
  text-decoration: none;
}

#theme-toggle:focus-visible {
  outline: 2px solid #72c266;
  outline-offset: 2px;
}

#theme-toggle .ti {
  font-size: 1.15rem;
  line-height: 1;
  pointer-events: none;
}

[data-guide-theme='light'] #theme-toggle,
[data-guide-theme='light'] .header-row .btn {
  background-color: transparent;
  border: 1px solid #f6f8f4;
  color: #f6f8f4;
  transition: background-color 0.2s ease;
}

[data-guide-theme='light'] #theme-toggle:hover,
[data-guide-theme='light'] .header-row .btn:hover {
  background-color: rgba(246, 248, 244, 0.1);
  color: #f6f8f4;
  filter: none;
}

.search {
  flex-grow: 1;
  max-width: none;
  flex-basis: auto;
  min-width: 10rem;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1 1 auto;
  min-width: 12rem;
}

.header-tools .search {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}

.header-row .search {
  flex-grow: 1;
  max-width: none;
  flex-basis: auto;
}

.search input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-control);
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: var(--fs-small);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-control);
  background: var(--cool);
  color: var(--on-primary);
  font-weight: 650;
  font-size: 1.1rem;
  text-decoration: none;
  border: none;
}

.btn:hover {
  text-decoration: none;
  filter: brightness(1.06);
}

.cat-nav {
  display: none;
}

.topics-menu {
  position: relative;
  flex: 0 0 auto;
}

.topics-menu summary {
  list-style: none;
  cursor: pointer;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  user-select: none;
}

.site-header .topics-menu summary {
  color: var(--text);
}

[data-guide-theme='light'] .topics-menu summary {
  color: #050a08;
}

[data-guide-theme='dark'] .topics-menu summary {
  color: #f6f8f4;
}

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

.topics-menu summary::after {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.15s ease;
}

.topics-menu[open] summary::after {
  transform: rotate(-135deg) translateY(1px);
}

.topics-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 0.45rem);
  z-index: 40;
  min-width: min(18rem, calc(100vw - 2rem));
  max-height: min(70vh, 22rem);
  overflow: auto;
  margin: 0;
  padding: 0.45rem;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--elevated);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.topics-panel a {
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 0.55rem;
  color: var(--text);
  font-size: 1.05rem;
  text-decoration: none;
}

.topics-panel a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--cool);
  text-decoration: none;
}

@media (min-width: 901px) {
  .topics-panel {
    min-width: 20rem;
  }
}

.crumbs {
  padding: 1rem 0 0;
  font-size: var(--fs-small);
  color: var(--muted);
}

.crumbs .sep {
  margin: 0 0.45rem;
  opacity: 0.5;
}

.main {
  padding: 1.5rem 0 4rem;
}

.hero {
  padding: 1.25rem 0 0.5rem;
}

.hero h1 {
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  letter-spacing: -0.035em;
  line-height: 1.08;
  font-weight: 650;
  color: var(--text);
}

.hero.compact h1 {
  font-size: clamp(1.95rem, 3.8vw, 2.65rem);
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1.55;
}

/* —— Hub home —— */
.hub-intro {
  padding: 0.5rem 0 2.25rem;
  border-bottom: 1px solid var(--line);
}

.hub-intro h1 {
  margin: 0.4rem 0 0.85rem;
  font-size: clamp(2.35rem, 5.5vw, 3.6rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-weight: 650;
  color: var(--text);
}

.hub-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1rem;
  margin-top: 1.35rem;
}

.text-link {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 550;
  text-decoration: underline;
  text-decoration-color: rgba(246, 248, 244, 0.28);
  text-underline-offset: 0.22em;
}

.text-link:hover {
  color: var(--cool);
  text-decoration-color: var(--cool);
}

.section-heading {
  margin: 0 0 1.1rem;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hub-path {
  margin-top: 2rem;
  padding: 1.35rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}

.path-steps {
  margin: 0;
  padding-left: 1.35rem;
  color: var(--muted);
  font-size: 1.12rem;
}

.path-steps li {
  margin-bottom: 0.5rem;
}

.path-steps a {
  color: var(--text);
  font-weight: 550;
  text-decoration: none;
}

.path-steps a:hover {
  color: var(--cool);
  text-decoration: underline;
}

.hub-topics {
  margin-top: 2.5rem;
}

.topic-grid {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .topic-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .topic-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.topic-card {
  position: relative;
  display: block;
  padding: 1.2rem 1.25rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.topic-card:hover {
  border-color: color-mix(in srgb, var(--text) 18%, transparent);
  background: var(--elevated);
  text-decoration: none;
}

.topic-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.22rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}

.topic-card p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--muted);
}

.topic-card-arrow {
  position: absolute;
  right: 1rem;
  top: 1.15rem;
  color: var(--muted);
  font-size: 1.1rem;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.topic-card:hover .topic-card-arrow {
  opacity: 1;
  transform: translateX(0);
}

.hub-starters {
  margin-top: 2.75rem;
}

.starters {
  display: grid;
  gap: 0.65rem;
}

@media (min-width: 720px) {
  .starters {
    grid-template-columns: 1fr 1fr;
  }
}

.starters a {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 1.12rem;
  font-weight: 550;
}

.starters a:hover {
  background: var(--elevated);
  border-color: rgba(246, 248, 244, 0.2);
}

.panel {
  margin-top: 2rem;
  padding: 1.25rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}

.panel h2 {
  margin: 0 0 0.85rem;
  font-size: 1.3rem;
  color: var(--text);
}

.link-list,
.article-list {
  margin: 0;
  padding-left: 1.2rem;
}

.article-list li {
  margin-bottom: 1rem;
}

.article-list p {
  margin: 0.25rem 0 0;
  font-size: 1.1rem;
}

.muted {
  color: var(--muted);
}

.article {
  width: 100%;
}

.prose {
  max-width: none;
  width: 100%;
  margin-top: 1.4rem;
  font-size: 1.22rem;
  line-height: 1.7;
}

.prose p {
  margin: 0 0 1.15rem;
}

.prose ul {
  margin: 0 0 1.15rem;
  padding-left: 1.35rem;
}

.prose li {
  margin: 0 0 0.55rem;
}

.prose li:last-child {
  margin-bottom: 0;
}

.cta-row {
  margin: 1.75rem 0;
}

.related {
  margin-top: 2.25rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  max-width: none;
  width: 100%;
}

.related h2 {
  margin: 0 0 0.7rem;
  font-size: 1.2rem;
  color: var(--text);
}

.related ul {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 1.12rem;
}

.pager {
  display: none;
}

.glossary dl {
  margin: 1rem 0 0;
}

.glossary div {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.glossary dt {
  font-weight: 650;
  font-size: 1.2rem;
  color: var(--text);
}

.glossary dd {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 1.12rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.75rem;
  background: var(--bg-deep);
}

.footer-grid {
  display: grid;
  gap: 1.75rem;
  align-items: start;
  grid-template-columns: 1fr;
}

@media (min-width: 780px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 2rem;
  }
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-brand {
  margin: 0;
  font-weight: 650;
  font-size: 1.15rem;
  line-height: 1.35;
  color: var(--text);
}

.footer-col p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.45;
}

.footer-help-label {
  margin: 0;
  font-size: 1.1rem;
  color: var(--muted);
}

.footer-contact {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  align-items: flex-start;
  font-size: 1.1rem;
}

/* Obfuscated contact: plain text, no button chrome */
.email-safe {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  appearance: none;
  color: var(--text);
  font: inherit;
  font-size: 1.1rem;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(246, 248, 244, 0.3);
  text-underline-offset: 0.2em;
}

.email-safe:focus-visible {
  outline: 2px solid var(--cool);
  outline-offset: 3px;
  border-radius: 2px;
}

.email-safe:hover {
  color: var(--cool);
  text-decoration-color: var(--cool);
}

.email-safe .obf {
  color: var(--muted);
  text-decoration: none;
  font-weight: 450;
}

.search-panel {
  position: fixed;
  left: 0;
  right: 0;
  top: 4.75rem;
  z-index: 30;
  max-height: min(60vh, 26rem);
  overflow: auto;
  padding: 0.85rem 1rem 1.1rem;
  background: var(--elevated);
  border-bottom: 1px solid var(--line);
  font-size: 1.1rem;
}

.search-panel[hidden] {
  display: none;
}

.search-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.search-panel li a {
  display: block;
  padding: 0.65rem 0.4rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.search-panel li a:hover {
  color: var(--cool);
}

.search-panel .meta {
  display: block;
  font-size: 1rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .header-row {
    gap: 0.4rem;
    padding: 0.4rem 0;
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
    height: 32px;
  }

  .brand-mark {
    width: 112px;
    height: 32px;
  }

  .brand span {
    height: 32px;
    font-size: 0.92rem;
    padding-left: 6px;
  }

  #theme-toggle {
    width: 32px;
    height: 32px;
    min-height: 32px;
    margin-left: auto;
    font-size: 0.9rem;
  }

  #theme-toggle .ti {
    font-size: 0.95rem;
  }

  .topics-menu {
    width: 100%;
    flex: 1 0 100%;
  }

  .topics-menu summary {
    width: 100%;
    justify-content: space-between;
    min-height: 1.9rem;
    height: 1.9rem;
    padding: 0 0.65rem;
    font-size: 0.88rem;
    border-radius: 0.65rem;
  }

  .topics-panel {
    left: 0;
    right: 0;
    min-width: 0;
  }

  .header-tools {
    flex: 1 0 100%;
    width: 100%;
    gap: 0.4rem;
    min-width: 0;
  }

  .header-tools .search {
    flex: 1 1 0;
    min-width: 0;
  }

  .search input {
    padding: 0 0.65rem;
    min-height: 1.9rem;
    height: 1.9rem;
    font-size: 0.88rem;
    border-radius: 0.65rem;
  }

  .header-row .btn,
  .header-row .header-open {
    width: auto;
    flex: 0 0 auto;
    min-height: 1.9rem;
    height: 1.9rem;
    padding: 0 0.65rem;
    font-size: 0.8rem;
    white-space: nowrap;
    border-radius: 0.65rem;
  }
}
