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

:root {
  --bg: #0c0a09;
  --surface: #1c1917;
  --border: #292524;
  --text: #fafaf9;
  --text-muted: #a8a29e;
  --accent: #f59e0b;
  --accent-glow: #f59e0b33;
  --code-bg: #1a1614;
  --radius: 12px;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* === Film grain overlay === */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* === Hero === */
.hero {
  width: 100%;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-cats {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.cat-emoji {
  position: absolute;
  will-change: transform;
  opacity: calc(0.12 + (1 - var(--depth)) * 0.35);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 24px;
}

.hero-badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: 100px;
  padding: 6px 18px;
  margin-bottom: 32px;
  animation: fadeUp 0.8s ease both;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  animation: fadeUp 0.8s ease 0.1s both;
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  margin-top: 20px;
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeUp 0.8s ease 0.2s both;
}

/* === Preview Grid === */
.preview {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 24px 60px;
  animation: fadeUp 0.8s ease 0.15s both;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.preview-card {
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  aspect-ratio: 1;
  transition: transform 0.35s ease, border-color 0.35s ease;
}

.preview-card:hover {
  transform: scale(1.03);
  border-color: var(--accent);
}

.preview-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* === Usage Section === */
.usage {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
  text-align: center;
}

.api-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.api-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.api-url {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(1rem, 3vw, 1.35rem);
  font-weight: 500;
  color: var(--text);
}

.api-base {
  color: var(--text-muted);
}

.api-param {
  color: var(--accent);
  position: relative;
}

.api-param::after {
  content: attr(data-label);
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.api-param--opt::before {
  content: '';
  position: absolute;
  inset: -2px -4px;
  border: 1px dashed var(--text-muted);
  border-radius: 4px;
  opacity: 0.4;
}

.api-sep {
  color: var(--text-muted);
  opacity: 0.5;
}

.api-examples {
  display: flex;
  gap: 12px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.example {
  flex: 1;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.3s ease;
}

.example:hover {
  border-color: var(--accent);
}

.example code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
}

.example span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* === Footer === */
.footer {
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* === Animations === */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Responsive === */
@media (max-width: 640px) {
  .hero {
    min-height: 80vh;
  }

  .cat-emoji {
    font-size: 60% !important;
  }

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

  .api-box {
    padding: 20px 16px;
  }

  .api-param::after {
    display: none;
  }

  .api-examples {
    flex-direction: column;
  }
}
