/*
 * HandleHQ Marketing Site — B1 "Warm" Brand Foundation
 * ====================================================
 * Source of truth: docs/design/IMPLEMENTATION_SPEC_B1.md §3
 * Visual reference: docs/design/mockup-b1-home.html
 *
 * Tokens + shared components for the B1 "Warm" marketing reskin. Link this
 * BEFORE any page-specific CSS. Components reference tokens only, never
 * hardcoded hex, so the warm-dark theme works for free.
 */

/* -------------------------------------------------------------------------- */
/* 1. Design tokens                                                           */
/* -------------------------------------------------------------------------- */

/* Light theme (default) */
:root,
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #faf6ef;              /* page background, warm cream */
  --card: #ffffff;            /* cards, nav */
  --surface: #f3ede1;         /* inset panels, chips */
  --border: #e7ddc9;
  --border2: #d6c9ae;

  --ink: #292524;             /* headings, body */
  --muted: #57534e;           /* secondary text */
  --dim: #6d6660;             /* tertiary text — WCAG AA fix (#505): #78716c was 4.11:1 on --surface (fail); #6d6660 is ~4.84:1 on --surface and ~5.24:1 on --bg */

  --teal: #0f766e;            /* primary actions, links */
  --teal-deep: #115e59;       /* hover */
  --teal-faint: rgba(15, 118, 110, 0.09);
  --teal-on: #ffffff;         /* text/icon on a teal fill */

  --coral: #f97316;           /* highlight CTA, kickers */
  --coral-soft: #ffedd5;
  --coral-on: #431407;        /* text/icon on a coral fill — WCAG AA fix (#505): white-on-coral was 2.80:1 (fail); dark coral-ink is ~5.59:1 */

  --green: #16a34a;           /* live/success only */
  --green-soft: #dcfce7;
  --green-ink: #166534;       /* WCAG AA fix (#529): #15803d was ~4.30:1 on --surface (fail, the .mini-ticket/.case-ticket "Drafted"/"ok" checkmark labels); #166534 is ~6.12:1 on --surface and ~6.49:1 on --green-soft (still passes the .s-live/.t-done pairing) */
  --amber-ink: #c2410c;       /* "in progress" text on coral-soft background; also the AA-safe choice for coral-family TEXT on light backgrounds (~5.18:1 on --card, ~4.81:1 on --bg) */

  /* Chat-bubble surfaces (mockup) */
  --bub-in: #ffffff;
  --bub-out: #d8f3ee;
  --chat-bg-top: #f6f1e7;
  --chat-bg-bottom: #fbf8f2;

  --radius: 20px;             /* cards */
  --radius-md: 14px;
  --radius-sm: 12px;
  --radius-pill: 99px;
  --shadow: 0 2px 4px rgba(41, 37, 36, 0.04), 0 12px 32px rgba(41, 37, 36, 0.07);

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-ui: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --maxw: 1080px;
}

/* Warm dark theme (toggle option — NOT the old terminal black) */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #211d19;             /* warm charcoal, stone-tinted */
  --card: #2a2521;
  --surface: #332d27;
  --border: #453d34;
  --border2: #5a5044;

  --ink: #f3ede2;
  --muted: #c9c1b4;
  --dim: #a39a8a;            /* WCAG AA fix (#505): #9d9485 was ~4.53:1 on --surface (marginal, too close to the 4.5:1 line); #a39a8a is ~4.88:1 on --surface and ~6.02:1 on --bg */

  --teal: #2dd4bf;           /* brightened for contrast on dark */
  --teal-deep: #5eead4;      /* hover = lighter on dark */
  --teal-faint: rgba(45, 212, 191, 0.10);
  --teal-on: #12302b;

  --coral: #fb923c;
  --coral-soft: rgba(251, 146, 60, 0.16);
  --coral-on: #12302b;

  --green: #4ade80;
  --green-soft: rgba(74, 222, 128, 0.15);
  --green-ink: #4ade80;
  --amber-ink: #fb923c;

  --bub-in: #2a2521;
  --bub-out: rgba(45, 212, 191, 0.16);
  --chat-bg-top: #251f1b;
  --chat-bg-bottom: #2a2521;

  /* radius unchanged; soften shadow for dark */
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.20), 0 12px 32px rgba(0, 0, 0, 0.34);
}

/* -------------------------------------------------------------------------- */
/* 2. Fonts (self-hosted — enable once woff2 land under marketing/fonts/)     */
/* -------------------------------------------------------------------------- */
/*
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('fonts/fraunces-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/nunito-sans-var.woff2') format('woff2');
}
*/

/* -------------------------------------------------------------------------- */
/* 3. Base                                                                    */
/* -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

body.b1 {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.b1 h1, .b1 h2, .b1 h3 {
  font-family: var(--font-display);
  line-height: 1.13;
  letter-spacing: -0.01em;
  font-weight: 700;
}

/* Links have no underline; only NON-button links inherit color, so every .btn
   variant keeps its own explicit color (fixes the white-on-cream CTA button). */
.b1 a { text-decoration: none; }
.b1 a:not(.btn) { color: inherit; }

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

/* -------------------------------------------------------------------------- */
/* 4. Navigation                                                              */
/* -------------------------------------------------------------------------- */
.b1 nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--teal);
  color: var(--teal-on);
  display: grid;
  place-items: center;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 800;
}
.nav-links {
  display: flex;
  gap: 26px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}
.nav-links a:hover { color: var(--teal); }
.nav-cta { display: flex; gap: 12px; align-items: center; }

/* -------------------------------------------------------------------------- */
/* 5. Buttons                                                                 */
/* -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.94rem;
  border: 0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, filter 0.15s ease;
}
.btn-primary { background: var(--teal); color: var(--teal-on); }
.btn-primary:hover { background: var(--teal-deep); }
.btn-coral { background: var(--coral); color: var(--coral-on); }   /* max once per viewport */
.btn-coral:hover { filter: brightness(0.94); }
.btn-outline { border: 2px solid var(--border2); color: var(--ink); background: transparent; }
.btn-outline:hover { border-color: var(--teal); color: var(--teal); }
.btn-ghost { color: var(--muted); font-weight: 700; background: transparent; }
.btn-ghost:hover { color: var(--teal); }
.btn-cream { background: var(--bg); color: var(--teal-deep); }
.btn-cream:hover { background: var(--card); }

/* Theme toggle button (injected into .nav-actions by theme-toggle.js). */
.theme-toggle-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border2);
  background: var(--card);
  color: var(--muted);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle-button:hover { color: var(--teal); border-color: var(--teal); }
.theme-toggle-icon { font-size: 1rem; line-height: 1; }
.mobile-nav-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
}

/* -------------------------------------------------------------------------- */
/* 6. Pills + status chips                                                    */
/* -------------------------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  background: var(--teal-faint);
  color: var(--teal-deep);
  font-size: 0.82rem;
  font-weight: 800;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

.chan {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 0.86rem;
  font-weight: 700;
}
.s { font-size: 0.68rem; font-weight: 800; padding: 2px 9px; border-radius: var(--radius-pill); }
.s-live { background: var(--green-soft); color: var(--green-ink); }   /* Email */
.s-prog { background: var(--coral-soft); color: var(--amber-ink); }   /* WhatsApp */
.s-soon { background: var(--surface); color: var(--dim); }           /* Coming soon */

/* Kicker labels */
.kicker {
  color: var(--amber-ink);   /* WCAG AA fix (#505): --coral text on --card/--bg was ~2.6-2.8:1 (fail) in the light theme; --amber-ink is the AA-safe coral-family text token (~5.18:1 on --card, ~4.81:1 on --bg) and equals --coral in the dark theme, so dark is unchanged */
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* -------------------------------------------------------------------------- */
/* 7. Cards + section rhythm                                                  */
/* -------------------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
}
.b1 section { padding: 78px 0; }
.sec-title { font-size: 2.2rem; margin-bottom: 12px; }
.sec-sub { color: var(--muted); max-width: 37rem; margin-bottom: 42px; font-size: 1.05rem; }
.center { text-align: center; }
.center .sec-sub { margin-left: auto; margin-right: auto; }

/* Alternating section backgrounds with hairline borders */
.section-alt {
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* -------------------------------------------------------------------------- */
/* 8. Chat bubbles (hero + mini demos)                                        */
/* -------------------------------------------------------------------------- */
.chat { padding: 18px; background: linear-gradient(180deg, var(--chat-bg-top), var(--chat-bg-bottom)); }
.bub {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  box-shadow: 0 1px 2px rgba(41, 37, 36, 0.06);
}
.bub.in { background: var(--bub-in); border-bottom-left-radius: 4px; }
.bub.out { background: var(--bub-out); color: var(--ink); margin-left: auto; border-bottom-right-radius: 4px; }

/* -------------------------------------------------------------------------- */
/* 9. Dashed "placeholder" panel (reserved for future social proof)          */
/* -------------------------------------------------------------------------- */
.quote-slot {
  background: var(--teal-faint);
  border: 2px dashed var(--teal);
  border-radius: var(--radius);
  padding: 36px;
  text-align: center;
  color: var(--teal-deep);
}
.quote-slot b { font-family: var(--font-display); font-size: 1.2rem; display: block; margin-bottom: 6px; }
.quote-slot p { font-size: 0.94rem; }

/* -------------------------------------------------------------------------- */
/* 10. Footer                                                                 */
/* -------------------------------------------------------------------------- */
.b1 footer { padding: 40px 0; font-size: 0.88rem; color: var(--dim); text-align: center; }
.b1 footer .links {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 10px;
  flex-wrap: wrap;
}
.b1 footer a:hover { color: var(--teal); }

/* -------------------------------------------------------------------------- */
/* 11. Focus + reduced motion (accessibility)                                 */
/* -------------------------------------------------------------------------- */
.b1 a:focus-visible,
.btn:focus-visible,
.theme-toggle-button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* -------------------------------------------------------------------------- */
/* 12. Responsive                                                             */
/* -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .nav-links { display: none; }        /* mobile nav handled by mobile-nav.js */
  .sec-title { font-size: 1.8rem; }
}
