/* ── SnapService v4 — Terminal Theme (polished) ──── */
:root {
  --bg: #0a0e17;
  --bg-card: #0f1520;
  --bg-elevated: #131a28;
  --border: #1a2236;
  --border-hover: #243050;
  --text: #c9d1d9;
  --text-muted: #5a6577;
  --accent: #00ff88;
  --accent-dim: #00cc6a;
  --accent-bg: rgba(0,255,136,0.06);
  --str: #ffa657;
  --key: #79c0ff;
  --num: #d2a8ff;
  --kw: #ff7b72;
  --var: #7ee787;
  --success: #00ff88;
  --section-gap: 2.5rem;
  --mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', Consolas, monospace;
}

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

body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.scanline {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none; z-index: 9999;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,255,136,0.008) 2px, rgba(0,255,136,0.008) 4px);
}

.container { max-width: 780px; margin: 0 auto; padding: 2.5rem 1.5rem 3rem; }

/* ── Header ────────────────────────────────────────── */
header { text-align: center; margin-bottom: 1rem; padding-top: 0.5rem; }

.logo { font-size: 2.8rem; font-weight: 700; letter-spacing: -2px; margin-bottom: 0.4rem; }
.logo-bracket { color: var(--text-muted); }
.logo-text { color: var(--accent); }

.tagline {
  font-size: 1rem; color: var(--text); margin-bottom: 0.4rem;
  letter-spacing: 3px; text-transform: uppercase; font-weight: 400;
}
.tagline .accent { color: var(--accent); font-weight: 700; text-transform: lowercase; }

.subtitle { color: var(--text-muted); font-size: 0.78rem; max-width: 480px; margin: 0 auto; line-height: 1.5; }

/* ── Persona Switch ────────────────────────────────── */
.persona-switch {
  display: flex; justify-content: center; gap: 0;
  margin: 1.25rem auto 1.75rem;
  width: 280px;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.persona-btn {
  flex: 1; background: transparent; border: none;
  color: var(--text-muted); font-family: var(--mono); font-size: 0.78rem;
  padding: 0.6rem 0; cursor: pointer; transition: all 0.2s; text-align: center;
}
.persona-btn:first-child { border-right: 1px solid var(--border); }
.persona-btn:hover { color: var(--text); background: rgba(255,255,255,0.015); }
.persona-btn.active { color: var(--accent); background: var(--accent-bg); font-weight: 600; }

/* ── Views ─────────────────────────────────────────── */
.view.hidden { display: none; }

/* ── Agent View ────────────────────────────────────── */
.agent-hero { margin: 0 0 1rem; }

.agent-heading { text-align: center; margin-bottom: 1.75rem; }
.agent-icon { font-size: 2.2rem; margin-bottom: 0.4rem; }
.agent-heading h2 { font-size: 1.2rem; color: var(--accent); margin-bottom: 0.25rem; border: none; padding: 0; }
.agent-heading p { font-size: 0.8rem; }

.agent-card {
  border: 1px solid var(--accent-dim); border-radius: 10px;
  overflow: hidden; margin-bottom: 2rem;
}
.agent-card-header {
  background: var(--accent-bg); padding: 0.55rem 1.1rem;
  font-size: 0.82rem; font-weight: 700; color: var(--accent);
  letter-spacing: 1px; border-bottom: 1px solid var(--border);
}
.agent-card-body { padding: 1.1rem 1.25rem 1.25rem; }
.agent-card-body p { font-size: 0.8rem; color: var(--text); margin-bottom: 0.65rem; }

.agent-cmd {
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 0.65rem 0.9rem; margin-bottom: 0.9rem;
}
.agent-cmd code { font-size: 0.78rem; color: var(--text); }

.agent-list { margin-bottom: 1.1rem; }
.agent-list-item {
  font-size: 0.76rem; color: var(--text-muted); padding: 0.3rem 0;
  display: flex; gap: 0.5rem; align-items: baseline;
}
.agent-list-item .accent { flex-shrink: 0; font-size: 0.7rem; }

.skill-link {
  display: inline-block; color: var(--accent); border: 1px solid var(--accent);
  padding: 0.45rem 1.1rem; border-radius: 6px; text-decoration: none;
  font-size: 0.78rem; transition: all 0.2s; font-weight: 500;
}
.skill-link:hover { background: var(--accent-bg); }

.agent-quick { margin-bottom: 1.75rem; }
.agent-quick h3, .agent-scripts h3 {
  font-size: 0.88rem; color: var(--text); margin-bottom: 0.6rem; font-weight: 600;
}
.agent-scripts { margin-bottom: 1rem; }
.agent-script-links { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ── Agent Tip (human view) ────────────────────────── */
.agent-tip {
  background: rgba(0,255,136,0.03); border: 1px solid rgba(0,255,136,0.12);
  border-radius: 8px; padding: 0.8rem 1rem;
  font-size: 0.74rem; color: var(--text-muted); margin-bottom: var(--section-gap); line-height: 1.6;
}
.agent-tip strong { color: var(--accent); font-weight: 600; }
.agent-tip code {
  color: var(--str); background: rgba(255,166,87,0.06);
  padding: 0.12rem 0.35rem; border-radius: 3px; font-size: 0.7rem; word-break: break-all;
}

/* ── Terminal Blocks ───────────────────────────────── */
.terminal-chrome {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-bottom: none; border-radius: 8px 8px 0 0;
  padding: 0.5rem 0.9rem; display: flex; align-items: center; gap: 0.7rem;
}
.terminal-dots { display: flex; gap: 5px; }
.terminal-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.terminal-dots span:first-child { background: #ff5f57; }
.terminal-dots span:nth-child(2) { background: #ffbd2e; }
.terminal-dots span:last-child { background: #28c840; }
.terminal-title { color: var(--text-muted); font-size: 0.68rem; }

.terminal-body {
  background: var(--bg-card); border: 1px solid var(--border);
  border-top: none; border-radius: 0 0 8px 8px;
  padding: 1.1rem; font-size: 0.8rem; line-height: 1.7;
  overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}

/* ── Sections — uniform rhythm ─────────────────────── */
section, .features, .api-docs, .get-key, .examples,
.pow-section, .limits, .response-info, .errors { margin: var(--section-gap) 0; }

/* ── Features ──────────────────────────────────────── */
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.feature {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 1.1rem; transition: border-color 0.3s;
}
.feature:hover { border-color: var(--border-hover); }
.feature-icon { font-size: 1rem; color: var(--accent); margin-bottom: 0.4rem; font-weight: 700; }
.feature h3 { font-size: 0.85rem; color: var(--text); margin-bottom: 0.25rem; }
.feature p { font-size: 0.72rem; color: var(--text-muted); line-height: 1.5; }

/* ── API Docs ──────────────────────────────────────── */
h2 {
  font-size: 1rem; color: var(--accent); margin-bottom: 1.25rem;
  padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); font-weight: 600;
}

.endpoint {
  display: flex; align-items: center; gap: 0.6rem; margin: 1.25rem 0 0.4rem; flex-wrap: wrap;
}
.method-badge {
  font-size: 0.6rem; font-weight: 700; padding: 0.18rem 0.45rem;
  border-radius: 3px; letter-spacing: 1px; flex-shrink: 0;
}
.method-badge.post { background: rgba(255,107,107,0.12); color: var(--kw); border: 1px solid rgba(255,107,107,0.25); }
.method-badge.get { background: rgba(0,255,136,0.08); color: var(--accent); border: 1px solid rgba(0,255,136,0.18); }

.endpoint code { color: var(--text); font-size: 0.82rem; font-weight: 600; }

/* ── Code Blocks + Syntax ──────────────────────────── */
.code-block {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.9rem; margin-bottom: 0.75rem; overflow-x: auto;
}
.code-block pre { font-size: 0.76rem; line-height: 1.65; white-space: pre-wrap; word-break: break-all; }
.code-block.highlighted { border-left: 3px solid var(--accent-dim); }

.note { font-size: 0.7rem; color: var(--text-muted); margin: 0.35rem 0 0.75rem; }

.dim { color: var(--text-muted); }
.accent { color: var(--accent); }
.str { color: var(--str); }
.key { color: var(--key); }
.num { color: var(--num); }
.kw { color: var(--kw); }
.var { color: var(--var); }
.success { color: var(--success); font-weight: 700; }

/* ── Code Tabs ─────────────────────────────────────── */
.code-tabs {
  display: flex; gap: 0; border: 1px solid var(--border);
  border-bottom: none; border-radius: 8px 8px 0 0; overflow: hidden; margin-top: 0.75rem;
}
.code-tab {
  flex: 1; background: transparent; border: none;
  border-right: 1px solid var(--border); color: var(--text-muted);
  font-family: var(--mono); font-size: 0.72rem; padding: 0.5rem 0.6rem;
  cursor: pointer; transition: all 0.2s; text-align: center;
}
.code-tab:last-child { border-right: none; }
.code-tab:hover { color: var(--text); background: rgba(255,255,255,0.015); }
.code-tab.active { color: var(--accent); background: var(--bg-card); font-weight: 600; }

.code-panel { display: none; }
.code-panel.active { display: block; }
.code-panel .code-block { border-radius: 0 0 8px 8px; border-top: 1px solid var(--border); margin-top: 0; }

/* ── Registration ──────────────────────────────────── */
.form-row { display: flex; gap: 0.6rem; margin-bottom: 0.75rem; }

input[type="text"], input[type="email"] {
  flex: 1; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.6rem 0.8rem; color: var(--text);
  font-family: var(--mono); font-size: 0.78rem; outline: none; transition: border-color 0.3s;
}
input:focus { border-color: var(--accent-dim); }
input::placeholder { color: var(--text-muted); }

#reg-btn {
  background: transparent; border: 1px solid var(--accent); color: var(--accent);
  font-family: var(--mono); font-size: 0.78rem; padding: 0.6rem 1.2rem;
  border-radius: 6px; cursor: pointer; transition: all 0.3s; width: 100%;
}
#reg-btn:hover { background: var(--accent-bg); }
#reg-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.key-display { position: relative; }
.btn-copy {
  position: absolute; right: 0.9rem; bottom: 0.9rem;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); font-family: var(--mono); font-size: 0.68rem;
  padding: 0.25rem 0.5rem; border-radius: 3px; cursor: pointer; transition: all 0.2s;
}
.btn-copy:hover { border-color: var(--accent); color: var(--accent); }
.hidden { display: none; }
#key-result { margin-top: 1.25rem; position: relative; }

/* ── PoW Status ────────────────────────────────────── */
.pow-status { font-size: 0.7rem; margin-top: 0.4rem; min-height: 1.1rem; transition: color 0.3s; }
.pow-status.active { color: var(--str); }
.pow-status.done { color: var(--success); }
.pow-status.error { color: var(--kw); }

/* ── PoW Steps ─────────────────────────────────────── */
.pow-steps { display: flex; flex-direction: column; gap: 0.75rem; }
.pow-step {
  display: flex; gap: 0.85rem; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.9rem;
}
.step-num { font-size: 1.1rem; font-weight: 700; color: var(--accent); min-width: 1.8rem; text-align: center; }
.step-content h4 { font-size: 0.82rem; color: var(--text); margin-bottom: 0.2rem; }
.step-content p { font-size: 0.72rem; color: var(--text-muted); line-height: 1.5; }
.step-content code { color: var(--str); font-size: 0.7rem; }

/* ── Tables ────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
td { padding: 0.5rem 0; font-size: 0.78rem; border-bottom: 1px solid var(--border); }
td:last-child { text-align: right; font-weight: 600; }
.errors td:first-child { width: 55px; font-weight: 600; }
.errors td:last-child { text-align: left; font-weight: 400; }

/* ── Footer ────────────────────────────────────────── */
footer {
  margin-top: var(--section-gap); padding-top: 1.25rem;
  border-top: 1px solid var(--border); text-align: center;
}
.footer-links {
  font-size: 0.68rem; display: flex;
  justify-content: center; gap: 0.6rem; flex-wrap: wrap;
}
.footer-links a { color: var(--accent-dim); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-ascii { margin-top: 0.6rem; font-size: 0.62rem; }

/* ── Hero Glow ─────────────────────────────────────── */
.hero-terminal { margin: 1.5rem 0 0; animation: glow-pulse 4s ease-in-out infinite alternate; }
@keyframes glow-pulse {
  from { filter: drop-shadow(0 0 0 rgba(0,255,136,0)); }
  to { filter: drop-shadow(0 0 6px rgba(0,255,136,0.12)); }
}

/* ── Mobile ────────────────────────────────────────── */
@media (max-width: 640px) {
  :root { --section-gap: 2rem; }
  .container { padding: 1.25rem 1rem 2rem; }
  .logo { font-size: 2.2rem; }
  .tagline { font-size: 0.85rem; letter-spacing: 2px; }
  .feature-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  .terminal-body { font-size: 0.7rem; padding: 0.7rem; }
  .code-block pre { font-size: 0.68rem; }
  .endpoint { font-size: 0.78rem; }
  .persona-switch { width: 100%; max-width: 280px; }
  .agent-tip code { display: block; margin-top: 0.3rem; }
  .agent-heading { margin-bottom: 1.25rem; }
  .agent-card-body { padding: 0.9rem 1rem; }
  .pow-step { flex-direction: column; gap: 0.4rem; }
  .step-num { text-align: left; }
}

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
