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

:root {
  --color-bg: #ffffff;
  --color-surface: #f7f7f5;
  --color-text: #1a1a1a;
  --color-text-muted: #5c5c5c;
  --color-accent: #1d4ed8;
  --color-accent-hover: #1e40af;
  --color-accent-light: #eff6ff;
  --color-border: #e2e2df;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --max-width: 960px;
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
}

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

section {
  padding: 4rem 0;
}

section.section-alt {
  background: var(--color-surface);
}

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

/* ── Hero ─────────────────────────────────────────── */

.hero {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 5rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}

.hero-lead {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 580px;
  margin: 0 auto 0.5rem;
}

.hero-sub {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* ── Section headings ─────────────────────────────── */

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

/* ── Workflow diagram ─────────────────────────────── */

.workflow-flow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.workflow-step {
  flex: 1;
  min-width: 120px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.875rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.step-abbr {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-accent);
}

.step-name {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.3;
}

.step-verb {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  font-style: italic;
}

.workflow-arrow {
  font-size: 1.375rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
  line-height: 1;
}

/* Workflow narrative detail */

.workflow-detail {
  display: grid;
  gap: 1rem;
  margin-top: 2.5rem;
}

.workflow-detail-step {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
}

/* ── Tool cards ───────────────────────────────────── */

.tool-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1rem;
}

.tool-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.tool-header {
  margin-bottom: 0.75rem;
}

.tool-abbr {
  display: block;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1.2;
}

.tool-fullname {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.tool-desc {
  font-size: 0.9375rem;
  line-height: 1.55;
  flex: 1;
  margin-bottom: 1rem;
}

.tool-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── Buttons ──────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 0.4375rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.btn-primary {
  background: var(--color-accent);
  color: #ffffff;
  border: 1px solid var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}

.btn-secondary:hover {
  background: var(--color-accent-light);
}

/* ── CLR Prompts ──────────────────────────────────── */

.prompt-list {
  list-style: none;
  margin: 1.25rem 0;
}

.prompt-list li {
  margin-bottom: 0.5rem;
}

.prompt-list a {
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: none;
}

.prompt-list a:hover {
  text-decoration: underline;
}

.prompt-note {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* ── About ────────────────────────────────────────── */

#about p {
  max-width: 640px;
}

/* ── Footer ───────────────────────────────────────── */

footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

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

footer a:hover {
  text-decoration: underline;
}

/* ── Mobile ───────────────────────────────────────── */

@media (max-width: 600px) {
  .hero {
    padding: 3rem 0;
  }

  .hero h1 {
    font-size: 1.875rem;
  }

  section {
    padding: 2.5rem 0;
  }

  /* Stack the workflow diagram vertically */
  .workflow-flow {
    flex-direction: column;
    align-items: stretch;
    overflow-x: visible;
  }

  .workflow-step {
    min-width: unset;
  }

  /* Rotate arrows to point down */
  .workflow-arrow {
    align-self: center;
    transform: rotate(90deg);
  }

  .tool-cards {
    grid-template-columns: 1fr;
  }
}
