:root {
  --bg: #faf8f5;
  --bg-deep: #f0ebe3;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: rgba(255, 255, 255, 0.97);
  --line: rgba(140, 90, 40, 0.14);
  --text: #1c1410;
  --muted: #7a6358;
  --white: #ffffff;
  --espresso: #3d1f0d;
  --roast: #7c3f10;
  --caramel: #c07232;
  --cream: #f4ead8;
  --amber: #d97706;
  --shadow: 0 20px 60px rgba(90, 45, 10, 0.10);
  --shadow-sm: 0 4px 18px rgba(90, 45, 10, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 10% 8%, rgba(192, 114, 50, 0.10), transparent 28%),
    radial-gradient(circle at 90% 18%, rgba(217, 119, 6, 0.08), transparent 26%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

main {
  position: relative;
  z-index: 1;
}

/* ─── Layout ─────────────────────────────────────────────── */

.container {
  width: min(1180px, calc(100vw - 2rem));
  margin: 0 auto;
}

.slim {
  width: min(840px, calc(100vw - 2rem));
}

/* ─── Header ─────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  background: rgba(250, 248, 245, 0.88);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 16px rgba(90, 45, 10, 0.06);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(124, 63, 16, 0.18);
}

.brand-name,
h1,
h2,
h3,
.footer-title {
  font-family: "Space Grotesk", sans-serif;
}

.brand-name {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--espresso);
}

.brand-tag {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--caramel);
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--muted);
  font-weight: 500;
  transition: color 140ms ease;
}

.main-nav a:hover {
  color: var(--espresso);
}

.header-actions,
.hero-actions,
.repo-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  border-radius: 999px;
  padding: 0.72rem 1.3rem;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: linear-gradient(135deg, var(--roast), var(--caramel));
  color: var(--white);
  box-shadow: 0 8px 24px rgba(124, 63, 16, 0.30);
}

.button.primary:hover {
  box-shadow: 0 12px 32px rgba(124, 63, 16, 0.40);
}

.button.ghost {
  background: var(--white);
  border-color: var(--line);
  color: var(--espresso);
  box-shadow: var(--shadow-sm);
}

.button.ghost:hover {
  border-color: var(--caramel);
}

.button.coffee {
  background: linear-gradient(135deg, #f4e9d0, #d6c29f);
  color: #3a2a1e;
  box-shadow: 0 8px 24px rgba(214, 194, 159, 0.40);
}

.button.coffee:hover {
  box-shadow: 0 12px 30px rgba(214, 194, 159, 0.55);
}

.button.coffee img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.button.coffee.xl {
  padding: 0.9rem 1.6rem;
  font-size: 1rem;
}

/* ─── Sections ───────────────────────────────────────────── */

.hero-section,
.section-block,
.page-hero {
  padding: 5.5rem 0;
}

.section-block.muted {
  background: linear-gradient(180deg, var(--bg-deep), var(--bg));
}

.hero-grid,
.split-section {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

.split-section.reverse {
  grid-template-columns: 0.9fr 1.1fr;
}

/* ─── Typography helpers ─────────────────────────────────── */

.eyebrow,
.meta-label,
.card-kicker,
.layer-index,
.repo-label {
  font-size: 0.76rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--caramel);
  font-weight: 600;
}

.hero-copy h1,
.page-hero h1 {
  margin: 0.9rem 0 1rem;
  font-size: clamp(2.6rem, 5.5vw, 4.8rem);
  line-height: 1.00;
  color: var(--espresso);
}

.hero-lead,
.page-intro,
.section-heading h2 + p,
.footer-copy,
.feature-card p,
.layer-card p,
.callout-panel p,
.repo-card p {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
}

/* ─── Hero meta strip ────────────────────────────────────── */

.hero-meta {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

/* ─── Cards & Panels ──────────────────────────────────────── */

.hero-meta div,
.feature-card,
.info-card,
.diagram-card,
.layer-card,
.callout-panel,
.repo-card,
.mini-card,
.cta-banner {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-meta div,
.feature-card,
.info-card,
.layer-card,
.mini-card {
  border-radius: 22px;
  padding: 1.25rem;
}

.hero-meta strong,
.feature-card h3,
.info-card strong,
.layer-card h3,
.repo-card h3,
.cta-banner h2 {
  color: var(--espresso);
}

.hero-panel {
  display: grid;
  gap: 1rem;
}

.diagram-card,
.repo-card,
.callout-panel,
.cta-banner {
  border-radius: 28px;
  padding: 1.75rem;
}

/* ─── Diagram / How it works ─────────────────────────────── */

.diagram-card {
  display: grid;
  gap: 0.8rem;
}

.diagram-node,
.diagram-arrow {
  text-align: center;
  padding: 0.85rem 1rem;
  border-radius: 18px;
}

.diagram-node {
  background: var(--cream);
  color: var(--espresso);
  border: 1px solid rgba(124, 63, 16, 0.18);
  font-weight: 600;
}

.diagram-arrow {
  color: var(--caramel);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ─── Hero message card ───────────────────────────────────── */

.hero-message-card h2 {
  margin: 0.75rem 0 0;
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  line-height: 1.1;
  color: var(--espresso);
}

/* ─── Badge stack ────────────────────────────────────────── */

.hero-badge-stack,
.mini-grid,
.card-grid,
.layer-grid,
.footer-grid {
  display: grid;
  gap: 1rem;
}

.card-grid.three-up,
.footer-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card-grid.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.layer-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.section-heading {
  max-width: 760px;
  margin-bottom: 2.5rem;
}

.section-heading h2,
.cta-banner h2 {
  margin: 0.75rem 0 0;
  font-size: clamp(1.9rem, 3.8vw, 3.1rem);
  line-height: 1.08;
  color: var(--espresso);
}

.feature-card h3,
.layer-card h3,
.repo-card h3 {
  margin-top: 0;
  font-size: 1.25rem;
  color: var(--espresso);
}

/* ─── Feature icon ────────────────────────────────────────── */

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--roast), var(--caramel));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

/* ─── Layer cards ────────────────────────────────────────── */

.layer-card.warm {
  background: linear-gradient(160deg, rgba(192, 114, 50, 0.10), rgba(255, 255, 255, 0.80));
}

.layer-card.cool {
  background: linear-gradient(160deg, rgba(217, 119, 6, 0.08), rgba(255, 255, 255, 0.80));
}

.check-list,
.layer-card ul,
.prose-shell ul {
  padding-left: 1.2rem;
  color: var(--muted);
}

.check-list li,
.layer-card li,
.prose-shell li {
  margin-bottom: 0.65rem;
}

/* ─── Mini grid / stats ─────────────────────────────────── */

.mini-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1.5rem;
}

.mini-card {
  text-align: center;
}

.mini-card span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.mini-card strong {
  font-size: 1.1rem;
}

/* ─── CTA banner ─────────────────────────────────────────── */

.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: linear-gradient(135deg, var(--cream), rgba(244, 233, 208, 0.70));
}

.cta-banner h2 {
  color: var(--espresso);
}

/* ─── Prose / legal pages ────────────────────────────────── */

.page-content {
  padding-top: 1rem;
}

.prose-shell {
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}

.prose-shell h2,
.prose-shell h3 {
  color: var(--espresso);
  font-family: "Space Grotesk", sans-serif;
}

.prose-shell p,
.prose-shell li {
  color: var(--muted);
  line-height: 1.8;
}

.prose-shell a {
  color: var(--roast);
  text-decoration: underline;
}

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

.site-footer {
  padding: 3rem 0 4rem;
  border-top: 1px solid var(--line);
  margin-top: 4rem;
  background: var(--bg-deep);
}

.footer-title {
  margin: 0 0 0.8rem;
  font-size: 1rem;
  color: var(--espresso);
}

.site-footer a {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--muted);
  transition: color 130ms ease;
}

.site-footer a:hover {
  color: var(--espresso);
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-bottom p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 1080px) {
  .header-inner,
  .hero-grid,
  .split-section,
  .split-section.reverse,
  .cta-banner,
  .card-grid.three-up,
  .card-grid.two-up,
  .footer-grid,
  .footer-bottom,
  .layer-grid,
  .hero-meta,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .header-inner {
    justify-items: start;
  }

  .main-nav {
    justify-content: flex-start;
  }

  .cta-banner {
    display: grid;
  }
}

@media (max-width: 720px) {
  .hero-section,
  .section-block,
  .page-hero {
    padding: 3.5rem 0;
  }

  .prose-shell,
  .diagram-card,
  .callout-panel,
  .repo-card,
  .cta-banner {
    padding: 1.25rem;
  }

  .button,
  .button.coffee.xl {
    width: 100%;
  }
}
