/* ==========================================================================
   Latticore AI — Design System
   ========================================================================== */

:root {
  /* Color tokens — light "technical" theme */
  --ink-0: #06080F;
  --ink-1: #0B1220;
  --ink-2: #182238;
  --ink-3: #2A3552;
  --slate-1: #4A5878;
  --slate-2: #768099;
  --slate-3: #A8B0C2;
  --slate-4: #D1D6E0;
  --slate-5: #E5E8EE;
  --canvas: #F6F7F9;
  --canvas-2: #FFFFFF;
  --canvas-tint: #EEF1F6;

  /* Accent */
  --accent: #3B82F6;
  --accent-2: #1E5FE8;
  --accent-glow: #60A5FA;
  --accent-soft: #DBEAFE;
  --gradient-1: linear-gradient(135deg, #3B82F6 0%, #6366F1 50%, #06B6D4 100%);
  --gradient-soft: linear-gradient(135deg, #DBEAFE 0%, #E0E7FF 100%);

  /* Type scale */
  --font-display: 'Geist', 'Inter', -apple-system, sans-serif;
  --font-body: 'Geist', 'Inter', -apple-system, sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(11, 18, 32, 0.04);
  --shadow-md: 0 4px 16px rgba(11, 18, 32, 0.06), 0 1px 3px rgba(11, 18, 32, 0.04);
  --shadow-lg: 0 24px 48px -12px rgba(11, 18, 32, 0.12), 0 8px 16px -4px rgba(11, 18, 32, 0.06);
  --shadow-xl: 0 40px 80px -20px rgba(11, 18, 32, 0.18), 0 12px 24px -6px rgba(11, 18, 32, 0.08);

  /* Layout */
  --max-w: 1280px;
  --content-w: 1200px;
  --reading-w: 720px;
  --nav-h: 72px;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--canvas);
  color: var(--ink-1);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "ss02", "cv11";
  letter-spacing: -0.005em;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  padding: 0;
}

input,
textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ==========================================================================
   Lattice background — global decoration
   ========================================================================== */
.lattice-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(11, 18, 32, 0.07) 1px, transparent 0);
  background-size: 28px 28px;
  background-position: 0 0;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 80%);
}

/* ==========================================================================
   Typography
   ========================================================================== */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-2);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

.eyebrow.no-line::before {
  display: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--ink-0);
  margin: 0;
}

.h-display {
  font-size: clamp(40px, 5.6vw, 84px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.0;
}

.h-1 {
  font-size: clamp(36px, 4.4vw, 60px);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.h-2 {
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.h-3 {
  font-size: clamp(20px, 1.6vw, 24px);
  letter-spacing: -0.015em;
  line-height: 1.25;
  font-weight: 500;
}

.lede {
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.55;
  color: var(--slate-1);
  max-width: 64ch;
  letter-spacing: -0.005em;
}

p {
  color: var(--slate-1);
}

p strong {
  color: var(--ink-1);
  font-weight: 600;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}

/* Subtle gradient highlight on key words */
.highlight {
  background: var(--gradient-1);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   Layout primitives
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
}

.container-wide {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
}

.section {
  padding: var(--space-9) 0;
  position: relative;
}

.section-tight {
  padding: var(--space-8) 0;
  position: relative;
}

.divider {
  height: 1px;
  background: var(--slate-5);
  width: 100%;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 50;
  display: flex;
  align-items: center;
  background: rgba(246, 247, 249, 0.72);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 250ms ease, background 250ms ease;
}

.nav.scrolled {
  border-bottom-color: var(--slate-5);
  background: rgba(246, 247, 249, 0.88);
}

.nav-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--ink-0);
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--slate-2);
  text-transform: uppercase;
  padding: 3px 6px;
  border: 1px solid var(--slate-4);
  border-radius: 3px;
  margin-left: 4px;
}

.brand-logotext {
  height: 28px;
  width: auto;
  display: block;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  position: relative;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 450;
  color: var(--slate-1);
  border-radius: var(--radius-md);
  transition: color 180ms ease, background 180ms ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-link:hover {
  color: var(--ink-0);
  background: var(--slate-5);
}

.nav-link.active {
  color: var(--ink-0);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: var(--radius-md);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--ink-1);
  color: var(--canvas-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--ink-0);
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, var(--shadow-md);
}

.btn-primary .arrow {
  transition: transform 220ms ease;
}

.btn-primary:hover .arrow {
  transform: translateX(3px);
}

.btn-secondary {
  background: var(--canvas-2);
  color: var(--ink-1);
  border-color: var(--slate-4);
}

.btn-secondary:hover {
  border-color: var(--ink-2);
  background: var(--canvas-2);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-1);
  padding: 12px 16px;
}

.btn-ghost:hover {
  background: var(--slate-5);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-1);
  border-bottom: 1px solid var(--slate-4);
  padding-bottom: 4px;
  transition: border-color 180ms ease, color 180ms ease, gap 180ms ease;
}

.btn-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  gap: 12px;
}

.btn-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  background: var(--canvas-2);
  border: 1px solid var(--slate-5);
  border-radius: var(--radius-lg);
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--slate-4);
  box-shadow: var(--shadow-lg);
}

.card-flat {
  background: var(--canvas-2);
  border: 1px solid var(--slate-5);
  border-radius: var(--radius-lg);
}

/* ==========================================================================
   Reveal animations
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1), transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

.reveal-d1 {
  transition-delay: 60ms;
}

.reveal-d2 {
  transition-delay: 120ms;
}

.reveal-d3 {
  transition-delay: 180ms;
}

.reveal-d4 {
  transition-delay: 240ms;
}

.reveal-d5 {
  transition-delay: 300ms;
}

.reveal-d6 {
  transition-delay: 360ms;
}

/* ==========================================================================
   Page transition
   ========================================================================== */
.page {
  animation: pageIn 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: var(--ink-1);
  color: var(--slate-3);
  padding: var(--space-9) 0 var(--space-6);
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.04) 1px, transparent 0);
  background-size: 28px 28px;
  opacity: 0.7;
  pointer-events: none;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  position: relative;
}

.footer h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--slate-3);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer a {
  color: var(--slate-4);
  font-size: 14px;
  transition: color 160ms ease;
}

.footer a:hover {
  color: var(--canvas-2);
}

.footer-bottom {
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--slate-3);
  font-family: var(--font-mono);
  position: relative;
}

.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.footer-brand-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: invert(1);
  flex-shrink: 0;
}

.footer-brand-logotext {
  height: 28px;
  width: auto;
  object-fit: contain;
  filter: invert(1) brightness(2);
}

.footer-tagline {
  font-size: 14px;
  color: var(--slate-3);
  max-width: 32ch;
  line-height: 1.55;
}

/* ==========================================================================
   Misc utilities
   ========================================================================== */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.row-tight {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate-1);
  background: var(--canvas-2);
  border: 1px solid var(--slate-5);
  border-radius: 100px;
}

.tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--slate-4);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--canvas-2);
  color: var(--slate-1);
}

/* Section header */
.sect-head {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 64px;
  align-items: end;
  margin-bottom: var(--space-8);
}

.sect-head .lede {
  margin-top: 16px;
}

@media (max-width: 900px) {
  .sect-head {
    grid-template-columns: 1fr;
    gap: 24px;
  }

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

  .nav-links {
    display: none;
  }
}

/* Mobile menu hide */
@media (max-width: 720px) {

  .container,
  .container-wide {
    padding: 0 20px;
  }

  .nav-inner {
    padding: 0 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--canvas);
}

::-webkit-scrollbar-thumb {
  background: var(--slate-4);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--slate-3);
}

/* Selection */
::selection {
  background: var(--ink-1);
  color: var(--canvas);
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}