/* ============================================
   NextNode — Design System
   ============================================ */

:root {
  --bg-dark: #16253b;
  --bg-dark-2: #192b45;
  --bg-light: #f6f7fb;
  --bg-white: #ffffff;
  --text-dark: #16253b;
  --text-light: #f6f7fb;
  --muted: #6b7280;
  --muted-light: #7c8ba1;
  --border: #e5e7eb;
  --border-dark: #243e63;
  --accent: #2291ff;
  --accent-2: #1c5fd1;
  --logo-amber: #ffb733;
  --logo-coral: #ff4d6f;
  --logo-cyan: #40ecff;
  --gradient: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(11, 15, 25, 0.08);
  --shadow-lg: 0 20px 60px rgba(11, 15, 25, 0.35);
  --max-width: 1180px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

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

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

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

ul {
  list-style: none;
}

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

section {
  padding: 96px 0;
}

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.25rem; }

p { color: var(--muted); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(91, 107, 255, 0.08);
  border: 1px solid rgba(91, 107, 255, 0.2);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-head p {
  margin-top: 16px;
  font-size: 1.05rem;
}

/* 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.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 8px 24px rgba(91, 107, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(91, 107, 255, 0.45);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dark);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--text-dark);
}

.btn-ghost-light {
  background: transparent;
  color: var(--text-light);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-ghost-light:hover {
  border-color: rgba(255, 255, 255, 0.6);
}

.btn-block { width: 100%; }

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 27px;
  height: 34px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s ease;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ============ Hero ============ */
.hero {
  background: radial-gradient(circle at 20% 20%, rgba(34, 145, 255, 0.12), transparent 45%),
              radial-gradient(circle at 80% 0%, rgba(255, 77, 111, 0.10), transparent 45%),
              var(--bg-white);
  padding: 120px 0 80px;
  text-align: center;
}

.hero .section-head {
  max-width: 780px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 36px;
}

.page-hero {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 140px 0 72px;
  text-align: center;
  background-image: radial-gradient(circle at 15% 20%, rgba(34, 145, 255, 0.35), transparent 45%),
                     radial-gradient(circle at 85% 10%, rgba(255, 77, 111, 0.28), transparent 45%);
}

.page-hero h1 { color: #fff; }
.page-hero p { color: var(--muted-light); max-width: 640px; margin: 18px auto 0; font-size: 1.05rem; }

/* ============ Stack marquee ============ */
.stack-strip {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stack-strip .label {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-light);
  margin-bottom: 28px;
}

.badge-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.badge {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
  background: var(--bg-light);
}

/* ============ Cards / Services ============ */
.grid {
  display: grid;
  gap: 24px;
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(34, 145, 255, 0.35);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

/* Cycle the logo's three brand colors across service card icons */
.stagger .card:nth-child(3n+1) .card-icon {
  background: linear-gradient(135deg, var(--logo-amber) 0%, var(--logo-coral) 100%);
}

.stagger .card:nth-child(3n+2) .card-icon {
  background: linear-gradient(135deg, var(--logo-coral) 0%, var(--logo-cyan) 100%);
}

.stagger .card:nth-child(3n+3) .card-icon {
  background: linear-gradient(135deg, var(--logo-cyan) 0%, var(--accent) 100%);
}

.card-icon svg {
  width: 24px;
  height: 24px;
  stroke: #fff;
}

.card h3 {
  margin-bottom: 10px;
}

.card p {
  font-size: 0.95rem;
}

.card ul {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card ul li {
  font-size: 0.88rem;
  color: var(--muted);
  padding-left: 22px;
  position: relative;
}

.card ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--gradient);
}

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

/* ============ Why us ============ */
.value-item {
  display: flex;
  gap: 18px;
}

.value-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 32px;
}

/* ============ Process ============ */
.process-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  counter-reset: step;
}

.process-step {
  position: relative;
  padding: 28px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
}

.process-step .step-num {
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 12px;
  display: block;
}

.process-step h4 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.process-step p {
  font-size: 0.85rem;
}

/* ============ CTA banner ============ */
.cta-banner {
  background: var(--bg-dark);
  color: var(--text-light);
  border-radius: 24px;
  padding: 64px 48px;
  text-align: center;
  margin: 0 24px;
  background-image: radial-gradient(circle at 20% 20%, rgba(34, 145, 255, 0.35), transparent 50%),
                     radial-gradient(circle at 80% 80%, rgba(255, 183, 51, 0.22), transparent 50%);
}

.cta-banner h2 { color: #fff; margin-bottom: 14px; }
.cta-banner p { color: var(--muted-light); max-width: 520px; margin: 0 auto 32px; }
.cta-actions { display: flex; gap: 16px; justify-content: center; }

/* ============ Footer ============ */
.site-footer {
  background: var(--bg-dark);
  color: var(--muted-light);
  padding: 72px 0 32px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border-dark);
}

.footer-brand .logo { color: #fff; }
.footer-brand p {
  margin-top: 16px;
  font-size: 0.9rem;
  max-width: 280px;
  color: var(--muted-light);
}

.footer-col h4 {
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col a {
  font-size: 0.92rem;
  color: var(--muted-light);
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom .legal-links {
  display: flex;
  gap: 20px;
}

/* ============ Forms ============ */
.form-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text-dark);
  background: var(--bg-light);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

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

.form-note {
  font-size: 0.82rem;
  color: var(--muted-light);
  margin-top: 14px;
  text-align: center;
}

.form-success {
  display: none;
  text-align: center;
  padding: 40px 20px;
}

.form-success.visible { display: block; }
.form-success .check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.form-success .check svg { stroke: #fff; width: 26px; height: 26px; }

/* ============ Legal pages ============ */
.legal-content {
  max-width: 780px;
  margin: 0 auto;
}

.legal-content h2 {
  margin-top: 44px;
  margin-bottom: 16px;
  font-size: 1.4rem;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p,
.legal-content li {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.98rem;
}

.legal-content ul {
  padding-left: 20px;
  list-style: disc;
}

.legal-updated {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--muted-light);
  margin-bottom: 40px;
}

/* ============ 404 ============ */
.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.error-code {
  font-size: 6rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}

/* ============ Responsive ============ */
@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  section { padding: 64px 0; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  body.nav-open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: #fff;
    padding: 24px;
    border-bottom: 1px solid var(--border);
    gap: 20px;
  }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .cta-actions { flex-direction: column; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ============ Scroll reveal ============ */
/* Progressive enhancement: only hide content once JS confirms it can reveal it again. */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 0.8, 0.24, 1), transform 0.7s cubic-bezier(0.16, 0.8, 0.24, 1);
}

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

.js .stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .stagger.revealed > * {
  opacity: 1;
  transform: translateY(0);
}

.js .stagger.revealed > *:nth-child(1) { transition-delay: 0ms; }
.js .stagger.revealed > *:nth-child(2) { transition-delay: 80ms; }
.js .stagger.revealed > *:nth-child(3) { transition-delay: 160ms; }
.js .stagger.revealed > *:nth-child(4) { transition-delay: 240ms; }
.js .stagger.revealed > *:nth-child(5) { transition-delay: 320ms; }
.js .stagger.revealed > *:nth-child(6) { transition-delay: 400ms; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal,
  .js .stagger > * {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
