:root {
  --bg: #070b12;
  --bg-card: rgba(12, 20, 36, 0.72);
  --border: rgba(56, 189, 248, 0.25);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #a78bfa;
  --green: #4ade80;
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

#grid-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.55;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-chip {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.2);
  animation: chip-glow 3s ease-in-out infinite;
}

@keyframes chip-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(56, 189, 248, 0.15); }
  50% { box-shadow: 0 0 28px rgba(167, 139, 250, 0.35); }
}

.site-header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.tagline {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9rem;
}

.site-nav a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
}

.site-nav a:hover {
  color: #fff;
  text-shadow: 0 0 12px var(--accent);
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2.5rem 0;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-2);
  margin: 0 0 0.5rem;
}

.hero h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.25;
  margin: 0 0 1rem;
}

.accent {
  color: var(--accent);
}

.lead {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  backdrop-filter: blur(8px);
}

.status-pill.ok { border-color: rgba(74, 222, 128, 0.5); }
.status-pill.err { border-color: rgba(248, 113, 113, 0.5); }

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  animation: pulse 1.5s ease infinite;
}

.status-pill.ok .pulse { background: var(--green); }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.6; }
}

.hero-terminal {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(4, 8, 16, 0.9);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot.red { background: #f87171; }
.dot.yellow { background: #fbbf24; }
.dot.green { background: #4ade80; }

.terminal-title {
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.terminal-body {
  margin: 0;
  padding: 1rem 1.1rem;
  min-height: 140px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--green);
  white-space: pre-wrap;
  word-break: break-word;
}

.caret {
  display: inline-block;
  width: 8px;
  height: 1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.about {
  padding: 1.5rem 0 0.5rem;
}

.about-card {
  padding: 1.25rem 1.35rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(6px);
  font-size: 0.95rem;
}

.about-card p {
  margin: 0.5rem 0;
}

.about-card a {
  color: var(--accent);
  text-decoration: none;
}

.about-card a:hover {
  text-decoration: underline;
}

.pipeline {
  padding: 2rem 0;
}

.pipeline h3,
.cards h3,
.tools h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.pipeline-track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.node {
  flex: 1 1 140px;
  max-width: 200px;
  padding: 1.25rem 1rem;
  text-align: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.7s ease forwards;
  animation-delay: calc(var(--d, 0) * 0.15s);
}

.node[data-delay="0"] { --d: 0; }
.node[data-delay="1"] { --d: 1; }
.node[data-delay="2"] { --d: 2; }

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

.node-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.node h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.node p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.wire {
  flex: 0 1 48px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: flow 2s linear infinite;
}

@keyframes flow {
  0% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  display: block;
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, border-color 0.25s, box-shadow 0.25s;
  backdrop-filter: blur(6px);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(56, 189, 248, 0.12);
}

.card-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-2);
  margin-bottom: 0.35rem;
}

.card-url {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  word-break: break-all;
}

.card p {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.hint {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.hint a {
  color: var(--accent);
}

.tools table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.tools th,
.tools td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.tools th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent);
}

.site-footer {
  padding: 2.5rem 1.25rem 3rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #grid-canvas { display: none; }
}
