/* ==========================================================
   CRAWDAD DESIGN SYSTEM
   Authoritative center of trust. Restrained sophistication.
   Cyan-on-deep-teal. Cool palette only. No warm accents.
   ========================================================== */

/* --- PALETTE --- */
:root {
  --cd-bg: #0a1628;
  --cd-bg-deep: #060f1c;
  --cd-surface: #0e1f32;
  --cd-surface-2: #132a3e;
  --cd-surface-3: #183448;
  --cd-border: #1c3a52;
  --cd-border-subtle: #152e44;

  --cd-text: #e4ebf1;
  --cd-text-dim: #8599ae;
  --cd-text-muted: #546a7e;

  --cd-cyan: #22d3bb;
  --cd-cyan-dim: rgba(34, 211, 187, 0.08);
  --cd-cyan-border: rgba(34, 211, 187, 0.18);
  --cd-cyan-glow: 0 0 25px rgba(34, 211, 187, 0.12);

  --cd-orange: #ff6b35;
  --cd-orange-dim: rgba(255, 107, 53, 0.08);
  --cd-orange-border: rgba(255, 107, 53, 0.18);
  --cd-orange-glow: 0 0 25px rgba(255, 107, 53, 0.15);

  --cd-green: #34d399;
  --cd-red: #f87171;

  --cd-font-display: 'Archivo', system-ui, sans-serif;
  --cd-font-headline: 'Archivo', system-ui, sans-serif;
  --cd-font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --cd-font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --cd-max-width: 1200px;
  --cd-content-width: 780px;
  --cd-nav-height: 72px;
}


/* --- RESET + BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  background: var(--cd-bg);
  color: var(--cd-text);
  font-family: var(--cd-font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  color: var(--cd-cyan);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: #3ee0c8; }


/* --- DEPTH (subtle radial gradient overlay) --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 25% 0%, rgba(34, 211, 187, 0.035) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 100%, rgba(34, 211, 187, 0.02) 0%, transparent 55%);
}

/* --- FRACTAL NOISE TEXTURE --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}


/* --- TYPOGRAPHY --- */
.cd-display {
  font-family: var(--cd-font-display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--cd-text);
}

.cd-overline {
  font-family: var(--cd-font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--cd-cyan);
  display: block;
  margin-bottom: 0.75rem;
}

.cd-body {
  font-family: var(--cd-font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--cd-text-dim);
}

.cd-mono {
  font-family: var(--cd-font-mono);
}


/* --- LAYOUT --- */
.cd-container {
  max-width: var(--cd-max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.cd-section {
  padding: 8rem 0;
}

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

.cd-section-header {
  margin-bottom: 4rem;
}

.cd-narrow {
  max-width: var(--cd-content-width);
}

.cd-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.cd-screenshot-frame {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  background: #0a1019;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.1);
}
.cd-screenshot-chrome {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: #080e18;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.cd-screenshot-chrome span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.cd-screenshot-chrome span:nth-child(1) { background: #ff5f57; }
.cd-screenshot-chrome span:nth-child(2) { background: #ffbd2e; }
.cd-screenshot-chrome span:nth-child(3) { background: #28ca42; }
.cd-screenshot-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.cd-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.cd-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.cd-grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }


/* --- NAV --- */
.cd-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--cd-nav-height);
  padding: 0 2rem;
  background: rgba(10, 22, 40, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--cd-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cd-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.cd-nav-brand img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.cd-nav-brand span {
  font-family: var(--cd-font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--cd-text);
  letter-spacing: -0.01em;
}

.cd-nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

.cd-nav-links a {
  color: var(--cd-text-dim);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
  text-decoration: none;
}

.cd-nav-links a:hover {
  color: var(--cd-text);
}

.cd-nav-cta {
  margin-left: 0.8rem;
}

/* Mobile hamburger */
.cd-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 36px;
  height: 36px;
  position: relative;
}

.cd-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--cd-text-dim);
  border-radius: 1px;
  position: absolute;
  left: 8px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.cd-hamburger span:nth-child(1) { top: 10px; }
.cd-hamburger span:nth-child(2) { top: 17px; }
.cd-hamburger span:nth-child(3) { top: 24px; }

.cd-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cd-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.cd-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer */
.cd-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.cd-drawer-overlay.active { opacity: 1; pointer-events: auto; }

.cd-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  width: 300px;
  max-width: 85vw;
  background: var(--cd-surface);
  border-left: 1px solid var(--cd-border);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  overflow-y: auto;
}
.cd-drawer.active { transform: translateX(0); }

.cd-drawer-close {
  align-self: flex-end;
  background: none;
  border: none;
  color: var(--cd-text-dim);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.5rem 1.5rem;
  line-height: 1;
}

.cd-drawer a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--cd-text-dim);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}
.cd-drawer a:hover,
.cd-drawer a:focus {
  color: var(--cd-text);
  background: rgba(255, 255, 255, 0.03);
}

.cd-drawer-cta {
  margin: 1.5rem 1.5rem 0;
}


/* --- BUTTONS --- */
.cd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: var(--cd-font-body);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.cd-btn-primary {
  background: var(--cd-text);
  color: var(--cd-bg);
  font-weight: 700;
}
.cd-btn-primary:hover {
  background: #fff;
  color: #050e18;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(228, 235, 241, 0.1);
}

.cd-btn-outline {
  background: transparent;
  border: 1px solid var(--cd-border);
  color: var(--cd-text);
}
.cd-btn-outline:hover {
  border-color: var(--cd-cyan);
  color: var(--cd-cyan);
}

.cd-btn-ghost {
  background: transparent;
  border: 1px solid var(--cd-cyan-border);
  color: var(--cd-cyan);
}
.cd-btn-ghost:hover {
  background: var(--cd-cyan-dim);
  transform: translateY(-1px);
}

.cd-btn-lg {
  padding: 0.9rem 2.2rem;
  font-size: 1rem;
}

.cd-btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
}


/* --- CARDS --- */
.cd-card {
  background: var(--cd-surface);
  border: 1px solid var(--cd-border-subtle);
  border-radius: 10px;
  padding: 2rem;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.cd-card:hover {
  transform: translateY(-2px);
  border-color: var(--cd-border);
}

.cd-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--cd-text);
  margin-bottom: 0.6rem;
}

.cd-card-body {
  font-size: 0.9rem;
  color: var(--cd-text-dim);
  line-height: 1.65;
}

.cd-card-accent-top {
  border-top: 2px solid var(--cd-cyan);
}


/* --- SECTION LABELS + TITLES --- */
.cd-section-label {
  font-family: var(--cd-font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--cd-cyan);
  display: block;
  margin-bottom: 0.75rem;
}

.cd-section-title {
  font-family: var(--cd-font-display);
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--cd-text);
  margin-bottom: 1rem;
}

.cd-section-desc {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--cd-text-dim);
  max-width: 600px;
  margin-bottom: 3rem;
}


/* --- STAT DISPLAY --- */
.cd-stat {
  text-align: center;
}

.cd-stat-value {
  font-family: var(--cd-font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--cd-text);
  display: block;
  line-height: 1.2;
}

.cd-stat-value.cyan {
  color: var(--cd-cyan);
}

.cd-stat-label {
  font-size: 0.78rem;
  color: var(--cd-text-dim);
  margin-top: 0.25rem;
  display: block;
}


/* --- LIVE DOT --- */
.cd-live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cd-cyan);
  animation: cd-pulse 2s ease-in-out infinite;
}


/* --- TERMINAL --- */
.cd-terminal {
  background: #0d1117;
  border: 1px solid var(--cd-cyan-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--cd-cyan-glow);
  text-align: left;
}

.cd-terminal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--cd-border-subtle);
  background: #161b22;
}

.cd-terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.cd-terminal-dot:nth-child(1) { background: #ff5f57; }
.cd-terminal-dot:nth-child(2) { background: #ffbd2e; }
.cd-terminal-dot:nth-child(3) { background: #28ca42; }

.cd-terminal-title {
  margin-left: auto;
  font-family: var(--cd-font-mono);
  font-size: 0.72rem;
  color: var(--cd-text-muted);
}

.cd-terminal-body {
  padding: 1rem 1.2rem;
  font-family: var(--cd-font-mono);
  font-size: 0.8rem;
  line-height: 1.9;
  color: var(--cd-text-dim);
}

.cd-terminal-body .cmd { color: var(--cd-cyan); }
.cd-terminal-body .prompt { color: var(--cd-text-muted); }
.cd-terminal-body .comment { color: #3a4a5c; }


/* --- BADGE (hero badge style) --- */
.cd-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--cd-cyan-dim);
  border: 1px solid var(--cd-cyan-border);
  padding: 0.4rem 1.1rem;
  border-radius: 100px;
  font-size: 0.78rem;
  color: var(--cd-cyan);
  font-family: var(--cd-font-mono);
  font-weight: 500;
}


/* --- DIVIDER --- */
.cd-divider {
  border: none;
  border-top: 1px solid var(--cd-border-subtle);
  margin: 0;
}


/* --- FOOTER --- */
.cd-footer {
  border-top: 1px solid var(--cd-border-subtle);
  padding: 5rem 0 3rem;
  color: var(--cd-text-dim);
  font-size: 0.88rem;
}

.cd-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

.cd-footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.cd-footer-brand img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}
.cd-footer-brand span {
  font-family: var(--cd-font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--cd-text);
}

.cd-footer-tagline {
  color: var(--cd-text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
  max-width: 260px;
}

.cd-footer-col h4 {
  font-family: var(--cd-font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cd-text-dim);
  margin-bottom: 1rem;
}

.cd-footer-col a {
  display: block;
  color: var(--cd-text-muted);
  font-size: 0.85rem;
  padding: 0.25rem 0;
  transition: color 0.2s;
  text-decoration: none;
}
.cd-footer-col a:hover {
  color: var(--cd-text);
}

.cd-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--cd-border-subtle);
  font-size: 0.8rem;
  color: var(--cd-text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

.cd-footer-bottom a {
  color: var(--cd-text-muted);
  text-decoration: none;
}
.cd-footer-bottom a:hover {
  color: var(--cd-text-dim);
}

.cd-footer-legal {
  display: flex;
  gap: 1.5rem;
}


/* --- ANIMATIONS --- */
@keyframes cd-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 211, 187, 0.4); }
  50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(34, 211, 187, 0); }
}

@keyframes cd-fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

/* Stagger children */
.cd-stagger > .cd-reveal:nth-child(1) { transition-delay: 0s; }
.cd-stagger > .cd-reveal:nth-child(2) { transition-delay: 0.08s; }
.cd-stagger > .cd-reveal:nth-child(3) { transition-delay: 0.16s; }
.cd-stagger > .cd-reveal:nth-child(4) { transition-delay: 0.24s; }
.cd-stagger > .cd-reveal:nth-child(5) { transition-delay: 0.32s; }
.cd-stagger > .cd-reveal:nth-child(6) { transition-delay: 0.4s; }


/* --- RESPONSIVE --- */
@media (max-width: 960px) {
  .cd-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

/* Nav has 8 links + CTA + brand — compress spacing before it can overflow. */
@media (max-width: 1180px) {
  .cd-nav { padding: 0 1.25rem; }
  .cd-nav-links { gap: 0.9rem; }
  .cd-nav-links a { font-size: 0.8rem; }
  .cd-nav-cta { margin-left: 0.5rem; }
}

/* Below 1024px even the compressed inline nav can't fit all items without
   clipping (Threat Intel / How it works would drop off the right edge), so
   collapse to the hamburger + drawer — which carries every item. */
@media (max-width: 1024px) {
  .cd-nav-links { display: none; }
  .cd-hamburger { display: block; }
}

@media (max-width: 768px) {
  .cd-split { grid-template-columns: 1fr; gap: 2rem; }
  .cd-grid-2, .cd-grid-3 { grid-template-columns: 1fr; }
  .cd-section { padding: 5rem 0; }
  .cd-section-title { font-size: clamp(1.7rem, 5vw, 2.5rem); }

  .cd-footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .cd-footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  .cd-footer-legal {
    justify-content: center;
  }
}

/* ═══ Contact Form Modal ═══ */
.cd-contact-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,0.75);z-index:10000;align-items:center;justify-content:center;backdrop-filter:blur(6px)}
.cd-contact-overlay.active{display:flex}
.cd-contact-modal{background:var(--cd-surface);border:1px solid var(--cd-cyan-border);border-radius:16px;padding:2.5rem;max-width:480px;width:90%;position:relative;box-shadow:var(--cd-cyan-glow)}
.cd-contact-modal h3{font-size:1.4rem;font-weight:700;margin-bottom:0.5rem;color:var(--cd-text)}
.cd-contact-modal p{color:var(--cd-text-dim);font-size:0.9rem;margin-bottom:1.5rem}
.cd-contact-close{position:absolute;top:1rem;right:1rem;background:none;border:none;color:var(--cd-text-dim);font-size:1.4rem;cursor:pointer;line-height:1}
.cd-contact-close:hover{color:var(--cd-text)}
.cd-contact-modal input,.cd-contact-modal textarea{width:100%;padding:0.85rem 1rem;border-radius:6px;border:1px solid var(--cd-border);background:var(--cd-surface-2);color:var(--cd-text);font-family:var(--cd-font-body);font-size:0.95rem;outline:none;margin-bottom:1rem;resize:vertical}
.cd-contact-modal textarea{min-height:100px}
.cd-contact-modal input:focus,.cd-contact-modal textarea:focus{border-color:var(--cd-cyan)}
.cd-contact-modal input::placeholder,.cd-contact-modal textarea::placeholder{color:var(--cd-text-muted)}
.cd-contact-submit{width:100%;padding:0.9rem;border-radius:6px;border:none;background:var(--cd-text);color:var(--cd-bg);font-weight:700;font-size:1rem;cursor:pointer;font-family:var(--cd-font-body);transition:all .2s}
.cd-contact-submit:hover{opacity:0.9}
.cd-contact-submit:disabled{opacity:0.5;cursor:not-allowed}
.cd-contact-error{color:var(--cd-red);font-size:0.9rem;margin-top:0.5rem;display:none}
.cd-contact-error.show{display:block}
.cd-contact-success{text-align:center;padding:2rem 0}
.cd-contact-success h3{color:var(--cd-cyan);margin-bottom:0.5rem}
