/* Layout: a contractor's carbon-copy proposal, marked up in red pen.
   Paper ground, canary carbon sheet for the hero, red pen used only for grading marks. */
:root {
  --paper: #f4f5f2;
  --surface: #ffffff;
  --ink: #1b2220;
  --muted: #56615c;
  --rule: #d6dbd6;
  --carbon: #fbeea0;
  --carbon-ink: #3a3410;
  --carbon-rule: #e2d27a;
  --redpen: #c3161c;
  --focus: #1f5fbf;

  --f-display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --f-pen: "Caveat", "Bradley Hand", "Segoe Print", cursive;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121614;
    --surface: #1a1f1d;
    --ink: #e8ece9;
    --muted: #a3aea9;
    --rule: #2c3431;
    --carbon: #36311a;
    --carbon-ink: #f3eac0;
    --carbon-rule: #574e22;
    --redpen: #ff6058;
    --focus: #7fb0ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121614;
  --surface: #1a1f1d;
  --ink: #e8ece9;
  --muted: #a3aea9;
  --rule: #2c3431;
  --carbon: #36311a;
  --carbon-ink: #f3eac0;
  --carbon-rule: #574e22;
  --redpen: #ff6058;
  --focus: #7fb0ff;
  color-scheme: dark;
}

*, *::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;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.55;
}
img { max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.02; text-wrap: balance; margin: 0; letter-spacing: 0.005em; }
h1 { font-size: clamp(2.75rem, 7vw, 4.75rem); text-transform: uppercase; }
h2 { font-size: clamp(2rem, 4.2vw, 2.9rem); text-transform: uppercase; }
h3 { font-size: 1.35rem; text-transform: uppercase; letter-spacing: 0.02em; }
p { margin: 0; }
.eyebrow { font-family: var(--f-mono); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 34em; }

/* Header */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.logo { font-family: var(--f-display); font-weight: 800; font-size: 1.6rem; text-transform: uppercase; text-decoration: none; letter-spacing: 0.01em; display: inline-flex; align-items: baseline; gap: 2px; }
.logo .mark { font-family: var(--f-pen); color: var(--redpen); font-size: 1.9rem; text-transform: none; line-height: 1; transform: rotate(-6deg); display: inline-block; margin-left: 4px; }
.head-cta { font-weight: 600; font-size: 0.98rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--f-display); font-weight: 700; font-size: 1.25rem; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; padding: 14px 26px; border-radius: 4px; border: 2px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer; }
.btn:hover { background: transparent; color: var(--ink); }
.btn:disabled { opacity: 0.6; cursor: progress; }

/* Hero */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(28px, 5vw, 64px); align-items: center; padding-block: clamp(36px, 6vw, 72px); }
.hero-copy { display: grid; gap: 22px; min-width: 0; }
.hero-copy h1 .pen { font-family: var(--f-pen); text-transform: none; color: var(--redpen); font-weight: 700; font-size: 1.12em; display: inline-block; transform: rotate(-3deg); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.hero-note { font-size: 0.95rem; color: var(--muted); }

/* The carbon-copy proposal */
.sheet { position: relative; background: var(--carbon); color: var(--carbon-ink); border-radius: 3px; padding: 22px 22px 18px; box-shadow: 0 1px 0 var(--carbon-rule), 0 14px 30px -18px rgba(40, 34, 0, 0.45); transform: rotate(0.8deg); min-width: 0; }
.sheet-head { display: flex; justify-content: space-between; gap: 12px; font-family: var(--f-mono); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 1.5px solid var(--carbon-rule); padding-bottom: 10px; padding-right: 76px; }
.sheet-title { font-family: var(--f-display); font-weight: 700; font-size: 1.35rem; text-transform: uppercase; margin-top: 10px; padding-right: 76px; }
.sheet-sub { font-family: var(--f-mono); font-size: 0.78rem; margin-top: 2px; }
.lines { list-style: none; margin: 14px 0 0; padding: 0; font-family: var(--f-mono); font-size: 0.82rem; }
.lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline; padding: 7px 0; border-bottom: 1px dashed var(--carbon-rule); }
.lines .amt { font-variant-numeric: tabular-nums; text-align: right; }
.lines .note { grid-column: 1 / -1; font-family: var(--f-pen); color: var(--redpen); font-size: 1.15rem; line-height: 1.1; margin-top: 2px; }
.lines .struck { text-decoration: line-through; text-decoration-color: var(--redpen); text-decoration-thickness: 2px; }
.sheet-total { display: flex; justify-content: space-between; font-family: var(--f-mono); font-weight: 600; font-size: 0.9rem; padding-top: 10px; }
.grade { position: absolute; top: 14px; right: 16px; width: 70px; height: 62px; display: grid; place-items: center; font-family: var(--f-pen); font-weight: 700; font-size: 2.6rem; color: var(--redpen); line-height: 1; transform: rotate(-8deg); }
.grade::before { content: ""; position: absolute; inset: 0; border: 2.5px solid var(--redpen); border-radius: 50% 46% 52% 48% / 54% 50% 48% 50%; }
.sample-tag { font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 10px; text-align: right; }

/* Sections */
section.block { border-top: 1px solid var(--rule); }
section.block > .wrap { padding-block: clamp(44px, 7vw, 84px); display: grid; gap: 28px; }
.section-head { display: grid; gap: 10px; max-width: 46em; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; counter-reset: step; }
.steps li { counter-increment: step; display: grid; gap: 8px; align-content: start; border-top: 3px solid var(--ink); padding-top: 14px; min-width: 0; }
.steps li::before { content: "Step " counter(step); font-family: var(--f-mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.steps p { color: var(--muted); }

.checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.checks li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.checks .tick { font-family: var(--f-pen); color: var(--redpen); font-size: 1.6rem; line-height: 1; }
.checks strong { display: block; font-weight: 700; }
.checks span.d { color: var(--muted); font-size: 0.97rem; }

/* Sample comparison */
.table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); }
table.compare { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 0.95rem; }
.compare th, .compare td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
.compare thead th { font-family: var(--f-display); font-size: 1.15rem; text-transform: uppercase; letter-spacing: 0.03em; background: var(--paper); }
.compare tbody th { font-weight: 600; color: var(--muted); white-space: nowrap; }
.compare td.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.compare .flag { color: var(--redpen); font-weight: 600; }
.compare tr.grade-row td { font-family: var(--f-pen); font-size: 1.9rem; color: var(--redpen); font-weight: 700; line-height: 1; }
.compare tr:last-child th, .compare tr:last-child td { border-bottom: 0; }
.verdict { border-left: 4px solid var(--redpen); padding: 4px 0 4px 16px; max-width: 46em; }
.verdict .eyebrow { color: var(--redpen); }
.caption { font-size: 0.9rem; color: var(--muted); }

/* Founder / fairness */
.fair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.fair-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.fair-rules li { padding: 16px 18px; background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; }
.fair-rules strong { display: block; font-family: var(--f-display); font-size: 1.2rem; text-transform: uppercase; letter-spacing: 0.02em; }

/* Form */
.form-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: clamp(20px, 4vw, 36px); display: grid; gap: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
label, legend { font-weight: 600; font-size: 0.98rem; }
.opt { font-weight: 400; color: var(--muted); }
.hint { font-size: 0.88rem; color: var(--muted); }
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  font: inherit; color: var(--ink); background: var(--paper); border: 1.5px solid var(--rule); border-radius: 4px; padding: 11px 12px; width: 100%;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 6px; }
.choices label { font-weight: 400; display: inline-flex; align-items: center; gap: 8px; }
.uploads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.drop { position: relative; display: grid; gap: 6px; align-content: start; border: 2px dashed var(--rule); border-radius: 6px; padding: 16px; background: var(--paper); min-width: 0; }
.drop.has-file { border-style: solid; border-color: var(--ink); }
.drop .slot { font-family: var(--f-display); font-size: 1.2rem; text-transform: uppercase; letter-spacing: 0.02em; }
.drop input[type="file"] { font-size: 0.9rem; width: 100%; }
.drop .picked { font-family: var(--f-mono); font-size: 0.78rem; color: var(--muted); overflow-wrap: anywhere; }
.consent { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; font-weight: 400; font-size: 0.95rem; }
.consent input { margin-top: 4px; width: 18px; height: 18px; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.form-status { font-weight: 600; }
.form-status.error { color: var(--redpen); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* FAQ */
.faq { display: grid; gap: 0; max-width: 52em; }
.faq details { border-bottom: 1px solid var(--rule); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 1.08rem; list-style-position: outside; }
.faq details p { margin-top: 8px; color: var(--muted); max-width: 40em; }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-block: 26px; font-size: 0.9rem; color: var(--muted); }

/* Simple text pages */
.page { padding-block: clamp(36px, 6vw, 72px); display: grid; gap: 18px; max-width: 46em; }
.page h2 { font-size: 1.6rem; margin-top: 18px; }
.page ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.page p, .page li { color: var(--ink); }

@media (max-width: 880px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .sheet { transform: none; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .fair { grid-template-columns: minmax(0, 1fr); }
  .uploads { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .checks { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .head-cta { display: none; }
}

/* Live grading: progress and report */
.progress { display: grid; gap: 14px; justify-items: start; }
.progress .pen-spin { font-family: var(--f-pen); color: var(--redpen); font-size: 2.4rem; line-height: 1; display: inline-block; animation: wobble 1.2s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .progress .pen-spin { animation: none; } }
.progress-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-family: var(--f-mono); font-size: 0.9rem; color: var(--muted); }
.progress-steps li.done { color: var(--ink); }
.progress-steps li.done::before { content: "\2713  "; color: var(--redpen); }
.progress-steps li.now { color: var(--ink); font-weight: 600; }
.progress-steps li.now::before { content: "\2192  "; }

.report { display: grid; gap: 30px; }
.report-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 14px; }
.report-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn.small { font-size: 1rem; padding: 9px 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 18px 18px 16px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.card.picked { border: 2px solid var(--redpen); }
.card .label { font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.card .who { font-family: var(--f-display); font-size: 1.35rem; text-transform: uppercase; line-height: 1.05; padding-right: 64px; overflow-wrap: anywhere; }
.card .price { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.card .why { color: var(--muted); font-size: 0.95rem; }
.card .g { position: absolute; top: 12px; right: 14px; font-family: var(--f-pen); font-weight: 700; color: var(--redpen); font-size: 2.6rem; line-height: 1; transform: rotate(-8deg); }
.card .pick-tag { justify-self: start; font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; background: var(--redpen); color: var(--surface); padding: 3px 8px; border-radius: 3px; }
.per-quote { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.per-quote > div { display: grid; gap: 10px; align-content: start; min-width: 0; }
.per-quote h3 { font-size: 1.2rem; }
.per-quote ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.per-quote .flags li { color: var(--ink); }
.per-quote .flags li::marker { color: var(--redpen); }
.compare td.concern { color: var(--redpen); font-weight: 600; }
.report .disclaimer { font-size: 0.88rem; color: var(--muted); max-width: 52em; }
.notice { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--redpen); border-radius: 4px; padding: 16px 18px; display: grid; gap: 8px; }

@media print {
  .site-head, .site-foot, section.block:not(#upload), .hero, .report-actions, #quote-form, .progress { display: none !important; }
  body { background: #fff; color: #000; }
  section.block { border: 0; }
  .card, .table-scroll { break-inside: avoid; }
}
.steps-list { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; max-width: 46em; }
.disclosure { margin-top: 10px; padding: 10px 12px; background: var(--carbon); color: var(--carbon-ink); border-radius: 4px; font-weight: 600; font-size: 0.95rem; }
.form-status.error { display: block; flex-basis: 100%; background: color-mix(in srgb, var(--redpen) 10%, var(--surface)); border: 1.5px solid var(--redpen); border-radius: 4px; padding: 10px 12px; order: -1; }
.invalid { outline: 2.5px solid var(--redpen); outline-offset: 3px; border-radius: 4px; }
.file-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.file-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: 4px 4px 4px 10px; }
.file-list .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.file-list .fsize { color: var(--muted); font-variant-numeric: tabular-nums; }
.file-list .remove { font: inherit; font-size: 1.3rem; line-height: 1; width: 36px; height: 36px; border: 0; border-radius: 4px; background: transparent; color: var(--redpen); cursor: pointer; }
.file-list .remove:hover { background: color-mix(in srgb, var(--redpen) 12%, transparent); }
.sr-file { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.add-btn { justify-self: start; display: inline-flex; align-items: center; font-weight: 600; font-size: 0.98rem; padding: 9px 14px; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--surface); color: var(--ink); cursor: pointer; }
.add-btn:hover { background: var(--ink); color: var(--paper); }
.sr-file:focus-visible + .add-btn { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Feature checklist */
.compare.features th .sub { display: block; font-family: var(--f-body); font-size: 0.85rem; text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 600; }
.compare.features tbody th { white-space: normal; color: var(--ink); min-width: 180px; }
.compare.features tbody th .why { display: block; font-weight: 400; font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.fcell { white-space: normal; }
.fcell .mark { display: inline-block; min-width: 2.2em; font-weight: 700; font-size: 1.1rem; }
.fcell .fdetail { font-size: 0.92rem; }
.ok .mark, .legend .ok { color: #1f7a3d; }
.up .mark, .legend .up { color: #1f7a3d; }
.up .fdetail { font-weight: 700; }
.basic .mark, .legend .basic { color: #8a6d00; }
.opt .mark, .legend .opt { color: var(--focus); }
.no .mark, .legend .no { color: var(--redpen); }
.unk .mark, .legend .unk { color: var(--muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ok .mark, :root:not([data-theme="light"]) .up .mark, :root:not([data-theme="light"]) .legend .ok, :root:not([data-theme="light"]) .legend .up { color: #6fd08f; } :root:not([data-theme="light"]) .basic .mark, :root:not([data-theme="light"]) .legend .basic { color: #e6c25a; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-weight: 600; }
.card .price.matched { color: var(--ink); font-weight: 600; }
.detail-table { border: 1px solid var(--rule); border-radius: 4px; padding: 12px 14px; background: var(--surface); }
.detail-table summary { cursor: pointer; font-weight: 700; }
.detail-table[open] summary { margin-bottom: 10px; }
#upload.showing-report > .wrap > .section-head:first-child { display: none; }

@media print {
  #upload > .wrap > .section-head:first-child { display: none !important; }
  .per-quote, .cards { display: block !important; }
  .per-quote > div, .card { margin-bottom: 14px; break-inside: avoid; }
  .table-scroll { overflow: visible !important; }
  table.compare { min-width: 0 !important; font-size: 0.8rem; }
  .compare th, .compare td { padding: 6px 8px; }
  .report { display: block !important; }
  .report > * { margin-bottom: 18px; }
  .detail-table { border: 0; padding: 0; }
  .detail-table summary { list-style: none; }
}
.compare.features td.diff { min-width: 260px; font-size: 0.92rem; color: var(--ink); white-space: normal; }
.compare.features td.diff .edge { display: block; font-family: var(--f-mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--redpen); font-weight: 600; margin-bottom: 3px; }
.compare.features td.diff .edge.even { color: var(--muted); }
@media print { .compare.features td.diff { min-width: 0; } }
