/* Kloodi Labs — Redesign 2026 */
/* Aesthetic: Dark Engineering Lab — precise, industrial, alive */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Syne:wght@400;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
  --red: #C61D23;
  --red-dark: #8E1419;
  --red-glow: rgba(198, 29, 35, 0.15);
  --bg: #0A0E14;
  --bg-surface: #0F1520;
  --bg-raised: #141B27;
  --bg-border: #1E2A3A;
  --text-primary: #E8EDF5;
  --text-secondary: #8494A8;
  --text-muted: #4A5568;
  --white: #FFFFFF;
  --accent-line: #1E2A3A;

  --font-display: 'Syne', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-body: 'Inter', sans-serif;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
}

/* ─── Reset ──────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

/* Subtle noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  opacity: 0.4;
}

/* Grid line background */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(30, 42, 58, 0.3) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30, 42, 58, 0.3) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
img { display: block; }

/* ─── Typography ─────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; }

h1 { font-size: clamp(32px, 4vw, 52px); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(28px, 4vw, 48px); font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: clamp(20px, 2.5vw, 28px); font-weight: 600; }

.mono { font-family: var(--font-mono); }

/* ─── Container ──────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  position: relative;
  z-index: 1;
}

/* ─── Navigation ─────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(12px) saturate(1.5);
  border-bottom: 1px solid var(--bg-border);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  transition: opacity 150ms var(--ease);
}

.logo:hover { opacity: 0.8; }

.logo-claw {
  width: 28px;
  height: 28px;
  color: var(--red);
  flex-shrink: 0;
}

.logo-text { color: var(--text-primary); }
.logo-text span { color: var(--red); }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  transition: color 150ms var(--ease);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--red);
  transition: width 200ms var(--ease);
}

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

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

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 20px;
  background: var(--red);
  color: var(--white) !important;
  border-radius: 6px;
  font-family: var(--font-mono) !important;
  font-size: 13px !important;
  font-weight: 500;
  transition: background 150ms var(--ease) !important;
}

.nav-cta:hover { background: var(--red-dark) !important; }
.nav-cta::after { display: none !important; }

/* Mobile toggle */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--bg-border);
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: 6px;
  color: var(--text-primary);
}

/* ─── Hero ───────────────────────────────────────── */
.hero {
  padding: var(--space-4xl) 0 var(--space-3xl);
  position: relative;
  overflow: hidden;
}

/* Radial red glow behind hero */
.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(198, 29, 35, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--red);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

.hero-eyebrow::before,
.hero-eyebrow::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--red);
  opacity: 0.5;
}

.hero h1 {
  text-align: center;
  max-width: 820px;
  margin: 0 auto var(--space-lg);
  color: var(--text-primary);
}

.hero h1 em {
  font-style: normal;
  color: var(--red);
}

.hero-sub {
  text-align: center;
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto var(--space-2xl);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Status bar below hero */
.hero-status {
  margin-top: var(--space-3xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--bg-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3xl);
  flex-wrap: wrap;
}

.status-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.status-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.status-value span { color: var(--red); }

.status-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ─── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all 150ms var(--ease);
  cursor: pointer;
  border: none;
}

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

.btn-primary:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(198, 29, 35, 0.3);
}

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

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

/* ─── Section ────────────────────────────────────── */
section {
  padding: var(--space-4xl) 0;
  position: relative;
  z-index: 1;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.section-header {
  margin-bottom: var(--space-3xl);
}

.section-title {
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 17px;
  max-width: 560px;
  line-height: 1.7;
}

.section-header.centered {
  text-align: center;
}

.section-header.centered .section-subtitle {
  margin: 0 auto;
}

/* ─── Services Section ───────────────────────────── */
.services {
  background: var(--bg-surface);
  border-top: 1px solid var(--bg-border);
  border-bottom: 1px solid var(--bg-border);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--bg-border);
  border: 1px solid var(--bg-border);
  border-radius: 12px;
  overflow: hidden;
}

.service-card {
  background: var(--bg-surface);
  padding: var(--space-xl) var(--space-xl) var(--space-2xl);
  transition: background 200ms var(--ease);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 300ms var(--ease-out);
}

.service-card:hover {
  background: var(--bg-raised);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-icon {
  width: 40px;
  height: 40px;
  color: var(--red);
  margin-bottom: var(--space-lg);
}

.service-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
  display: block;
}

.service-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.service-card p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
}

/* ─── About Section ──────────────────────────────── */
.about {
  padding: var(--space-4xl) 0;
}

.about-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4xl);
  align-items: center;
}

.about-text p {
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.8;
  margin-bottom: var(--space-lg);
}

.about-text p:last-child { margin-bottom: 0; }

.about-panel {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: 12px;
  overflow: hidden;
}

.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--bg-border);
  font-family: var(--font-mono);
  font-size: 13px;
  transition: background 150ms var(--ease);
}

.panel-row:last-child { border-bottom: none; }
.panel-row:hover { background: var(--bg-raised); }

.panel-row .key { color: var(--text-muted); }
.panel-row .val { color: var(--text-primary); font-weight: 500; }
.panel-row .val.red { color: var(--red); }

/* ─── CTA Section ────────────────────────────────── */
.cta {
  padding: var(--space-4xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(198, 29, 35, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.cta h2 { margin-bottom: var(--space-md); }

.cta p {
  color: var(--text-secondary);
  font-size: 17px;
  margin-bottom: var(--space-2xl);
}

/* ─── Footer ─────────────────────────────────────── */
footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--bg-border);
  padding: var(--space-3xl) 0 var(--space-xl);
  position: relative;
  z-index: 1;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-3xl);
  margin-bottom: var(--space-3xl);
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: var(--space-md);
  line-height: 1.6;
  max-width: 260px;
}

.footer-section h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--space-lg);
}

.footer-section ul { list-style: none; }

.footer-section ul li { margin-bottom: var(--space-sm); }

.footer-section a {
  color: var(--text-secondary);
  font-size: 14px;
  transition: color 150ms var(--ease);
}

.footer-section a:hover { color: var(--red); }

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-lg) 0;
  border-top: 1px solid var(--bg-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-bottom p {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ─── References Page ────────────────────────────── */
.reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: var(--space-lg);
}

.reference-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: 12px;
  padding: var(--space-xl);
  transition: all 200ms var(--ease);
  position: relative;
  overflow: hidden;
}

.reference-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, var(--red), transparent);
  opacity: 0;
  transition: opacity 250ms var(--ease);
}

.reference-card:hover {
  border-color: rgba(198, 29, 35, 0.3);
  transform: translateY(-2px);
}

.reference-card:hover::after { opacity: 1; }

.reference-industry {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--red);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
}

.reference-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.reference-card > p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  border-radius: 4px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  transition: all 150ms var(--ease);
}

.reference-card:hover .tag {
  border-color: rgba(198, 29, 35, 0.25);
  color: var(--text-secondary);
}

/* ─── Contact Page ───────────────────────────────── */
.contact-layout {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--space-3xl);
  align-items: start;
}

.contact-form-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: 12px;
  padding: var(--space-2xl);
}

.contact-form-wrap h2 {
  font-size: 24px;
  margin-bottom: var(--space-xl);
  color: var(--text-primary);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px var(--space-md);
  background: var(--bg);
  border: 1px solid var(--bg-border);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-primary);
  transition: all 150ms var(--ease);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(198, 29, 35, 0.12);
}

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

.contact-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.contact-info-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: 12px;
  padding: var(--space-xl);
}

.contact-info-card h3 {
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.info-item:last-child { margin-bottom: 0; }

.info-icon {
  width: 20px;
  height: 20px;
  color: var(--red);
  flex-shrink: 0;
  margin-top: 2px;
}

.info-item h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.info-item p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.contact-meta {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: 12px;
  padding: var(--space-lg);
  font-family: var(--font-mono);
  font-size: 13px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg-border);
}

.meta-row:last-child { border-bottom: none; }
.meta-row .mk { color: var(--text-muted); }
.meta-row .mv { color: var(--text-secondary); }

/* ─── Page Hero (inner pages) ────────────────────── */
.page-hero {
  padding: var(--space-3xl) 0 var(--space-2xl);
  border-bottom: 1px solid var(--bg-border);
}

.page-hero h1 {
  font-size: clamp(32px, 4vw, 48px);
  margin-bottom: var(--space-md);
}

.page-hero p {
  color: var(--text-secondary);
  font-size: 17px;
  max-width: 520px;
  line-height: 1.7;
}

/* ─── Divider ────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--bg-border) 20%, var(--bg-border) 80%, transparent);
  margin: 0;
}

/* ─── Animations ─────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  opacity: 0;
  animation: fadeUp 0.6s var(--ease-out) forwards;
}

.animate-in:nth-child(1) { animation-delay: 0ms; }
.animate-in:nth-child(2) { animation-delay: 80ms; }
.animate-in:nth-child(3) { animation-delay: 160ms; }
.animate-in:nth-child(4) { animation-delay: 240ms; }

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 900px) {
  .services-grid { grid-template-columns: 1fr; }
  .about-layout { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .footer-content { grid-template-columns: 1fr 1fr; }
  .hero-status { gap: var(--space-2xl); }
}

@media (max-width: 768px) {
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--bg-border);
    padding: var(--space-lg);
    gap: var(--space-md);
  }

  .nav-links.active { display: flex; }
  .menu-toggle { display: flex; }
  .nav-cta { display: none; }

  section { padding: var(--space-3xl) 0; }

  .hero { padding: var(--space-3xl) 0 var(--space-2xl); }
  .hero-status { display: none; }

  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }

  .reference-grid { grid-template-columns: 1fr; }
}
