/* speedrun.io — shared stylesheet for api / data / privacy / terms pages */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0d0f0e;
  --border: rgba(255,255,255,0.10);
  --text-primary: #f0ede8;
  --text-secondary: rgba(240,237,232,0.65);
  --text-muted: rgba(240,237,232,0.35);
  --accent: #5b8db8;
  --accent-hover: #6fa0cc;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--bg);
}

.bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
  opacity: 0.25;
}

.bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(13,15,14,0.40) 0%,
    rgba(13,15,14,0.10) 40%,
    rgba(13,15,14,0.60) 85%,
    rgba(13,15,14,0.90) 100%
  );
}

.content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 clamp(24px, 5vw, 72px);
}

/* ── Nav ── */
nav.topnav {
  display: flex;
  align-items: center;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-icon svg {
  width: 16px;
  height: 16px;
  fill: var(--text-primary);
}

.logo-text {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* ── Legal layout ── */
.legal-wrap {
  flex: 1;
  display: flex;
  gap: 56px;
  padding: 56px 0 80px;
  align-items: flex-start;
}

/* ── TOC ── */
.toc {
  width: 200px;
  position: fixed;
  top: 100px;
  left: clamp(24px, 5vw, 72px);
}

.toc-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc ol li a {
  font-size: 12px;
  font-weight: 300;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.5;
  display: block;
  padding: 4px 0 4px 10px;
  border-left: 1px solid var(--border);
  transition: color 0.15s, border-color 0.15s;
}

.toc ol li a:hover,
.toc ol li a.active {
  color: var(--text-primary);
  border-left-color: var(--accent);
}

/* ── Legal content ── */
.legal {
  flex: 1;
  min-width: 0;
  max-width: 680px;
  margin-left: 256px;
}

.legal-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.legal-title {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.legal-meta {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 300;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.legal-body h2 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 44px 0 12px;
  scroll-margin-top: 32px;
}

.legal-body h2:first-child {
  margin-top: 0;
}

.legal-body p {
  font-size: 15px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 14px;
}

.legal-body ul {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}

.legal-body ul li {
  font-size: 15px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.7;
  padding-left: 18px;
  position: relative;
  margin-bottom: 6px;
}

.legal-body ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-muted);
  font-size: 12px;
  top: 4px;
}

.legal-body a {
  color: var(--accent);
  text-decoration: none;
}

.legal-body a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ── Footer ── */
footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px 0 32px;
  border-top: 1px solid var(--border);
}

.footer-bottom {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding-bottom: 0px;
}

.footer-disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 300;
  opacity: 0.7;
  line-height: 1.5;
}

.footer-brand {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 300;
  margin-left: 6px;
}

.footer-sep {
  width: 1px;
  height: 10px;
  background: var(--border);
  margin: 0 12px;
}

.footer-legal {
  display: flex;
  gap: 16px;
  align-items: center;
}

.footer-legal a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 300;
  transition: color 0.2s;
}

.footer-legal a:hover { color: var(--text-primary); }
.footer-legal a.active { color: var(--text-primary); }

/* ── Mobile TOC button ── */
.toc-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  margin-bottom: 16px;
  width: fit-content;
}

.toc-toggle:hover,
.toc-toggle:focus-visible {
  background: rgba(255,255,255,0.10);
  border-color: var(--accent);
  outline: none;
}

.toc-toggle svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.toc-toggle.open svg {
  transform: rotate(180deg);
}

/* ── Mobile TOC overlay + panel ── */
.toc-mobile {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
}

.toc-mobile.open {
  pointer-events: auto;
}

.toc-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.toc-mobile.open .toc-overlay {
  opacity: 1;
}

.toc-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 85%;
  max-width: 320px;
  height: 100%;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 24px 20px;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.toc-mobile.open .toc-panel {
  transform: translateX(0);
}

.toc-panel .toc-label {
  margin-bottom: 20px;
}

.toc-panel ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-panel ol li a {
  display: block;
  padding: 10px 0 10px 14px;
  font-size: 14px;
  font-weight: 300;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.5;
  border-left: 2px solid var(--border);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.toc-panel ol li a:hover,
.toc-panel ol li a:focus {
  color: var(--text-primary);
  border-left-color: var(--accent);
  background: rgba(91,141,184,0.08);
}

.toc-panel ol li a.active {
  color: var(--text-primary);
  border-left-color: var(--accent);
  background: rgba(91,141,184,0.12);
  font-weight: 500;
}

/* ── Sitemap ── */
.sitemap {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ── License tier badges (used on data.html) ── */
.tier-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 3px 10px;
  margin-left: 10px;
  vertical-align: middle;
}
.tier-open    { background: rgba(74,158,110,0.15); color: #4a9e6e; }
.tier-nc      { background: rgba(217,119,6,0.15);  color: #d97706; }
.tier-private { background: rgba(91,141,184,0.15); color: #5b8db8; }

/* ── Responsive ── */
@media (max-width: 860px) {
  .toc {
    display: none;
  }
  .legal {
    margin-left: 0;
  }
  .toc-toggle {
    display: flex;
  }
  .toc-mobile {
    display: block;
  }
}

@media (max-width: 640px) {
  .legal-wrap { padding: 40px 0 60px; }
  footer { gap: 10px; }
  .toc-panel { width: 90%; max-width: none; }
}