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

:root {
  --bg: #F8F6F1;
  --card-bg: #FFF4D6;
  --primary: #111111;
  --border: #000000;
  --red: #E63946;
  --blue: #CDE7FF;
  --green: #B7F5C3;
  --yellow: #FFE79B;
  --purple: #E7D7FF;
  --white: #FFFFFF;

  --border-width: 4px;
  --shadow: 8px 8px 0 #000;
  --shadow-hover: 12px 12px 0 #000;
  --shadow-pressed: 2px 2px 0 #000;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-xl: 40px;

  --font-sans: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--primary);
  line-height: 1.5;
  overflow-x: hidden;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg);
  opacity: 0.85;
  z-index: -1;
  pointer-events: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1rem;
}

h1 { font-size: clamp(3rem, 6vw, 5.5rem); letter-spacing: -0.05em; }
h2 { font-size: clamp(2.5rem, 5vw, 4rem); letter-spacing: -0.03em; }
h3 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h4 { font-size: clamp(1.25rem, 2vw, 1.75rem); }

p {
  font-size: clamp(1rem, 1.2vw, 1.25rem);
  margin-bottom: 1.5rem;
  font-weight: 600;
  color: var(--primary);
}

a {
  color: var(--primary);
  text-decoration: none;
}

ul {
  list-style: none;
}

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

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

/* Colors */
.bg-red { background-color: var(--red); color: white; }
.bg-blue { background-color: var(--blue); }
.bg-green { background-color: var(--green); }
.bg-yellow { background-color: var(--yellow); }
.bg-purple { background-color: var(--purple); }
.bg-white { background-color: var(--white); }
.bg-card { background-color: var(--card-bg); }

/* Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--yellow);
  color: var(--primary);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn:hover {
  box-shadow: var(--shadow-hover);
  transform: translate(-2px, -2px);
}

.btn:active {
  box-shadow: var(--shadow-pressed);
  transform: translate(6px, 6px);
}

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

.btn.primary:hover {
  background-color: #222;
}

.card {
  background-color: var(--card-bg);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translate(-2px, -2px);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border: var(--border-width) solid var(--border);
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.875rem;
  background-color: var(--purple);
  box-shadow: 4px 4px 0 #000;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */
.navbar {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 1200px;
  background-color: var(--white);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  z-index: 100;
  transition: var(--transition);
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.nav-links a {
  font-weight: 700;
  font-size: 1.125rem;
  position: relative;
}

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

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

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger-line {
  width: 24px;
  height: 4px;
  background-color: var(--primary);
  margin: 4px 0;
  transition: var(--transition);
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */
section {
  padding: 8rem 0;
  position: relative;
}

/* HERO */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 120px;
}

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

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

.hero-title {
  font-size: clamp(3.5rem, 7vw, 6.5rem);
  text-transform: uppercase;
  position: relative;
  display: inline-block;
}

.hero-title .highlight {
  background-color: var(--green);
  padding: 0 0.5rem;
  border: var(--border-width) solid var(--border);
  box-shadow: 6px 6px 0 #000;
  display: inline-block;
  transform: rotate(-2deg);
  margin-top: 0.5rem;
}

.hero-buttons {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.hero-visual {
  position: relative;
  width: 100%;
  height: 500px;
  background-color: var(--blue);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Architecture preview in hero */
.arch-preview {
  width: 80%;
  height: 80%;
  background: var(--white);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: inset 0 0 0 var(--border-width) var(--border);
  position: relative;
}

/* PROBLEM */
.problem {
  background-color: var(--primary);
  color: var(--white);
  border-top: var(--border-width) solid var(--border);
  border-bottom: var(--border-width) solid var(--border);
  padding: 10rem 0;
}

.problem p, .problem h2 {
  color: var(--white);
}

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

.problem-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.problem-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.5rem;
  font-weight: 800;
  padding: 1rem;
  background-color: #222;
  border: var(--border-width) solid var(--white);
  border-radius: var(--radius-sm);
  transform: rotate(-1deg);
  transition: var(--transition);
}

.problem-item:hover {
  transform: rotate(1deg) scale(1.02);
  background-color: var(--red);
  color: var(--white);
}

.problem-item:nth-child(even) {
  transform: rotate(1deg);
}

/* SOLUTION */
.solution-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 5rem;
}

.pipeline-diagram {
  width: 100%;
  background-color: var(--white);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow-x: auto;
}

.pipeline-node {
  background-color: var(--card-bg);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  min-width: 150px;
  text-align: center;
  font-weight: 800;
  position: relative;
  z-index: 2;
  box-shadow: 4px 4px 0 #000;
  transition: var(--transition);
  cursor: pointer;
}

.pipeline-node:hover {
  transform: translateY(-5px);
  background-color: var(--yellow);
}

.pipeline-arrow {
  flex-grow: 1;
  height: var(--border-width);
  background-color: var(--border);
  min-width: 30px;
  position: relative;
}
.pipeline-arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border-left: 10px solid var(--border);
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}

/* ARCHITECTURE DIAGRAM */
.architecture-canvas {
  width: 100%;
  min-height: 600px;
  background-color: var(--blue);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 4rem;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
}

.arch-box {
  background-color: var(--white);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: 6px 6px 0 #000;
  z-index: 10;
  position: relative;
}

.arch-box.main {
  grid-column: 1 / -1;
  background-color: var(--purple);
  text-align: center;
}

.svg-connections {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* BENTO FEATURES */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 250px;
  gap: 2rem;
}

.bento-card {
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  background-color: var(--white);
}

.bento-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translate(-4px, -4px);
}

.bento-card h3 {
  position: relative;
  z-index: 2;
  background: var(--white);
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0;
}

.bento-large { grid-column: span 2; grid-row: span 2; background-color: var(--yellow); }
.bento-wide { grid-column: span 2; background-color: var(--green); }
.bento-tall { grid-row: span 2; background-color: var(--red); }
.bento-square { background-color: var(--blue); }

.bento-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 80px;
  height: 80px;
  opacity: 0.8;
}

.bento-large .bento-icon {
  width: 150px;
  height: 150px;
  top: auto;
  bottom: -20px;
  right: -20px;
}

/* LLM ROUTER */
.llm-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.llm-visual {
  background-color: var(--white);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-xl);
  padding: 3rem;
  box-shadow: var(--shadow);
  position: relative;
}

.llm-provider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-weight: 800;
  font-size: 1.25rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.llm-provider:hover {
  transform: translateX(10px);
}

.llm-provider.groq { background-color: #FF5A5F; color: white; }
.llm-provider.gemini { background-color: #4285F4; color: white; }
.llm-provider.cerebras { background-color: #E35335; color: white; }
.llm-provider.openrouter { background-color: #000; color: white; }

.status-indicator {
  width: 16px;
  height: 16px;
  background-color: var(--green);
  border: 2px solid var(--border);
  border-radius: 50%;
  animation: blink 2s infinite;
}

/* TECH STACK */
.tech-magazine {
  column-count: 2;
  column-gap: 3rem;
}

.tech-group {
  break-inside: avoid;
  margin-bottom: 3rem;
  background-color: var(--white);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: 6px 6px 0 #000;
}

.tech-group h3 {
  border-bottom: var(--border-width) solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.tech-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tech-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.tech-icon {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  background-color: var(--bg);
}

/* PROJECT STRUCTURE */
.structure-window {
  background-color: var(--primary);
  color: var(--white);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.window-header {
  background-color: var(--white);
  color: var(--primary);
  border-bottom: var(--border-width) solid var(--border);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.window-dots {
  display: flex;
  gap: 8px;
}
.window-dot {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 50%;
}
.dot-red { background-color: var(--red); }
.dot-yellow { background-color: var(--yellow); }
.dot-green { background-color: var(--green); }

.file-tree {
  padding: 2rem;
  font-family: var(--font-mono);
  font-size: 1.125rem;
  line-height: 1.8;
}

.file-row {
  display: flex;
  align-items: center;
  transition: background 0.2s;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.file-row:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.file-icon {
  margin-right: 1rem;
}

.file-comment {
  color: #888;
  margin-left: auto;
  font-size: 0.9rem;
}

/* PERFORMANCE METRICS */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.metric-card {
  background-color: var(--white);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.metric-card:nth-child(1) { background-color: var(--yellow); }
.metric-card:nth-child(2) { background-color: var(--green); }
.metric-card:nth-child(3) { background-color: var(--blue); }
.metric-card:nth-child(4) { background-color: var(--purple); }

.metric-value {
  font-size: 4rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  letter-spacing: -2px;
}

.metric-label {
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
}

/* INSTALLATION */
.install-container {
  max-width: 900px;
  margin: 0 auto;
}

.install-step {
  margin-bottom: 3rem;
  position: relative;
  padding-left: 4rem;
}

.install-step::before {
  content: attr(data-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 48px;
  background-color: var(--red);
  color: white;
  border: var(--border-width) solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.5rem;
  box-shadow: 4px 4px 0 #000;
}

.code-block {
  background-color: var(--primary);
  color: #00FF41;
  font-family: var(--font-mono);
  padding: 1.5rem;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 1rem;
  position: relative;
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.copy-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: var(--white);
  color: var(--primary);
  border: 2px solid var(--border);
  padding: 0.25rem 0.75rem;
  font-family: var(--font-sans);
  font-weight: 800;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.copy-btn:hover {
  background-color: var(--yellow);
}

/* WORKFLOW TIMELINE */
.timeline {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 40px;
  top: 0;
  bottom: 0;
  width: var(--border-width);
  background-color: var(--border);
}

.timeline-item {
  position: relative;
  padding-left: 100px;
  margin-bottom: 3rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease-out;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-time {
  position: absolute;
  left: 0;
  top: 10px;
  background-color: var(--white);
  border: var(--border-width) solid var(--border);
  padding: 0.25rem 0.5rem;
  font-family: var(--font-mono);
  font-weight: 800;
  border-radius: var(--radius-sm);
  z-index: 2;
}

.timeline-content {
  background-color: var(--white);
  border: var(--border-width) solid var(--border);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: 6px 6px 0 #000;
}

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

.roadmap-col h3 {
  text-align: center;
  padding: 1rem;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--white);
  margin-bottom: 2rem;
  box-shadow: 4px 4px 0 #000;
}

.roadmap-col:nth-child(1) h3 { background-color: var(--green); }
.roadmap-col:nth-child(2) h3 { background-color: var(--yellow); }
.roadmap-col:nth-child(3) h3 { background-color: var(--blue); }

.roadmap-item {
  background-color: var(--white);
  border: var(--border-width) solid var(--border);
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-weight: 700;
  box-shadow: 4px 4px 0 #000;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* CTA */
.cta-section {
  background-color: var(--red);
  color: var(--white);
  text-align: center;
  padding: 10rem 0;
  border-top: var(--border-width) solid var(--border);
}

.cta-section h2, .cta-section p {
  color: var(--white);
}

.cta-box {
  background-color: var(--white);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-xl);
  padding: 5rem 2rem;
  max-width: 800px;
  margin: 0 auto;
  box-shadow: 16px 16px 0 #000;
  color: var(--primary);
  transform: rotate(-1deg);
}

.cta-box h2, .cta-box p {
  color: var(--primary);
}

/* FOOTER */
footer {
  background-color: var(--primary);
  color: var(--white);
  padding: 4rem 0 2rem;
  text-align: center;
  font-weight: 600;
}

/* ANIMATIONS */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes slideRight {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: 0; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-content {
    align-items: center;
  }
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .architecture-canvas {
    grid-template-columns: 1fr;
  }
  .tech-magazine {
    column-count: 1;
  }
  .roadmap-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 5rem;
    left: 1rem;
    right: 1rem;
    background-color: var(--white);
    flex-direction: column;
    padding: 2rem;
    border: var(--border-width) solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    transform: translateY(-150%);
    transition: transform 0.3s ease-in-out;
  }
  
  .nav-links.active {
    transform: translateY(0);
  }
  
  .hamburger {
    display: block;
  }
  
  .problem-layout, .llm-layout {
    grid-template-columns: 1fr;
  }
  
  .pipeline-diagram {
    flex-direction: column;
    gap: 1rem;
  }
  
  .pipeline-arrow {
    width: var(--border-width);
    height: 30px;
    min-height: 30px;
    min-width: 0;
  }
  .pipeline-arrow::after {
    top: auto;
    bottom: -10px;
    right: 50%;
    transform: translateX(50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--border);
    border-bottom: none;
  }
  
  .timeline::before {
    left: 20px;
  }
  .timeline-item {
    padding-left: 60px;
  }
  .timeline-time {
    top: -15px;
    left: 20px;
  }
}

@media (max-width: 480px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .bento-large, .bento-wide, .bento-tall {
    grid-column: span 1;
    grid-row: span 1;
  }
  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }
  .btn {
    width: 100%;
  }
  .file-tree {
    font-size: 0.85rem;
    overflow-x: auto;
  }
  .file-row {
    flex-wrap: wrap;
  }
}
