/* ==========================================================================
   Tyr Framework — /docs (static documentation reference)
   Reuses variables/components from style.css (--bg, --gold, .code, .btn, …).
   ========================================================================== */

.docs-head {
  padding: 64px 0 32px;
  text-align: center;
}
.docs-head h1 { font-size: clamp(30px, 4vw, 44px); }
.docs-head__sub {
  max-width: 640px;
  margin: 0 auto;
  color: var(--text-dim);
  font-size: 16px;
}

.docs-layout {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  padding-bottom: 100px;
}

.docs-nav {
  width: 250px;
  flex-shrink: 0;
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
  padding-right: 12px;
}
.docs-nav h3 {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  margin: 22px 0 8px;
}
.docs-nav h3:first-child { margin-top: 0; }
.docs-nav a {
  display: block;
  font-size: 14px;
  color: var(--text-dim);
  padding: 5px 8px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}
.docs-nav a:hover { color: var(--gold); background: rgba(232, 182, 76, 0.08); }

.docs-main { flex: 1; min-width: 0; }
.docs-loading, .docs-error { color: var(--text-dim); font-size: 15px; }
.docs-error { color: var(--danger); }

.doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 24px;
  scroll-margin-top: 88px;
}
.doc-card h2 {
  font-size: 20px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.doc-card__tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--ice-dim);
  color: var(--ice);
}
.doc-card__tag--cmd { background: rgba(232, 182, 76, 0.16); color: var(--gold); }
.doc-card__desc {
  color: var(--text-dim);
  font-size: 15px;
  white-space: pre-wrap;
  margin: 0;
}

.doc-method {
  margin-top: 22px;
  padding-left: 16px;
  border-left: 3px solid var(--ice-dim);
}
.doc-method h3 {
  font-family: var(--font-mono);
  font-size: 15.5px;
  color: var(--ice);
  margin: 0 0 6px;
}
.doc-method__desc {
  color: var(--text-dim);
  font-size: 14.5px;
  white-space: pre-wrap;
  margin: 0 0 10px;
}
.doc-method .code { margin-top: 6px; }

a.xref {
  color: var(--ice);
  text-decoration: underline dotted;
  font-family: var(--font-mono);
}
a.xref:hover { color: var(--gold); }

.back-to-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--gold);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.15s ease;
  z-index: 90;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover { border-color: var(--gold); }

@media (max-width: 900px) {
  .docs-layout { flex-direction: column; }
  .docs-nav {
    width: 100%;
    position: static;
    max-height: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
  }
  .docs-nav h3 { width: 100%; margin: 14px 0 4px; }
  .docs-nav h3:first-child { margin-top: 0; }
}
