/*
 * 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); }

html { scroll-behavior: smooth; }

a, .btn, .nav-link, .sub-link {
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

#features, #screenshots, #requirements, #safety, #faq {
  scroll-margin-top: 96px;
}

/* ── 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:visited { color: var(--color-on-surface); text-decoration: none; }
.nav-link[aria-current="page"] { border-bottom-color: var(--color-accent); }

/* ── Product sub-header ───────────────────────────────────────────────────── */
.subheader {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-surface);
  border-bottom: 1px solid var(--rule-hair);
}

.subheader .wrap {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  min-height: 56px;
}

.subnav { display: flex; align-items: stretch; flex-wrap: wrap; gap: 0 clamp(12px, 3vw, 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:visited { color: var(--color-on-surface); text-decoration: none; }
.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: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

.product-copy { display: flex; flex-direction: column; gap: 24px; align-items: flex-start; }
.product-visual {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.safety-strip {
  background: var(--color-critical-bg);
  border-left: 4px solid var(--color-critical);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 44em;
}
.safety-strip p { text-wrap: pretty; }
.safety-strip strong { font-weight: 700; }
.safety-more { font-size: var(--size-body-sm); }

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

/* ── Launch video ─────────────────────────────────────────────────────────── */
.demo-video { margin: 0; max-width: 960px; display: flex; flex-direction: column; gap: 10px; }
.demo-video video { display: block; width: 100%; height: auto; border: 1px solid var(--rule-hair); }

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

.shot-link {
  display: block;
  border: 1px solid var(--rule-hair);
  cursor: zoom-in;
}
.shot-link img { border: 0; }
.product-visual .shot-link { border: 1px solid var(--rule-hair); }
.zoom-hint { color: var(--link); white-space: nowrap; }

/* A CSS-only lightbox: :target makes the figure a full-viewport layer.
   The close link is a real link, so no JavaScript is needed. */
.shot:target {
  position: fixed;
  inset: 0;
  z-index: 100;
  margin: 0;
  padding: clamp(16px, 4vw, 48px);
  background: var(--color-background);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  overflow: auto;
}
.shot:target .shot-link {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(100%, 1600px);
  max-height: calc(100vh - 150px);
  border: 0;
  cursor: default;
}
.shot:target .shot-link img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 150px);
}
.shot:target .caption { max-width: 80ch; text-align: center; }
.shot:target .zoom-hint { display: none; }
.shot-close {
  display: none;
  position: fixed;
  top: clamp(12px, 2vw, 24px);
  right: clamp(12px, 2vw, 24px);
  z-index: 101;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: var(--color-background);
  border: 2px solid var(--color-on-surface);
  color: var(--color-on-surface);
  font-size: 28px;
  line-height: 1;
  text-decoration: none;
}
.shot-close:hover { background: var(--color-surface); color: var(--color-on-surface); }
.shot:target .shot-close { display: flex; }

/* Keep the page behind the lightbox from scrolling while it is open. */
body:has(.shot:target) { overflow: hidden; }

.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; }
.hero-product .soon { align-self: flex-start; }

.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: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 20px clamp(24px, 4vw, 48px);
  align-items: start;
}
.needs ul {
  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; }
.needs-more { grid-column: 2; font-size: var(--size-body-sm); }

.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: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 20px clamp(24px, 4vw, 48px);
  align-items: start;
}
.limits-body { 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-title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.plan-head h2 { font-size: var(--size-h3); }
.plan-extra .text-list { max-width: 720px; }
.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) 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.simple .lede { max-width: 40em; }

/* ── Long-form pages (About, Privacy, Terms) ─────────────────────────────── */
.legal {
  max-width: 780px;
  padding: clamp(40px, 7vw, 96px) 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.legal h2 { font-size: var(--size-h3); margin-top: 12px; }
.legal h3 { font-size: var(--size-h4); margin-top: 6px; }
.legal p { text-wrap: pretty; }
.legal ul {
  list-style: disc;
  padding-left: 1.3em;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.legal li { text-wrap: pretty; }
.draft-note {
  max-width: 68ch;
  padding: 12px 16px;
  border-left: 4px solid var(--color-major);
  background: var(--color-warning-bg);
  font-size: var(--size-body-sm);
}

/* ── Ruled text lists (compatibility, sample report) ─────────────────────── */
.text-list { border-bottom: 1px solid var(--rule-hair); }
.text-list li { border-top: 1px solid var(--rule-hair); padding: 12px 0; text-wrap: pretty; }

/* ── Sample report data ──────────────────────────────────────────────────── */
.data-list {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  border-bottom: 1px solid var(--rule-hair);
}
.data-list dt, .data-list dd {
  margin: 0;
  border-top: 1px solid var(--rule-hair);
  padding: 12px 0;
}
.data-list dt { font-weight: 700; padding-right: 16px; }
.data-list dd {
  font-family: var(--font-mono);
  font-size: var(--size-body-sm);
}
.confidence {
  align-self: flex-start;
  display: inline-block;
  border: 2px solid var(--color-major);
  color: var(--color-major);
  padding: 6px 10px;
  font-size: var(--size-label);
  font-weight: 700;
  letter-spacing: var(--label-letter-spacing);
  text-transform: uppercase;
}

/* ── FAQ (native details, no JavaScript) ─────────────────────────────────── */
.faq-list { border-bottom: 1px solid var(--rule-hair); }
.faq-item { border-top: 1px solid var(--rule-hair); }
.faq-item summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  flex: none;
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
}
.faq-item[open] summary::after { content: "–"; }
.faq-answer {
  padding: 0 0 18px;
  max-width: 70ch;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-answer p { text-wrap: pretty; }

/* ── Footer, and the launch-list sign-up ──────────────────────────────────── */
.site-footer { border-top: 2px solid var(--rule-strong); }
.site-footer .wrap {
  padding-top: 24px;
  padding-bottom: 32px;
  font-size: 14px;
  color: var(--color-muted);
}
.footer-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px 48px;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  max-width: 520px;
}
.site-footer a { color: var(--link); }
.footer-note { margin: 16px 0 0; font-size: var(--size-body-sm); }

.signup {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 320px;
  max-width: 460px;
}
.signup-label {
  font-size: var(--size-label);
  font-weight: 600;
  letter-spacing: var(--label-letter-spacing);
}
.signup-row { display: flex; flex-wrap: wrap; gap: 8px; }
.signup-input {
  flex: 1 1 200px;
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  color: var(--color-on-surface);
  background: var(--color-background);
  /* --color-muted, not --rule-strong: a control's own edge needs 3:1 (this is
     5.83:1 on paper, 5.75:1 on ink), while the rule tokens are tuned for lines
     between blocks rather than boundaries around a control. */
  border: 1px solid var(--color-muted);
}
.signup-input::placeholder { color: var(--color-muted); }
/* The honeypot. Off-screen rather than display:none, so a bot still fills it. */
.signup-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── Coming soon ──────────────────────────────────────────────────────────── */
.soon {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 10px 16px;
  border: 2px solid var(--color-on-surface);
  font-size: var(--size-label);
  font-weight: 700;
  letter-spacing: var(--kicker-letter-spacing);
  text-transform: uppercase;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .product-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .needs,
  .limits,
  .data-list { grid-template-columns: 1fr; }
  .needs-more { grid-column: 1; }
  .data-list dt { padding-bottom: 2px; }
  .data-list dd { border-top: 0; padding-top: 0; }
  .safety-strip { padding: 14px 16px; }
  .legal h2 { margin-top: 8px; }
}

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