/* AgentKavach v0.2 — MONOCHROME ONLY: white, black, and grays in between.
   No hue anywhere: every hex below is #fff, #000, or a gray (r == g == b).
   Premium animations: scroll-reveal, marquee, counters, hover lift + glow,
   magnetic buttons (JS), animated FAQ. No external images. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #000;
  background: #fff;
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: #000; }
button, input { font: inherit; }
button { cursor: pointer; }
/* Kill the browser-default (blue) focus ring everywhere: focus is black only. */
button:focus, a:focus, input:focus, summary:focus { outline: none; }
:focus-visible { outline: 2px solid #000; outline-offset: 3px; }
section[id] { scroll-margin-top: 84px; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; background: #000;
  color: #fff; padding: 10px 16px; z-index: 200;
}
.skip-link:focus { left: 8px; top: 8px; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Buttons — min 44px tap targets, hover lift + white-on-black glow */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid transparent; font-weight: 600; text-decoration: none;
  white-space: nowrap;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  will-change: transform;
}
.btn-lg { min-height: 48px; padding: 12px 24px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-primary { background: #000; color: #fff; }
.btn-primary:hover {
  background: #222;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.btn-outline { background: #fff; color: #000; border-color: #000; }
.btn-outline:hover {
  background: #f5f5f5;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}
.btn-ghost { background: transparent; color: #000; }
.btn-ghost:hover { background: #f0f0f0; transform: translateY(-2px); }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid #e5e5e5;
  backdrop-filter: blur(6px);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.25rem; font-weight: 800; color: #000; text-decoration: none;
}
.logo-mark { width: 34px; height: 34px; flex: none; }
.nav-links { display: flex; gap: 20px; margin-left: auto; flex-wrap: wrap; }
.nav-links a { color: #555; text-decoration: none; font-weight: 500; padding: 10px 2px; }
.nav-links a:hover { color: #000; }
.nav-actions { display: flex; gap: 8px; }

/* Hero */
.hero {
  max-width: 1200px; margin: 0 auto; padding: 48px 20px 32px;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 32px; align-items: center;
}
.eyebrow { color: #555; font-weight: 700; letter-spacing: 0.08em; font-size: 0.85rem; margin: 0 0 12px; }
.hero h1 { font-size: 3rem; line-height: 1.1; margin: 0 0 16px; }
.hero-sub { font-size: 1.15rem; color: #444; margin: 0 0 24px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { color: #777; font-size: 0.9rem; }

/* 3D stage + CSS fallback shield (always visible underneath the canvas) */
.hero-stage {
  position: relative; min-height: 380px;
  background: radial-gradient(ellipse at center, #222 0%, #000 75%);
  border-radius: 20px; overflow: hidden;
}
#hero-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity 0.8s ease; display: block;
}
#hero-canvas.ready { opacity: 1; }
.css-shield {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
}
.css-shield-body {
  width: 170px; height: 170px;
  filter: drop-shadow(0 0 24px rgba(255, 255, 255, 0.55));
  animation: shield-float 4s ease-in-out infinite;
}
.css-shield-body svg { width: 100%; height: 100%; }
.css-orb {
  position: absolute; width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #999 70%);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.8);
}
.orb-1 { animation: orbit-1 9s linear infinite; }
.orb-2 { animation: orbit-2 11s linear infinite; }
.orb-3 { animation: orbit-3 13s linear infinite; }
@keyframes shield-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.03); }
}
@keyframes orbit-1 {
  from { transform: rotate(0deg) translateX(120px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(120px) rotate(-360deg); }
}
@keyframes orbit-2 {
  from { transform: rotate(120deg) translateX(140px) rotate(-120deg); }
  to { transform: rotate(480deg) translateX(140px) rotate(-480deg); }
}
@keyframes orbit-3 {
  from { transform: rotate(240deg) translateX(105px) rotate(-240deg); }
  to { transform: rotate(600deg) translateX(105px) rotate(-600deg); }
}
.stage-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  margin: 0; padding: 12px; text-align: center;
  color: #ddd; font-size: 0.9rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

/* Marquee strip */
.marquee {
  overflow: hidden; background: #000; color: #fff;
  padding: 14px 0; border-top: 1px solid #000; border-bottom: 1px solid #000;
}
.marquee-track {
  display: flex; width: max-content;
  animation: marquee-scroll 28s linear infinite;
  font-weight: 700; letter-spacing: 0.08em; font-size: 0.95rem; white-space: nowrap;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Stats (animated counters — true product facts only) */
.stats {
  max-width: 1200px; margin: 0 auto; padding: 48px 20px 8px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center;
}
.stat-number { font-size: 3rem; font-weight: 800; margin: 0; line-height: 1.1; }
.stat-suffix { font-size: 1.6rem; color: #555; }
.stat-label { color: #555; margin: 6px 0 0; }

/* Sections */
.section { max-width: 1200px; margin: 0 auto; padding: 56px 20px; }
.section-alt { background: #f5f5f5; border-top: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5; }
.section h2 { font-size: 2rem; margin: 0 0 8px; text-align: center; }
.section-sub { color: #555; text-align: center; margin: 0 0 32px; font-size: 1.05rem; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: #fff; border: 1px solid #e5e5e5; border-radius: 16px;
  padding: 24px; display: flex; flex-direction: column; gap: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  border-color: #999;
}
.section-alt .card { background: #fff; }
.card-icon { width: 44px; height: 44px; }
.card-icon svg { width: 100%; height: 100%; }
.card h3 { margin: 4px 0; font-size: 1.3rem; color: #000; }
.card p, .card li { color: #444; }
.card ul { margin: 4px 0 12px; padding-left: 20px; }
.card .btn { margin-top: auto; align-self: flex-start; }
.card-featured { border: 2px solid #000; position: relative; }
.featured-tag {
  position: absolute; top: -13px; left: 24px; margin: 0;
  background: #000; color: #fff; font-size: 0.75rem; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; letter-spacing: 0.05em;
}
.price { font-size: 2.5rem; font-weight: 800; color: #000; margin: 0; }
.price-note { margin: 0; color: #777; }

/* Chat demo */
.chat {
  max-width: 720px; margin: 0 auto; background: #000;
  border-radius: 16px; overflow: hidden; color: #eee;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}
.chat-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; background: #1a1a1a; font-weight: 600; color: #fff;
}
.chat-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; flex: none; }
.chat-badge { margin-left: auto; font-size: 0.7rem; letter-spacing: 0.08em; color: #aaa; }
.chat-messages { min-height: 260px; max-height: 380px; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 85%; padding: 11px 14px; border-radius: 14px; line-height: 1.45; }
.msg-user { align-self: flex-end; background: #fff; color: #000; border-bottom-right-radius: 4px; }
.msg-agent { align-self: flex-start; background: #1a1a1a; color: #eee; border-bottom-left-radius: 4px; }
.msg-typing { color: #999; font-style: italic; }
.chat-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 18px 12px; }
.chat-chips button {
  min-height: 40px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid #444; background: transparent; color: #ddd; font-size: 0.9rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.chat-chips button:hover { border-color: #fff; background: #1a1a1a; }
.chat-form { display: flex; gap: 10px; padding: 14px 18px 18px; }
.chat-tools { border-top: 1px solid #e5e5e5; padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.chat-tools-note { font-size: 13px; color: #555; margin: 0; }
.byok-row { display: flex; gap: 8px; flex-wrap: wrap; }
.byok-row input { flex: 1; min-width: 200px; padding: 10px 12px; border: 1px solid #ccc; border-radius: 8px; font-size: 14px; }
.history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.history-list[hidden] { display: none; }
.history-list button { width: 100%; text-align: left; background: #f5f5f5; border: 1px solid #e5e5e5; border-radius: 8px; padding: 10px 12px; font-size: 14px; cursor: pointer; }
.chat-form input {
  flex: 1; min-width: 0; min-height: 44px; padding: 10px 14px;
  border-radius: 10px; border: 1px solid #444; background: #1a1a1a; color: #fff;
}
.chat-form input::placeholder { color: #777; }

/* Security checks */
.checks { max-width: 760px; margin: 0 auto; padding-left: 24px; }
.checks li { margin-bottom: 14px; font-size: 1.05rem; }
.checks li::marker { color: #000; font-weight: 700; }

/* FAQ — animated open */
details {
  max-width: 760px; margin: 0 auto 12px; background: #fff;
  border: 1px solid #e5e5e5; border-radius: 12px; padding: 16px 20px;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
details:hover { border-color: #999; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1); }
summary { font-weight: 600; cursor: pointer; min-height: 28px; }
details p { color: #444; margin: 10px 0 0; }
details[open] p { animation: faq-in 0.35s ease; }
@keyframes faq-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Company */
.company { max-width: 760px; margin: 0 auto; text-align: center; }
.company h2 { font-size: 2rem; line-height: 1.25; }
.company p { color: #444; font-size: 1.05rem; }
.company-contact { font-weight: 600; }
.company-contact a { color: #000; }

/* Footer */
.footer { text-align: center; padding: 32px 20px; color: #444; background: #000; color: #ddd; }
.footer p { margin: 4px 0; }
.footer a { color: #fff; }
.footer-small { font-size: 0.85rem; color: #999; }

/* Auth modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 300; background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
/* Safety net: any nav button marked hidden must actually hide,
   even though .btn sets display:inline-flex (see refreshNav note). */
.nav-actions [hidden] { display: none !important; }
.modal {
  position: relative; width: 100%; max-width: 420px; background: #fff;
  border-radius: 16px; padding: 28px 24px; color: #000;
}
.modal-close {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px;
  border: none; background: transparent; font-size: 1.6rem; line-height: 1; color: #777;
}
.modal h2 { margin: 0 0 16px; }
.modal-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.modal-tabs button {
  flex: 1; min-height: 44px; border-radius: 10px; border: 1px solid #e5e5e5;
  background: #f5f5f5; font-weight: 600; color: #000;
}
.modal-tabs button[aria-selected="true"] { background: #000; color: #fff; border-color: #000; }
.modal label { display: block; font-weight: 600; margin: 12px 0 6px; }
.modal input {
  width: 100%; min-height: 44px; padding: 10px 14px;
  border-radius: 10px; border: 1px solid #ccc; background: #fff; color: #000;
}
.modal-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: #999; font-size: 0.85rem; }
.modal-divider::before, .modal-divider::after { content: ""; flex: 1; height: 1px; background: #e5e5e5; }
.auth-note {
  background: #f5f5f5; border: 1px solid #ccc; border-radius: 10px;
  padding: 12px 14px; color: #000; font-size: 0.95rem;
}
.modal-small { font-size: 0.85rem; color: #999; text-align: center; }

/* Tablet */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .hero h1 { font-size: 2.4rem; }
  .hero-stage { min-height: 340px; }
  .cards { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .nav-links { order: 3; width: 100%; margin-left: 0; gap: 14px; }
  .nav-actions { margin-left: auto; }
}

/* Mobile (390px) */
@media (max-width: 560px) {
  .hero { padding: 24px 16px; gap: 20px; }
  .hero h1 { font-size: 2rem; }
  .hero-sub { font-size: 1rem; }
  .hero-stage { min-height: 300px; }
  .css-shield-body { width: 130px; height: 130px; }
  .section { padding: 40px 16px; }
  .section h2 { font-size: 1.6rem; }
  .stats { padding: 32px 16px 4px; gap: 12px; }
  .stat-number { font-size: 2.2rem; }
  .nav-inner { padding: 10px 16px; gap: 10px; }
  .nav-links { gap: 10px; font-size: 0.95rem; }
  .btn { padding: 10px 14px; }
  .hero-cta .btn { flex: 1; }
  .chat-messages { min-height: 220px; }
  .msg { max-width: 92%; }
}

@media (prefers-reduced-motion: reduce) {
  .css-shield-body, .css-orb, .marquee-track { animation: none; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
