/* CoverLetterGen — warm paper + ink + rust. Serif headings, thin rules, no shadows. */

:root {
  --paper: #fbf8f2;
  --paper-2: #fffdfa;
  --ink: #151b22;
  --ink-soft: #3c4652;
  --muted: #6d7683;
  --line: #e5ded1;
  --line-strong: #cfc5b4;
  --accent: #a3541e;
  --accent-soft: #f4e7dc;
  --slate: #2b4152;
  --ok: #2f6b4f;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-soft-ink, #7d3e12); }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h1 { font-size: clamp(1.95rem, 3.5vw, 2.7rem); }
h2 { font-size: clamp(1.55rem, 2.8vw, 2.1rem); margin-top: 0; }
h3 { font-size: 1.22rem; }
h4 { font-size: 1.02rem; font-family: var(--sans); font-weight: 700; letter-spacing: 0; }

p { margin: 0 0 1.05em; }
ul, ol { margin: 0 0 1.15em; padding-left: 1.25em; }
li { margin-bottom: 0.45em; }
strong { color: var(--ink); }
small { font-size: 0.86rem; }

.muted { color: var(--muted); }
.lede { font-size: 1.14rem; color: var(--ink-soft); }
.kicker {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
}

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 248, 242, 0.94);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 66px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand .mark {
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  display: inline-grid;
  place-items: center;
  font-size: 0.9rem;
  padding-top: 4px;
  position: relative;
}
.brand .mark::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 7px;
  height: 7px;
  background: var(--accent);
}
.nav { display: flex; align-items: center; gap: 22px; font-size: 0.92rem; }
.nav a { color: var(--ink-soft); text-decoration: none; white-space: nowrap; }
.nav a:hover, .nav a.active { color: var(--accent); }
.nav a.active { font-weight: 600; }

/* ---------------------------------------------------------------- hero */
.hero { padding: 58px 0 44px; border-bottom: 1px solid var(--line); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 54px;
  align-items: center;
}
.hero h1 { margin-bottom: 16px; }
.hero .lede { font-size: 1.16rem; margin-bottom: 26px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }

.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--paper-2);
  border: 1px solid var(--ink);
  border-radius: 3px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover { background: #2c3641; color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--accent-soft); color: var(--ink); }
.btn.small { padding: 8px 14px; font-size: 0.85rem; }

.hero-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  font-size: 0.88rem;
  color: var(--muted);
}
.hero-points li { margin: 0; padding-left: 16px; position: relative; }
.hero-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 1.5px;
  background: var(--accent);
}

/* paper mock */
.paper-mock {
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 30px 30px 26px;
  box-shadow: 12px 12px 0 rgba(43, 65, 82, 0.06);
  transform: rotate(-0.7deg);
  font-family: var(--serif);
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--ink-soft);
}
.paper-mock .pm-head { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 16px; }
.paper-mock .pm-name { font-size: 1rem; font-weight: 700; color: var(--ink); letter-spacing: 0.02em; }
.paper-mock .pm-meta { font-size: 0.74rem; color: var(--muted); letter-spacing: 0.04em; }
.paper-mock .pm-line { background: var(--line); height: 6px; border-radius: 1px; margin: 0 0 9px; }
.paper-mock .pm-line.w90 { width: 90%; }
.paper-mock .pm-line.w75 { width: 75%; }
.paper-mock .pm-line.w60 { width: 60%; }
.paper-mock .pm-mark {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.72rem;
  font-family: var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

/* ---------------------------------------------------------------- bands */
.band { padding: 54px 0; border-bottom: 1px solid var(--line); }
.band.tight { padding: 40px 0; }
.band.alt { background: var(--paper-2); }
.band-head { margin-bottom: 30px; }
.band-head p { color: var(--ink-soft); margin-bottom: 0; }

.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }

.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 22px 22px 18px;
}
.card h3 { margin-bottom: 8px; font-size: 1.1rem; }
.card p { font-size: 0.94rem; color: var(--ink-soft); margin-bottom: 0; }
.card .num {
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--accent);
  border: 1px solid var(--line-strong);
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  margin-bottom: 12px;
}

/* letter sample */
.letter {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 32px 34px;
  font-family: var(--serif);
  font-size: 0.97rem;
  line-height: 1.75;
  color: #202932;
  max-width: 720px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.letter p { margin-bottom: 0.85em; }
.letter .lh { border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 16px; }
.letter .lh strong { font-size: 1.02rem; letter-spacing: 0.02em; }
.letter .meta { font-size: 0.84rem; color: var(--muted); }
.letter .sig { margin-top: 18px; }
.letter-note {
  font-family: var(--sans);
  font-size: 0.86rem;
  color: var(--accent);
  border-left: 2px solid var(--accent);
  padding-left: 12px;
  margin: 14px 0 0;
}

.annotation { display: grid; grid-template-columns: 1fr; gap: 22px; }
.anno-item { border-top: 1px solid var(--line); padding-top: 14px; }
.anno-item h4 { margin-bottom: 4px; }
.anno-item p { font-size: 0.92rem; color: var(--ink-soft); margin: 0; }

/* table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 3px; background: var(--paper-2); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f6f1e7; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); }
tr:last-child td { border-bottom: 0; }
td code, p code, li code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: #f2ece1;
  padding: 1px 5px;
  border-radius: 2px;
}

/* ---------------------------------------------------------------- builder tool */
.builder {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  align-items: start;
}
.builder-form,
.builder-out {
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 22px;
}
.builder-out { position: sticky; top: 84px; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 0.94rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 9px 11px;
  line-height: 1.5;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}
.hint { font-size: 0.78rem; color: var(--muted); margin: 5px 0 0; }

.out-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 14px;
  font-size: 0.8rem;
  color: var(--muted);
}
.out-toolbar .actions { display: flex; gap: 8px; }

#letterOut {
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 1.72;
  white-space: pre-wrap;
  word-break: break-word;
  color: #1f2831;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 6px;
}
#letterOut .ph { color: var(--muted); font-style: italic; }

.count-badge { font-variant-numeric: tabular-nums; }
.count-badge.warn { color: var(--accent); }

/* faq */
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  list-style: none;
  position: relative;
  padding-right: 26px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 2px;
  top: -2px;
  font-size: 1.25rem;
  color: var(--accent);
  font-weight: 400;
}
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 10px 0 0; font-size: 0.94rem; color: var(--ink-soft); }

/* step list */
.steps { list-style: none; padding: 0; counter-reset: step; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 22px 52px;
  border-left: 1px solid var(--line);
  margin-left: 14px;
  margin-bottom: 0;
}
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: -14px;
  top: -2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 0.88rem;
  color: var(--accent);
}
.steps h3 { font-size: 1.08rem; margin-bottom: 6px; }
.steps p, .steps ul { font-size: 0.96rem; color: var(--ink-soft); }

/* callout */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 16px 20px;
  border-radius: 0 3px 3px 0;
  margin: 0 0 24px;
  font-size: 0.95rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout.warn { border-left-color: #8c5a12; background: #fbf1de; }

/* toc */
.toc {
  border: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: 3px;
  padding: 18px 22px;
  margin-bottom: 34px;
  font-size: 0.92rem;
}
.toc h4 { margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin-bottom: 3px; }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

/* footer */
.site-footer { padding: 46px 0 40px; background: var(--paper-2); border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 30px; }
.footer-grid h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; font-size: 0.9rem; }
.footer-grid li { margin-bottom: 7px; }
.footer-grid a { color: var(--ink-soft); text-decoration: none; }
.footer-grid a:hover { color: var(--accent); }
.footer-note {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
}
.footer-note p { margin-bottom: 6px; }

/* disclosure strip */
.disclosure {
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-left: 3px solid var(--slate);
  background: var(--paper-2);
  padding: 10px 14px;
  margin: 0 0 26px;
}

/* breadcrumbs */
.crumbs { font-size: 0.8rem; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

/* 404 */
.notfound { padding: 90px 0 100px; text-align: left; }
.notfound h1 { font-size: 3rem; }

@media (max-width: 900px) {
  .hero-grid, .builder, .cols-3, .cols-2, .footer-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 38px; }
  .paper-mock { transform: none; box-shadow: 6px 6px 0 rgba(43, 65, 82, 0.06); }
  .builder-out { position: static; }
  .nav { gap: 14px; font-size: 0.86rem; }
  .footer-grid { gap: 22px; }
  .hero-points { gap: 6px 18px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .site-header .wrap { min-height: 58px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .nav { width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .field-row { grid-template-columns: 1fr; }
  .letter { padding: 22px 20px; }
  .band { padding: 38px 0; }
}
