/* secondforeman.com — work-order feel for the trades. Phone first. No webfonts. */

:root {
  color-scheme: light dark;
  --paper: #f4eddc;        /* manila ticket */
  --panel: #fffaf0;
  --ink: #1d1a16;
  --muted: #5e5747;
  --rule: #c8bba0;
  --rule-strong: #8e7f62;
  --accent: #d9481f;       /* safety orange, darkened for contrast on paper */
  --accent-ink: #fff8ee;
  --accent-soft: #fbe6dc;
  --ok: #2f6b3a;
  --warn: #8a5a00;
  --error: #a3261b;
  --shadow: 0 1px 0 rgba(0,0,0,.06), 0 6px 18px rgba(60,40,10,.08);
  --radius: 6px;
  --tap: 48px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15171c;
    --panel: #1d2026;
    --ink: #ece6d8;
    --muted: #aaa391;
    --rule: #3a3f4a;
    --rule-strong: #6b7280;
    --accent: #ff7a45;
    --accent-ink: #1a0f08;
    --accent-soft: #3a2418;
    --ok: #7fd18f;
    --warn: #ffcc66;
    --error: #ff8a7a;
    --shadow: 0 1px 0 rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}

* { 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: 1.55;
  color: var(--ink);
  background: var(--paper);
  /* faint ruled-paper lines */
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, color-mix(in srgb, var(--rule) 35%, transparent) 31px 32px);
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { width: min(100% - 2rem, 46rem); margin-inline: auto; }
.muted { color: var(--muted); }
.opt { color: var(--muted); font-weight: 400; font-size: .9em; }
.note { font-size: .92rem; color: var(--muted); margin: .75rem 0 0; }
.note.pending { color: var(--warn); }
.placeholder { color: var(--warn); font-style: italic; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---- header: the ticket head ---- */
.ticket-head { background: var(--panel); border-bottom: 3px double var(--rule-strong); }
.ticket-head-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 0 .5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-weight: 700; letter-spacing: .01em; }
.brand-mark { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; background: var(--accent); color: var(--accent-ink); font-family: var(--mono); font-weight: 700; border-radius: 4px; }
.brand-name { font-size: 1.15rem; }
.ticket-meta { margin: 0; text-align: right; line-height: 1.2; }
.ticket-label { display: block; font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 .25rem; }
.ticket-no { font-family: var(--mono); font-size: .85rem; font-weight: 700; color: var(--accent); }
.site-nav { display: flex; gap: .25rem .9rem; flex-wrap: wrap; padding: .25rem 0 .7rem; font-size: .95rem; }
.site-nav a { color: var(--ink); text-decoration: none; padding: .35rem 0; border-bottom: 2px solid transparent; min-height: var(--tap); display: inline-flex; align-items: center; }
.site-nav a:hover, .site-nav a:focus-visible { border-bottom-color: var(--accent); }
.ai-banner { margin: 0 auto; padding: .6rem .8rem .8rem; font-size: .9rem; border-top: 1px dashed var(--rule); color: var(--muted); }
.ai-banner strong { color: var(--ink); }

/* ---- sections ---- */
.section { padding: 2.25rem 0 1rem; border-top: 1px dashed var(--rule); }
.section h2 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 .9rem; display: flex; align-items: baseline; gap: .6rem; }
.num { font-family: var(--mono); font-size: .9rem; color: var(--accent); border: 1.5px solid var(--accent); padding: .05rem .4rem; border-radius: 3px; flex: none; }
.sub { font-size: 1.1rem; margin: 1.75rem 0 .6rem; font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

.hero { padding: 2rem 0 1.5rem; position: relative; }
.hero h1 { font-size: clamp(1.7rem, 6vw, 2.5rem); line-height: 1.15; margin: 0 0 .9rem; letter-spacing: -.01em; }
.lede { font-size: 1.1rem; margin: 0 0 1.25rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.stamp {
  display: inline-block; margin: 1.5rem 0 0; padding: .35rem .7rem;
  font-family: var(--mono); font-size: .78rem; letter-spacing: .14em; font-weight: 700;
  color: var(--accent); border: 2px solid var(--accent); border-radius: 4px;
  transform: rotate(-3deg); opacity: .9;
}

/* ---- buttons: big enough for thumbs ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: var(--tap); padding: .7rem 1.1rem; border-radius: var(--radius);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 2px solid var(--accent); line-height: 1.2; text-align: center;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary { background: transparent; color: var(--accent); }
.btn-call { background: var(--ink); color: var(--paper); border-color: var(--ink); width: 100%; font-family: var(--mono); font-size: 1.05rem; }
.btn[disabled], .btn[aria-disabled="true"], .btn.is-pending { opacity: .55; cursor: not-allowed; filter: none; }

/* ---- panels / lists ---- */
.two-up { display: grid; gap: 1rem; }
@media (min-width: 700px) { .two-up { grid-template-columns: 1fr 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.1rem 1.1rem 1.2rem; box-shadow: var(--shadow); }
.panel h3 { margin: .2rem 0 .7rem; font-size: 1.15rem; }
.checklist { list-style: none; padding: 0; margin: 0 0 .5rem; }
.checklist li { position: relative; padding-left: 1.7rem; margin: .45rem 0; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .32rem; width: .95rem; height: .95rem;
  border: 1.5px solid var(--rule-strong); border-radius: 2px; background: var(--panel);
}
.checklist li::after {
  content: ""; position: absolute; left: .3rem; top: .36rem; width: .32rem; height: .6rem;
  border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(40deg);
}
.checklist.plain li::after { display: none; }

/* ---- demo lines ---- */
.demo-lines { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .8rem; }
@media (min-width: 700px) { .demo-lines { grid-template-columns: repeat(3, 1fr); } }
.demo-line { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: .9rem; display: grid; gap: .5rem; box-shadow: var(--shadow); }
.demo-trade { font-family: var(--mono); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.demo-note { font-size: .88rem; color: var(--muted); }

/* ---- tiers ---- */
.tiers { display: grid; gap: 1rem; margin: 0 0 .5rem; }
@media (min-width: 760px) { .tiers { grid-template-columns: repeat(3, 1fr); align-items: stretch; } .tiers-2 { grid-template-columns: repeat(2, 1fr); } }
.tier { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.1rem; display: flex; flex-direction: column; box-shadow: var(--shadow); height: 100%; }
.tier-featured { border: 2px solid var(--accent); }
.tier h3 { margin: 0 0 .3rem; font-size: 1.15rem; }
.tier-price { margin: 0 0 .25rem; display: flex; align-items: baseline; gap: .25rem; }
.tier-price .amount { font-family: var(--mono); font-size: 2.1rem; font-weight: 700; letter-spacing: -.02em; }
.tier-price .per { color: var(--muted); }
.tier-bundled { margin: 0 0 .4rem; font-size: .88rem; color: var(--muted); }
.tier-tagline { margin: 0 0 .6rem; font-weight: 600; }
.tier .checklist { flex: 1; }
.tier .btn { width: 100%; margin-top: .6rem; }

/* ---- forms: the work-order sheet ---- */
.wo-form { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.1rem; margin: 1rem 0; box-shadow: var(--shadow); }
.wo-form fieldset { border: 0; border-top: 1px dashed var(--rule); padding: 1rem 0 .25rem; margin: .5rem 0 0; }
.wo-form legend { font-family: var(--mono); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 .4rem 0 0; }
.field { margin: 0 0 .9rem; }
.field label { display: block; font-weight: 600; margin: 0 0 .3rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: var(--tap); padding: .6rem .7rem; font: inherit; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--rule-strong); border-radius: 4px;
}
.field textarea { min-height: 5rem; resize: vertical; }
/* red only after the user has interacted with the field, never on first paint */
.field input:user-invalid, .field select:user-invalid, .field textarea:user-invalid { border-color: var(--error); }
.field-check { display: grid; grid-template-columns: 1.4rem 1fr; gap: .6rem; align-items: start; }
.field-check input { width: 1.25rem; height: 1.25rem; min-height: 0; margin: .2rem 0 0; accent-color: var(--accent); }
.field-check label { font-weight: 400; margin: 0; }
.radio-row { display: grid; gap: .5rem; margin: .4rem 0; }
.radio-row label { display: flex; gap: .6rem; align-items: flex-start; min-height: var(--tap); padding: .4rem .5rem; border: 1px solid var(--rule); border-radius: 4px; }
.radio-row input { accent-color: var(--accent); width: 1.2rem; height: 1.2rem; margin-top: .2rem; }
.guard-fieldset { background: var(--accent-soft); border-radius: 4px; padding-inline: .8rem !important; border-top: 0 !important; margin-top: 1rem !important; }
.decline { margin: .6rem 0 0; padding: .7rem .8rem; border-left: 4px solid var(--error); background: var(--panel); }
.form-status { min-height: 1.4rem; margin: .7rem 0 0; font-weight: 600; }
.form-status[data-kind="error"] { color: var(--error); }
.form-status[data-kind="pending"] { color: var(--warn); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- faq / docs ---- */
.faq dt { font-weight: 700; margin: 1rem 0 .2rem; }
.faq dd { margin: 0; }
.doc h1 { font-size: clamp(1.6rem, 5.5vw, 2.2rem); line-height: 1.2; margin: 0 0 .9rem; }
.doc h2 { font-size: 1.2rem; margin: 1.6rem 0 .5rem; display: block; }
.doc p { margin: 0 0 .8rem; }
.greeting { margin: .5rem 0 1rem; padding: .8rem 1rem; border-left: 4px solid var(--accent); background: var(--panel); font-style: italic; }
.steps { padding-left: 1.3rem; }
.steps li { margin: .5rem 0; }

/* ---- footer: the ticket stub ---- */
.ticket-foot { margin-top: 2.5rem; padding: 0 0 6rem; background: var(--panel); border-top: 3px double var(--rule-strong); font-size: .92rem; }
.perforation { height: 0; margin: 0 0 1.2rem; border-top: 2px dashed var(--rule-strong); }
.foot-disclosure { font-size: 1rem; margin: 1.2rem 0 .8rem; }
.foot-google, .foot-notestimonials, .foot-textback { color: var(--muted); margin: 0 0 .6rem; }
.foot-grid { display: grid; gap: 1.2rem; margin: 1.4rem 0; }
@media (min-width: 700px) { .foot-grid { grid-template-columns: 1.2fr 1.2fr 1fr; } }
.postal { font-style: normal; line-height: 1.45; }
.foot-links { list-style: none; padding: 0; margin: 0; }
.foot-links li { margin: .25rem 0; }
.foot-links a { min-height: 2rem; display: inline-flex; align-items: center; }
.foot-legal { font-size: .82rem; margin: 1rem 0 0; }

/* ---- sticky call bar on phones ---- */
.call-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom)); background: var(--panel); border-top: 2px solid var(--rule-strong); z-index: 50; }
@media (min-width: 700px) { .call-bar { display: none; } .ticket-foot { padding-bottom: 2rem; } }

@media print {
  .site-nav, .call-bar, .btn-call.is-pending { display: none; }
  body { background: #fff; color: #000; }
}
