/* GrayPass — shared theme.
 *
 * Mirrors the palette, typography, and motion of graypass.org (the
 * landing page). Every static page in this repo (demo, portal, docs,
 * developers, status, telemetry) inherits from this file so the cream
 * → red → near-black aesthetic is consistent across the whole product.
 */

@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap");

:root {
  /* Light palette */
  --background: #fafaf8;
  --surface-2: #f3f4f2;
  --card: #ffffff;
  --card-foreground: #020617;
  --foreground: #020617;
  --muted-foreground: #334155;
  --text-tertiary: #64748b;
  --primary: #eb4155;
  --primary-hover: #d7374a;
  --primary-foreground: #ffffff;
  --border: #e5e7eb;
  --input: #e5e7eb;
  --ring: rgba(235, 65, 85, 0.35);
  --destructive: #eb4155;
  --success: #16a34a;
  --warning: #d97706;

  --radius-sm: 0.5rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;

  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

:root[data-theme="dark"], html.dark {
  --background: #050507;
  --surface-2: #0a0a0d;
  --card: #0d0d12;
  --card-foreground: #e8eaef;
  --foreground: #fafaf8;
  --muted-foreground: #b6bdc9;
  --text-tertiary: #7a8497;
  --border: #1c1c24;
  --input: #1c1c24;
}

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

html, body { margin: 0; padding: 0; }

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.28s ease, color 0.28s ease;
}

::selection { background: rgba(235, 65, 85, 0.22); color: var(--foreground); }

a {
  color: var(--foreground);
  text-decoration: none;
  transition: color 0.18s ease;
}
a:hover { color: var(--primary); }
a.muted { color: var(--muted-foreground); }
a.muted:hover { color: var(--foreground); }

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

/* ── Layout ───────────────────────────────────────────────── */

.gp-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.gp-container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.gp-section { padding: 56px 0; }
.gp-section-tight { padding: 28px 0; }

/* ── Header (matches landing) ────────────────────────────── */

.gp-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 85%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.gp-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
  padding: 0 24px;
  max-width: 1180px;
  margin: 0 auto;
}
.gp-brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-weight: 600; letter-spacing: -0.01em;
  color: var(--foreground);
  font-size: 16px;
}
.gp-brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  box-shadow: 0 0 16px rgba(235, 65, 85, 0.25);
  ring: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  font-family: var(--font-mono);
}
.gp-brand-suffix {
  font-weight: 500;
  color: var(--text-tertiary);
  font-size: 13px;
  margin-left: 4px;
  font-family: var(--font-mono);
}
.gp-nav {
  display: flex; gap: 4px; align-items: center;
}
.gp-nav a {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  border-radius: 8px;
  transition: color 0.18s ease, background 0.18s ease;
}
.gp-nav a:hover { color: var(--foreground); background: var(--surface-2); }
.gp-nav a.active { color: var(--foreground); }

/* ── Buttons (matches landing primary + outline) ─────────── */

.gp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.gp-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.gp-btn-primary {
  background: var(--foreground);
  color: var(--background);
  border-color: var(--foreground);
}
.gp-btn-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

.gp-btn-accent {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}
.gp-btn-accent:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.gp-btn-outline {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border);
}
.gp-btn-outline:hover {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--foreground) 25%, var(--border));
}

.gp-btn-ghost {
  background: transparent;
  color: var(--muted-foreground);
  border-color: transparent;
}
.gp-btn-ghost:hover {
  background: var(--surface-2);
  color: var(--foreground);
}

.gp-btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.gp-btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 12px; }

/* ── Cards ──────────────────────────────────────────────── */

.gp-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  transition: border-color 0.2s ease;
}
.gp-card.gp-card-hover:hover {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
}
.gp-card-header { margin-bottom: 14px; }
.gp-card-title { font-size: 17px; font-weight: 600; margin: 0 0 4px 0; letter-spacing: -0.01em; }
.gp-card-subtitle {
  font-size: 13px; color: var(--text-tertiary); margin: 0; font-weight: 400;
}

/* ── Pills, badges, dots ────────────────────────────────── */

.gp-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  font-family: var(--font-mono);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  border-radius: 999px;
  text-transform: lowercase;
  letter-spacing: 0;
}
.gp-pill-accent { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); background: color-mix(in srgb, var(--primary) 8%, var(--surface-2)); }
.gp-pill-success { color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, var(--border)); background: color-mix(in srgb, var(--success) 8%, transparent); }
.gp-pill-warning { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 30%, var(--border)); background: color-mix(in srgb, var(--warning) 8%, transparent); }
.gp-pill-danger  { color: var(--destructive); border-color: color-mix(in srgb, var(--destructive) 30%, var(--border)); background: color-mix(in srgb, var(--destructive) 8%, transparent); }

.gp-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--text-tertiary);
}
.gp-dot.live { background: var(--success); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.55); animation: gp-pulse 2.2s infinite; }
.gp-dot.warn { background: var(--warning); }
.gp-dot.bad  { background: var(--destructive); }

@keyframes gp-pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* ── Hairlines, grain, glows ────────────────────────────── */

.gp-hairline {
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--foreground) 12%, transparent), transparent);
  border: 0;
  margin: 0;
}
.gp-vrule { width: 1px; background: var(--border); }

.gp-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(235, 65, 85, 0.10), transparent 70%);
}

/* ── Forms ───────────────────────────────────────────────── */

.gp-input, .gp-select, .gp-textarea {
  width: 100%;
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.gp-input:focus, .gp-select:focus, .gp-textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
  box-shadow: 0 0 0 3px var(--ring);
}
.gp-input::placeholder, .gp-textarea::placeholder { color: var(--text-tertiary); }
.gp-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-bottom: 6px;
  letter-spacing: 0;
}

/* ── Tables ──────────────────────────────────────────────── */

.gp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.gp-table th, .gp-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.gp-table th {
  font-size: 11.5px;
  font-weight: 500;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}
.gp-table tbody tr:hover td { background: var(--surface-2); }
.gp-table td.mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted-foreground); }

/* ── Code blocks ─────────────────────────────────────────── */

pre.gp-code, .gp-code {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--muted-foreground);
}
pre.gp-code .hl-key { color: var(--primary); }
pre.gp-code .hl-str { color: #5b8c00; }
:root[data-theme="dark"] pre.gp-code .hl-str,
html.dark pre.gp-code .hl-str { color: #79c879; }

/* ── Footer ──────────────────────────────────────────────── */

.gp-footer {
  border-top: 1px solid var(--border);
  background: var(--background);
  padding: 36px 0 24px;
  margin-top: auto;
}
.gp-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12.5px;
  color: var(--text-tertiary);
}
.gp-footer-inner a { color: var(--muted-foreground); }

/* ── Stats grid (matches Hero) ───────────────────────────── */

.gp-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 18px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
.gp-stat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.gp-stat-value {
  font-size: 22px; font-weight: 600;
  color: var(--foreground);
  letter-spacing: -0.01em;
}
.gp-stat-label {
  font-size: 11.5px;
  text-transform: lowercase;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* ── Mobile ─────────────────────────────────────────────── */

@media (max-width: 720px) {
  .gp-header-inner { padding: 0 16px; height: 56px; }
  .gp-container { padding: 0 16px; }
  .gp-section { padding: 36px 0; }
  .gp-card { padding: 16px; }
  .gp-nav { gap: 0; }
  .gp-nav a { padding: 6px 8px; font-size: 12px; }
  .gp-stats { grid-template-columns: 1fr 1fr; }
}

/* ── Motion ─────────────────────────────────────────────── */

@keyframes gp-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes gp-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes gp-scale-in {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes gp-slide-right {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes gp-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes gp-spin { to { transform: rotate(360deg); } }

@keyframes gp-glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(235, 65, 85, 0.55), 0 0 24px rgba(235, 65, 85, 0.15); }
  50%      { box-shadow: 0 0 0 14px rgba(235, 65, 85, 0), 0 0 40px rgba(235, 65, 85, 0.35); }
}

@keyframes gp-success-pop {
  0%   { transform: scale(0.4); opacity: 0; }
  50%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.gp-anim-fade-up { animation: gp-fade-up 0.55s cubic-bezier(0.22,0.55,0.36,1) both; }
.gp-anim-fade-in { animation: gp-fade-in 0.5s ease-out both; }
.gp-anim-scale-in { animation: gp-scale-in 0.4s cubic-bezier(0.22,0.55,0.36,1) both; }
.gp-anim-slide-right { animation: gp-slide-right 0.4s cubic-bezier(0.22,0.55,0.36,1) both; }
.gp-anim-pop { animation: gp-success-pop 0.6s cubic-bezier(0.22,1.36,0.36,1) both; }
.gp-anim-glow { animation: gp-glow-pulse 2.4s ease-in-out infinite; }

.gp-stagger > * { animation: gp-fade-up 0.5s cubic-bezier(0.22,0.55,0.36,1) both; }
.gp-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.gp-stagger > *:nth-child(2) { animation-delay: 0.12s; }
.gp-stagger > *:nth-child(3) { animation-delay: 0.19s; }
.gp-stagger > *:nth-child(4) { animation-delay: 0.26s; }
.gp-stagger > *:nth-child(5) { animation-delay: 0.33s; }
.gp-stagger > *:nth-child(6) { animation-delay: 0.40s; }
.gp-stagger > *:nth-child(7) { animation-delay: 0.47s; }
.gp-stagger > *:nth-child(8) { animation-delay: 0.54s; }

/* Shimmer skeleton (for "loading"). */
.gp-skeleton {
  background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-2) 60%, var(--card)) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: gp-shimmer 1.6s linear infinite;
  border-radius: 6px;
}

.gp-spin {
  width: 16px; height: 16px;
  border: 2px solid color-mix(in srgb, var(--foreground) 18%, transparent);
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: gp-spin 0.7s linear infinite;
  display: inline-block;
}

/* Smooth-hover on cards / buttons */
.gp-lift { transition: transform 0.22s cubic-bezier(0.22,0.55,0.36,1), box-shadow 0.22s ease; }
.gp-lift:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -16px rgba(2,6,23,0.18); }

@media (prefers-reduced-motion: reduce) {
  .gp-anim-fade-up, .gp-anim-fade-in, .gp-anim-scale-in, .gp-anim-slide-right,
  .gp-anim-pop, .gp-stagger > *, .gp-anim-glow {
    animation: none !important;
  }
}

/* ── Utilities ──────────────────────────────────────────── */

.gp-muted { color: var(--muted-foreground); }
.gp-tertiary { color: var(--text-tertiary); }
.gp-mono { font-family: var(--font-mono); }
.gp-mb-0 { margin-bottom: 0; }
.gp-mb-1 { margin-bottom: 6px; }
.gp-mb-2 { margin-bottom: 12px; }
.gp-mb-3 { margin-bottom: 18px; }
.gp-mb-4 { margin-bottom: 24px; }
.gp-mt-1 { margin-top: 6px; }
.gp-mt-2 { margin-top: 12px; }
.gp-mt-3 { margin-top: 18px; }
.gp-mt-4 { margin-top: 24px; }
.gp-row { display: flex; gap: 12px; align-items: center; }
.gp-row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.gp-grid-2 { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.gp-grid-3 { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .gp-grid-2, .gp-grid-3 { grid-template-columns: 1fr; } }
.gp-hidden { display: none !important; }
