/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,900;1,9..40,400&display=swap');

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

:root {
  --bg: #080808;
  --surface: #131313;
  --surface-2: #1c1c1e;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(103, 58, 228, 0.4);
  --text: #fff;
  --text-dim: rgba(255, 255, 255, 0.45);
  --text-muted: rgba(255, 255, 255, 0.22);
  --accent: #673ae4;
  --accent-light: #8b5cf6;
  --accent-glow: rgba(103, 58, 228, 0.12);
  --green: #4bff91;
  --red: #ff5f57;
  --yellow: #ffbd2e;
  --font-mono: 'Menlo', 'Monaco', 'Consolas', monospace;
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 10px;
  --radius-lg: 14px;
  --max: 1120px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent-light);
  background: rgba(103, 58, 228, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ── Nav ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  height: 60px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.logo {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-light);
}

.nav-cta {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 7px 16px;
  border-radius: 8px;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.nav-cta:hover {
  border-color: var(--border-hover);
  background: var(--accent-glow);
  color: var(--text);
}

/* ── Section helpers ── */
.section-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(60px, 10vw, 110px) clamp(1.25rem, 4vw, 3rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

/* ── Hero ── */
.hero {
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 60% 55% at 15% 60%, rgba(103, 58, 228, 0.07) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 85% 20%, rgba(139, 92, 246, 0.04) 0%, transparent 65%);
}

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(80px, 13vw, 150px) clamp(1.25rem, 4vw, 3rem) clamp(60px, 10vw, 110px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.73rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 1.6rem;
}

h1 {
  font-size: clamp(2.6rem, 7.5vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.03;
  margin-bottom: 1.5rem;
  background: linear-gradient(145deg, #fff 55%, rgba(139, 92, 246, 0.75) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sub {
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  color: var(--text-dim);
  max-width: 510px;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  line-height: 1.72;
  font-weight: 400;
}

.hero-cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 11px 24px;
  border-radius: 8px;
  transition: background 0.2s, box-shadow 0.2s;
  letter-spacing: -0.01em;
}
.btn-primary:hover {
  background: var(--accent-light);
  box-shadow: 0 0 24px rgba(103, 58, 228, 0.4);
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 11px 24px;
  border-radius: 8px;
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.2); color: var(--text); }

/* ── Terminal ── */
.terminal {
  background: #0c0c0e;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: min(580px, 100%);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot.red    { background: var(--red); }
.dot.yellow { background: var(--yellow); }
.dot.green  { background: var(--green); }

.terminal-body {
  padding: 22px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.9;
  white-space: pre;
  overflow-x: auto;
}

.prompt { color: var(--text-muted); }
.cmd    { color: var(--text); }
.step   { color: var(--green); }
.dim    { color: var(--text-muted); }
.success { color: var(--accent-light); }

/* ── Features ── */
.features {
  border-bottom: 1px solid var(--border);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.875rem, 1.5vw, 1.5rem);
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  transition: border-color 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 40% 0%, rgba(103, 58, 228, 0.06) 0%, transparent 65%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.feature-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 32px rgba(103, 58, 228, 0.08), 0 1px 3px rgba(0,0,0,0.4);
}

.feature-card:hover::before { opacity: 1; }

/* ── Animated Feature Icons ── */
.feature-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 1.1rem;
  color: var(--accent-light);
  position: relative;
}

.feature-icon svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ── Keyframes ── */
@keyframes icon-float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-4px); }
}

@keyframes icon-pulse-opacity {
  0%, 100% { opacity: 0.9; }
  50%       { opacity: 0.25; }
}

@keyframes icon-rotate-cw {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes icon-rotate-ccw {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}

@keyframes icon-dash-march {
  to { stroke-dashoffset: -24; }
}

@keyframes icon-flow-dot {
  0%   { transform: translateX(-10px); opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateX(10px); opacity: 0; }
}

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

@keyframes icon-line-in {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

@keyframes icon-alert-shake {
  0%, 100% { transform: scale(1) rotate(0deg); }
  15%       { transform: scale(1.1) rotate(-3deg); }
  30%       { transform: scale(1.05) rotate(3deg); }
  45%       { transform: scale(1.08) rotate(-1deg); }
  60%       { transform: scale(1) rotate(0deg); }
}

@keyframes icon-glow-pulse {
  0%, 100% { filter: drop-shadow(0 0 0px rgba(139, 92, 246, 0)); }
  50%       { filter: drop-shadow(0 0 7px rgba(139, 92, 246, 0.65)); }
}

/* ── Cloud (multi-cloud) icon animations ── */
.cloud-body {
  animation: icon-float 3.2s ease-in-out infinite;
  transform-origin: center;
}
.cloud-node {
  animation: icon-pulse-opacity 1.6s ease-in-out infinite;
}
.cloud-node:nth-child(2) { animation-delay: 0.53s; }
.cloud-node:nth-child(3) { animation-delay: 1.07s; }

/* ── Docker (container) icon animations ── */
.docker-outer {
  stroke-dasharray: 8 4;
  animation: icon-dash-march 1.4s linear infinite;
}
.docker-inner {
  animation: icon-pulse-opacity 2s ease-in-out infinite;
}
.docker-dot {
  animation: icon-pulse-opacity 1.8s ease-in-out infinite;
}
.docker-dot:nth-child(3) { animation-delay: 0.3s; }
.docker-dot:nth-child(4) { animation-delay: 0.6s; }
.docker-dot:nth-child(5) { animation-delay: 0.9s; }

/* ── Config (lines) icon animations ── */
.config-line {
  transform-origin: left center;
  animation: icon-line-in 0.5s ease-out both;
}
.config-line:nth-child(1) { animation-delay: 0.05s; }
.config-line:nth-child(2) { animation-delay: 0.35s; }
.config-line:nth-child(3) { animation-delay: 0.65s; }
.config-line:nth-child(4) { animation-delay: 0.95s; }

/* ── Pipeline (flow dots) icon animations ── */
.pipeline-track {
  opacity: 0.2;
}
.pipeline-dot {
  animation: icon-flow-dot 2s ease-in-out infinite;
}
.pipeline-dot:nth-child(3) { animation-delay: 0.5s; }
.pipeline-dot:nth-child(4) { animation-delay: 1s; }
.pipeline-dot:nth-child(5) { animation-delay: 1.5s; }

/* ── Alert (fails loudly) icon animations ── */
.alert-group {
  animation: icon-alert-shake 3s ease-in-out infinite, icon-glow-pulse 3s ease-in-out infinite;
  transform-origin: center bottom;
}

/* ── Script (custom) icon animations ── */
.script-bracket {
  animation: icon-pulse-opacity 2.5s ease-in-out infinite;
}
.script-bracket:nth-child(2) { animation-delay: 0.8s; }
.script-line {
  stroke-dasharray: 18;
  stroke-dashoffset: 18;
  transform-origin: left center;
  animation: icon-dash-march 2.2s linear infinite;
}
.script-line:nth-child(3) { animation-delay: 0s; stroke-dashoffset: 16; }
.script-line:nth-child(4) { animation-delay: 0.4s; stroke-dashoffset: 12; }
.script-cursor {
  animation: icon-blink 0.9s step-end infinite;
}

/* ── Feature card text ── */
.feature-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.65;
}

/* ── How it works ── */
.how {
  border-bottom: 1px solid var(--border);
}

.steps {
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 5vw, 4rem);
}

.step-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: start;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-muted);
  padding-top: 5px;
  letter-spacing: 0.06em;
}

.step-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  letter-spacing: -0.02em;
}

.step-content p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  max-width: 480px;
  line-height: 1.68;
}

/* ── Code block ── */
.code-block {
  background: #0c0c0e;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.85;
  white-space: pre;
  overflow-x: auto;
  color: rgba(255,255,255,0.6);
}

/* ── Install ── */
.install {
  border-bottom: 1px solid var(--border);
}

.install-steps {
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 2.5vw, 2rem);
}

.install-label {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.code-copy-wrap {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.05);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.copy-btn:hover {
  background: var(--accent-glow);
  color: var(--accent-light);
  border-color: var(--border-hover);
}
.copy-btn.copied { color: var(--green); }

/* ── Footer ── */
footer {
  padding: clamp(2rem, 5vw, 4rem) clamp(1.25rem, 4vw, 3rem);
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ── Responsive breakpoints ── */

/* Tablet: ≤ 1024px — 2-column feature grid */
@media (max-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Small tablet / large mobile: ≤ 768px */
@media (max-width: 768px) {
  h2 {
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  }

  .hero-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-primary,
  .btn-ghost {
    width: 100%;
    text-align: center;
  }
}

/* Mobile: ≤ 600px — single column everything */
@media (max-width: 600px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .step-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .step-num { display: none; }
}

/* Large desktop: ≥ 1440px — wider max container */
@media (min-width: 1440px) {
  :root { --max: 1240px; }
}

/* XL desktop: ≥ 1800px — infrasyte's top breakpoint */
@media (min-width: 1800px) {
  :root { --max: 1400px; }
  body  { font-size: 17px; }

  nav { height: 68px; }

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