/* RatchetStrap — marketing site
   One page, no build step. Design language: near-black canvas, one strap red,
   heavy grotesque headings, mono for anything executable. */

:root {
  --bg: #0d0d0f;
  --bg-soft: #101012;
  --panel: #141416;
  --panel-2: #191a1d;
  --line: #26262b;
  --line-soft: #1e1e22;
  --ink: #f6f4f1;
  --ink-2: #c9c5bf;
  --muted: #a7a39d;
  --red: #f03a2a;
  --red-deep: #c22a1c;
  --red-fill: #d8321f;
  --on-red: #fdfbf7;
  --good: #5fd38a;

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Archivo", "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1160px;
  --radius: 14px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.02;
  margin: 0;
}

h2 { font-size: clamp(1.85rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.05rem; letter-spacing: -0.01em; line-height: 1.3; }

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

code, pre, kbd { font-family: var(--mono); font-size: 0.875rem; }

code.inline {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.1em 0.36em;
  color: var(--ink-2);
  white-space: nowrap;
  font-size: 0.82em;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--red-fill);
  color: var(--on-red);
  padding: 10px 16px;
  font-weight: 600;
  z-index: 20;
}
.skip:focus { left: 12px; top: 12px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(13, 13, 15, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand img { width: 34px; height: 34px; }
.brand-name {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.18rem;
  letter-spacing: -0.03em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 9px;
  padding: 11px 18px;
  font: 600 0.92rem/1 var(--sans);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-sm { padding: 9px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }

.btn-solid { background: var(--red-fill); color: var(--on-red); }
.btn-solid:hover { background: var(--red-deep); }

.btn-ghost { border-color: #33333a; color: var(--ink); }
.btn-ghost:hover { border-color: #4a4a53; background: rgba(255, 255, 255, 0.04); }

/* ---------- hero ---------- */

.hero { position: relative; overflow: hidden; padding: 76px 0 0; }

.hazard {
  position: absolute;
  top: -60px;
  right: -40px;
  width: 46%;
  height: 620px;
  background: repeating-linear-gradient(
    118deg,
    rgba(240, 58, 42, 0.5) 0 26px,
    transparent 26px 62px
  );
  opacity: 0.13;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at 80% 15%, #000 20%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 80% 15%, #000 20%, transparent 72%);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  align-items: center;
  gap: 48px;
}

.hero-copy, .split > *, .term, .card { min-width: 0; }

h1 {
  font-size: clamp(2.4rem, 4.5vw, 3.7rem);
  letter-spacing: -0.03em;
  line-height: 0.99;
  margin: 0 0 22px;
}
h1 span { color: var(--red); display: inline-block; }

.lead {
  font-size: 1.075rem;
  color: var(--ink-2);
  max-width: 34ch;
  margin-bottom: 10px;
}
.lead-sub { color: var(--muted); font-size: 1rem; margin-bottom: 30px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }

.install {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #08080a;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px 11px 16px;
  max-width: 100%;
}
.install code {
  color: var(--ink-2);
  font-size: 0.82rem;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  min-width: 0;
}

.copy {
  flex: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-2);
  font: 500 0.74rem/1 var(--sans);
  padding: 7px 10px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.copy:hover { background: rgba(255, 255, 255, 0.11); color: var(--ink); }

.fine {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 14px;
  max-width: 46ch;
}

.hero-art { justify-self: center; }
.hero-art img {
  width: min(100%, 460px);
  filter: drop-shadow(0 34px 60px rgba(0, 0, 0, 0.62));
}

/* ---------- sections ---------- */

.sect { padding: 96px 0; border-bottom: 1px solid var(--line-soft); }
.sect h2 { margin-bottom: 18px; }

section[id], #install { scroll-margin-top: 84px; }

.sect-head { max-width: 62ch; margin-bottom: 56px; }
.sect-head p { color: var(--ink-2); font-size: 1.05rem; margin-top: 16px; }

.body { color: var(--ink-2); max-width: 58ch; }

.split {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 64px;
  align-items: start;
}
.split-rev { grid-template-columns: 1fr 1fr; }

.grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.grid4 li {
  padding: 26px 26px 30px 0;
  border-right: 1px solid var(--line-soft);
}
.grid4 li:last-child { border-right: 0; }
.grid4 li + li { padding-left: 26px; }
.grid4 h3 { margin: 12px 0 10px; }
.grid4 p { font-size: 0.925rem; color: var(--muted); }

.num {
  font: 500 0.72rem/1 var(--mono);
  letter-spacing: 0.14em;
  color: var(--red);
}

/* ---------- terminal ---------- */

.term {
  background: #08080a;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.45);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: #0e0e10;
}
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #33333a; }
.term-bar i:nth-child(1) { background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-bar span {
  margin-left: 8px;
  font: 400 0.72rem/1 var(--mono);
  color: #918d86;
}

.term pre { margin: 0; padding: 22px 20px 24px; overflow-x: auto; }
.term-note { margin-top: 14px; font-size: 0.8rem; color: var(--muted); }
.term code { font-size: 0.8rem; line-height: 1.95; color: var(--ink-2); display: block; }
.ln { display: block; white-space: pre; }
.ln + .ln { margin-top: 2px; }
.p { color: var(--red); margin-right: 6px; }
.out { padding-left: 18px; font-size: 0.76rem; }
.out.bad { color: #ff7a6b; }
.out.good { color: var(--good); }

@media (max-width: 760px) {
  .term code { font-size: 0.75rem; }
  .ln { white-space: pre-wrap; }
}

/* ---------- steps ---------- */

.steps { list-style: none; margin: 30px 0 0; padding: 0; counter-reset: step; }
.steps li {
  padding: 20px 0;
  border-top: 1px solid var(--line-soft);
}
.steps li:last-child { padding-bottom: 0; }
.steps h3 { margin-bottom: 6px; }
.steps p { font-size: 0.925rem; color: var(--muted); }

/* ---------- cards ---------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
  font: 400 0.72rem/1 var(--mono);
  letter-spacing: 0.06em;
  color: #918d86;
}

.code {
  margin: 0;
  padding: 18px 18px 20px;
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.8;
  color: var(--ink-2);
  white-space: pre;
  tab-size: 2;
}
.code.cmd { white-space: pre-wrap; overflow-wrap: anywhere; }
.code .k { color: #ff9a8d; }

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

.code-block + .code-block,
.card-foot + .code-block { border-top: 1px solid var(--line-soft); }

.code-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line-soft);
  font: 400 0.66rem/1 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #918d86;
}
.code-label .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.code-label .dot.bad { background: var(--red); }
.code-label .dot.good { background: var(--good); }

.tok-k { color: #ff9a8d; }
.tok-s { color: #a7d9a0; }
.tok-f { color: #f0c674; }
.tok-t { color: #8fb8ff; }
.tok-c { color: #9a958e; font-style: italic; }
.tok-p { color: #d7d2ca; }

.code-error { background: rgba(240, 58, 42, 0.055); }
.code-error .err { color: #ff7a6b; }

.card-foot {
  border-top: 1px solid var(--line-soft);
  padding: 14px 16px;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.ticks { list-style: none; margin: 26px 0 0; padding: 0; }
.ticks li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 14px;
  font-size: 0.93rem;
  color: var(--muted);
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 10px;
  height: 2px;
  background: var(--red);
}

/* ---------- footer ---------- */

.site-foot { background: var(--bg-soft); }

.band {
  position: relative;
  background: var(--red-fill);
  color: var(--on-red);
  overflow: hidden;
}
.band-inner {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 104px;
  padding: 26px 28px;
}
.band p {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.25rem, 2.9vw, 1.9rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  max-width: 22ch;
}

.hazard-foot {
  position: absolute;
  inset: 0 0 0 auto;
  width: 44%;
  height: 100%;
  opacity: 0.9;
  background: repeating-linear-gradient(
    -62deg,
    rgba(0, 0, 0, 0.16) 0 22px,
    transparent 22px 58px
  );
  mask-image: linear-gradient(to left, #000 40%, transparent 100%);
  -webkit-mask-image: linear-gradient(to left, #000 40%, transparent 100%);
}

.band-install {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.band-label {
  font: 500 0.68rem/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-red);
}
.band-install code {
  font-size: clamp(0.95rem, 2.1vw, 1.3rem);
  letter-spacing: -0.01em;
  color: var(--on-red);
}
.copy-band {
  background: var(--red-deep);
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--on-red);
}
.copy-band:hover { background: #a82417; color: var(--on-red); }

.foot-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 32px;
  padding-top: 26px;
  padding-bottom: 34px;
}
.foot-row p {
  margin: 0;
  font: 400 0.78rem/1.6 var(--mono);
  color: var(--ink-2);
}
.foot-row .co::before { content: "· "; }
.foot-links { display: flex; flex-wrap: wrap; gap: 22px; }
.foot-links a {
  font-size: 0.86rem;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.foot-links a:hover { color: var(--ink); border-bottom-color: var(--red); }

.muted { color: var(--muted); }

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-art { order: -1; justify-self: start; }
  .hero-art img { width: min(78%, 340px); }
  .split, .split-rev { grid-template-columns: 1fr; gap: 40px; }
  .grid4 { grid-template-columns: 1fr 1fr; }
  .grid4 li:nth-child(2) { border-right: 0; }
  .grid4 li:nth-child(n + 3) { border-top: 1px solid var(--line-soft); }
  .band-install { gap: 12px; }
}

@media (max-width: 820px) {
  .sect { padding: 72px 0; }
  .hero { padding-top: 48px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 20px; }
  .grid4 { grid-template-columns: 1fr; }
  .grid4 li, .grid4 li + li { padding: 22px 0; border-right: 0; }
  .grid4 li + li { border-top: 1px solid var(--line-soft); }
  .band-inner { min-height: 0; padding: 20px 20px 22px; }
  .band-install { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px; }
  .band-label { grid-column: 1 / -1; font-size: 0.62rem; }
  .band-install code { font-size: 0.82rem; }
  .copy-band { padding: 6px 9px; font-size: 0.7rem; }
  .foot-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .foot-row .co { display: block; margin-top: 2px; }
  .foot-row .co::before { content: ""; }
  .foot-links { gap: 10px 18px; }
  .foot-links a { font-size: 0.82rem; }
  .install { flex-wrap: wrap; }
  .install code { white-space: normal; overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* ---------- agent prompt ---------- */

.agent-prompt {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  font-size: 0.76rem;
  line-height: 1.7;
  color: var(--ink-2);
  tab-size: 2;
}
.card-head .copy { margin: -4px 0; }

/* ---------- 404 ---------- */

.notfound {
  display: grid;
  align-items: center;
  min-height: 100vh;
  padding: 96px 0;
}
.nf-code {
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.2em;
  color: var(--red);
  margin: 0 0 22px;
}
.notfound .lead { margin-top: 22px; }
.notfound .actions { margin-top: 34px; }

.fine a {
  color: var(--ink-2);
  border-bottom: 1px solid #3a3a40;
}
.fine a:hover { color: var(--ink); border-bottom-color: var(--red); }
