/* BeagleLathe — neubrutalism design system. One stylesheet. No frameworks. */

/* =========================================================================
   1. Design tokens
   ========================================================================= */

:root {
  /* Colors sampled from the logo */
  --bg:           #FAFAF7;
  --yellow:       #F2C13C;
  --blue:         #2E6CB6;
  --ink:          #0A0A0A;
  --ink-soft:     #4A4A4A;
  --code-bg:      #0A0A0A;
  --code-fg:      #F4F4F1;

  /* Borders, shadows, radius */
  --border:       3px solid var(--ink);
  --border-thick: 5px solid var(--ink);
  --shadow-brutal: 6px 6px 0 0 var(--ink);
  --shadow-brutal-lift: 8px 8px 0 0 var(--ink);
  --radius:       0;
  --radius-input: 2px;

  /* Type */
  --font-display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body:    "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:    ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  /* Layout */
  --wrap:         720px;
  --gutter:       1.25rem;
}

/* =========================================================================
   2. Reset + base
   ========================================================================= */

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

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

::selection { background: var(--yellow); color: var(--ink); }

/* =========================================================================
   3. Layout
   ========================================================================= */

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

main { padding: 0; }

/* Section dividers — thick black rules, not subtle separators. */
section {
  padding: 3rem 0;
  border-bottom: var(--border);
}
section:last-child { border-bottom: 0; }

/* The one yellow-background section. Bleeds to viewport edges. */
section.section-accent {
  background: var(--yellow);
  margin: 0 calc(50% - 50vw);
  padding-left: calc(50vw - 50% + var(--gutter));
  padding-right: calc(50vw - 50% + var(--gutter));
}

/* =========================================================================
   4. Typography
   ========================================================================= */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.75rem, 7.5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  overflow-wrap: break-word;
  hyphens: auto;
}

h2 {
  font-size: clamp(1.5rem, 6vw, 1.75rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  overflow-wrap: break-word;
}

h3 {
  font-size: 1.125rem;
  line-height: 1.2;
  margin: 1.75rem 0 0.5rem;
}

h3:first-child { margin-top: 0; }

p, ul, ol { margin-bottom: 1rem; }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.35rem; }

em { font-style: italic; }
strong { font-weight: 700; }

/* Prose links — :not(.btn) so buttons keep their own color/decoration */
main a:not(.btn),
footer a:not(.btn) {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}
main a:not(.btn):hover,
footer a:not(.btn):hover { color: var(--ink); }
main a:not(.btn):visited { color: var(--blue); }

/* =========================================================================
   5. Header / nav
   ========================================================================= */

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand img {
  height: 32px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
}

.site-nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

@media (max-width: 560px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .site-nav { gap: 1rem; }
}

/* =========================================================================
   6. Hero
   ========================================================================= */

#hero { padding-top: 3rem; }

.hero-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.hero-logo {
  flex: 0 0 auto;
  width: 100px;
  height: 100px;
  background: var(--yellow);
  border: var(--border-thick);
  box-shadow: var(--shadow-brutal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-top h1 {
  margin: 0;
  text-align: center;
  font-size: clamp(2.5rem, 10vw, 5rem);
  max-width: 18ch;
}

.subhead {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.install-hint, .prereq {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}

@media (max-width: 560px) {
  .hero-top { gap: 1rem; }
  .hero-logo { width: 72px; height: 72px; padding: 6px; }
}

/* =========================================================================
   7. Buttons / CTAs
   ========================================================================= */

.btn {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-brutal);
  text-decoration: none;
  cursor: pointer;
  transition: transform 60ms ease, box-shadow 60ms ease;
  line-height: 1.2;
}

.btn:hover {
  text-decoration: none;
  color: var(--ink);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.btn--primary {
  background: var(--blue);
  color: #fff;
}

.btn--primary:hover { color: #fff; }

.btn--yellow {
  background: var(--yellow);
  color: var(--ink);
}

.btn--disabled {
  background: var(--bg);
  color: var(--ink-soft);
  box-shadow: none;
  cursor: not-allowed;
  border-color: var(--ink-soft);
}
.btn--disabled:active { transform: none; }

/* =========================================================================
   8. Cards
   ========================================================================= */

.card {
  background: #fff;
  border: var(--border);
  box-shadow: var(--shadow-brutal);
  padding: 1.5rem;
  transition: transform 80ms ease, box-shadow 80ms ease;
}

.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-brutal-lift);
}

/* When a card sits on the yellow accent section, keep it white so the
   contrast and shadow read crisply. */
.section-accent .card { background: #fff; }

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.pillars--two { grid-template-columns: repeat(2, 1fr); }

/* One-line roadmap callout sitting beneath the pillar grid. The 2.5rem
   top margin clears the cards' 6px brutal shadow with breathing room. */
.roadmap-line {
  margin-top: 2.5rem;
  padding: 1rem 1.1rem;
  border: var(--border);
  background: #fff;
  font-size: 0.9375rem;
  line-height: 1.55;
}
.roadmap-line strong { letter-spacing: -0.005em; }

.pillar h3 { margin: 0 0 0.5rem; font-size: 1.0625rem; }
.pillar p { font-size: 0.9375rem; color: var(--ink); line-height: 1.5; margin: 0; }

.pillar .tag {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  padding: 0.05rem 0.4rem;
  margin-left: 0.4rem;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@media (max-width: 720px) {
  .pillars { grid-template-columns: 1fr; }
}

/* Stats — like pillars but with hero-sized numerals. Used in #numbers. */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
}

.stat {
  padding: 1.75rem 1.5rem;
}

.stat-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.25rem, 11vw, 5.25rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--blue);
  margin-bottom: 0.35rem;
}

.stat-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 0.85rem;
  text-transform: lowercase;
}

.stat p {
  font-size: 0.9375rem;
  color: var(--ink);
  line-height: 1.5;
  margin: 0;
}

#numbers h2 {
  font-size: clamp(1.75rem, 6.5vw, 2.5rem);
}

@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr; }
}

/* =========================================================================
   9. Code blocks
   ========================================================================= */

.code {
  position: relative;
  margin: 1.25rem 0;
  border: var(--border);
  background: var(--code-bg);
  box-shadow: var(--shadow-brutal);
}

.code__tag {
  position: absolute;
  top: -3px;
  left: -3px;
  padding: 0.15rem 0.55rem;
  background: var(--yellow);
  color: var(--ink);
  border: var(--border);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  transform: translateY(-50%);
  z-index: 1;
}

.code__copy {
  position: absolute;
  top: 0;
  right: 10px;
  transform: translateY(-50%);
  padding: 0.2rem 0.55rem;
  background: var(--bg);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 0 var(--ink);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 60ms ease, box-shadow 60ms ease;
  z-index: 2;
}

.code__copy:hover { background: var(--yellow); }
.code__copy:active {
  transform: translate(2px, calc(-50% + 2px));
  box-shadow: none;
}

.code__copy[data-state="copied"] {
  background: var(--yellow);
}

.code pre {
  margin: 0;
  padding: 1.25rem 1rem 1rem;
  background: transparent;
  color: var(--code-fg);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.55;
  overflow-x: auto;
  border: 0;
}

.code pre code {
  background: transparent;
  color: inherit;
  border: 0;
  padding: 0;
  font-size: inherit;
}

/* Inline code in prose */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--yellow);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  padding: 0.02em 0.3em;
  border-radius: 0;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

main a code { color: var(--ink); }

/* Code-comparison grid */
.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.comparison .code { margin: 0; }
.comparison .code pre { font-size: 0.75rem; }

/* Hero install: bigger code so the curl line reads as the primary CTA. */
.hero-install { margin-top: 1.75rem; }
.hero-install pre { font-size: 1rem; padding: 1.35rem 1.1rem 1.15rem; }
@media (max-width: 560px) {
  .hero-install pre { font-size: 0.8125rem; }
}

/* Hero stats strip: compact 3-number row under the install card. */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.6rem 0.85rem;
  background: #fff;
  border: var(--border);
  box-shadow: 4px 4px 0 0 var(--ink);
}

.hero-stat .n {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 4.5vw, 1.75rem);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--blue);
}

.hero-stat .l {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  margin-top: 0.2rem;
  color: var(--ink);
}

@media (max-width: 560px) {
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
  .hero-stat { padding: 0.45rem 0.55rem; }
  .hero-stat .l { font-size: 0.6875rem; }
}

/* Comparison: stock = red-tinted tag, lathe = green-tinted tag. */
.code--bad .code__tag { background: #E94B3C; color: #fff; }
.code--good .code__tag { background: #1F9D55; color: #fff; }

/* Tiny syntax tokens for the comparison code blocks. */
.code pre .tok-tool   { color: var(--yellow); font-weight: 700; }
.code pre .tok-str    { color: #9DDCA0; }
.code pre .tok-cmt    { color: #8A8A8A; font-style: italic; }
.code pre .tok-arrow  { color: #F2C13C; }
.code pre .tok-bad    { color: #E94B3C; font-weight: 700; }

/* The "12 calls → 2 calls (−83%)" banner under the comparison. */
.comparison-result {
  margin: 0.5rem 0 1rem;
  padding: 0.85rem 1rem;
  background: var(--ink);
  color: var(--bg);
  border: var(--border);
  box-shadow: var(--shadow-brutal);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  letter-spacing: -0.01em;
}
.comparison-result .r-from { color: #E94B3C; text-decoration: line-through; text-decoration-thickness: 2px; }
.comparison-result .r-arrow { color: var(--yellow); margin: 0 0.5rem; }
.comparison-result .r-to { color: #9DDCA0; }
.comparison-result .r-pct {
  display: inline-block;
  margin-left: 0.75rem;
  padding: 0.1rem 0.5rem;
  background: var(--yellow);
  color: var(--ink);
  border: 2px solid var(--bg);
  font-size: 0.8125rem;
}

@media (max-width: 720px) {
  .comparison { grid-template-columns: 1fr; }
}

/* =========================================================================
   10. Pricing
   ========================================================================= */

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.pricing-card {
  display: flex;
  flex-direction: column;
}

.pricing-card .tier-name {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.pricing-card .price {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.pricing-card .tier-features {
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

.pricing-card .tier-features li {
  padding: 0.25rem 0;
  border-bottom: 1px dashed var(--ink);
  margin-bottom: 0;
}

.pricing-card .tier-features li:last-child { border-bottom: 0; }

.pricing-card .btn { align-self: flex-start; margin-top: auto; }

.pricing-card--pending { opacity: 0.85; }
.pricing-card--pending .tier-name { display: flex; align-items: center; gap: 0.5rem; }
.tag--pending {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--ink);
  padding: 0.05rem 0.4rem;
}

@media (max-width: 560px) {
  .pricing-grid { grid-template-columns: 1fr; }
}

/* =========================================================================
   11. Lists / FAQ / Steps
   ========================================================================= */

.steps {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  counter-reset: step;
}

.steps > li {
  counter-increment: step;
  padding: 1.25rem 1.25rem 1.25rem 3.5rem;
  margin-bottom: 1.25rem;
  border: var(--border);
  background: #fff;
  box-shadow: var(--shadow-brutal);
  position: relative;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  top: -3px;
  left: -3px;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--blue);
  color: #fff;
  border: var(--border);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps > li > p:first-child { margin-bottom: 0.75rem; font-weight: 600; }
.steps > li > p:last-child { margin-bottom: 0; }

.faq-item {
  margin-bottom: 1.25rem;
  padding: 0.85rem 0 0.4rem 1rem;
  border-left: 4px solid var(--blue);
}
.faq-item:last-child { margin-bottom: 0; }
.faq-item h3 { font-size: 1.0625rem; margin-bottom: 0.4rem; margin-top: 0; }
.faq-item p { color: var(--ink); margin-bottom: 0; }

/* =========================================================================
   12. Usage example block
   ========================================================================= */

.usage-example {
  background: #fff;
  border: var(--border);
  box-shadow: var(--shadow-brutal);
  padding: 1.25rem;
  margin: 1.25rem 0;
}

.usage-example p { margin: 0 0 0.5rem; font-size: 0.9375rem; line-height: 1.5; }
.usage-example p:last-child { margin-bottom: 0; }
.usage-example .prompt { color: var(--ink); border-bottom: 2px solid var(--ink); padding-bottom: 0.6rem; margin-bottom: 0.75rem; }
.usage-example .calls { font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.55; }
.usage-example .note { color: var(--ink-soft); font-size: 0.8125rem; margin-top: 0.75rem; padding-top: 0.6rem; border-top: 2px dashed var(--ink); }

/* =========================================================================
   13. Tables (docs)
   ========================================================================= */

.cmd-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
  margin: 1rem 0 1.5rem;
  border: var(--border);
  background: #fff;
  box-shadow: var(--shadow-brutal);
}

.cmd-table th, .cmd-table td {
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-bottom: 2px solid var(--ink);
  vertical-align: top;
}

.cmd-table tr:last-child th,
.cmd-table tr:last-child td { border-bottom: 0; }

.cmd-table th {
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cmd-table td:first-child { white-space: nowrap; }

.cmd-table td code { font-size: 0.8125rem; }

.cmd-table small {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

@media (max-width: 560px) {
  .cmd-table, .cmd-table tbody, .cmd-table tr, .cmd-table td, .cmd-table th { display: block; width: 100%; }
  .cmd-table thead { display: none; }
  .cmd-table tr { border-bottom: 3px solid var(--ink); }
  .cmd-table tr:last-child { border-bottom: 0; }
  .cmd-table td { border-bottom: 1px dashed var(--ink); padding: 0.5rem 0.85rem; }
  .cmd-table td:last-child { border-bottom: 0; }
  .cmd-table td:first-child { background: var(--bg); padding-top: 0.75rem; }
}

/* =========================================================================
   14. Misc helpers
   ========================================================================= */

.toc {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  margin-top: 1rem;
}

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

/* Docs TOC: 2-row grid (4 columns) instead of a single bullet-separated line. */
.toc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
  margin-bottom: 0;
  list-style: none;
  padding: 0;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
}

.toc-grid li {
  margin: 0;
  padding: 0;
}

.toc-grid a {
  display: block;
  padding: 0.45rem 0.6rem;
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  text-align: center;
  transition: transform 60ms ease, box-shadow 60ms ease, background 60ms ease;
}

.toc-grid a:hover {
  background: var(--yellow);
  box-shadow: 3px 3px 0 0 var(--ink);
  transform: translate(-1px, -1px);
}

@media (max-width: 720px) {
  .toc-grid { grid-template-columns: repeat(2, 1fr); }
}

.fine-print {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin-top: 0.75rem;
}

.fine-print a { color: var(--ink-soft); }

/* =========================================================================
   15. Footer
   ========================================================================= */

.site-footer {
  background: var(--ink);
  color: var(--bg);
  margin-top: 3rem;
  padding: 2rem 0;
}

.site-footer .wrap {
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.875rem;
}

.site-footer .made-by {
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.site-footer .made-by a {
  color: var(--yellow);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.site-footer .made-by a:hover { color: #fff; }

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 0.6rem;
  font-size: 0.8125rem;
  color: var(--bg);
}

.footer-links a {
  color: var(--bg);
  text-decoration: none;
}

.footer-links a:hover { color: var(--yellow); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }

.footer-links .sep {
  color: var(--ink-soft);
  user-select: none;
}

.footer-copy {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
