/* ============================================
   CIPHER CIRCUITS — Master Design System v2
   Professional Hi-Tech Engineering Aesthetic
   Inspired by: NVIDIA, Anduril, D-Wave
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- Design Tokens --- */
:root {
  /* Backgrounds — layered depth, not flat */
  --cc-bg-primary:    #0b0f19;
  --cc-bg-secondary:  #0f1421;
  --cc-bg-surface:    #141b2d;
  --cc-bg-elevated:   #1a2340;

  /* Accent — used sparingly */
  --cc-accent:        #00e5ff;
  --cc-accent-hover:  #33ebff;
  --cc-accent-subtle: rgba(0,229,255,0.08);
  --cc-accent-muted:  rgba(0,229,255,0.04);
  --cc-emerald:       #10b981;

  /* Text — clear hierarchy */
  --cc-text-primary:   #f1f5f9;
  --cc-text-secondary: #94a3b8;
  --cc-text-tertiary:  #64748b;
  --cc-text-dim:       #475569;

  /* Borders & Effects — subtle, not flashy */
  --cc-border:     rgba(255,255,255,0.06);
  --cc-border-hover: rgba(255,255,255,0.12);
  --cc-shadow-sm:  0 1px 2px rgba(0,0,0,0.3);
  --cc-shadow-md:  0 4px 16px rgba(0,0,0,0.3);
  --cc-shadow-lg:  0 8px 32px rgba(0,0,0,0.4);

  /* Layout */
  --cc-section-pad: 120px;
  --cc-container:   1200px;
  --cc-radius:      12px;
  --cc-radius-sm:   8px;
  --cc-radius-lg:   20px;

  /* Motion */
  --cc-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --cc-transition: 0.3s var(--cc-ease);
  --cc-transition-slow: 0.6s var(--cc-ease);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.7;
  color: var(--cc-text-primary);
  background-color: var(--cc-bg-primary);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--cc-accent); text-decoration: none; transition: color var(--cc-transition); }
a:hover { color: var(--cc-accent-hover); }
ul, ol { list-style: none; }

/* --- Typography (Inter only — professional, clean) --- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  color: var(--cc-text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.75rem); font-weight: 700; }
h3 { font-size: clamp(1.125rem, 2.5vw, 1.5rem); font-weight: 600; }
h4 { font-size: 1.125rem; font-weight: 600; }

p { color: var(--cc-text-secondary); margin-bottom: 1rem; font-size: 1.0625rem; line-height: 1.75; }
.text-mono { font-family: 'JetBrains Mono', monospace; font-size: 0.8125rem; }

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--cc-accent);
  margin-bottom: 1rem;
  display: block;
}

/* --- Layout --- */
.container {
  max-width: var(--cc-container);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: var(--cc-section-pad) 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 72px;
}

.section-header h2 { margin-bottom: 1.25rem; }
.section-header p { font-size: 1.125rem; color: var(--cc-text-secondary); }

/* Grid overlay background — very subtle */
.grid-bg {
  position: relative;
  background: var(--cc-bg-secondary);
}
.grid-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
}
.grid-bg > * { position: relative; z-index: 1; }

/* --- Navigation --- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;
  transition: background var(--cc-transition), padding var(--cc-transition), box-shadow var(--cc-transition);
}

.site-nav.scrolled {
  background: rgba(11,15,25,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 12px 0;
  box-shadow: 0 1px 0 var(--cc-border);
}

.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  padding: 0 40px;
}

.nav-logo {
  justify-self: start;
}

.nav-logo img {
  height: 48px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  justify-self: center;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 100px;
  padding: 10px 36px;
}

.nav-cta {
  justify-self: end;
}

.nav-links a {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--cc-text-secondary);
  letter-spacing: 0.01em;
  position: relative;
  padding: 4px 0;
  transition: color var(--cc-transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--cc-accent);
  transition: width var(--cc-transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--cc-text-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--cc-text-primary);
  transition: transform var(--cc-transition), opacity var(--cc-transition);
}

.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile overlay */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11,15,25,0.97);
  backdrop-filter: blur(20px);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.nav-overlay.open { display: flex; }

.nav-overlay a {
  font-family: 'Inter', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--cc-text-secondary);
  letter-spacing: 0.02em;
  transition: color var(--cc-transition);
}

.nav-overlay a:hover { color: var(--cc-accent); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--cc-radius-sm);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: all var(--cc-transition);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--cc-accent);
  color: var(--cc-bg-primary);
  box-shadow: 0 0 24px rgba(0,229,255,0.2);
}

.btn-primary:hover {
  background: var(--cc-accent-hover);
  color: var(--cc-bg-primary);
  box-shadow: 0 0 40px rgba(0,229,255,0.3);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--cc-text-primary);
  border: 1.5px solid rgba(255,255,255,0.2);
}

.btn-secondary:hover {
  border-color: rgba(255,255,255,0.4);
  color: var(--cc-text-primary);
  background: rgba(255,255,255,0.04);
  transform: translateY(-2px);
}

/* Subtle pulse — not aggressive */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(0,229,255,0.2); }
  50% { box-shadow: 0 0 36px rgba(0,229,255,0.3); }
}

.btn-primary.pulse { animation: glowPulse 4s ease-in-out infinite; }

/* --- Cards --- */
.glass-card {
  background: var(--cc-bg-surface);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  padding: 40px 32px;
  transition: all var(--cc-transition);
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  border-color: var(--cc-border-hover);
  box-shadow: var(--cc-shadow-lg);
  transform: translateY(-4px);
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--cc-radius-sm);
  background: var(--cc-accent-subtle);
  border: 1px solid rgba(0,229,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.card-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--cc-accent);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.glass-card h3 { margin-bottom: 12px; font-size: 1.25rem; }
.glass-card p { font-size: 0.9375rem; color: var(--cc-text-secondary); margin-bottom: 0; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 80px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(11,15,25,0.4) 0%,
    rgba(11,15,25,0.7) 50%,
    var(--cc-bg-primary) 100%
  );
}

#particle-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-content h1 {
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

.hero-content .hero-sub {
  font-size: 1.1875rem;
  color: var(--cc-text-secondary);
  line-height: 1.8;
  margin-bottom: 2.5rem;
  max-width: 640px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Typing cursor */
.type-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--cc-accent);
  margin-left: 4px;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

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

/* --- Difference / Credibility Section --- */
.diff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.diff-card {
  background: var(--cc-bg-surface);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

.diff-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cc-accent), transparent);
}

.diff-card .diff-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--cc-accent);
  margin-bottom: 16px;
}

.diff-card h3 { margin-bottom: 16px; font-size: 1.375rem; }
.diff-card p { font-size: 1rem; line-height: 1.8; }

.stat-highlight {
  font-family: 'Inter', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  color: var(--cc-accent);
  display: block;
  margin: 16px 0;
  letter-spacing: -0.03em;
}

/* --- Industries Grid --- */
.industries-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.industry-card {
  background: var(--cc-bg-surface);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  padding: 36px 28px;
  text-align: center;
  transition: all var(--cc-transition);
  cursor: default;
}

.industry-card:hover {
  border-color: var(--cc-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--cc-shadow-lg);
}

.industry-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--cc-accent-subtle);
  border: 1px solid rgba(0,229,255,0.1);
}

.industry-icon svg {
  width: 30px;
  height: 30px;
  stroke: var(--cc-accent);
  fill: none;
  stroke-width: 1.5;
}

.industry-card h4 { font-size: 1rem; margin-bottom: 8px; }
.industry-card p { font-size: 0.875rem; margin-bottom: 0; }

/* --- CTA Section --- */
.cta-section {
  text-align: center;
  background: linear-gradient(180deg, var(--cc-bg-primary), var(--cc-bg-secondary));
}

.cta-section h2 { margin-bottom: 1rem; }
.cta-section p { font-size: 1.125rem; max-width: 600px; margin: 0 auto 2rem; }

/* --- American Banner --- */
.american-banner {
  background: var(--cc-bg-surface);
  border-top: 1px solid var(--cc-border);
  border-bottom: 1px solid var(--cc-border);
  text-align: center;
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

.american-banner h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  margin-bottom: 0.75rem;
  position: relative;
}

.american-banner p {
  font-size: 1rem;
  max-width: 700px;
  margin: 0 auto;
  position: relative;
}

/* --- Footer --- */
.site-footer {
  background: var(--cc-bg-secondary);
  border-top: 1px solid var(--cc-border);
  padding: 72px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand img { height: 36px; margin-bottom: 16px; }
.footer-brand p { font-size: 0.875rem; color: var(--cc-text-tertiary); max-width: 280px; }

.footer-col h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cc-text-secondary);
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  font-size: 0.875rem;
  color: var(--cc-text-tertiary);
  padding: 4px 0;
  transition: color var(--cc-transition);
}

.footer-col a:hover { color: var(--cc-accent); }

.footer-bottom {
  border-top: 1px solid var(--cc-border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--cc-text-dim);
}

/* --- Circuit Trace Divider --- */
.circuit-divider {
  width: 100%;
  height: 40px;
  position: relative;
  overflow: hidden;
}

.circuit-divider svg { width: 100%; height: 100%; }

.circuit-divider path {
  fill: none;
  stroke: var(--cc-accent);
  stroke-width: 1;
  opacity: 0.15;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}

.circuit-divider.animated path {
  animation: drawCircuit 3s ease forwards;
}

@keyframes drawCircuit {
  to { stroke-dashoffset: 0; }
}

/* --- Scroll Reveal Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger delays for grid children */
.stagger > *:nth-child(1) { transition-delay: 0s; }
.stagger > *:nth-child(2) { transition-delay: 0.1s; }
.stagger > *:nth-child(3) { transition-delay: 0.2s; }
.stagger > *:nth-child(4) { transition-delay: 0.3s; }
.stagger > *:nth-child(5) { transition-delay: 0.4s; }
.stagger > *:nth-child(6) { transition-delay: 0.5s; }

/* --- Contact Form --- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--cc-text-secondary);
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  background: var(--cc-bg-elevated);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-sm);
  color: var(--cc-text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  transition: border-color var(--cc-transition), box-shadow var(--cc-transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--cc-accent);
  box-shadow: 0 0 0 3px rgba(0,229,255,0.08);
}

.form-group textarea { resize: vertical; min-height: 140px; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  :root { --cc-section-pad: 80px; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .diff-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 768px) {
  :root { --cc-section-pad: 56px; }

  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-cta .btn { display: none; }
  .nav-inner { grid-template-columns: 1fr auto; }

  .cards-grid,
  .industries-grid { grid-template-columns: 1fr; }

  .hero-content { text-align: center; }
  .hero-content .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }

  .glass-card { padding: 32px 24px; }
  .diff-card { padding: 32px 24px; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
}
