/* Docs / Terms / Privacy prose pages - shares tokens with styles.css */

.doc-wrap {
  position: relative;
  z-index: 1;
  width: min(880px, 100% - calc(var(--gutter) * 2));
  margin: 0 auto;
  padding: 40px 0 72px;
  text-align: left;
}

.doc-eyebrow {
  margin: 0 0 12px;
  color: var(--accent-hi);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.doc-wrap h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.doc-lede {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 62ch;
}

.doc-meta {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.doc-toc {
  margin: 28px 0 0;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(22, 24, 28, 0.6);
}

.doc-toc p {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.doc-toc ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

.doc-toc a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: rgba(34, 211, 238, 0.4);
  text-underline-offset: 3px;
}

.doc-toc a:hover {
  color: var(--text);
}

.doc-wrap h2 {
  margin: 44px 0 0;
  padding-top: 28px;
  border-top: 1px solid rgba(38, 42, 49, 0.7);
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.doc-wrap h3 {
  margin: 24px 0 0;
  font-size: 1.02rem;
  font-weight: 600;
}

.doc-wrap p,
.doc-wrap li {
  color: #C3CAD5;
  font-size: 15px;
  line-height: 1.7;
}

.doc-wrap p {
  margin: 12px 0 0;
  max-width: 72ch;
}

.doc-wrap ul,
.doc-wrap ol {
  margin: 12px 0 0;
  padding-left: 22px;
  max-width: 72ch;
}

.doc-wrap li {
  margin: 6px 0;
}

.doc-wrap a {
  color: var(--accent-hi);
  text-decoration: underline;
  text-decoration-color: rgba(34, 211, 238, 0.4);
  text-underline-offset: 3px;
}

.doc-wrap a:hover {
  text-decoration-color: var(--accent-hi);
}

.doc-wrap code {
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(22, 24, 28, 0.8);
  color: var(--text);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.85em;
  white-space: nowrap;
}

.doc-wrap pre {
  margin: 14px 0 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #101318;
  overflow-x: auto;
}

.doc-wrap pre code {
  padding: 0;
  border: 0;
  background: none;
  white-space: pre;
  font-size: 13px;
  line-height: 1.65;
}

.doc-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.doc-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 560px;
}

.doc-wrap th,
.doc-wrap td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(38, 42, 49, 0.7);
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
}

.doc-wrap tr:last-child th,
.doc-wrap tr:last-child td {
  border-bottom: 0;
}

.doc-wrap th {
  background: rgba(22, 24, 28, 0.8);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.doc-wrap td {
  color: #C3CAD5;
}

.callout {
  margin-top: 16px;
  padding: 14px 18px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 12px;
  background: rgba(34, 211, 238, 0.06);
}

.callout p {
  margin: 0;
  font-size: 14px;
}

.callout strong {
  color: var(--text);
}

.callout-warn {
  border-color: rgba(227, 160, 8, 0.4);
  background: rgba(227, 160, 8, 0.07);
}

.doc-back {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid rgba(38, 42, 49, 0.7);
  font-size: 14px;
}

.placeholder {
  color: var(--warn, #E3A008);
}

/* ---------- Smooth anchor scrolling ---------- */

html {
  scroll-behavior: smooth;
}

.doc-wrap h2,
.doc-wrap h3 {
  scroll-margin-top: 84px;
}

/* Vertically centers short pages (status) in the 1fr grid row. */
.doc-wrap.status-center {
  margin-top: auto;
  margin-bottom: auto;
}

/* ---------- Entrance (above the fold, CSS only) ---------- */

@keyframes doc-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.doc-eyebrow,
.doc-wrap h1,
.doc-lede,
.doc-meta,
.doc-toc {
  opacity: 0;
  animation: doc-rise 0.9s var(--ease-out) forwards;
}

.doc-eyebrow { animation-delay: 0.05s; }
.doc-wrap h1 { animation-delay: 0.15s; }
.doc-lede { animation-delay: 0.25s; }
.doc-meta { animation-delay: 0.33s; }
.doc-toc { animation-delay: 0.42s; }

.doc-eyebrow {
  animation-name: doc-rise, doc-pulse;
  animation-duration: 0.9s, 4s;
  animation-delay: 0.05s, 1s;
  animation-timing-function: var(--ease-out), ease-in-out;
  animation-iteration-count: 1, infinite;
  animation-fill-mode: forwards, none;
}

@keyframes doc-pulse {
  0%, 100% { text-shadow: 0 0 0 rgba(34, 211, 238, 0); }
  50% { text-shadow: 0 0 14px rgba(34, 211, 238, 0.55); }
}

/* ---------- Scroll-in (JS adds .in via IntersectionObserver) ---------- */

.anim {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out),
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    background-color 0.35s ease;
  transition-delay: var(--d, 0s), var(--d, 0s), 0s, 0s, 0s;
}

.anim.in {
  opacity: 1;
  transform: none;
}

/* ---------- Hover life on everything ---------- */

.doc-toc {
  transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s var(--ease-out);
}

.doc-toc:hover {
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 0 24px -10px rgba(34, 211, 238, 0.4);
  transform: translateY(-2px);
}

.doc-toc li {
  transition: transform 0.3s var(--ease-out);
}

.doc-toc li:hover {
  transform: translateX(4px);
}

.doc-wrap a {
  transition: color 0.25s ease, text-decoration-color 0.25s ease, text-shadow 0.25s ease;
}

.doc-wrap a:hover {
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
}

.doc-wrap h2 {
  transition: text-shadow 0.4s ease;
}

.doc-wrap h2:hover {
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
}

.callout {
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s ease, border-color 0.35s ease;
}

.callout:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 28px -10px rgba(34, 211, 238, 0.5);
}

.callout-warn:hover {
  border-color: rgba(227, 160, 8, 0.65);
  box-shadow: 0 0 28px -10px rgba(227, 160, 8, 0.45);
}

.doc-wrap pre {
  transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s var(--ease-out);
}

.doc-wrap pre:hover {
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 0 24px -12px rgba(34, 211, 238, 0.45);
  transform: translateY(-2px);
}

.doc-wrap code {
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.doc-wrap code:hover {
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 12px -4px rgba(34, 211, 238, 0.5);
}

.doc-table-wrap {
  transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s var(--ease-out);
}

.doc-table-wrap:hover {
  border-color: rgba(34, 211, 238, 0.3);
  box-shadow: 0 0 24px -12px rgba(34, 211, 238, 0.4);
}

.doc-wrap tbody tr {
  transition: background-color 0.25s ease;
}

.doc-wrap tbody tr:hover {
  background-color: rgba(34, 211, 238, 0.05);
}

.doc-back a {
  display: inline-block;
  transition: transform 0.3s var(--ease-out), color 0.25s ease, text-shadow 0.25s ease;
}

.doc-back a:hover {
  transform: translateY(-1px);
}

/* ---------- Status ---------- */

.status-page {
  --state: var(--muted);
  --state-glow: rgba(138, 147, 162, 0.35);
  width: min(640px, 100% - calc(var(--gutter) * 2));
}

.status-page[data-state="ok"] { --state: #34D399; --state-glow: rgba(52, 211, 153, 0.45); }
.status-page[data-state="bad"] { --state: #FBBF24; --state-glow: rgba(251, 191, 36, 0.4); }
.status-page[data-state="down"] { --state: #F87171; --state-glow: rgba(248, 113, 113, 0.4); }

.status-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.status-hero h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
}

.status-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin-bottom: 22px;
}

.status-shard {
  position: relative;
  width: 64px;
  height: 64px;
  animation: status-float 7s ease-in-out infinite;
}

.status-ring {
  position: absolute;
  inset: 0;
  border: 1px solid var(--state);
  border-radius: 50%;
  opacity: 0.4;
  box-shadow: 0 0 40px -6px var(--state-glow), inset 0 0 30px -10px var(--state-glow);
  transition: border-color 0.6s ease, box-shadow 0.6s ease;
}

.status-page[data-state="wait"] .status-ring {
  border-color: var(--border);
  border-top-color: var(--accent);
  opacity: 0.8;
  animation: status-spin 1.4s linear infinite;
}

@keyframes status-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes status-spin {
  to { transform: rotate(360deg); }
}

.doc-wrap .status-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  min-height: 1.5em;
  font-variant-numeric: tabular-nums;
}

.status-meta [hidden] {
  display: none;
}

.doc-wrap .status-list {
  margin: 36px 0 0;
  padding: 0;
  max-width: none;
  list-style: none;
}

.doc-wrap .status-row {
  --row: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(22, 24, 28, 0.6);
  transition: border-color 0.3s ease;
}

.doc-wrap .status-row + .status-row {
  margin-top: 10px;
}

.status-row[data-state="ok"] { --row: #34D399; }
.status-row[data-state="bad"] { --row: #FBBF24; }
.status-row[data-state="down"] { --row: #F87171; }

.doc-wrap .status-row:hover {
  border-color: color-mix(in srgb, var(--row) 40%, transparent);
}

.status-name {
  color: var(--text);
  font-size: 15px;
  font-weight: 550;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 4px 12px;
  border: 1px solid color-mix(in srgb, var(--row) 40%, transparent);
  border-radius: 999px;
  color: var(--row);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: color 0.4s ease, border-color 0.4s ease;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--row);
  box-shadow: 0 0 10px var(--row);
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.status-row[data-state="wait"] .status-dot {
  box-shadow: none;
  animation: status-blink 1.2s ease-in-out infinite;
}

.status-row[data-state="na"] .status-dot {
  background: transparent;
  border: 1px solid var(--muted);
  box-shadow: none;
}

@keyframes status-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.status-actions {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.status-actions [hidden] {
  display: none;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .status-shard,
  .status-ring,
  .status-dot {
    animation: none;
  }

  .doc-eyebrow,
  .doc-wrap h1,
  .doc-lede,
  .doc-meta,
  .doc-toc,
  .anim {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }

  .doc-toc:hover,
  .callout:hover,
  .doc-wrap pre:hover,
  .doc-table-wrap:hover,
  .doc-back a:hover,
  .doc-toc li:hover {
    transform: none;
    box-shadow: none;
  }
}
