/* Wrenfield Heating & Cooling (demo brand) · shared design kit
   Same family as stingraybookkeeping.com: Fraunces headlines, Inter text, hairline borders, soft shadows,
   pill buttons, quiet motion. Brand colors come from the logo (deep blue, navy, amber) and are
   used with restraint: blue is the action color, gold only for stars/small accents, blue for links/info.
   Every color is a token so light and dark stay in step. Dark follows the device. */

:root {
  color-scheme: light;
  --paper: #FFFFFF; --cream: #FBF7F0; --mist: #F5F0E8; --surface: #FFFFFF; --surface-2: #FCFAF6;
  --ink: #1A1523; --ink-2: #2E2838; --text: #4A4453; --muted: #6F6878; --faint: #A39CAB;
  --line: #ECE5DA; --line-strong: #DDD3C4;
  --brand: #1D4E9E; --brand-hover: #173F82; --brand-soft: #EAF1FB; --brand-ink: #173A75; --on-brand: #FFFFFF;
  --blue: #23408E; --blue-soft: #EAEFFA;
  --gold: #C99A2E; --gold-soft: #FBF3DF; --gold-ink: #7A5A12;
  --ok: #147A52; --ok-strong: #0F6B47; --ok-bg: #E7F6EF; --on-ok: #FFFFFF;
  --warn: #B45309; --warn-bg: #FEF3E2;
  --bad: #B4472F; --bad-bg: #FDEEEA;
  --scrim: rgba(20, 14, 26, .52);
  --header-bg: rgba(251, 247, 240, .9);
  --shadow-sm: 0 1px 2px rgba(26, 21, 35, .05), 0 2px 10px rgba(26, 21, 35, .04);
  --shadow: 0 10px 30px rgba(26, 21, 35, .08);
  --shadow-lg: 0 24px 60px rgba(26, 21, 35, .14);
  --img-bg: #EFE8DD;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --r-sm: 12px; --r: 18px; --r-lg: 24px; --r-xl: 28px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.22, 1, .36, 1);
  --flag: linear-gradient(90deg, #14274E 0 33.3%, #1D4E9E 33.3% 66.6%, #E08A1E 66.6% 100%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #121016; --cream: #15121B; --mist: #1B1722; --surface: #1E1A26; --surface-2: #231E2C;
    --ink: #F3EFF7; --ink-2: #DCD5E5; --text: #C3BBCD; --muted: #9A92A6; --faint: #6F6879;
    --line: #2C2636; --line-strong: #3A3346;
    --brand: #3B74D9; --brand-hover: #2F63C2; --brand-soft: #14233F; --brand-ink: #B9D0F7; --on-brand: #FFFFFF;
    --blue: #93A9F2; --blue-soft: #1E2542;
    --gold: #E0B85A; --gold-soft: #33290F; --gold-ink: #F1DFB4;
    --ok: #57CF9A; --ok-strong: #1F9D68; --ok-bg: #12382B; --on-ok: #FFFFFF;
    --warn: #F0A35A; --warn-bg: #3A2612;
    --bad: #F29A85; --bad-bg: #3A1E18;
    --scrim: rgba(0, 0, 0, .62);
    --header-bg: rgba(21, 18, 27, .88);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
    --img-bg: #2A2433;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121016; --cream: #15121B; --mist: #1B1722; --surface: #1E1A26; --surface-2: #231E2C;
  --ink: #F3EFF7; --ink-2: #DCD5E5; --text: #C3BBCD; --muted: #9A92A6; --faint: #6F6879;
  --line: #2C2636; --line-strong: #3A3346;
  --brand: #3B74D9; --brand-hover: #2F63C2; --brand-soft: #14233F; --brand-ink: #B9D0F7; --on-brand: #FFFFFF;
  --blue: #93A9F2; --blue-soft: #1E2542;
  --gold: #E0B85A; --gold-soft: #33290F; --gold-ink: #F1DFB4;
  --ok: #57CF9A; --ok-strong: #1F9D68; --ok-bg: #12382B; --on-ok: #FFFFFF;
  --warn: #F0A35A; --warn-bg: #3A2612;
  --bad: #F29A85; --bad-bg: #3A1E18;
  --scrim: rgba(0, 0, 0, .62);
  --header-bg: rgba(21, 18, 27, .88);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
  --img-bg: #2A2433;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--cream);
       -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 700; line-height: 1.12; letter-spacing: -.012em; margin: 0; }
p { margin: 0 0 12px; }
.num, .price { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--brand-soft); }

.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--brand-ink); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

/* icons from icons.js */
.i { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px;
       border-radius: 999px; border: 1.5px solid transparent; font-weight: 700; font-size: 15.5px; line-height: 1.2;
       text-decoration: none; white-space: nowrap; user-select: none;
       transition: transform .14s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled] { opacity: .5; pointer-events: none; box-shadow: none; }
.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 8px 20px rgba(29, 78, 158, .24); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-ok { background: var(--ok-strong); color: var(--on-ok); box-shadow: 0 8px 20px rgba(20, 122, 82, .22); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-soft { background: var(--mist); color: var(--ink); }
.btn-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 16.5px; padding: 14px 24px; }
.btn-sm { min-height: 38px; padding: 8px 14px; font-size: 14px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface);
            border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .14s var(--ease), background-color .2s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }

/* ---------- small parts ---------- */
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface);
        border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.live { box-shadow: 0 0 0 0 rgba(20, 122, 82, .45); animation: livePulse 2s var(--ease) infinite; }
.dot.off { background: var(--faint); }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(20, 122, 82, .45); } 70% { box-shadow: 0 0 0 8px rgba(20, 122, 82, 0); } 100% { box-shadow: 0 0 0 0 rgba(20, 122, 82, 0); } }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
         letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.badge-gold { background: var(--gold-soft); color: var(--gold-ink); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-brand { background: var(--brand-soft); color: var(--brand-ink); }
.paid { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--ok-strong); color: var(--on-ok);
        font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.hair { height: 1px; background: var(--line); border: 0; margin: 0; }
.flag-rule { height: 3px; background: var(--flag); border-radius: 3px; }

/* ---------- forms ---------- */
.field { display: block; }
.label { display: block; font-weight: 600; font-size: 14.5px; margin: 16px 0 7px; color: var(--ink); }
.label small { font-weight: 400; color: var(--muted); }
.input, textarea.input, select.input { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface);
         border: 1.5px solid var(--line-strong); font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--ink-2); box-shadow: 0 0 0 4px rgba(35, 64, 142, .12); }
.input.bad { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(180, 71, 47, .12); }
textarea.input { resize: none; min-height: 84px; line-height: 1.45; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.err { font-size: 13.5px; color: var(--bad); margin-top: 8px; font-weight: 600; }

/* ---------- photos (soft shimmer while loading) ---------- */
.ph { position: relative; overflow: hidden; background: var(--img-bg); }
.ph img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s var(--ease), transform .6s var(--ease); }
.ph img.ready { opacity: 1; }
.ph::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .35) 50%, transparent 80%);
              transform: translateX(-100%); animation: shimmer 1.4s infinite; }
.ph.loaded::before { display: none; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------- motion ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- preview ribbon (only on the public preview, outside the pitch frames) ---------- */
.preview-ribbon { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 14px; background: #1A1523; color: #F6F1E9;
                  font-size: 12.5px; font-weight: 600; letter-spacing: .02em; text-align: center; }
.preview-ribbon b { color: #E0B85A; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 11.5px; }
