/* ==========================================================================
   Karalytica — Brand Stylesheet
   ========================================================================== */

:root {
  /* Brand palette — deep ink + electric accent */
  --ink-950: #050810;
  --ink-900: #0a0f1f;
  --ink-800: #111827;
  --ink-700: #1f2937;
  --ink-600: #374151;
  --ink-500: #6b7280;
  --ink-400: #9ca3af;
  --ink-300: #d1d5db;
  --ink-200: #e5e7eb;
  --ink-100: #f3f4f6;
  --ink-50:  #f9fafb;

  --bg:         #ffffff;
  --bg-subtle:  #fafbfc;
  --bg-muted:   #f4f6fa;

  --accent-700: #1e40af;
  --accent-600: #2563eb;
  --accent-500: #3b82f6;
  --accent-400: #60a5fa;
  --accent-glow:#06b6d4;

  --gradient-brand: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  --gradient-ink:   linear-gradient(180deg, #0a0f1f 0%, #050810 100%);

  /* Typography */
  --font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Spacing */
  --space-1:   0.25rem;
  --space-2:   0.5rem;
  --space-3:   0.75rem;
  --space-4:   1rem;
  --space-5:   1.25rem;
  --space-6:   1.5rem;
  --space-8:   2rem;
  --space-10:  2.5rem;
  --space-12:  3rem;
  --space-16:  4rem;
  --space-20:  5rem;
  --space-24:  6rem;
  --space-32:  8rem;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(10, 15, 31, 0.05);
  --shadow-sm: 0 1px 3px rgba(10, 15, 31, 0.08), 0 1px 2px rgba(10, 15, 31, 0.04);
  --shadow-md: 0 4px 12px rgba(10, 15, 31, 0.08), 0 2px 4px rgba(10, 15, 31, 0.04);
  --shadow-lg: 0 12px 32px rgba(10, 15, 31, 0.10), 0 4px 8px rgba(10, 15, 31, 0.05);
  --shadow-xl: 0 24px 48px rgba(10, 15, 31, 0.14);
  --shadow-glow: 0 0 0 3px rgba(37, 99, 235, 0.12);

  --container: 1200px;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-800);
  background: var(--bg);
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color var(--transition); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* Typography ------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink-950);
}

h1 { font-size: clamp(2.5rem, 5.5vw, 4.25rem); font-weight: 700; letter-spacing: -0.035em; }
h2 { font-size: clamp(2rem, 3.8vw, 3rem); letter-spacing: -0.025em; }
h3 { font-size: clamp(1.375rem, 2vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p { font-size: 1rem; color: var(--ink-700); }
.lead { font-size: clamp(1.125rem, 1.6vw, 1.25rem); color: var(--ink-600); line-height: 1.65; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-600);
  margin-bottom: var(--space-4);
}

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

/* Layout ---------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

section { padding: var(--space-24) 0; }
section.compact { padding: var(--space-16) 0; }

/* Navigation ------------------------------------------------------------ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.nav.scrolled {
  border-bottom-color: var(--ink-200);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink-950);
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 32px;
  height: 32px;
  display: block;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  list-style: none;
}
.nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-700);
}
.nav-links a:hover { color: var(--accent-600); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.lang-switcher {
  display: flex;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-500);
  background: var(--ink-100);
  border-radius: var(--radius-full);
  padding: 4px;
}
.lang-switcher a {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  transition: all var(--transition);
}
.lang-switcher a.active {
  background: var(--bg);
  color: var(--ink-950);
  box-shadow: var(--shadow-xs);
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
}
.menu-toggle span {
  width: 20px;
  height: 2px;
  background: var(--ink-800);
  position: relative;
}
.menu-toggle span::before,
.menu-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--ink-800);
}
.menu-toggle span::before { top: -6px; }
.menu-toggle span::after  { top: 6px; }

/* Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary {
  background: var(--ink-950);
  color: white;
}
.btn-primary:hover {
  background: var(--accent-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.btn-accent {
  background: var(--gradient-brand);
  color: white;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.32);
}
.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.42);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-800);
  border: 1px solid var(--ink-200);
}
.btn-ghost:hover {
  background: var(--ink-50);
  border-color: var(--ink-300);
}
.btn-link {
  color: var(--accent-600);
  font-weight: 600;
  font-size: 0.9375rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-link:hover { color: var(--accent-700); gap: 10px; }

/* Hero ------------------------------------------------------------------ */
.hero {
  position: relative;
  padding: calc(var(--space-32) + var(--space-8)) 0 var(--space-32);
  overflow: hidden;
  background: var(--bg);
}
.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.12), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -300px;
  left: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.10), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 880px;
  text-align: center;
  margin: 0 auto;
}
.hero h1 { margin-bottom: var(--space-6); }
.hero .lead { margin-bottom: var(--space-10); max-width: 720px; margin-left: auto; margin-right: auto; }
.hero-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-700);
  background: var(--bg);
  border: 1px solid var(--ink-200);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-xs);
}
.hero-badge .pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-glow);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.25);
}

/* Section header -------------------------------------------------------- */
.section-head {
  max-width: 720px;
  margin: 0 auto var(--space-16);
  text-align: center;
}
.section-head h2 { margin-bottom: var(--space-4); }
.section-head p { font-size: 1.125rem; color: var(--ink-600); }

/* Services grid --------------------------------------------------------- */
.services {
  background: var(--bg-subtle);
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
}
.service-card {
  background: var(--bg);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  transition: all var(--transition);
}
.service-card:hover {
  border-color: var(--accent-500);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.service-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(6, 182, 212, 0.12));
  display: grid;
  place-items: center;
  color: var(--accent-600);
  margin-bottom: var(--space-5);
  font-size: 1.5rem;
}
.service-card h3 { margin-bottom: var(--space-3); font-size: 1.25rem; }
.service-card p { color: var(--ink-600); font-size: 0.9375rem; line-height: 1.65; }

/* Product showcase (Cognita) -------------------------------------------- */
.product {
  background: var(--gradient-ink);
  color: white;
  position: relative;
  overflow: hidden;
}
.product::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1000px;
  height: 1000px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.18), transparent 50%);
  pointer-events: none;
}
.product-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}
.product-content .eyebrow { color: var(--accent-glow); }
.product-content h2 { color: white; margin-bottom: var(--space-6); }
.product-content p { color: rgba(255, 255, 255, 0.78); font-size: 1.0625rem; }
.product-features {
  list-style: none;
  margin-top: var(--space-8);
  display: grid;
  gap: var(--space-4);
}
.product-features li {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.9375rem;
}
.check-icon {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.18);
  color: var(--accent-glow);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  margin-top: 2px;
}

.product-visual {
  position: relative;
  border-radius: var(--radius-2xl);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: var(--space-6);
  backdrop-filter: blur(20px);
}
.doc-stack {
  display: grid;
  gap: var(--space-3);
}
.doc-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.86);
}
.doc-item .doc-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(37, 99, 235, 0.18);
  color: var(--accent-400);
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.doc-item .doc-meta {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.doc-tag {
  font-size: 0.6875rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.16);
  color: var(--accent-glow);
  font-weight: 500;
}
.shield-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(37, 99, 235, 0.18);
  color: var(--accent-glow);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(37, 99, 235, 0.28);
}

/* Process / How it works ------------------------------------------------ */
.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-8);
  counter-reset: step;
}
.step {
  position: relative;
  padding-top: var(--space-16);
}
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  position: absolute;
  top: 0;
  left: 0;
}
.step h3 { font-size: 1.25rem; margin-bottom: var(--space-3); }
.step p { color: var(--ink-600); font-size: 0.9375rem; }

/* Use cases ------------------------------------------------------------- */
.use-cases {
  background: var(--bg-subtle);
}
.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-5);
}
.use-card {
  background: var(--bg);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--ink-200);
}
.use-card .icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent-600);
  display: grid;
  place-items: center;
  margin-bottom: var(--space-4);
  font-size: 1.25rem;
}
.use-card h4 { font-size: 1.0625rem; margin-bottom: var(--space-2); }
.use-card p { font-size: 0.875rem; color: var(--ink-600); }

/* CTA block ------------------------------------------------------------- */
.cta {
  padding: var(--space-32) 0;
}
.cta-inner {
  background: var(--gradient-ink);
  border-radius: var(--radius-2xl);
  padding: clamp(var(--space-12), 6vw, var(--space-24));
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-inner::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.18), transparent 60%);
}
.cta-inner h2 { color: white; margin-bottom: var(--space-5); position: relative; z-index: 1; }
.cta-inner p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto var(--space-10);
  position: relative;
  z-index: 1;
}
.cta-actions { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; position: relative; z-index: 1; }

/* Contact form / page --------------------------------------------------- */
.contact-page {
  padding: calc(var(--space-32) + var(--space-8)) 0 var(--space-24);
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: start;
}
.contact-info h1 { margin-bottom: var(--space-6); }
.contact-info .lead { margin-bottom: var(--space-10); }
.contact-channels {
  display: grid;
  gap: var(--space-5);
  list-style: none;
}
.contact-channel {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  padding: var(--space-5);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
}
.contact-channel .icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  color: white;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.contact-channel h4 { font-size: 1rem; margin-bottom: 2px; }
.contact-channel a {
  color: var(--accent-600);
  font-weight: 500;
  font-size: 0.9375rem;
}
.contact-channel a:hover { color: var(--accent-700); }

.contact-form {
  background: var(--bg);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
}
.form-row { margin-bottom: var(--space-5); }
.form-row label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-700);
  margin-bottom: var(--space-2);
}
.form-row input,
.form-row textarea,
.form-row select {
  width: 100%;
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 11px 14px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--ink-900);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-row textarea { min-height: 140px; resize: vertical; }
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--accent-500);
  box-shadow: var(--shadow-glow);
}
.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.form-status {
  margin-top: var(--space-4);
  font-size: 0.875rem;
  text-align: center;
  min-height: 1.2em;
}
.form-status.success { color: var(--accent-glow); }
.form-status.error { color: #e11d48; }

/* Footer ---------------------------------------------------------------- */
.footer {
  background: var(--ink-950);
  color: rgba(255, 255, 255, 0.68);
  padding: var(--space-16) 0 var(--space-8);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}
.footer-brand .brand { color: white; margin-bottom: var(--space-4); }
.footer-brand p { color: rgba(255, 255, 255, 0.64); font-size: 0.9375rem; max-width: 320px; }
.footer h5 {
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--space-4);
  letter-spacing: 0.02em;
}
.footer ul { list-style: none; display: grid; gap: var(--space-2); }
.footer ul a {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.9375rem;
  transition: color var(--transition);
}
.footer ul a:hover { color: white; }
.footer-bottom {
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Legal page typography ------------------------------------------------- */
.legal {
  padding: calc(var(--space-32) + var(--space-8)) 0 var(--space-24);
}
.legal .container { max-width: 800px; }
.legal h1 { margin-bottom: var(--space-4); }
.legal .updated { color: var(--ink-500); font-size: 0.9375rem; margin-bottom: var(--space-12); }
.legal h2 { font-size: 1.5rem; margin: var(--space-12) 0 var(--space-4); }
.legal h3 { font-size: 1.125rem; margin: var(--space-8) 0 var(--space-3); }
.legal p, .legal li { color: var(--ink-700); margin-bottom: var(--space-4); }
.legal ul { padding-left: var(--space-6); }

/* Responsive ------------------------------------------------------------ */
@media (max-width: 960px) {
  .product-inner { grid-template-columns: 1fr; gap: var(--space-12); }
  .contact-grid { grid-template-columns: 1fr; gap: var(--space-12); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    padding: var(--space-4) var(--space-6);
    gap: var(--space-2);
    box-shadow: var(--shadow-md);
    border-top: 1px solid var(--ink-100);
  }
  .nav-links.open li { width: 100%; }
  .nav-links.open a { display: block; padding: var(--space-3) 0; }
  .menu-toggle { display: inline-flex; }
  section { padding: var(--space-20) 0; }
  .hero { padding: calc(var(--space-24) + var(--space-8)) 0 var(--space-20); }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: var(--space-3); text-align: center; }
  .nav-actions .btn-primary { display: none; }
}

/* Reveal animation ------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Utility --------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
