/* ============================================================
   KIMERA CO. — DESIGN SYSTEM
   Merged from Antigravity DS + Black Forest Labs DS
   ============================================================ */

/* ─── CSS VARIABLES ─────────────────────────────────────────── */
:root {
  /* ── Palette ─────────────────────────────── */
  --c-black:       #000000;
  --c-black-100:   #080808;
  --c-black-200:   #111111;
  --c-black-300:   #181818;
  --c-black-400:   #222222;
  --c-white:       #FFFFFF;
  --c-white-72:    rgba(255,255,255,0.72);
  --c-white-45:    rgba(255,255,255,0.45);
  --c-white-18:    rgba(255,255,255,0.18);
  --c-white-10:    rgba(255,255,255,0.10);
  --c-white-05:    rgba(255,255,255,0.05);
  --c-white-03:    rgba(255,255,255,0.03);

  /* ── Accent ── */
  --c-accent:      #FF2020;
  --c-accent-80:   rgba(255,32,32,0.80);
  --c-accent-40:   rgba(255,32,32,0.40);
  --c-accent-20:   rgba(255,32,32,0.20);
  --c-accent-10:   rgba(255,32,32,0.10);
  --c-accent-glow: 0 0 40px rgba(255,32,32,0.25), 0 0 80px rgba(255,32,32,0.10);

  /* ── Borders ─ */
  --c-border:      rgba(255,255,255,0.10);
  --c-border-r:    rgba(255,32,32,0.20);

  /* ── Typography ─────────────────────────── */
  --font-display: 'Syne', sans-serif;
  --font-mono:    'Space Mono', monospace;

  /* ── Type Scale ─ */
  --t-hero:   clamp(3.5rem, 10vw, 8rem);
  --t-h1:     clamp(3rem, 7vw, 6rem);
  --t-h2:     clamp(2.2rem, 5vw, 4.5rem);
  --t-h3:     clamp(1.6rem, 3vw, 2.8rem);
  --t-h4:     clamp(1.2rem, 2vw, 1.75rem);
  --t-body-lg: 1.125rem;
  --t-body:    1rem;
  --t-sm:      0.875rem;
  --t-xs:      0.75rem;
  --t-label:   0.6875rem;

  /* ── Spacing ─────────────────────────────── */
  --sp-2:    2px;
  --sp-4:    4px;
  --sp-8:    8px;
  --sp-12:   12px;
  --sp-16:   16px;
  --sp-20:   20px;
  --sp-24:   24px;
  --sp-32:   32px;
  --sp-40:   40px;
  --sp-48:   48px;
  --sp-64:   64px;
  --sp-80:   80px;
  --sp-96:   96px;
  --sp-128:  128px;
  --sp-160:  160px;

  /* ── Shape ──────────────────────────────── */
  --r-sm:   4px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-xl:   20px;
  --r-pill: 999px;

  /* ── Shadows ─────────────────────────────── */
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.5);
  --shadow-md:  0 8px 32px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg:  0 24px 80px rgba(0,0,0,0.7), 0 8px 24px rgba(0,0,0,0.5);
  --shadow-xl:  0 48px 120px rgba(0,0,0,0.8);

  /* ── Blur ────────────────────────────────── */
  --blur-sm:  4px;
  --blur-md:  12px;
  --blur-lg:  24px;
  --blur-xl:  48px;

  /* ── Easing ──────────────────────────────── */
  --ease-out:    cubic-bezier(0.25, 0.10, 0.25, 1.00);
  --ease-in-out: cubic-bezier(0.45, 0.00, 0.55, 1.00);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1.00);
  --ease-expo:   cubic-bezier(0.16, 1.00, 0.30, 1.00);

  /* ── Transitions ─────────────────────────── */
  --tr-fast: 150ms var(--ease-out);
  --tr-med:  300ms var(--ease-out);
  --tr-slow: 500ms var(--ease-expo);

  /* ── Layout ──────────────────────────────── */
  --page-px:    clamp(20px, 5vw, 80px);
  --max-w:      1400px;
  --nav-h:      72px;

  /* ── Noise ───────────────────────────────── */
  --noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ─── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font-display);
  font-size: var(--t-body);
  line-height: 1.65;
  background: var(--c-black);
  color: var(--c-white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
ul, ol { list-style: none; }
input, textarea, select { font-family: inherit; }

/* ─── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 2px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-accent); border-radius: var(--r-pill); }

/* ─── TYPOGRAPHY UTILITIES ───────────────────────────────────── */
.t-hero {
  font-size: var(--t-hero);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.92;
}
.t-h1 {
  font-size: var(--t-h1);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.95;
}
.t-h2 {
  font-size: var(--t-h2);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.0;
}
.t-h3 {
  font-size: var(--t-h3);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.t-h4 {
  font-size: var(--t-h4);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.t-body-lg {
  font-size: var(--t-body-lg);
  font-weight: 400;
  line-height: 1.7;
}
.t-body {
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.65;
}
.t-label {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.t-muted   { color: var(--c-white-45); }
.t-accent  { color: var(--c-accent); }
.t-white72 { color: var(--c-white-72); }

/* ─── BUTTON SYSTEM ──────────────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  font-family: var(--font-display);
  font-size: var(--t-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 14px 28px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  overflow: hidden;
  transition: color var(--tr-med), border-color var(--tr-med), box-shadow var(--tr-med), transform var(--tr-fast), background var(--tr-med);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--tr-med);
}

/* Primary */
.btn-primary {
  background: var(--c-accent);
  color: var(--c-white);
  border-color: var(--c-accent);
}
.btn-primary::after {
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.2) 0%, transparent 70%);
}
.btn-primary:hover::after { opacity: 1; }
.btn-primary:hover {
  box-shadow: 0 0 0 1px var(--c-accent), var(--c-accent-glow);
  transform: translateY(-1px);
}
.btn-primary:active { transform: scale(0.98) translateY(0); }

/* Secondary (outline) */
.btn-secondary {
  background: transparent;
  color: var(--c-white);
  border-color: var(--c-border);
}
.btn-secondary::after { background: var(--c-white-05); }
.btn-secondary:hover::after { opacity: 1; }
.btn-secondary:hover {
  border-color: rgba(255,255,255,0.3);
  transform: translateY(-1px);
}

/* Ghost accent */
.btn-ghost {
  background: var(--c-accent-10);
  color: var(--c-accent);
  border-color: var(--c-border-r);
}
.btn-ghost:hover {
  border-color: var(--c-accent);
  box-shadow: 0 0 20px var(--c-accent-20);
  transform: translateY(-1px);
}

/* Sizes */
.btn-lg { padding: 18px 36px; font-size: var(--t-body); }
.btn-sm { padding: 8px 16px; font-size: var(--t-xs); }

/* Arrow decoration */
.btn-arrow .arrow {
  display: inline-block;
  transition: transform var(--tr-fast);
}
.btn-arrow:hover .arrow { transform: translateX(4px); }

/* ─── CARD SYSTEM ────────────────────────────────────────────── */
.card {
  position: relative;
  background: var(--c-white-03);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color var(--tr-med), box-shadow var(--tr-med), transform var(--tr-slow);
}
.card:hover {
  border-color: rgba(255,255,255,0.18);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.card-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, var(--c-accent-40), transparent 50%);
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--tr-slow);
  z-index: -1;
}
.card-glow:hover::before { opacity: 1; }

/* ─── INPUT SYSTEM ───────────────────────────────────────────── */
.input {
  width: 100%;
  background: var(--c-white-05);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  font-family: var(--font-display);
  font-size: var(--t-sm);
  color: var(--c-white);
  outline: none;
  transition: border-color var(--tr-fast), box-shadow var(--tr-fast), background var(--tr-fast);
}
.input::placeholder { color: var(--c-white-45); }
.input:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-10);
  background: var(--c-white-10);
}
.input:hover:not(:focus) { border-color: var(--c-white-18); }

/* ─── LABEL BADGE ────────────────────────────────────────────── */
.label-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-accent);
  padding: 6px 14px;
  border: 1px solid var(--c-border-r);
  border-radius: var(--r-pill);
  background: var(--c-accent-10);
}
.label-badge::before {
  content: '//';
  opacity: 0.5;
}

/* ─── DIVIDER ────────────────────────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--c-border);
}

/* ─── GRID ───────────────────────────────────────────────────── */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--sp-24);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-24);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-24);
}
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ─── NOISE OVERLAY ──────────────────────────────────────────── */
.noise-overlay {
  position: fixed;
  inset: 0;
  background-image: var(--noise);
  background-size: 125px;
  image-rendering: pixelated;
  opacity: 0.04;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 9999;
}

/* ─── FOCUS VISIBLE ──────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
}

/* ─── REDUCED MOTION ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
