:root {
  --bg: #0b0d10;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --text-subtle: #6b7280;
  --accent: #7dd3fc;
  --accent-contrast: #082f49;
  --dot: #34d399;
  --glow-1: rgba(56, 189, 248, 0.14);
  --glow-2: rgba(167, 139, 250, 0.12);
  --grid-line: rgba(255, 255, 255, 0.03);
}

html[data-theme="light"] {
  --bg: #faf9f6;
  --surface: rgba(17, 24, 39, 0.035);
  --surface-hover: rgba(17, 24, 39, 0.065);
  --border: rgba(17, 24, 39, 0.1);
  --border-strong: rgba(17, 24, 39, 0.22);
  --text: #111827;
  --text-muted: #4b5563;
  --text-subtle: #6b7280;
  --accent: #0284c7;
  --accent-contrast: #ffffff;
  --dot: #10b981;
  --glow-1: rgba(56, 189, 248, 0.16);
  --glow-2: rgba(167, 139, 250, 0.12);
  --grid-line: rgba(17, 24, 39, 0.035);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Ambient background */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, black 35%, transparent 100%);
}

.glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(110px);
}

.glow-1 {
  width: 440px;
  height: 440px;
  top: -120px;
  left: 12%;
  background: var(--glow-1);
}

.glow-2 {
  width: 380px;
  height: 380px;
  bottom: -100px;
  right: 10%;
  background: var(--glow-2);
}

/* Layout shell */
.page-shell {
  position: relative;
  z-index: 1;
  max-width: 960px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 24px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 56px;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  font-weight: 500;
}

.brand-name {
  font-size: 0.95rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(52, 211, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}

.theme-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.theme-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

.theme-btn svg {
  width: 17px;
  height: 17px;
}

html[data-theme="dark"] .icon-moon,
html[data-theme="light"] .icon-sun {
  display: none;
}

/* Hero */
.hero {
  max-width: 760px;
  animation: fadeUp 0.6s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.mono-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.divider {
  color: var(--text-subtle);
}

.headline {
  margin: 0 0 20px;
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.serif-accent {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

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

.lead {
  margin: 0 0 40px;
  max-width: 58ch;
  font-size: 1.06rem;
  color: var(--text-muted);
}

/* Preview grid */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.preview-card {
  padding: 20px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.preview-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.card-index {
  display: inline-block;
  margin-bottom: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--accent);
}

.preview-card h2 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.preview-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Footer */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-subtle);
}

.copyright {
  margin: 0;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.social-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.social-links a:hover {
  color: var(--text);
}

@media (max-width: 720px) {
  .page-shell {
    padding: 20px 18px 28px;
    gap: 40px;
  }

  .status-pill {
    display: none;
  }

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