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

:root {
  /* Palette */
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-200: #fecaca;
  --red-400: #f87171;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --red-800: #991b1b;
  --red-900: #7f1d1d;

  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;

  /* Semantic */
  --primary: #c62828;
  --primary-dark: #8e0000;
  --primary-light: #ff5f52;
  --bg: #ffffff;
  --bg-alt: var(--slate-50);
  --bg-card: #ffffff;
  --text: var(--slate-900);
  --text-secondary: var(--slate-500);
  --border: var(--slate-200);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, .07), 0 2px 4px -2px rgba(0, 0, 0, .05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .08), 0 4px 6px -4px rgba(0, 0, 0, .05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .05);

  /* Sizing */
  --nav-height: 72px;
  --container: 1200px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Animations ────────────────────────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(.16,1,.3,1), transform 0.7s cubic-bezier(.16,1,.3,1);
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}
@keyframes pulse-glow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}
@keyframes bounce-down {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
  40% { transform: translateY(8px) translateX(-50%); }
  60% { transform: translateY(4px) translateX(-50%); }
}

/* ─── Navigation ────────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
}
.navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.nav-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.3rem;
}
.logo-icon {
  color: var(--primary);
  font-size: 28px;
}
.logo-accent {
  color: var(--primary);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--slate-600);
  border-radius: 8px;
  transition: all 0.2s ease;
}
.nav-link:hover {
  color: var(--primary);
  background: var(--red-50);
}
.nav-github {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--slate-900);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  margin-left: 8px;
}
.nav-github:hover {
  background: var(--slate-700);
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--slate-700);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ─── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  overflow: hidden;
  background: linear-gradient(135deg, #fff 0%, var(--red-50) 50%, #fff 100%);
}
.hero-bg-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.07;
}
.shape-1 {
  width: 600px;
  height: 600px;
  background: var(--primary);
  top: -200px;
  right: -200px;
  animation: pulse-glow 8s ease-in-out infinite;
}
.shape-2 {
  width: 400px;
  height: 400px;
  background: var(--primary-light);
  bottom: -100px;
  left: -100px;
  animation: pulse-glow 6s ease-in-out infinite 2s;
}
.shape-3 {
  width: 200px;
  height: 200px;
  background: var(--primary);
  top: 50%;
  left: 50%;
  animation: pulse-glow 4s ease-in-out infinite 1s;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--red-50);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--red-200);
  margin-bottom: 24px;
}
.hero-badge .material-icons-round { font-size: 16px; }
.hero-title {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin-bottom: 32px;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
}
.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(198, 40, 40, 0.35);
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 20px rgba(198, 40, 40, 0.45);
  transform: translateY(-2px);
}
.btn-outline {
  background: transparent;
  color: var(--slate-700);
  border: 2px solid var(--slate-200);
}
.btn-outline:hover {
  border-color: var(--slate-400);
  background: var(--slate-50);
  transform: translateY(-2px);
}

.hero-stats {
  display: flex;
  gap: 24px;
  align-items: center;
}
.stat-item { text-align: center; }
.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-image-wrapper {
  position: relative;
  width: 100%;
  max-width: 500px;
}
.hero-image {
  width: 100%;
  height: auto;
  animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 20px 40px rgba(198, 40, 40, 0.15));
}
.hero-glow {
  position: absolute;
  width: 80%;
  height: 80%;
  top: 10%;
  left: 10%;
  background: radial-gradient(circle, rgba(198, 40, 40, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce-down 2s infinite;
  color: var(--slate-400);
}
.hero-scroll-indicator .material-icons-round { font-size: 32px; }

/* ─── Sections ──────────────────────────────────────────────────────────── */
.section {
  padding: 100px 0;
}
.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 64px;
}
.section-badge {
  display: inline-block;
  background: var(--red-50);
  color: var(--primary);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  border: 1px solid var(--red-100);
}
.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
}
.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ─── Features Grid ─────────────────────────────────────────────────────── */
.features-section {
  background: var(--bg-alt);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  border: 1px solid var(--border);
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--red-200);
}
.feature-card:hover::before {
  transform: scaleX(1);
}
.feature-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red-50);
  color: var(--primary);
  margin-bottom: 20px;
  font-size: 24px;
}
.feature-icon-wrapper .material-icons-round { font-size: 26px; }
.icon-orange { background: #fff7ed; color: #ea580c; }
.icon-green { background: #f0fdf4; color: #16a34a; }
.icon-purple { background: #faf5ff; color: #9333ea; }
.icon-teal { background: #f0fdfa; color: #0d9488; }
.icon-amber { background: #fffbeb; color: #d97706; }
.icon-indigo { background: #eef2ff; color: #4f46e5; }
.icon-slate { background: var(--slate-100); color: var(--slate-600); }
.icon-rose { background: #fff1f2; color: #e11d48; }

.feature-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.feature-description {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ─── How It Works / Timeline ───────────────────────────────────────────── */
.how-section {
  background: var(--bg);
}
.timeline {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 28px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--red-200), var(--red-100));
}
.timeline-item {
  position: relative;
  padding-left: 76px;
  margin-bottom: 48px;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-number {
  position: absolute;
  left: 12px;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  z-index: 1;
  box-shadow: 0 0 0 6px var(--bg);
}
.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  transition: all 0.3s ease;
}
.timeline-content:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--red-200);
}
.timeline-icon-bg {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--red-50);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.timeline-icon-bg .material-icons-round { font-size: 22px; }
.timeline-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.timeline-content p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ─── Tech Stack ────────────────────────────────────────────────────────── */
.tech-section {
  background: var(--bg-alt);
}
.tech-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}
.tech-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  transition: all 0.3s ease;
}
.tech-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--red-200);
}
.tech-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.tech-logo img {
  border-radius: 12px;
}
.tech-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.tech-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ─── Data Model ────────────────────────────────────────────────────────── */
.model-section {
  background: var(--bg);
}
.model-diagram {
  max-width: 800px;
  margin: 0 auto;
}
.code-block {
  background: var(--slate-900);
  color: #e2e8f0;
  padding: 24px 32px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.88rem;
  line-height: 1.8;
  margin-bottom: 32px;
  border: 1px solid var(--slate-700);
}
.code-comment {
  color: var(--slate-500);
}
.model-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.model-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
}
.model-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--red-200);
}
.model-card .material-icons-round {
  color: var(--primary);
  font-size: 28px;
  margin-bottom: 8px;
}
.model-card strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.model-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ─── Get Started ───────────────────────────────────────────────────────── */
.start-section {
  background: var(--bg-alt);
}
.start-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin-bottom: 48px;
}
.start-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
}
.start-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--red-200);
}
.start-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 28px 0;
}
.start-card-header .material-icons-round {
  color: var(--primary);
  font-size: 24px;
}
.start-card-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
}
.start-card .code-block {
  margin: 20px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  padding: 20px 24px;
}
.start-card-footer {
  padding: 0 28px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.port-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.port-badge .material-icons-round { font-size: 16px; color: var(--primary); }

.credentials-box {
  max-width: 440px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.credentials-header {
  background: var(--slate-900);
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.95rem;
}
.credentials-header .material-icons-round { font-size: 20px; color: var(--red-400); }
.credentials-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.credential {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cred-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.cred-value {
  background: var(--slate-100);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  color: var(--slate-700);
}

/* ─── Footer ────────────────────────────────────────────────────────────── */
.footer {
  background: var(--slate-950);
  color: var(--slate-400);
  padding: 64px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
}
.footer-brand .nav-logo {
  margin-bottom: 16px;
}
.footer-brand .logo-text { color: #fff; }
.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 320px;
}
.footer-links h4 {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer-links a {
  display: block;
  font-size: 0.88rem;
  color: var(--slate-400);
  padding: 4px 0;
  transition: color 0.2s ease;
}
.footer-links a:hover {
  color: var(--red-400);
}
.footer-bottom {
  border-top: 1px solid var(--slate-800);
  padding: 20px 0;
  text-align: center;
  font-size: 0.82rem;
}

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }
  .hero-content { order: 1; }
  .hero-visual { order: 0; }
  .hero-subtitle { margin: 0 auto 32px; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-image-wrapper { max-width: 380px; }

  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .tech-grid { grid-template-columns: repeat(3, 1fr); }
  .model-cards { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --nav-height: 64px; }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 16px 24px 24px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open {
    transform: translateY(0);
  }
  .nav-toggle { display: flex; }
  .nav-github { margin-left: 0; justify-content: center; }

  .hero-title { font-size: 2.5rem; }
  .section-title { font-size: 2rem; }

  .features-grid { grid-template-columns: 1fr; }
  .start-grid { grid-template-columns: 1fr; }
  .tech-grid { grid-template-columns: repeat(2, 1fr); }
  .model-cards { grid-template-columns: 1fr 1fr; }

  .timeline::before { left: 18px; }
  .timeline-item { padding-left: 56px; }
  .timeline-number { left: 2px; }
  .timeline-content { padding: 20px 24px; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }
  .footer-brand p { margin: 0 auto; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }
  .hero-stats { flex-direction: column; gap: 16px; }
  .stat-divider { width: 40px; height: 1px; }
  .tech-grid { grid-template-columns: repeat(2, 1fr); }
}
