/*
 * Letter Kit — the same editorial system as Submit Kit: warm paper and ink,
 * hairline rules rather than cards, one accent used sparingly, generous type.
 *
 * Plain CSS on purpose. Submit Kit's pages come out of Rails and Tailwind;
 * these are hand-written, so a build step would exist only to be forgotten
 * before a deploy. What you read here is what ships.
 *
 * The type is a system serif stack — no webfont request, so `font-src 'self'`
 * in the CSP stays exactly as it is and nothing is fetched from a third party.
 */

:root {
  --paper: #f6f4ee;        /* page ground, light */
  --paper-raised: #fdfcf8; /* inputs, panels */
  --ink: #211d19;          /* primary text, warm near-black */
  --ink-soft: #5c554d;     /* secondary text */
  --ink-faint: #989084;    /* metadata, footer */
  --rule: #ddd7cb;         /* hairline borders */

  /* Deep teal-blue, where Submit Kit is rust. Siblings, not twins. */
  --accent: #0f4c5c;
  --accent-on-accent: #fdfcf8;

  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #33302b;        /* night — a warm mid grey, not black */
    --paper-raised: #3c3833;
    --ink: #ece8e0;          /* linen */
    --ink-soft: #b5ac9f;
    --ink-faint: #b5ac9f;
    --rule: #514b42;

    --accent: #5aa9bd;
    --accent-on-accent: #33302b;
  }
}

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

html {
  font-family: var(--serif);
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* Accent discipline: links, the primary button, the wordmark's period. */
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Horizontal padding only, and as longhands. The `padding` shorthand here beat
   every element selector that tried to set vertical padding on the same box —
   `main` and the header `nav` both carry .wrap — and silently zeroed it. */
.wrap { margin: 0 auto; max-width: 42rem; padding-left: 1.5rem; padding-right: 1.5rem; width: 100%; }

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

.site-header { border-bottom: 1px solid var(--rule); }
/* Position context for the disclosure summary. It has to be this box rather
   than .nav-row: the <details> is a sibling of the row, not a child, so the
   row cannot grow when the panel opens. */
.site-header nav { position: relative; padding-top: 1.25rem; padding-bottom: 1.25rem; }
.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; }

.wordmark {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark .dot { color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 1.25rem; font-family: var(--sans); font-size: 13px; }
.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); }

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-on-accent);
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}
.button:hover { background: var(--ink); color: var(--paper-raised); }
.button:disabled { opacity: 0.6; cursor: default; }
/* `.site-nav a` is more specific than `.button`, so the CTA needs its colour
   restating here or it inherits ink-soft — near-invisible on the accent. */
.site-nav a.button { padding: 0.5rem 0.875rem; color: var(--accent-on-accent); }
.site-nav a.button:hover { color: var(--paper-raised); }

/* ---------- main ---------- */

main { flex: 1 0 auto; padding-top: 3.5rem; padding-bottom: 3.5rem; }

h1 { font-size: 2rem; font-weight: 400; line-height: 1.2; letter-spacing: -0.015em; margin: 0; }
h2 { font-size: 1.375rem; font-weight: 400; line-height: 1.3; margin: 2.75rem 0 0; }
h3 { font-size: 1.0625rem; font-weight: 600; margin: 2rem 0 0; }

p, ul, ol { line-height: 1.65; margin: 1.25rem 0 0; }
li { margin-top: 0.5rem; }
li:first-child { margin-top: 0; }
ul, ol { padding-left: 1.25rem; }

.lede { margin-top: 1.25rem; color: var(--ink-soft); font-size: 1.0625rem; }
.muted { color: var(--ink-soft); }
.small { font-family: var(--sans); font-size: 0.8125rem; color: var(--ink-faint); }

strong { font-weight: 600; }
code { font-family: var(--mono); font-size: 0.875em; background: var(--paper-raised); border: 1px solid var(--rule); padding: 0.05em 0.3em; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0 0; }

/* A note set off by a hairline in the accent — used for the draft banner,
   the guarantee, and the form's status messages. Never a card. */
.note {
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
  margin-top: 1.75rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.6;
}
.note strong { color: var(--ink); }

/* The price, stated once, plainly. */
.price { font-size: 2.5rem; line-height: 1.1; margin-top: 2rem; }
.price .amount { color: var(--accent); }

/* Numbered steps as hanging figures rather than a grid of boxes. */
.steps { list-style: none; padding: 0; margin-top: 2rem; counter-reset: step; }
.steps > li { counter-increment: step; padding-left: 2.5rem; position: relative; margin-top: 1.75rem; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05em;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--ink-faint);
  border: 1px solid var(--rule);
  width: 1.625rem;
  height: 1.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps h3 { margin-top: 0; }

table { border-collapse: collapse; width: 100%; margin-top: 1.75rem; font-family: var(--sans); font-size: 0.875rem; }
th, td { text-align: left; padding: 0.625rem 0.75rem 0.625rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; color: var(--ink-soft); }

/* ---------- forms ---------- */

form { margin-top: 2rem; max-width: 28rem; }
.field { display: block; margin-top: 1rem; }
.field:first-of-type { margin-top: 0; }
.field > span { font-family: var(--sans); font-size: 0.875rem; font-weight: 500; display: block; }
.field .hint { font-weight: 400; color: var(--ink-faint); font-size: 0.75rem; margin-top: 0.25rem; }
.field .hint-inline { display: inline; font-weight: 400; color: var(--ink-faint); }

input[type="text"], input[type="email"], textarea {
  margin-top: 0.375rem;
  width: 100%;
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  color: var(--ink);
  padding: 0.5rem 0.75rem;
  font-family: var(--sans);
  font-size: 15px;
}
input:focus, textarea:focus { border-color: var(--accent); outline: none; }
textarea { resize: vertical; }

.cf-turnstile { margin-top: 1.25rem; }
form .button { margin-top: 1.25rem; }

#form-status { font-family: var(--sans); font-size: 0.875rem; margin-top: 1rem; }

/* The confirmation replaces the form, so it has to read as the answer to the
   page rather than as another aside. A .note here looked identical to the
   informational one below it — same small sans, same muted grey. This keeps
   the accent rule but sets the message in serif at heading size, in full ink. */
.form-success {
  margin-top: 2rem;
  border-left: 3px solid var(--accent);
  padding-left: 1.375rem;
}
.form-success .headline {
  display: block;
  font-family: var(--serif);
  font-size: 1.375rem;
  line-height: 1.3;
  color: var(--ink);
}
.form-success .detail {
  display: block;
  margin-top: 0.625rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
#form-status.error { color: var(--accent); }

/* ---------- mobile menu ---------- */

/* A native <details> disclosure: no JavaScript, and so nothing the CSP has to
   allow. Hidden entirely once the full navigation fits. */
.menu { display: none; }
.menu summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--ink);
  /* A 44px target — the whole point of the exercise is thumbs. The padding
     is the target; the offsets below account for it. */
  padding: 0.625rem;
}
.menu summary::-webkit-details-marker { display: none; }
.menu svg { width: 1.5rem; height: 1.5rem; display: block; }
.menu .i-close, .menu[open] .i-open { display: none; }
.menu[open] .i-close { display: block; }

.menu-panel {
  display: flex;
  flex-direction: column;
  margin-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.9375rem;
}
.menu-panel a {
  border-bottom: 1px solid var(--rule);
  padding: 0.875rem 0;
  color: var(--ink);
  text-decoration: none;
}
.menu-panel a[aria-current="page"] { color: var(--ink-faint); }
.menu-panel a.button {
  align-self: flex-start;
  margin-top: 1.25rem;
  border-bottom: 0;
  padding: 0.625rem 1.25rem;
  color: var(--accent-on-accent);
}

@media (max-width: 40rem) {
  .site-nav { display: none; }
  .menu { display: block; }
  /* Sit the trigger in the header row rather than below it, at a FIXED top
     offset. Anchoring it to the middle (top: 50%) drifts it downwards as the
     open panel makes its container taller — the bug Submit Kit's header
     records having had. The offsets subtract the 0.625rem tap padding so the
     icon itself lines up with the wordmark and the content edge. */
  .menu summary { position: absolute; top: 0.75rem; right: 0.875rem; }
}

/* ---------- home page hero ---------- */

.hero-title {
  font-size: 2.4rem;
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.hero-lede {
  margin-top: 1.5rem;
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* Small accent squares rather than bullets — the one place the accent is
   allowed to be a shape instead of text. */
.marks { list-style: none; padding: 0; margin-top: 2rem; font-family: var(--sans); font-size: 0.9375rem; }
.marks li { display: flex; align-items: baseline; gap: 0.75rem; margin-top: 0.875rem; line-height: 1.5; }
.marks li::before {
  content: "";
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--accent);
  transform: translateY(-0.1em);
}

.actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.875rem 1.5rem; margin-top: 2.25rem; }
.action-link {
  font-family: var(--sans);
  font-size: 0.875rem;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 4px;
}
.action-link:hover { text-decoration-color: var(--accent); }

.panel { margin-top: 3rem; border-top: 1px solid var(--rule); padding-top: 2rem; }
.panel-label {
  margin: 0;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}
.sample {
  margin: 0.75rem 0 0;
  overflow-x: auto;
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  padding: 1rem;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
}
.sample code { background: none; border: 0; padding: 0; font-size: inherit; }

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

.site-footer { border-top: 1px solid var(--rule); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; padding-top: 2rem; padding-bottom: 2rem; font-family: var(--sans); font-size: 13px; color: var(--ink-faint); }
.site-footer a { color: var(--ink-faint); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.site-footer .grow { flex: 1 1 auto; }

/* The reciprocal half of Submit Kit's house ad: same band, same rule weight,
   this palette's accent. Asset-free on purpose — no logo image and no webfont,
   so the strict CSP needs no new directive to carry an ad. */
.house-ad { border-top: 1px solid var(--rule); }
.house-ad .wrap { padding-top: 2.25rem; padding-bottom: 2.25rem; }
.house-ad-body { margin: 0.75rem 0 0; line-height: 1.6; }
.house-ad-name { font-weight: 600; }
.house-ad-name .dot { color: var(--accent); }
.house-ad-body .muted { color: var(--ink-soft); }
.house-ad-link { margin: 1rem 0 0; font-family: var(--sans); font-size: 0.875rem; }

@media (min-width: 40rem) {
  .house-ad .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 2rem; }
  .house-ad-col { flex: 1 1 auto; }
  .house-ad-body { max-width: 32rem; }
  .house-ad-link { margin-top: 0; flex: 0 0 auto; }
}

@media (max-width: 32rem) {
  h1 { font-size: 1.75rem; }
  .hero-title { font-size: 2rem; }
  .price { font-size: 2rem; }
  main { padding-top: 2.5rem; padding-bottom: 2.5rem; }
}
