:root {
  color-scheme: light dark;
  --bg-start: #0f172a;
  --bg-end: #1e293b;
  --card-bg: #ffffff;
  --card-border: rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --muted: #64748b;
  --accent: #d97706;
}

@media (prefers-color-scheme: dark) {
  :root {
    --card-bg: #111827;
    --card-border: rgba(255, 255, 255, 0.08);
    --text: #e5e7eb;
    --muted: #9ca3af;
    --accent: #fbbf24;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at top, var(--bg-end), var(--bg-start));
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1.25rem 4rem;
}

header {
  text-align: center;
  margin-bottom: 2.5rem;
  color: #f8fafc;
}

header .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: #fcd34d;
  font-weight: 600;
}

header h1 {
  margin: 0.5rem 0 0;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
}

nav.back {
  width: 100%;
  max-width: 960px;
  margin-bottom: 1.5rem;
}

nav.back a {
  color: #fde68a;
  text-decoration: none;
  font-size: 0.9rem;
}

nav.back a:hover {
  text-decoration: underline;
}

.diagram-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
  padding: 2.5rem;
  max-width: 960px;
  width: 100%;
  overflow-x: auto;
}

.diagram-card .mermaid {
  display: flex;
  justify-content: center;
}

.diagram-card svg {
  max-width: 100%;
  height: auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  max-width: 960px;
  width: 100%;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.22);
}

.card-title {
  font-weight: 600;
}

.card-arrow {
  color: var(--accent);
  font-size: 1.1rem;
}

footer {
  margin-top: 3rem;
  color: #94a3b8;
  font-size: 0.8rem;
  text-align: center;
  max-width: 960px;
}

footer code {
  background: rgba(148, 163, 184, 0.15);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
