/* =========================================================================
   AmbitForge — "Shop Ledger" design system
   Approved 2026-06-11 via /plan-design-review. Tokens & rules from DESIGN.md.
   A well-organized maker's bench meets an engineering notebook:
   warm paper, ink, one confident safety-orange accent.
   ========================================================================= */

:root {
  --paper: #f6f1e7;
  --paper-deep: #efe7d6;
  --card: #fffdf8;
  --ink: #221d15;
  --ink-soft: #5c5346;
  --rule: #d8cdb8;
  --accent: #d9560b;       /* large accents, decorative kickers only */
  --accent-deep: #b34407;  /* button bg + any text-size accent (AA on paper) */
  --accent-press: #933805;
  --ok: #3e6b3a;
  --err: #a3320e;

  --maxw: 680px;
  --pad: 20px;
  --section-y: 56px;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'Courier New', monospace;
}

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

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

main > section { padding: var(--section-y) 0; border-bottom: 1px solid var(--rule); }

/* ---------- accessibility utilities ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 50%; top: -60px; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  font-family: var(--font-mono); font-size: 0.85rem;
  padding: 10px 18px; border-radius: 0 0 4px 4px; z-index: 100;
  text-decoration: none; transition: top 120ms ease;
}
.skip-link:focus { top: 0; }

/* Visible, consistent focus for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- header ---------- */
.site-header {
  border-bottom: 2px solid var(--ink);
  padding: 14px 0;
  background: var(--paper);
}
.masthead { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}
.logo span { color: var(--accent-deep); }
.masthead .tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- shared section bits ---------- */
.kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent-deep); display: block; margin-bottom: 8px;
}
h2 {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.6rem;
  margin-bottom: 8px; letter-spacing: -0.01em; line-height: 1.15;
}
.section-intro { color: var(--ink-soft); margin-bottom: 30px; max-width: 36em; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  background: var(--accent-deep); color: #fff;
  font-family: var(--font-body); font-weight: 600; font-size: 1.02rem;
  padding: 14px 26px; min-height: 48px; border-radius: 4px;
  text-decoration: none; border: none; cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);          /* the one "hand-stamped" moment */
  transition: background 140ms ease, transform 90ms ease, box-shadow 90ms ease;
}
.btn:hover { background: var(--accent-press); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn[disabled] { opacity: 0.7; cursor: progress; box-shadow: 3px 3px 0 var(--rule); }

/* ---------- hero ---------- */
.hero { padding-top: 48px; }
.hero .eyebrow {
  font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--ink-soft); margin-bottom: 12px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.1rem, 6vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede { font-size: 1.1rem; color: var(--ink-soft); max-width: 34em; margin-bottom: 28px; }
.hero .cta-row { margin-top: 26px; }
.cta-sub { display: block; margin-top: 10px; font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- photo figures (render ONLY when a real photo exists) ---------- */
figure.shot { margin: 0; }
figure.shot img {
  display: block; width: 100%; height: auto;
  border: 2px solid var(--ink); border-radius: 4px;
  background: var(--paper-deep);
}
figure.shot.hero-shot img { aspect-ratio: 4 / 3; object-fit: cover; }
figure.shot figcaption {
  font-family: var(--font-mono);
  font-size: 0.78rem; color: var(--ink-soft); margin-top: 10px;
}

/* ---------- how it works ---------- */
.steps { list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 52px 1fr; gap: 16px;
  padding: 18px 0; border-top: 1px dashed var(--rule);
}
.steps li::before {
  content: "0" counter(step);
  font-family: var(--font-display); font-weight: 900;
  font-size: 1.7rem; color: var(--accent);
}
.steps h3 { font-size: 1.05rem; margin-bottom: 4px; }
.steps p { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- packages (ledger rows) ---------- */
.pkg { border-top: 2px solid var(--ink); padding: 22px 0; }
.pkg:last-of-type { border-bottom: 2px solid var(--ink); }
.pkg .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pkg h3 { font-family: var(--font-display); font-size: 1.25rem; }
.pkg .price {
  font-family: var(--font-mono); font-weight: 500;
  font-size: 1rem; color: var(--accent-deep); white-space: nowrap;
}
.pkg p { color: var(--ink-soft); font-size: 0.95rem; margin-top: 6px; max-width: 36em; }
.pricing-note {
  margin-top: 18px; font-size: 0.85rem; color: var(--ink-soft);
  font-family: var(--font-mono);
}

/* ---------- portfolio ---------- */
.build-card {
  border: 2px solid var(--ink); border-radius: 4px; overflow: hidden;
  background: var(--card);
}
.build-card .build-cover img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  object-fit: cover; border: none; border-bottom: 2px solid var(--ink); border-radius: 0;
}
.build-card .body { padding: 20px; }
.badge {
  display: inline-block; font-family: var(--font-mono);
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em;
  background: var(--ink); color: var(--paper); padding: 4px 10px; border-radius: 3px;
  margin-bottom: 10px;
}
.badge.live { background: var(--accent-deep); }
.build-card h3 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 6px; }
.build-card p { color: var(--ink-soft); font-size: 0.95rem; }
.build-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.build-strip figure.shot img { aspect-ratio: 1; object-fit: cover; border-width: 1px; }
.build-strip figcaption { font-size: 0.68rem; margin-top: 6px; }

/* Honest launch state: no photos yet — a plain note, never a hatched placeholder */
.bench-note {
  border: 2px dashed var(--rule); border-radius: 4px;
  padding: 22px 24px; color: var(--ink-soft); font-size: 0.95rem;
  background: var(--card);
}
.bench-note strong { color: var(--ink); }

/* ---------- trust ---------- */
.trust-grid { display: grid; gap: 24px; }
.trust-block h3 {
  font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 10px; font-family: var(--font-mono);
}
.trust-block ul { list-style: none; }
.trust-block li {
  padding: 7px 0 7px 30px; position: relative;
  color: var(--ink-soft); font-size: 0.95rem;
  border-top: 1px dashed var(--rule);
}
.trust-block li .glyph {
  position: absolute; left: 2px; top: 9px; width: 18px; height: 18px;
}

/* ---------- form ---------- */
.form-section { background: var(--paper-deep); border-bottom: none !important; }
form.intake { display: grid; gap: 18px; margin-top: 26px; }
.field label { font-weight: 600; font-size: 0.92rem; display: block; margin-bottom: 6px; }
.field label .opt { font-weight: 400; color: var(--ink-soft); }
.field input,
.field textarea,
.field select {
  width: 100%; padding: 12px 14px; min-height: 48px;
  border: 2px solid var(--ink); border-radius: 4px;
  background: var(--card); font: inherit; font-size: 0.98rem; color: var(--ink);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: var(--err); }
.hint { font-size: 0.82rem; color: var(--ink-soft); margin-top: 5px; }
.field-error {
  display: none; font-size: 0.82rem; color: var(--err);
  font-family: var(--font-mono); margin-top: 6px;
}
.field-error.show { display: block; }

/* honeypot — hidden from humans, present for bots */
.gotcha { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.reply-promise {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 0.9rem; color: var(--ink-soft);
  border-top: 1px dashed var(--rule); padding-top: 16px;
}
.reply-promise strong { color: var(--ink); }
.reply-promise svg { flex-shrink: 0; margin-top: 2px; }

/* form status (errors at submit) */
.form-status {
  font-family: var(--font-mono); font-size: 0.88rem;
  padding: 12px 14px; border: 2px solid var(--err); border-radius: 4px;
  color: var(--err); background: #fbeee8;
}
.form-status[hidden] { display: none; }

/* success swap */
.form-success {
  border: 2px solid var(--ink); border-radius: 4px; background: var(--card);
  padding: 26px 24px; margin-top: 26px;
}
.form-success[hidden] { display: none; }
.form-success .check { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.form-success h3 { font-family: var(--font-display); font-size: 1.3rem; }
.form-success p { color: var(--ink-soft); font-size: 0.95rem; }
.form-success p + p { margin-top: 10px; }

/* ---------- footer ---------- */
.site-footer {
  padding: 30px 0 60px; font-size: 0.82rem;
  color: var(--ink-soft); font-family: var(--font-mono);
}
.site-footer a { color: var(--ink-soft); }

/* ---------- responsive: two-column moments only at >=720px ---------- */
@media (min-width: 720px) {
  .trust-grid { grid-template-columns: 1fr 1fr; }
  .hero.has-photo .hero-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center;
  }
}

/* ---------- motion: exactly three functional motions ---------- */
/* (1) one-time subtle hero reveal on load.
   Transform-only (no opacity fade): the text stays at full opacity the whole
   time, so it never drops below the AA contrast bar mid-animation and the hero
   is never blank if the animation stalls. Reduced-motion users skip it. */
@media (prefers-reduced-motion: no-preference) {
  .hero .reveal { transform: translateY(10px); animation: heroReveal 600ms ease 80ms forwards; }
  .hero .reveal.d1 { animation-delay: 160ms; }
  .hero .reveal.d2 { animation-delay: 240ms; }
  .hero .reveal.d3 { animation-delay: 320ms; }
  /* (3) success swap easing handled inline below */
  .form-success { animation: swapIn 300ms ease; }
}
@keyframes heroReveal { to { transform: none; } }
@keyframes swapIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
