/* ENGINEROOM: one stylesheet for the whole site. Calm, spare, readable.
   No web fonts, no framework. Light and dark follow the visitor's system setting. */

:root {
  --bg: #f6f3ee;
  --surface: #fbf9f5;
  --ink: #1f1d1a;
  --muted: #6b665e;
  --rule: #ddd7cd;
  --accent: #7a5c3e;      /* 5.6:1 on --bg (AA) */
  --on-accent: #f6f3ee;
  --note-bg: #efe6d6;
  --focus: #1f5fa8;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171614;
    --surface: #1f1d1a;
    --ink: #ece8e1;
    --muted: #a39d93;
    --rule: #34312c;
    --accent: #c9a67f;    /* 8:1 on --bg */
    --on-accent: #171614;
    --note-bg: #2a251e;
    --focus: #8fb8ff;
  }
}

* { box-sizing: border-box; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* Layout: body text stays at a readable 40rem; hero and comparison can go wider. */
.wrap { max-width: 40rem; margin: 0 auto; padding: 0 1rem; }
.wide { max-width: 64rem; margin: 0 auto; padding: 0 1rem; }
.wrap-inline { max-width: 40rem; }

a { color: var(--accent); }

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

.skip {
  position: absolute; left: -999px; top: 0.5rem;
  background: var(--ink); color: var(--bg); padding: 0.5rem 1rem; z-index: 10;
}
.skip:focus { left: 0.5rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Header */
header.site {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem;
  justify-content: space-between; align-items: center;
  padding: 1.75rem 0 1rem;
}
header.site.wide { padding: 1.75rem 1rem 1rem; }

.wordmark {
  font-weight: 600; letter-spacing: 0.18em; font-size: 0.95rem;
  color: var(--ink); text-decoration: none;
}

nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.25rem; }
nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
nav a:hover, footer a:hover { color: var(--ink); }

/* Type */
h1, h2, h3 { font-weight: 500; line-height: 1.2; }
h1 { font-size: 2.4rem; margin: 2.5rem 0 1rem; letter-spacing: -0.015em; }
h2 { font-size: 1.45rem; margin: 3.5rem 0 1rem; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
p, li { margin: 0 0 1rem; }
.lede { font-size: 1.2rem; color: var(--muted); }
.big { font-size: 1.2rem; }
.meta { color: var(--muted); font-size: 0.92rem; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

.note {
  background: var(--note-bg); border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem; margin: 1.5rem 0; font-size: 0.95rem;
}
.note ul { margin: 0; padding-left: 1.2rem; }

/* Buttons */
.btn, button {
  display: inline-block; font: inherit; font-weight: 500; line-height: 1.2;
  padding: 0.8rem 1.3rem; border-radius: 999px; cursor: pointer;
  text-decoration: none; border: 1.5px solid var(--ink);
  background: transparent; color: var(--ink);
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-outline { border-color: var(--accent); color: var(--accent); }
.btn-outline:hover, button:not(.btn-primary):hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-small { padding: 0.45rem 1rem; font-size: 0.92rem; }
nav a.btn-primary { color: var(--on-accent); }

/* Hero */
.hero { display: grid; gap: 2.5rem; align-items: center; padding-bottom: 1rem; }
.hero-text .btn { margin-top: 0.5rem; }
@media (min-width: 60rem) {
  .hero { grid-template-columns: 1.15fr 1fr; gap: 4rem; }
  .hero h1 { font-size: 3rem; }
}

/* Pin card: looks like a pin without borrowing Pinterest's branding */
.pin-card {
  margin: 0; background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); overflow: hidden; max-width: 26rem; justify-self: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
}
.pin-card img { display: block; width: 100%; height: auto; border-radius: var(--radius) var(--radius) 0 0; }
.pin-body { padding: 1rem 1.1rem 0.5rem; }
.board-tag {
  display: inline-block; font-size: 0.78rem; color: var(--muted);
  border: 1px solid var(--rule); border-radius: 999px; padding: 0.1rem 0.6rem; margin-bottom: 0.6rem;
}
.pin-title { font-weight: 600; line-height: 1.35; margin-bottom: 0.4rem; }
.pin-desc { color: var(--muted); font-size: 0.92rem; margin-bottom: 0.5rem; }
.pin-link { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.pin-card figcaption {
  font-size: 0.85rem; color: var(--muted); padding: 0.75rem 1.1rem 1rem;
  border-top: 1px solid var(--rule); font-style: italic;
}

/* Steps */
ol.steps { list-style: none; padding: 0; counter-reset: step; }
ol.steps li { counter-increment: step; padding: 1rem 0 0.25rem 3rem; border-top: 1px solid var(--rule); position: relative; }
ol.steps li::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 1rem;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
ol.steps strong { display: block; font-weight: 500; }

/* Lists */
ul.ticks, ul.crosses { list-style: none; padding: 0; }
ul.ticks li, ul.crosses li { position: relative; padding-left: 1.6rem; }
ul.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); }
ul.crosses li::before { content: "–"; position: absolute; left: 0.2rem; color: var(--muted); }

.two-col { display: grid; gap: 0 2.5rem; }
@media (min-width: 40rem) { .two-col { grid-template-columns: 1fr 1fr; } }
.two-col h3 { margin-top: 0.5rem; }

/* Comparison table: a little wider than body text, centred with it */
.compare-section { max-width: 52rem; margin: 0 auto; padding: 0 1rem; }
.table-scroll { overflow-x: auto; margin: 1rem 0 0; }
table.compare { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 36rem; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 0.85rem 0.9rem; border-bottom: 1px solid var(--rule); }
.compare thead th { font-weight: 500; color: var(--muted); }
.compare tbody th { font-weight: 500; width: 20%; }
.compare .us { background: var(--note-bg); }
.compare thead .us { color: var(--ink); font-weight: 600; border-radius: 10px 10px 0 0; }

/* Pricing */
.plans { display: grid; gap: 1.25rem; }
@media (min-width: 40rem) { .plans { grid-template-columns: 1fr 1fr; } }
.plan { border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.25rem 1.25rem 0.5rem; background: var(--surface); }
.plan h3 { margin-top: 0; }
.plan-founding { border-color: var(--accent); }
.plan .btn { display: block; text-align: center; padding-left: 0.75rem; padding-right: 0.75rem; }
.price { font-size: 2rem; font-weight: 500; margin: 0.25rem 0 0.75rem; line-height: 1; }
.price span { font-size: 1rem; color: var(--muted); font-weight: 400; }

/* FAQ */
.faq details { border-top: 1px solid var(--rule); padding: 0.9rem 0; }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0.75rem 0 0.25rem; color: var(--muted); }

/* Fit Check form */
.apply { padding-bottom: 1rem; }
.fit-form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.fit-form label { display: grid; gap: 0.35rem; font-weight: 500; font-size: 0.95rem; }
.fit-form label .meta { font-weight: 400; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: 10px; padding: 0.65rem 0.8rem; width: 100%; max-width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--focus); }
.fit-form button { justify-self: start; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Worker-rendered admin pages */
select:not(.fit-form select) { width: auto; margin: 0 0.75rem 0.75rem 0.5rem; }
form + form { margin-top: 0.5rem; }
pre { white-space: pre-wrap; word-break: break-word; font-size: 0.85rem; background: var(--note-bg); padding: 0.75rem; }
img { max-width: 100%; height: auto; }

/* Footer */
footer.site {
  margin: 4rem auto 2rem; padding-top: 1rem; border-top: 1px solid var(--rule);
  color: var(--muted); font-size: 0.9rem;
}
footer.site a { color: var(--muted); margin-right: 1rem; }

@media (max-width: 30rem) {
  h1 { font-size: 1.9rem; margin-top: 1.5rem; }
  .lede, .big { font-size: 1.08rem; }
  nav { gap: 0.25rem 0.9rem; }
}
