@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --ink: #151312;
  --ink-soft: #4a403c;
  --paper: #f6f3ee;
  --panel: #fffcf7;
  --accent: #a43820;
  --accent-soft: #d6674d;
  --line: #d8cfc3;
  --shadow: 0 16px 40px rgba(53, 32, 24, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 80% -20%, rgba(212, 115, 84, 0.24), rgba(246, 243, 238, 0)),
    radial-gradient(900px 540px at 5% 5%, rgba(204, 149, 70, 0.19), rgba(246, 243, 238, 0)),
    var(--paper);
  font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

.shell {
  max-width: 1060px;
  margin: 0 auto;
  padding: 2.2rem 1.2rem 4rem;
}

/* ── Background texture ────────────────────────────── */

.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.23;
  z-index: -1;
  background-image: linear-gradient(transparent 95%, rgba(53, 32, 24, 0.08) 96%),
    linear-gradient(90deg, transparent 95%, rgba(53, 32, 24, 0.08) 96%);
  background-size: 34px 34px;
}

/* ── Sticky header / topbar ───────────────────────── */

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1060px;
  margin: 0 auto 2.2rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 252, 247, 0.76);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 12px rgba(53, 32, 24, 0.07);
}

.brand {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}

.topnav {
  display: flex;
  gap: 0.95rem;
  font-size: 0.95rem;
}

.topnav a {
  text-decoration: none;
  color: var(--ink-soft);
}

.topnav a:hover {
  color: var(--ink);
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.topbar-actions a,
.topbar-actions a:visited,
.topbar-actions a:active {
  color: var(--ink-soft);
  text-decoration: none;
}

.topbar-actions a:hover,
.topbar-actions a:focus-visible {
  color: var(--ink);
  text-decoration: none;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
  line-height: 1;
}

.topbar-link-icon {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}

.topbar-sep {
  color: #8c817a;
  font-size: 0.84rem;
  line-height: 1;
  user-select: none;
}

/* ── Hamburger toggle ─────────────────────────────── */

.topnav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}

.topnav-toggle-bars,
.topnav-toggle-bars::before,
.topnav-toggle-bars::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.topnav-toggle-bars {
  position: relative;
}

.topnav-toggle-bars::before,
.topnav-toggle-bars::after {
  content: '';
  position: absolute;
  left: 0;
}

.topnav-toggle-bars::before {
  top: -6px;
}

.topnav-toggle-bars::after {
  top: 6px;
}

.nav-open .topnav-toggle-bars {
  background: transparent;
}

.nav-open .topnav-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-open .topnav-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.hero {
  border: 1px solid var(--line);
  background: linear-gradient(170deg, rgba(255, 252, 247, 0.98), rgba(255, 246, 234, 0.92));
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: clamp(1.4rem, 5vw, 3rem);
  animation: rise 0.7s ease-out both;
}

.hero h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(2rem, 8vw, 3.5rem);
  line-height: 1.04;
  margin: 0 0 0.8rem;
}

.hero p {
  max-width: 56ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2.8vw, 1.14rem);
}

.hero .cta {
  display: inline-block;
  margin-top: 1.4rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 0.58rem 1rem;
  font-weight: 600;
  text-decoration: none;
}

.hero .cta:hover {
  background: #902f1b;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 1.2rem;
}

.card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  padding: 1rem;
}

.card h2,
.card h3 {
  margin: 0 0 0.55rem;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.16rem;
}

.card p {
  margin: 0;
  color: var(--ink-soft);
}

.metric-row {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-top: 1.2rem;
}

.metric {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.8rem;
}

.metric .label {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.metric .value {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.5rem;
  line-height: 1.1;
}

.eyebrow {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.74rem;
  color: var(--accent);
  font-weight: 600;
}

.content {
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.86);
  border-radius: 16px;
  padding: clamp(1rem, 3.5vw, 2rem);
  box-shadow: var(--shadow);
}

.content h1,
.content h2,
.content h3 {
  font-family: 'Fraunces', Georgia, serif;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.content th {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  background: var(--paper);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.content td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  color: var(--ink-soft);
}

/* ── Details / Summary ────────────────────────────── */

.content details {
  border: 1px solid var(--line);
  background: #fff;
  margin-bottom: 10px;
  border-radius: 8px;
}

.content summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 600;
  list-style: none;
}

.content summary::-webkit-details-marker {
  display: none;
}

.content summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.2s ease;
}

.content details[open] summary::before {
  transform: rotate(90deg);
}

.content details[open] summary {
  border-bottom: 1px solid var(--line);
}

.content details > :not(summary) {
  padding: 0 12px;
}

.content code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9em;
}

.summary-banner {
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  background: #fff;
  border-radius: 12px;
  padding: 0.95rem 1rem;
  margin-bottom: 1rem;
}

.summary-banner h2 {
  margin: 0 0 0.35rem;
  font-size: 1.24rem;
}

.summary-banner p {
  margin: 0;
  color: var(--ink-soft);
}

.chart {
  display: grid;
  gap: 0.72rem;
  margin: 0.95rem 0 1.25rem;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) 2.3fr auto;
  gap: 0.7rem;
  align-items: center;
}

.chart-label {
  font-size: 0.92rem;
  line-height: 1.25;
}

.chart-detail {
  display: block;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.chart-track {
  width: 100%;
  height: 0.7rem;
  border-radius: 999px;
  background: #ece4d8;
  overflow: hidden;
  border: 1px solid #d7cec2;
}

.chart-fill {
  display: block;
  height: 100%;
}

.chart-fill.is-good {
  background: linear-gradient(90deg, #2d7e5e, #4aa873);
}

.chart-fill.is-mid {
  background: linear-gradient(90deg, #b88723, #d3a648);
}

.chart-fill.is-low {
  background: linear-gradient(90deg, #b14833, #d86345);
}

.chart-fill.is-na {
  background: repeating-linear-gradient(
    -45deg,
    #b9afa3,
    #b9afa3 6px,
    #d0c7bc 6px,
    #d0c7bc 12px
  );
}

.chart-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.88rem;
}

.footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.88rem;
  text-align: center;
}

.footer p {
  margin: 0.3rem 0;
}

.footer strong {
  color: var(--ink);
}

.dev-credit {
  font-size: 0.82rem;
  margin-top: 0.6rem;
}

/* ── Scroll anchor offset ───────────────────────── */

[id] {
  scroll-margin-top: 80px;
}

/* ── Section heading ────────────────────────────── */

.section-heading {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.4rem, 4vw, 2rem);
  margin: 0 0 0.6rem;
}

/* ── Copy button ────────────────────────────────── */

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.copy-label {
  pointer-events: none;
}

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

.hero-copy {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}

.install-copy {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(0.88rem, 2.4vw, 1rem);
  background: var(--ink);
  color: #f0ebe4;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
}

.install-hint {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 0.3rem 0 0;
}

.hero-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}

.cta-ghost {
  background: transparent;
  color: var(--accent);
}

.cta-ghost:hover {
  background: rgba(164, 56, 32, 0.08);
}

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

.badge-stack {
  margin-top: 1rem;
}

.badge-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.trust-badge img {
  height: 22px;
  vertical-align: middle;
}

/* ── Tool gallery ───────────────────────────────── */

.tool-count {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
}

.tool-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tool-list code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  background: rgba(164, 56, 32, 0.07);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* ── Install cards ──────────────────────────────── */

.install-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.install-pre-wrap {
  position: relative;
}

.install-pre-wrap pre {
  background: var(--ink);
  color: #f0ebe4;
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0.5rem 0 0;
}

.install-pre-wrap .copy-btn {
  position: absolute;
  top: 0.7rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #d0c7bc;
}

.install-pre-wrap .copy-btn:hover {
  border-color: var(--accent-soft);
  color: #fff;
}

/* ── Section spacing ────────────────────────────── */

.hero ~ .reveal,
.hero ~ .callout {
  margin-top: 1.5rem;
}

/* ── Callout section ────────────────────────────── */

.callout {
  border-radius: 16px;
  padding: clamp(1.4rem, 5vw, 2.5rem);
  margin-top: 1.2rem;
  background: linear-gradient(135deg, rgba(164, 56, 32, 0.08), rgba(204, 149, 70, 0.1));
  border: 1px solid var(--line);
  text-align: center;
}

.callout h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  margin: 0 0 0.5rem;
}

.callout p {
  color: var(--ink-soft);
  margin: 0 0 1rem;
}

.callout .hero-actions {
  justify-content: center;
}

/* ── Reveal animations ────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive: mobile nav + table overflow ──────── */

@media (max-width: 640px) {
  .topnav-toggle {
    display: block;
  }

  .topbar {
    flex-wrap: wrap;
    top: 8px;
    margin-left: 0.6rem;
    margin-right: 0.6rem;
  }

  .topnav {
    flex-basis: 100%;
    flex-direction: column;
    gap: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
  }

  .nav-open .topnav {
    max-height: 200px;
    opacity: 1;
  }

  .topnav a {
    padding: 0.5rem 0;
    border-top: 1px solid var(--line);
  }

  .topbar-actions {
    display: none;
  }

  .nav-open .topbar-actions {
    display: flex;
    flex-basis: 100%;
    padding-top: 0.5rem;
    border-top: 1px solid var(--line);
    margin-left: 0;
  }

  .content table {
    display: block;
    overflow-x: auto;
  }

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

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .cta {
    text-align: center;
  }

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

  .footer {
    text-align: center;
  }

  .nav-open .topnav {
    max-height: 320px;
  }
}

@media (max-width: 760px) {
  .chart-row {
    grid-template-columns: 1fr;
    gap: 0.32rem;
  }

  .chart-value {
    justify-self: start;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

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