@import url("./tokens.css");

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}
a { color: var(--accent-2); }
.app-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2rem;
}
header { border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
h1 { color: var(--accent); font-size: 1.4rem; margin: 0; }
h2 { color: var(--accent-2); font-size: 1.15rem; margin: 0 0 0.75rem; scroll-margin-top: 1.25rem; }
h3 { color: #a7f3d0; font-size: 0.95rem; margin: 1.2rem 0 0.5rem; scroll-margin-top: 1.25rem; }
.header-row {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: start;
}
.header-row p { color: var(--muted); margin: 0.35rem 0 0; font-size: 0.95rem; }
.header-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  align-items: end;
}
.language-selector {
  display: grid;
  gap: 0.25rem;
  min-width: 150px;
  font-size: 0.85rem;
  color: var(--muted);
}
.language-selector select {
  background: var(--bg);
  border: 1px solid var(--input-line);
  border-radius: 0.25rem;
  color: inherit;
  padding: 0.45rem;
  font-family: inherit;
}
.trial-banner {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 0.5rem;
  color: var(--warn);
  font-size: 0.9rem;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
}
.site-navigation, .section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 1rem 0 0.5rem;
}
.site-navigation a, .section-nav a, .seg button {
  border: 1px solid var(--input-line);
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
}
.site-navigation a:hover,
.site-navigation a[aria-current="page"],
.section-nav a:hover,
.section-nav a.active,
.seg button.active,
.seg button[aria-pressed="true"] {
  background: var(--btn);
  border-color: var(--accent);
  color: var(--btn-text);
}
.course-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.toc {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  font-size: 0.85rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1rem;
}
.toc h2 { font-size: 0.95rem; margin: 0 0 0.6rem; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0.25rem 0; }
.toc a { color: #cbd5e1; text-decoration: none; }
.toc a:hover, .toc a.active { color: var(--accent); }
.article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1.25rem 1.4rem 2rem;
  line-height: 1.65;
  font-size: 0.95rem;
}
.article section { margin-bottom: 2rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
.article section:last-child { border-bottom: 0; margin-bottom: 0; }
.callout {
  border-left: 3px solid var(--accent);
  margin: 0.75rem 0 1rem;
  padding: 0.6rem 0.9rem;
  color: #d1fae5;
  background: #052e2b;
  border-radius: 0 0.4rem 0.4rem 0;
}
.callout.info {
  border-left-color: var(--accent-2);
  background: #0c1a2e;
  color: #bae6fd;
}
.callout .lead { font-weight: 700; display: block; margin-bottom: 0.25rem; }
.muted { color: var(--muted); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0.75rem 0; }
.steps li {
  counter-increment: step;
  margin: 0.6rem 0;
  padding-left: 2.2rem;
  position: relative;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--btn);
  color: var(--btn-text);
  font-size: 0.8rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.steps strong { color: #a7f3d0; }
.table-wrap { overflow-x: auto; margin: 0.75rem 0 1rem; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 520px;
}
th, td {
  border: 1px solid var(--line);
  padding: 0.5rem;
  vertical-align: top;
  text-align: left;
}
th { background: var(--th); color: var(--th-text); font-weight: 600; white-space: nowrap; }
td { background: var(--td); }
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0;
}
.props {
  display: grid;
  gap: 0.4rem;
  margin: 0.75rem 0;
  font-size: 0.88rem;
}
.props div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  background: #0b1220;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
}
.props dt, .props .k { color: var(--muted); font-weight: 600; }
.pitfalls {
  margin: 0.75rem 0;
  padding-left: 1.1rem;
  color: #fecaca;
}
.pitfalls li { margin: 0.25rem 0; }
.checklist { list-style: none; padding: 0; margin: 0.75rem 0; }
.checklist li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 0.45rem 0;
  padding: 0.55rem 0.7rem;
  background: #0b1220;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
}
.checklist .box {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 0.25rem;
  border: 1px solid var(--accent);
  flex: 0 0 auto;
  margin-top: 0.15rem;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  color: var(--accent);
}
.checklist .meta { color: var(--muted); font-size: 0.8rem; margin-left: 0.35rem; }
.link-cards {
  display: grid;
  gap: 0.6rem;
  margin: 0.75rem 0;
}
.link-cards a {
  display: block;
  padding: 0.75rem 0.9rem;
  background: #0b1220;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  text-decoration: none;
  color: var(--accent-2);
}
.link-cards a:hover { border-color: var(--accent); }
.link-cards .site { color: var(--muted); font-size: 0.8rem; display: block; }
footer.site {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}
.hidden { display: none !important; }
@media (max-width: 900px) {
  .course-layout { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; }
  .props div { grid-template-columns: 1fr; }
}
