/* =====================================================================
   Loop and Link — marketing site
   The layout grid is ruled practice paper: a 32px line rhythm that every
   block of type sits on, a red margin rule down the left of the content
   column, and dotted midlines behind section headings. Everything else
   stays quiet on purpose.
   ===================================================================== */

:root {
  --paper: #FBF6EA;
  --paper-deep: #F4ECD9;
  --ink: #2B3856;
  --ink-soft: #5E6472;
  --accent: #C0485C;            /* notebook margin red */
  --accent-soft: rgba(192, 72, 92, 0.32);
  --rule: rgba(43, 56, 86, 0.07);
  --rule-strong: rgba(43, 56, 86, 0.16);
  --green: #2FAE74;

  --line: 32px;                  /* the ruled line height — the whole grid */
  --measure: 62ch;
  --wrap: 1120px;

  --font: "Atkinson Hyperlegible", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { 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;
  font-family: var(--font);
  font-size: 17px;
  line-height: var(--line);
  color: var(--ink);
  background-color: var(--paper);
  /* the ruled paper itself */
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 calc(var(--line) - 1px),
    var(--rule) calc(var(--line) - 1px) var(--line)
  );
  background-position: 0 7px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- type on the baseline grid ---------- */
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.6vw, 3.05rem); line-height: calc(var(--line) * 1.5); }
h2 { font-size: clamp(1.5rem, 2.9vw, 2.05rem); line-height: calc(var(--line) * 1.25); }
h3 { font-size: 1.15rem; line-height: var(--line); }
p  { margin: 0 0 var(--line); max-width: var(--measure); }
p.lead { font-size: 1.2rem; line-height: calc(var(--line) * 1.25); color: var(--ink-soft); }
h1 + p { margin-top: 16px; }
strong { font-weight: 700; }
small { font-size: 0.87rem; }

a { color: var(--ink); text-decoration-color: var(--accent-soft); text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--accent); }

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

/* ---------- layout ---------- */
.wrap {
  width: min(100% - 48px, var(--wrap));
  margin-inline: auto;
}

/* The red margin rule, like the left line on ruled paper. Everything —
   including the header wordmark — sits to the right of it, so the whole
   page shares one margin the way a sheet of paper does. */
.ruled-margin { position: relative; }
@media (min-width: 1000px) {
  .wrap { padding-left: 40px; }
  .ruled-margin::before {
    content: "";
    position: absolute;
    inset-block: 0;
    left: 0;
    width: 2px;
    background: var(--accent-soft);
  }
}

section { padding-block: calc(var(--line) * 2); }
section + section { border-top: 1px solid var(--rule-strong); }

/* Dotted midline running behind a section heading, like practice paper. */
.midline {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: var(--line);
}
.midline h2 { flex: 0 1 auto; }
.midline::after {
  content: "";
  flex: 1 1 auto;
  height: 0;
  border-top: 2px dashed var(--rule-strong);
  transform: translateY(1px);
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule-strong);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: calc(var(--line) * 2.5);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.08rem;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.wordmark img { width: 30px; height: 30px; display: block; }
.site-nav { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.site-nav a { text-decoration: none; color: var(--ink-soft); font-size: 0.97rem; }
.site-nav a:hover { color: var(--ink); }
@media (max-width: 760px) { .site-nav .hide-sm { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 26px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease;
}
.btn:hover { transform: translateY(-1px); background: #222c45; }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--paper-deep); }
.btn.small { min-height: 40px; padding: 0 18px; font-size: 0.94rem; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover { transform: none; } }

.cta-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.cta-note { color: var(--ink-soft); font-size: 0.94rem; margin: 0; }

/* ---------- hero ---------- */
.hero { padding-block: calc(var(--line) * 2.5) calc(var(--line) * 3); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } }
.hero h1 { margin-bottom: var(--line); }

/* the demo card */
.demo-card {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 6px 6px 0 var(--paper-deep);
  overflow: hidden;
}
.demo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
}
.demo-head p { margin: 0; font-size: 0.95rem; font-weight: 700; }
.demo-canvas-wrap { height: 280px; position: relative; }
.demo-canvas-wrap canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.demo-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-top: 1px solid var(--rule-strong);
  min-height: 66px;
}
.demo-result { margin: 0; flex: 1 1 auto; font-size: 0.95rem; line-height: 22px; color: var(--ink-soft); }
@media (max-width: 520px) {
  .demo-foot { flex-wrap: wrap; }
  .demo-result { flex-basis: 100%; }
  .demo-head { flex-wrap: wrap; }
}
.demo-result.win { color: var(--green); font-weight: 700; }

/* ---------- cards / stages ---------- */
.cols { display: grid; gap: 28px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.card {
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 24px;
  background: color-mix(in srgb, #fff 55%, var(--paper));
}
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; font-size: 0.97rem; color: var(--ink-soft); }
.stage-mark {
  display: block;
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

/* ---------- author ---------- */
.author { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 760px) { .author { grid-template-columns: 1fr; gap: 24px; } }
.author img, .author .photo-placeholder {
  width: 220px;
  max-width: 100%;
  /* The width/height attributes on the <img> are there to reserve space
     before it loads, but they also apply as a presentational height, which
     would beat aspect-ratio. Hand the sizing back to CSS. */
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 6px 6px 0 var(--paper-deep);
}
.photo-placeholder {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* ---------- pricing ---------- */
.price-card {
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 32px;
  background: #fff;
  box-shadow: 6px 6px 0 var(--paper-deep);
  max-width: 520px;
}
.price-figure { font-size: 3rem; line-height: calc(var(--line) * 2); font-weight: 700; letter-spacing: -0.03em; }
.price-figure span { font-size: 1rem; font-weight: 400; color: var(--ink-soft); letter-spacing: 0; }
.price-list { list-style: none; margin: 0 0 var(--line); padding: 0; }
.price-list li { padding-left: 30px; position: relative; }
.price-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

/* ---------- faq ---------- */
.faq { max-width: 76ch; }
.faq details {
  border-bottom: 1px solid var(--rule-strong);
  padding-block: 12px;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 8px 0 12px; color: var(--ink-soft); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 2px solid var(--ink);
  padding-block: calc(var(--line) * 1.5);
  font-size: 0.94rem;
  color: var(--ink-soft);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
.site-footer a { color: var(--ink-soft); }
.site-footer .spacer { flex: 1 1 auto; }

/* ---------- forms ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; margin-bottom: var(--line); }
.field { display: flex; flex-direction: column; gap: 6px; width: min(100%, 380px); }
.field span { font-weight: 700; font-size: 0.95rem; }
.field input {
  font: inherit;
  padding: 12px 14px;
  min-height: 48px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.field input::placeholder { color: #9aa0ae; }

.form-status { margin: 0 0 var(--line); font-size: 0.97rem; color: var(--ink-soft); }
.form-status.ok { color: var(--green); font-weight: 700; }
.form-status.error { color: var(--accent); font-weight: 700; }
.form-status:empty { margin: 0; }

.child-list { list-style: none; margin: 0 0 var(--line); padding: 0; max-width: 480px; }
.child-list li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule-strong);
}
.child-name { flex: 1 1 auto; font-weight: 700; }

/* ---------- long-form legal pages ---------- */
.prose { max-width: 72ch; padding-block: calc(var(--line) * 1.5) calc(var(--line) * 3); }
.prose h1 { margin-bottom: 8px; }
.prose h2 { margin-top: var(--line); margin-bottom: 8px; font-size: 1.3rem; line-height: var(--line); }
.prose ul { margin: 0 0 var(--line); padding-left: 24px; }
.prose li { margin-bottom: 4px; }
.prose .updated { color: var(--ink-soft); margin-bottom: var(--line); }
