/* ============================================================
   q-ring — Quantum Keyring Landing Page
   Dark quantum theme, deep navy/black + glowing cyan/teal
   ============================================================ */

:root {
  --bg-deep:       #04080f;
  --bg-section:    #080e18;
  --bg-alt:        #0b1221;
  --bg-card:       #0f1a2e;
  --bg-card-hover: #142240;
  --border:        #1a2d4a;
  --border-glow:   #0ea5e9;

  --text-primary:  #f8f8ff;
  --text-secondary:#c8cfe0;
  --text-dim:      #8899b4;

  --accent:        #0ea5e9;
  --accent-bright: #38bdf8;
  --accent-dim:    rgba(14, 165, 233, 0.15);
  --accent-glow:   rgba(14, 165, 233, 0.4);

  --danger:        #ff5e5b;
  --warning:       #fbbf24;
  --green:         #22c55e;

  --font-display:  'Outfit', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;

  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     20px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-display);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-bright); }

/* ============ WEBGL BACKGROUND ============ */
#webgl-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

#webgl-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 15, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1;
}

#webgl-bg canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  position: relative;
  z-index: 0;
}

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  background: rgba(4, 8, 15, 0.75);
  border-bottom: 1px solid var(--border);
  transition: background .3s, box-shadow .3s;
}

.nav.scrolled {
  background: rgba(4, 8, 15, 0.92);
  box-shadow: 0 2px 32px rgba(14, 165, 233, 0.08);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-links a { color: var(--text-secondary); }
.nav-links a:hover { color: var(--accent-bright); }

/* ============ CONTAINER ============ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 3rem;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  width: 700px;
  height: 700px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: pulse 6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}

.hero-content { z-index: 1; }

.hero-logo {
  max-width: 360px;
  height: auto;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 20px var(--accent-dim));
  animation: float 5s ease-in-out infinite;
}

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

.hero-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero-q {
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

.hero-tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--text-secondary);
  font-weight: 300;
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.5;
}

.hero-install { margin-bottom: 1.5rem; }

.pkg-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.pkg-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.pkg-tab:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.pkg-tab.active {
  color: var(--accent-bright);
  background: var(--bg-card);
  border-color: var(--border);
}

.install-box {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent-bright);
  transition: border-color .3s, box-shadow .3s;
}

.install-box:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 20px var(--accent-dim);
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color .2s, background .2s;
  display: flex;
  align-items: center;
}

.copy-btn:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.copy-btn.copied { color: var(--green); }

.hero-badges {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.badge img {
  height: 22px;
  transition: transform .2s;
}

.badge:hover img { transform: translateY(-2px); }

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  animation: bobDown 2s ease-in-out infinite;
}

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

/* ============ SECTIONS ============ */
.section {
  padding: 6rem 0;
  position: relative;
  z-index: 1;
}

.section-alt { background: var(--bg-alt); }

.section-title {
  text-align: center;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 3rem;
}

/* ============ FEATURES GRID ============ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform .3s, border-color .3s, box-shadow .3s;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: 0 8px 32px rgba(14, 165, 233, 0.1);
}

.feature-icon-svg {
  width: 32px;
  height: 32px;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 0 6px rgba(0, 209, 255, 0.5));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.feature-card:hover .feature-icon-svg {
  transform: scale(1.1) translateY(-2px);
  filter: drop-shadow(0 0 10px rgba(0, 209, 255, 0.8)) drop-shadow(0 0 16px rgba(168, 85, 247, 0.5));
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.feature-cmd {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: rgba(14, 165, 233, 0.08);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  word-break: break-all;
}

/* ============ TERMINAL ============ */
.terminal {
  background: #0c0c0c;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 750px;
  margin: 0 auto;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}

.terminal-sm { max-width: 100%; }

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-dot.red    { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green  { background: #28c840; }

.terminal-title {
  margin-left: 0.5rem;
  color: #666;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.terminal-body {
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  overflow-x: auto;
}

.terminal-body pre { white-space: pre; }

.t-comment { color: #555; }
.t-prompt  { color: var(--green); font-weight: 700; }
.t-cmd     { color: var(--accent-bright); font-weight: 500; }

/* ============ MCP ============ */
.mcp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.mcp-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mcp-group h4 {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mcp-header-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(0, 209, 255, 0.4));
}

.mcp-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.mcp-list li {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  display: grid;
  grid-template-columns: 145px 1fr;
  align-items: start;
  gap: 0.75rem;
}

.mcp-tool {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-bright);
  background: var(--accent-dim);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.config-title {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.config-block h5 {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ============ ARCHITECTURE ============ */
.arch-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 2rem 0;
}

.arch-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.arch-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  transition: border-color .3s, box-shadow .3s;
}

.arch-box:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 16px var(--accent-dim);
}

.arch-cli      { color: var(--accent-bright); }
.arch-mcp-box  { color: var(--warning); }
.arch-engine   { color: var(--accent); border-color: var(--accent); font-weight: 700; font-size: 1rem; }
.arch-keyring  { color: var(--green); }
.arch-os       { color: var(--text-primary); border-color: var(--green); }

.arch-arrow {
  color: var(--accent);
  font-size: 1.5rem;
  filter: drop-shadow(0 0 6px var(--accent-glow));
  animation: arrowPulse 2s ease-in-out infinite;
}

@keyframes arrowPulse {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

.arch-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  max-width: 260px;
}

.arch-modules span {
  background: var(--accent-dim);
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  border: 1px solid rgba(14, 165, 233, 0.2);
}

/* ============ AGENT MODE ============ */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.agent-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: transform .3s, border-color .3s;
}

.agent-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
}

.agent-icon-svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 8px rgba(0, 209, 255, 0.6)) drop-shadow(0 0 12px rgba(168, 85, 247, 0.4));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.agent-card:hover .agent-icon-svg {
  transform: scale(1.1);
  filter: drop-shadow(0 0 12px rgba(0, 209, 255, 0.8)) drop-shadow(0 0 20px rgba(168, 85, 247, 0.6));
}

.agent-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.agent-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.terminal-agent { max-width: 600px; }

/* ============ STATUS DASHBOARD ============ */
.dash-showcase {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

.dash-browser-frame {
  background: var(--bg-deep);
  border: 1px solid rgba(14, 165, 233, 0.15);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 40px -8px rgba(0, 0, 0, 0.6), 0 0 24px rgba(14, 165, 233, 0.06);
}

.dash-browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(4, 8, 15, 0.8);
  border-bottom: 1px solid var(--border);
}

.dash-browser-url {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 10px;
  border-radius: 4px;
  flex: 1;
}

.dash-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: dashPulse 2s ease-in-out infinite;
}

@keyframes dashPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.dash-mock-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
}

.dash-mock-card {
  background: rgba(15, 26, 46, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.dash-mock-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 10px;
}

.dash-mock-donut {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.dash-mock-donut-label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text-primary);
}

.dash-mock-env {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 3px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 0, 85, 0.2);
  color: #ff0055;
  border: 1px solid rgba(255, 0, 85, 0.3);
}

.dash-mock-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash-mock-bar {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.dash-mock-bar span {
  display: block;
  height: 100%;
  border-radius: 3px;
}

.dash-mock-pairs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.dash-arrow {
  color: var(--accent-bright);
  margin: 0 4px;
}

.dash-features {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dash-feature-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.dash-feat-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  margin-top: 2px;
  filter: drop-shadow(0 0 6px rgba(0, 209, 255, 0.5)) drop-shadow(0 0 10px rgba(168, 85, 247, 0.3));
}

.dash-feature-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.dash-feature-item p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
}

.terminal-dash { max-width: 600px; }

@media (max-width: 768px) {
  .dash-showcase {
    grid-template-columns: 1fr;
  }
}

/* ============ FOOTER ============ */
.footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  position: relative;
  z-index: 1;
}

.footer-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.footer-version {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 400;
  margin-left: 0.5rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
}

.footer-links a { color: var(--text-secondary); }
.footer-links a:hover { color: var(--accent); }

.footer-copy {
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ============ REVEAL ANIMATION ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .nav-links { display: none; }

  .hero { padding: 5rem 1rem 2rem; }
  .hero-logo { max-width: 240px; height: auto; }
  .hero-title { font-size: 3rem; }

  .section { padding: 4rem 0; }

  .features-grid,
  .mcp-grid,
  .config-grid,
  .agent-grid {
    grid-template-columns: 1fr;
  }

  .arch-diagram { flex-direction: column; }
  .arch-arrow { transform: rotate(90deg); }

  .install-box { font-size: 0.8rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2.2rem; }
  .hero-tagline { font-size: 1rem; }

  .terminal-body { padding: 1rem; font-size: 0.75rem; }
}
