/* ── AutoscaleWorks Design System ─────────────────────────────────────── */

:root {
  --primary: #0f172a;
  --primary-light: #1e293b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --success: #10b981;
  --warning: #f59e0b;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #0f172a;
  --bg: #020617;
  --bg-card: #0f172a;
  --bg-card-hover: #1e293b;
  --border: #1e293b;
  --border-light: #334155;
  --gradient-start: #3b82f6;
  --gradient-end: #8b5cf6;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 1200px;
  --radius: 12px;
  --radius-sm: 8px;
}

/* ── Reset ────────────────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* ── Typography ───────────────────────────────────────────────────── */

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

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }

.section-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  display: block;
}

/* ── Layout ───────────────────────────────────────────────────────── */

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

section {
  padding: 6rem 0;
}

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

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

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

/* ── Navigation ───────────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(2, 6, 23, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0.2rem 0;
  transition: all 0.3s;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.nav-logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.nav-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.nav-logo-img {
  height: 88px;
  width: auto;
  border-radius: 8px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 24px rgba(59, 130, 246, 0.3));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.nav-logo-img:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 6px 32px rgba(59, 130, 246, 0.45));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

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

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

.nav-cta {
  background: var(--accent);
  color: white !important;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.nav-cta:hover {
  background: var(--accent-hover);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ── Hero ─────────────────────────────────────────────────────────── */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 5rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-glow);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 0.4rem 1rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.hero-badge .dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

.hero h1 {
  margin-bottom: 1.5rem;
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 560px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 3rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.hero-stat .number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  display: block;
}

.hero-stat .label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ── Buttons ──────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

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

.btn-outline:hover {
  background: var(--bg-card);
  border-color: var(--accent);
  color: var(--text);
}

/* ── Cards ────────────────────────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all 0.3s;
}

.card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-glow);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
}

.card h3 {
  margin-bottom: 0.75rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 4px;
  color: var(--accent);
}

/* ── Section Styles ───────────────────────────────────────────────── */

.section-header {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 4rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: 1rem;
}

/* ── Services ─────────────────────────────────────────────────────── */

.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  opacity: 0;
  transition: opacity 0.3s;
}

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

/* ── Logos / Trust ─────────────────────────────────────────────────── */

.trust-section {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.trust-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.trust-logo {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  opacity: 0.6;
  transition: opacity 0.2s;
}

.trust-logo:hover {
  opacity: 1;
}

/* ── Case Studies ─────────────────────────────────────────────────── */

.case-card {
  overflow: hidden;
}

.case-card .case-image {
  height: 200px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  opacity: 0.8;
}

.case-card .case-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* ── CTA Banner ───────────────────────────────────────────────────── */

.cta-section {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.06));
  border: 1px solid rgba(59, 130, 246, 0.1);
  border-radius: var(--radius);
  padding: 4rem;
  text-align: center;
  margin: 2rem 0;
}

.cta-section h2 {
  margin-bottom: 1rem;
}

.cta-section p {
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ── About / Team ─────────────────────────────────────────────────── */

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

.about-image {
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  opacity: 0.7;
}

.about-content h2 {
  margin-bottom: 1.5rem;
}

.about-content p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.values-list {
  list-style: none;
  margin-top: 2rem;
}

.values-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.values-list .check {
  color: var(--success);
  font-size: 1.1rem;
  margin-top: 0.1rem;
}

/* ── Contact ──────────────────────────────────────────────────────── */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

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

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.contact-item .icon {
  width: 44px;
  height: 44px;
  background: var(--accent-glow);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.contact-item h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.contact-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Footer ───────────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  margin-top: 4rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

/* ── Page Header ──────────────────────────────────────────────────── */

.page-header {
  padding: 10rem 0 4rem;
  text-align: center;
  position: relative;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(59, 130, 246, 0.06) 0%, transparent 60%);
}

.page-header h1 {
  margin-bottom: 1rem;
  position: relative;
}

.page-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

/* ── Stack Landing Page (single-viewport) ────────────────────────── */

.stack-page {
  position: relative;
  overflow: hidden;
  padding-top: 7rem;
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
}

.stack-page > .container {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ── Hero compact ────────────────────────────────────────────────── */

.stack-hero-compact {
  text-align: center;
  padding: 2rem 0 1.5rem;
}

.stack-hero-compact .hero-badge {
  margin: 0 auto 0.75rem;
}

.stack-headline {
  font-size: clamp(1.3rem, 2.8vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text);
  max-width: 700px;
  margin: 0 auto;
}

/* ── Main two-column ─────────────────────────────────────────────── */

.stack-main {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.5rem;
  align-items: start;
  padding: 1.5rem 0;
  flex: 1;
}

/* ── Stack tower (compact) ───────────────────────────────────────── */

.stack-tower {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.stack-layer {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.8);
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  transition: all 0.3s;
}

.stack-layer:hover {
  border-color: var(--accent);
  background: rgba(30, 41, 59, 0.9);
}

.stack-layer-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  width: 24px;
  height: 24px;
  min-width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border-radius: 6px;
  flex-shrink: 0;
}

.stack-layer-info h3 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0;
  color: var(--text);
  line-height: 1.3;
}

.stack-layer-info p {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.stack-connector {
  width: 2px;
  height: 10px;
  background: linear-gradient(180deg, var(--accent), rgba(59, 130, 246, 0.2));
  margin: 0 auto;
  flex-shrink: 0;
}

.stack-gap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.stack-gap-line {
  flex: 1;
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    var(--warning) 0,
    var(--warning) 8px,
    transparent 8px,
    transparent 14px
  );
  opacity: 0.8;
}

.stack-gap-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--warning);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 0.2rem 0.6rem;
  background: rgba(245, 158, 11, 0.15);
  border: 2px solid rgba(245, 158, 11, 0.4);
  border-radius: 4px;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.1);
}

/* ── Narrative (right column) ────────────────────────────────────── */

.stack-narrative p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 0.8rem;
}

.stack-subhead {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 1rem 0 0.4rem;
  line-height: 1.3;
}

.stack-subhead-accent {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Where AutoScale Fits (inline) ───────────────────────────────── */

.stack-fit {
  margin-top: 0.8rem;
}

.stack-fit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.8);
  border-radius: 0;
  margin-bottom: -1px;
  font-size: 0.8rem;
}

.stack-fit-row:first-child {
  border-radius: 8px 8px 0 0;
}

.stack-fit-row:last-child {
  border-radius: 0 0 8px 8px;
}

.stack-fit-us {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.12));
  border-color: rgba(59, 130, 246, 0.5);
  border-width: 2px;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

.stack-fit-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.stack-fit-tech {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}

.stack-fit-us .stack-fit-label,
.stack-fit-us .stack-fit-tech {
  color: var(--text);
}

.stack-fit-us .stack-fit-tech {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 0.85rem;
  font-weight: 700;
}

/* ── Bottom CTA bar ──────────────────────────────────────────────── */

.stack-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.25rem 2rem;
  margin-top: 1rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.06));
  border: 1px solid rgba(59, 130, 246, 0.12);
  border-radius: var(--radius);
}

.stack-closer {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.stack-closer strong {
  color: var(--text);
}

.stack-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.stack-actions .btn {
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
}

/* ── Footer compact ──────────────────────────────────────────────── */

.stack-footer {
  margin-top: 0;
  padding: 1.25rem 0;
}

/* ── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 968px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero-stats {
    gap: 2rem;
  }
  .stack-main {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .stack-bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .nav-logo-img {
    height: 80px;
  }
  .nav-links {
    display: none;
  }
  .nav-toggle {
    display: block;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem 2rem;
    gap: 1rem;
  }
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  .hero-stats {
    flex-direction: column;
    gap: 1.5rem;
  }
  .hero-actions {
    flex-direction: column;
  }
  .cta-section {
    padding: 2.5rem 1.5rem;
  }
  section {
    padding: 4rem 0;
  }
  .stack-main {
    grid-template-columns: 1fr;
  }
  .stack-actions {
    flex-direction: column;
  }
}
