/* ============================================
   CircuitSpire — Midnight Skyline Theme
   ============================================ */

:root {
  --bg: #0a0e17;
  --bg-elevated: #0f1524;
  --bg-elevated-2: #131b2e;
  --panel-border: rgba(120, 170, 255, 0.14);
  --text: #e8edf7;
  --text-dim: #9aa7c2;
  --text-faint: #6b7690;
  --accent: #4de3ff;
  --accent-2: #3b6bff;
  --accent-grad: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --glow: rgba(77, 227, 255, 0.35);
  --success: #35d999;
  --danger: #ff6b6b;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --header-h: 76px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

section { position: relative; padding: 110px 0; }

@media (max-width: 768px) {
  section { padding: 80px 0; }
}

/* ---------- Progress bar ---------- */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent-grad);
  z-index: 1000;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 8px var(--glow);
}

/* ---------- Typography helpers ---------- */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.eyebrow.center { display: block; text-align: center; }

.section-title {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
  color: #fff;
}
.section-title.center { text-align: center; max-width: 720px; margin-left: auto; margin-right: auto; }

.section-sub {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 560px;
}
.section-sub.center { text-align: center; max-width: 620px; margin: 0 auto 60px; }

.text-gradient {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent-grad);
  color: #05131f;
  box-shadow: 0 8px 30px -6px var(--glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -8px var(--glow); }
.btn-outline {
  background: transparent;
  border-color: rgba(255,255,255,0.18);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn-block { width: 100%; }
.btn-header { margin-left: auto; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  z-index: 900;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
}
.site-header.scrolled {
  background: rgba(10, 14, 23, 0.82);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--panel-border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: #fff;
}
.logo em { font-style: normal; color: var(--accent); font-weight: 700; }
.logo-mark { width: 32px; height: 32px; flex-shrink: 0; }

.main-nav ul { display: flex; gap: 30px; }
.nav-link {
  position: relative;
  font-size: 0.95rem;
  color: var(--text-dim);
  padding: 6px 0;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0%; height: 2px;
  background: var(--accent-grad);
  transition: width 0.25s ease;
}
.nav-link:hover, .nav-link.active { color: #fff; }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px; height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -20%; left: 50%;
  width: 1100px; height: 900px;
  transform: translateX(-50%);
  background: radial-gradient(circle at center, rgba(59, 107, 255, 0.28), rgba(59,107,255,0) 65%);
  pointer-events: none;
  z-index: 0;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(120,170,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,170,255,0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, #000 40%, transparent 90%);
  pointer-events: none;
  z-index: 0;
}
.hero-grid.subtle { opacity: 0.5; mask-image: radial-gradient(ellipse 70% 100% at 50% 0%, #000 20%, transparent 85%); }

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
  padding-top: 40px;
  padding-bottom: 260px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin-bottom: 22px;
  color: #fff;
}

.hero-sub {
  color: var(--text-dim);
  font-size: 1.15rem;
  max-width: 600px;
  margin-bottom: 36px;
}

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

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 40px;
}
.hero-stats strong {
  display: block;
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-stats span { font-size: 0.85rem; color: var(--text-faint); }

@media (max-width: 760px) {
  .hero-stats { grid-template-columns: repeat(2, auto); row-gap: 24px; }
}

.skyline-wrap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 320px;
  z-index: 1;
  will-change: transform;
}
.skyline-wrap svg { width: 100%; height: 100%; }
.skyline-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10,14,23,0) 0%, rgba(10,14,23,0.5) 60%, var(--bg) 100%);
  pointer-events: none;
}

.building { fill: #101a2c; }
.window {
  fill: #ffd873;
  opacity: 0.15;
}
.window.lit {
  opacity: 0.9;
  animation: twinkle 4s ease-in-out infinite;
}
.window.blue { fill: var(--accent); }

@keyframes twinkle {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.25; }
}

.scroll-cue {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: 24px; height: 38px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 14px;
}
.scroll-cue span {
  position: absolute;
  top: 6px; left: 50%;
  width: 4px; height: 8px;
  margin-left: -2px;
  background: var(--accent);
  border-radius: 2px;
  animation: scrollcue 1.8s ease-in-out infinite;
}
@keyframes scrollcue {
  0% { opacity: 1; transform: translateY(0); }
  70% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 0; transform: translateY(12px); }
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
  margin-top: 20px;
}
@media (max-width: 600px) { .services-grid { grid-template-columns: 1fr; } }

.service-card {
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-elevated-2) 100%);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(77, 227, 255, 0.4);
  box-shadow: 0 20px 40px -16px rgba(59, 107, 255, 0.35);
}
.service-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(77,227,255,0.15), rgba(59,107,255,0.15));
  color: var(--accent);
  margin-bottom: 20px;
}
.service-icon svg { width: 26px; height: 26px; }
.service-card h3 { font-size: 1.15rem; margin-bottom: 10px; color: #fff; }
.service-card p { color: var(--text-dim); font-size: 0.95rem; }

/* ---------- Why Us ---------- */
.why-us { background: var(--bg-elevated); }
.why-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}
@media (max-width: 860px) { .why-inner { grid-template-columns: 1fr; } }

.check-list { margin: 26px 0 34px; display: flex; flex-direction: column; gap: 14px; }
.check-list li { display: flex; align-items: center; gap: 12px; color: var(--text-dim); }
.check-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(53, 217, 153, 0.15);
  color: var(--success);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.glass-panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 32px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
}
.panel-row { margin-bottom: 22px; }
.panel-row:last-child { margin-bottom: 0; }
.panel-row span { display: block; font-size: 0.85rem; color: var(--text-dim); margin-bottom: 8px; }
.bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent-grad);
  width: 0;
  transition: width 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- About ---------- */
.about-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 60px;
  align-items: center;
}
@media (max-width: 860px) { .about-inner { grid-template-columns: 1fr; } }
.about-graphic { width: 100%; max-width: 420px; margin: 0 auto; }
.about-text p { color: var(--text-dim); margin-bottom: 16px; }
.about-text p:last-child { margin-bottom: 0; }

/* ---------- Testimonials ---------- */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
@media (max-width: 900px) { .testimonial-grid { grid-template-columns: 1fr; } }
.testimonial-card {
  background: var(--bg-elevated);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 30px;
}
.testimonial-card p {
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 20px;
  line-height: 1.65;
}
.testimonial-card footer strong { display: block; color: #fff; font-size: 0.95rem; }
.testimonial-card footer span { color: var(--text-faint); font-size: 0.85rem; }

/* ---------- Contact ---------- */
.contact { background: var(--bg-elevated); }
.contact-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 60px;
  position: relative;
  z-index: 1;
}
@media (max-width: 860px) { .contact-inner { grid-template-columns: 1fr; } }

.contact-details { margin-top: 30px; display: flex; flex-direction: column; gap: 16px; }
.contact-details div { display: flex; align-items: center; gap: 12px; color: var(--text-dim); }
.contact-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(77,227,255,0.1);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.contact-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 520px) { .contact-form .form-row { grid-template-columns: 1fr; } }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.field input, .field textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77,227,255,0.15);
}
.field-error {
  display: none;
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 6px;
}
.field.invalid input, .field.invalid textarea { border-color: var(--danger); }
.field.invalid .field-error { display: block; }

.form-success {
  display: none;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(53, 217, 153, 0.12);
  color: var(--success);
  font-size: 0.9rem;
  text-align: center;
}
.form-success.show { display: block; }

.form-error {
  display: none;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 107, 107, 0.12);
  color: var(--danger);
  font-size: 0.9rem;
  text-align: center;
}
.form-error.show { display: block; }

.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* Honeypot: present in the DOM for bots, invisible and unreachable for
   real visitors (off-screen, not tab-focusable, hidden from screen readers). */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #060911;
  border-top: 1px solid var(--panel-border);
  padding: 60px 0 0;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 40px;
}
.footer-brand p { color: var(--text-faint); font-size: 0.9rem; margin-top: 10px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: var(--text-dim); font-size: 0.9rem; transition: color 0.2s ease; }
.footer-links a:hover { color: var(--accent); }
.footer-social { display: flex; gap: 14px; }
.footer-social a {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.footer-social a svg { width: 17px; height: 17px; }
.footer-social a:hover { background: var(--accent-grad); color: #05131f; transform: translateY(-3px); }

.footer-bottom {
  border-top: 1px solid var(--panel-border);
  padding: 20px 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 24px; bottom: 24px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #05131f;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px -6px var(--glow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  z-index: 500;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------- Mobile nav ---------- */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .btn-header { display: none; }
  .main-nav {
    position: fixed;
    top: var(--header-h); left: 0; right: 0;
    background: rgba(10,14,23,0.98);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--panel-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }
  .main-nav.open { max-height: 400px; }
  .main-nav ul { flex-direction: column; gap: 0; padding: 10px 24px 20px; }
  .main-nav li { border-bottom: 1px solid rgba(255,255,255,0.06); }
  .nav-link { display: block; padding: 14px 0; }
  .nav-link::after { display: none; }
}
