/*
 * site.css — layout for deepwrench.com.
 *
 * Everything here traces to one of two sources: a token in tokens.css, or a
 * value in the Claude Design handoff (design/handoff/DeepWrench Site.dc.html),
 * which carried every style as an inline attribute. The port moved each of
 * those into a class below, value for value, because the site's CSP has no
 * 'unsafe-inline' — an inline style attribute would not render on Cloudflare.
 *
 * Modernist rules this file obeys: zero corner radius (there is none anywhere),
 * no shadows, no gradients, and no second accent. Separation is the 2px
 * --rule-strong between sections and the 1px --rule-hair between cells.
 *
 * The site ships no JavaScript. There is no theme toggle: both palettes come
 * from tokens.css under prefers-color-scheme.
 */

/* ── Interactive roles, per ground ───────────────────────────────────────────
   The handoff set these in an inline <style>: buttons are --accent-deep with
   paper text on BOTH grounds (6.41:1), while links lighten on ink (--accent-lt,
   5.26:1) because #ae1800 on a near-black ground is unreadable. --accent-lt is
   never used on --panel (4.46:1, under the floor). */
:root {
  --link: var(--accent-deep);
  --link-hover: var(--accent-800);
  --btn: var(--accent-deep);
  --btn-hover: var(--accent-800);
}

@media (prefers-color-scheme: dark) {
  :root {
    --link: var(--accent-lt);
    --link-hover: var(--accent-tnt);
  }
}

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

html, body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-on-surface);
}

body {
  font-family: var(--font-body);
  font-size: var(--size-h5);
  line-height: var(--body-line-height);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  line-height: var(--heading-line-height);
  letter-spacing: var(--heading-letter-spacing);
}

p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }

a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }

:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: var(--accent-300); color: var(--ink); }

/* ── Shell ────────────────────────────────────────────────────────────────── */
/* No overflow-x:hidden here on purpose. The handoff had it on the wrapper,
   which would clip real overflow and make the 375px check meaningless. */
.page { min-height: 100vh; display: flex; flex-direction: column; }

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px);
}

.main { flex: 1; }

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header { border-bottom: 2px solid var(--rule-strong); }

.site-header .wrap {
  display: flex;
  align-items: stretch;
  gap: clamp(24px, 4vw, 48px);
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: var(--heading-letter-spacing);
  color: var(--color-on-surface);
  text-decoration: none;
}
.brand:hover { color: var(--color-on-surface); }

.site-nav { display: flex; align-items: stretch; gap: clamp(16px, 3vw, 32px); }

.nav-link {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: var(--label-letter-spacing);
  color: var(--color-on-surface);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding-top: 2px;
}
.nav-link:hover { color: var(--color-on-surface); }
.nav-link[aria-current="page"] { border-bottom-color: var(--color-accent); }

/* ── Product sub-header ───────────────────────────────────────────────────── */
.subheader {
  background: var(--color-surface);
  border-bottom: 1px solid var(--rule-hair);
}

.subheader .wrap {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  column-gap: clamp(20px, 3vw, 32px);
  min-height: 56px;
}

.subtitle {
  display: flex;
  align-items: center;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: var(--heading-letter-spacing);
}

.subnav { display: flex; align-items: stretch; gap: 24px; }

.sub-link {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: var(--label-letter-spacing);
  color: var(--color-on-surface);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-top: 2px;
}
.sub-link:hover { color: var(--color-on-surface); }
.sub-link[aria-current="page"] { border-bottom-color: var(--color-accent); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 24px;
  background: var(--btn);
  color: var(--paper);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: var(--label-letter-spacing);
  text-decoration: none;
}
.btn:hover { background: var(--btn-hover); color: var(--paper); }

.btn-compact {
  margin-left: auto;
  align-self: center;
  min-height: 40px;
  padding: 0 16px;
  font-size: 13px;
}

.btn-outline {
  background: none;
  border: 2px solid var(--color-on-surface);
  color: var(--color-on-surface);
  padding: 0 22px;
}
.btn-outline:hover { background: var(--color-surface); color: var(--color-on-surface); }

/* ── Section furniture ────────────────────────────────────────────────────── */
.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--size-label);
  font-weight: 700;
  letter-spacing: var(--kicker-letter-spacing);
  text-transform: uppercase;
}
/* The 8px accent square. A marker, not text — #ec3013 is never behind text. */
.kicker::before {
  content: "";
  display: block;
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--color-accent);
}

.display { font-size: clamp(40px, 7.5vw, 76px); text-wrap: balance; }
.h2 { font-size: clamp(32px, 5vw, 42px); text-wrap: balance; }
.h3 { font-size: clamp(25px, 4vw, 32px); }

.lede { font-size: clamp(17px, 2vw, 20px); line-height: 1.5; text-wrap: pretty; }

.note { font-size: var(--size-body-sm); color: var(--color-muted); }

.section {
  border-top: 2px solid var(--rule-strong);
  padding: clamp(32px, 5vw, 56px) 0 clamp(40px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vw, 32px);
}

.link-row { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 15px; font-weight: 500; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 8px; }

/* ── Home ─────────────────────────────────────────────────────────────────── */
.hero {
  padding: clamp(40px, 7vw, 96px) 0 clamp(32px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.product-block {
  border-top: 2px solid var(--rule-strong);
  padding: clamp(32px, 5vw, 56px) 0 clamp(48px, 7vw, 96px);
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 4vw, 40px);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: clamp(20px, 4vw, 48px);
  align-items: start;
}

.cta-col { display: flex; flex-direction: column; gap: 24px; }
.cta-col .btn { align-self: flex-start; }
.cta-note { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

/* ── Screenshots ──────────────────────────────────────────────────────────── */
.shot { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.shot img { border: 1px solid var(--rule-hair); }
.shot-wide { grid-column: 1 / -1; }
.caption { font-size: var(--size-body-sm); color: var(--color-muted); }

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: clamp(24px, 3vw, 40px);
}

/* ── Product page ─────────────────────────────────────────────────────────── */
.hero-product {
  padding: clamp(40px, 7vw, 96px) 0 clamp(40px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.hero-product .display { max-width: 14em; }
.hero-product .lede { max-width: 40em; }

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  column-gap: clamp(24px, 3vw, 40px);
}
.feature-list li {
  border-top: 1px solid var(--rule-hair);
  padding: 16px 0 24px;
  text-wrap: pretty;
}
.feature-list strong { font-weight: 700; }

.needs { display: flex; flex-wrap: wrap; gap: 20px clamp(24px, 4vw, 48px); }
.needs h2 { flex: 1 1 260px; }
.needs ul {
  flex: 3 1 560px;
  min-width: 0;
  border-bottom: 1px solid var(--rule-hair);
}
.needs li { border-top: 1px solid var(--rule-hair); padding: 14px 0; text-wrap: pretty; }

.limits-section { border-top: 2px solid var(--rule-strong); padding: clamp(32px, 5vw, 56px) 0 clamp(48px, 7vw, 96px); }
.limits {
  background: var(--color-critical-bg);
  padding: clamp(20px, 4vw, 40px);
  display: flex;
  flex-wrap: wrap;
  gap: 20px clamp(24px, 4vw, 48px);
}
.limits h2 { flex: 1 1 220px; }
.limits-body { flex: 3 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.limits-body p { text-wrap: pretty; }
.limits-body .warn { font-weight: 700; }
.limits-body ul { border-bottom: 1px solid var(--rule-strong); }
.limits-body li { border-top: 1px solid var(--rule-strong); padding: 10px 0; }

/* ── Pricing ──────────────────────────────────────────────────────────────── */
.hero-pricing { padding: clamp(40px, 7vw, 96px) 0 clamp(32px, 5vw, 56px); }

.plan-section {
  border-top: 2px solid var(--rule-strong);
  padding: clamp(32px, 5vw, 56px) 0 clamp(48px, 7vw, 96px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.plan {
  width: 100%;
  max-width: 640px;
  background: var(--color-surface);
  padding: clamp(20px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.plan-head { display: flex; flex-direction: column; gap: 8px; }
.plan-head h2 { font-size: var(--size-h3); }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.price .amount { font-size: clamp(32px, 5vw, 42px); font-weight: 800; line-height: 1.1; letter-spacing: var(--heading-letter-spacing); }
.price .period { color: var(--color-muted); }
.plan ul { border-bottom: 1px solid var(--rule-hair); }
.plan li { border-top: 1px solid var(--rule-hair); padding: 12px 0; text-wrap: pretty; }
.plan .btn { align-self: flex-start; }

.footnote { max-width: 640px; font-size: var(--size-body-sm); color: var(--color-muted); }

/* ── Simple pages (thanks, 404, terms, privacy) ───────────────────────────── */
.simple {
  padding: clamp(40px, 7vw, 96px) clamp(16px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.simple .lede { max-width: 40em; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer { border-top: 2px solid var(--rule-strong); }
.site-footer .wrap {
  padding-top: 24px;
  padding-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  font-size: 14px;
  color: var(--color-muted);
}
.site-footer a { color: var(--link); }
