/* Tokens shared by the landing page and the docs. Dark is the only theme; perch is a terminal tool. */
:root {
  --bg: #08090c;
  --bg-panel: #0d0f15;
  --bg-raised: #12151d;
  --line: #1e2230;
  --line-soft: #171a24;
  --text: #e7e9f0;
  --text-dim: #9aa2b6;
  --text-faint: #6b7286;
  --accent: #ffb454;
  --accent-soft: #3a2a12;
  --glow-a: #3b2f6b;
  --glow-b: #123a45;
  --red: #ff6b6b;
  --yellow: #ffcc66;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --radius: 12px;
  --gutter: 24px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* Code blocks scroll inside their own box; the page itself never does. */
html, body { overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

code, pre, kbd { font-family: var(--mono); }

/* The background: one wide aurora behind the copy, a faint grid over the whole page. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.backdrop::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -35vh;
  width: 140vw;
  height: 110vh;
  transform: translateX(-50%);
  background:
    radial-gradient(48% 42% at 38% 42%, color-mix(in srgb, var(--glow-a) 78%, transparent) 0%, transparent 72%),
    radial-gradient(44% 40% at 64% 34%, color-mix(in srgb, var(--glow-b) 62%, transparent) 0%, transparent 70%),
    radial-gradient(30% 26% at 52% 20%, color-mix(in srgb, var(--accent) 12%, transparent) 0%, transparent 68%);
  filter: blur(18px);
  opacity: 0.7;
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(70% 55% at 50% 30%, #000 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(70% 55% at 50% 30%, #000 0%, transparent 100%);
  opacity: 0.6;
}

/* The GitHub link, top right of every page. */
.corner {
  position: absolute;
  top: 20px;
  right: var(--gutter);
  z-index: 3;
  display: flex;
  gap: 10px;
}
.corner a,
.ghlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-panel) 70%, transparent);
  backdrop-filter: blur(8px);
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.corner a:hover,
.ghlink:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--bg-raised);
  text-decoration: none;
}
.corner svg, .ghlink svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.corner svg.stroked, .ghlink svg.stroked { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Terminal panel, used in the hero and for shell blocks in the docs. */
.terminal {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-panel) 92%, transparent);
  box-shadow: 0 24px 70px -30px #000, 0 0 0 1px color-mix(in srgb, #fff 3%, transparent) inset;
  overflow: hidden;
  text-align: left;
}
.terminal .bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, #fff 2%, transparent);
}
.terminal .dot { width: 10px; height: 10px; border-radius: 50%; background: #2a2f3d; }
.terminal .bar .name {
  margin-left: 8px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 12px;
}
.terminal pre {
  margin: 0;
  padding: 16px 18px 18px;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  color: var(--text);
}

/* How sure perch is, colored the way the CLI colors it. */
.p-high { color: var(--red); }
.p-mid { color: var(--yellow); }
.p-low { color: var(--text-faint); }
.t-dim { color: var(--text-faint); }
.t-head { color: var(--text-dim); }
.t-prompt { color: var(--accent); }
.t-path { color: #7fd1de; }
.t-key { color: #7fd1de; }
.t-string { color: #a5d6a7; }
.t-rule { color: var(--accent); }

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .terminal pre { font-size: 11px; padding: 13px 13px 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
