/* CtrlZAPI — "REWIND" theme: deep purple-black temporal dark. */

:root {
  --bg: #12081f;
  --bg2: #22103f;
  --surface: #1d1133;
  --surface-2: #241543;
  --text: #efe9ff;
  --muted: #a79bc7;
  --border: #3d2560;
  --accent: #2dd4bf;
  --accent-2: #a78bfa;
  --on-accent: #0b0714;
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --cta: linear-gradient(135deg, #2dd4bf, #a78bfa);
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

/* signature keyframes — transform/opacity only (+ the shimmer sweep) */
@keyframes rewind-shimmer {
  from { background-position: 0% center; }
  to { background-position: 100% center; }
}
@keyframes rewind-spin-ccw {
  to { transform: rotate(-360deg); }
}
@keyframes glow-pulse {
  0%, 100% { opacity: 0.28; }
  50% { opacity: 0.65; }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  background: linear-gradient(160deg, #12081f 0%, #22103f 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text);
  line-height: 1.6;
}

::selection { background: rgba(45, 212, 191, 0.35); color: #efe9ff; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* header */
.site-header {
  background: #170d2b;
  border-bottom: 1px solid var(--border);
  padding: 28px 0 22px;
}
.site-header h1,
.api-head h1 {
  margin: 0 0 6px;
  font-size: 1.7rem;
  letter-spacing: -0.01em;
  background-image: linear-gradient(90deg, #2dd4bf 0%, #a78bfa 25%, #2dd4bf 50%, #a78bfa 75%, #2dd4bf 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: rewind-shimmer 6s linear infinite;
}
.api-head h1 { margin: 0 0 4px; font-size: 1.6rem; }
.site-header h1 .tick {
  color: #2dd4bf;
  -webkit-text-fill-color: #2dd4bf;
  position: relative;
  display: inline-block;
}
.site-header h1 .tick::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1.5px dashed rgba(45, 212, 191, 0.55);
  border-radius: 50%;
  animation: rewind-spin-ccw 24s linear infinite;
  pointer-events: none;
}
.tagline-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: -8px;
}
.tagline { margin: 0; color: var(--muted); max-width: 640px; }
nav { margin-top: 14px; font-size: 0.92rem; }
nav a { color: var(--accent); text-decoration: none; margin-right: 18px; }
nav a:hover { text-decoration: underline; color: #5eead4; }

/* dashboard */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 28px 0 40px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
a.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(45, 212, 191, 0.16);
}
.card-top { display: flex; align-items: center; gap: 10px; }
.card h2 { margin: 0; font-size: 1.08rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--green); box-shadow: 0 0 8px rgba(52, 211, 153, 0.7); }
.dot.error { background: var(--red); box-shadow: 0 0 8px rgba(248, 113, 113, 0.7); }
.card p { margin: 0; color: var(--muted); font-size: 0.9rem; flex: 1; }
.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.card-meta strong { color: var(--text); font-weight: 600; }
.mono { font-family: var(--mono); font-size: 0.85em; }
.updated { padding: 18px 0 0; color: var(--muted); font-size: 0.85rem; }

/* detail page */
.api-head { padding: 28px 0 8px; }
.api-head p { margin: 0; color: var(--muted); }
.api-stats { display: flex; gap: 24px; margin: 14px 0 4px; font-size: 0.9rem; color: var(--muted); }
.api-stats strong { color: var(--accent); }

.timeline { padding: 10px 0 40px; }
.day { margin-bottom: 26px; }
.day > h3 {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.change {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 0.92rem;
}
.change::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 90% at 0% 50%, rgba(45, 212, 191, 0.14), rgba(167, 139, 250, 0.10) 45%, transparent 70%);
  opacity: 0.28;
  animation: glow-pulse 4.5s ease-in-out infinite;
  pointer-events: none;
}
.change.added { border-left-color: var(--green); }
.change.removed { border-left-color: var(--red); }
.change.type_changed { border-left-color: var(--amber); }
.change .op {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 8px;
  border-radius: 4px;
  margin-right: 10px;
  color: #0b0714;
  font-weight: 700;
}
.change.added .op { background: var(--green); }
.change.removed .op { background: var(--red); color: #fff; }
.change.type_changed .op { background: var(--amber); }
.change .path { font-family: var(--mono); font-weight: 600; color: var(--text); }
.change .detail { color: var(--muted); font-size: 0.85rem; }
.change .endpoint { display: block; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); margin-bottom: 4px; }
.empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  margin: 20px 0 40px;
}

/* schema tree */
.schema-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 8px 0 40px;
}
.schema-box summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.95rem;
}
.schema-tree {
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 4px 16px 16px;
  overflow-x: auto;
  white-space: pre;
  color: var(--text);
}
.schema-tree .t-string { color: #5eead4; }
.schema-tree .t-number { color: #fbbf24; }
.schema-tree .t-boolean { color: #a78bfa; }
.schema-tree .t-null { color: var(--muted); }
.schema-tree .t-object, .schema-tree .t-array { color: var(--accent); }

/* about */
.prose { padding: 28px 0 48px; max-width: 720px; }
.prose h2 { margin-top: 30px; font-size: 1.25rem; }
.prose code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: #2a1745;
  color: #efe9ff;
  padding: 1px 6px;
  border-radius: 4px;
}
.prose pre {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: #0d0618;
  color: #efe9ff;
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
}
.prose ol, .prose ul { padding-left: 22px; }
.prose a { color: var(--accent); }

footer {
  border-top: 1px solid var(--border);
  padding: 18px 0 30px;
  color: var(--muted);
  font-size: 0.85rem;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 6px 14px; font-size: 0.85rem; cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active {
  background: linear-gradient(135deg, #2dd4bf, #a78bfa);
  border-color: transparent;
  color: #0b0714;
  font-weight: 700;
}
.card-cat { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin: -4px 0 8px; }
.lead { font-size: 1.1rem; font-weight: 500; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
