/* ======================================================
   Riptide AI for Roofing Contractors — shared site styles
   ====================================================== */

:root {
  --ink: #091524;
  --ink-soft: #3a4658;
  --muted: #6b7686;
  --line: #e3e8ef;
  --bg: #F7F9FC;
  --surface: #F0FAFB;
  --white: #ffffff;
  --orange: #FF5C3A;
  --orange-soft: #ff7a5c;
  --teal: #00C9B1;
  --teal-soft: #1de2cb;
  --navy: #0E2C4F;
  --navy-deep: #07182C;
  --blue: #1F5FB6;
  --sky: #E6F0FB;
  --success: #16a34a;
  --warn: #f59e0b;
  --danger: #dc2626;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); }
h1, h2, h3, h4, h5 {
  font-family: 'Fraunces', "Times New Roman", serif;
  letter-spacing: -0.015em;
  margin: 0;
}

/* ---------- LAYOUT ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }
.wrap-narrow { max-width: 880px; margin: 0 auto; padding: 0 28px; }

/* ---------- TOP BAR ---------- */
.topbar {
  background: var(--navy-deep);
  color: #cfdcef;
  font-size: 12.5px;
  padding: 9px 0;
}
.topbar .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar strong { color: #fff; font-weight: 600; }
.topbar .pill {
  background: rgba(255,255,255,0.08);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.topbar .pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(0,201,177,0.25);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(0,201,177,0.25); }
  50% { box-shadow: 0 0 0 7px rgba(0,201,177,0); }
}

/* ---------- SITE HEADER ---------- */
header.site {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(150%) blur(8px);
}
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--orange) 0%, #ff8466 100%);
  position: relative;
  box-shadow: inset 0 0 0 1.5px rgba(9, 21, 36, 0.15);
}
.brand-mark::after {
  content: ""; position: absolute; inset: 8px;
  border-radius: 4px; border: 2px solid #fff;
  border-left: 0; border-bottom: 0;
  transform: rotate(45deg);
}
.brand .name {
  font-family: 'Fraunces', serif;
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
  color: var(--ink);
}
.brand .tag {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  letter-spacing: 0.02em;
}
nav.site { display: flex; gap: 22px; align-items: center; }
nav.site a {
  font-size: 13.5px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
}
nav.site a:hover { color: var(--ink); }
nav.site a.active { color: var(--ink); font-weight: 600; }
nav.site .btn {
  background: var(--orange);
  color: #fff;
  padding: 11px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
nav.site .btn:hover { color: #fff; transform: translateY(-1px); }

/* Mobile-first responsive nav (basic) */
@media (max-width: 760px) {
  nav.site { gap: 14px; }
  nav.site a:not(.btn) { display: none; }
  nav.site .btn { min-height: 44px; padding: 12px 18px; }
  header.site .wrap { padding-top: 10px; padding-bottom: 10px; }
}

/* ---------- BUTTONS ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 13px 22px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, background 0.2s ease;
  letter-spacing: 0.01em;
}
.btn-primary:hover { transform: translateY(-1px); background: #ff7252; color: #fff; }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
.btn-primary.large { font-size: 16px; padding: 16px 28px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  padding: 12px 20px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-ghost.on-dark { color: #fff; border-color: rgba(255,255,255,0.4); }
.btn-ghost.on-dark:hover { background: #fff; color: var(--ink); border-color: #fff; }

/* ---------- ICONS / SHARED VISUALS ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
}
.eyebrow.on-dark { background: rgba(255,255,255,0.1); }
.eyebrow .dot {
  width: 6px; height: 6px; background: var(--teal); border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(0, 201, 177, 0.25);
  animation: pulse 1.6s ease-in-out infinite;
}

.section-num {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-num::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--orange);
  display: inline-block;
}

/* ---------- FOOTER ---------- */
footer.site {
  background: var(--navy-deep);
  color: rgba(255,255,255,0.65);
  padding: 56px 0 32px 0;
  font-size: 13.5px;
}
footer.site .wrap {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
}
@media (max-width: 820px) {
  footer.site .wrap { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  footer.site .wrap { grid-template-columns: 1fr; }
}
footer.site h5 {
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 14px 0;
  font-weight: 700;
}
footer.site a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  display: block;
  padding: 4px 0;
}
footer.site a:hover { color: #fff; }
footer.site .brand-block .name { color: #fff; }
footer.site .brand-block .tag { color: rgba(255,255,255,0.55); }
footer.site .legal {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  margin-top: 44px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  text-align: center;
}

/* ---------- LEAD-GEN: STICKY CTA BAR ---------- */
.sticky-cta {
  position: fixed;
  bottom: -100px;
  left: 0; right: 0;
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  z-index: 100;
  box-shadow: 0 -8px 32px rgba(9, 21, 36, 0.18);
  transition: bottom 0.4s ease;
  border-top: 2px solid var(--orange);
}
.sticky-cta.show { bottom: 0; }
.sticky-cta .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.sticky-cta .msg { font-size: 14px; line-height: 1.4; }
.sticky-cta .msg strong { color: var(--orange); }
.sticky-cta .actions { display: flex; gap: 10px; align-items: center; }
.sticky-cta .actions a {
  background: var(--orange);
  color: #fff;
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.sticky-cta .actions a:hover { background: #ff7252; }
.sticky-cta .close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  font-family: inherit;
  line-height: 1;
}
.sticky-cta .close:hover { color: #fff; }
@media (max-width: 600px) {
  .sticky-cta { padding: 10px 14px; }
  .sticky-cta .msg { font-size: 12.5px; }
  .sticky-cta .actions a { padding: 10px 14px; font-size: 12.5px; min-height: 40px; display: inline-flex; align-items: center; }
  .sticky-cta .close { width: 44px; height: 44px; padding: 0; font-size: 26px; }
}
@media (max-width: 480px) {
  /* Condense to single line on tiny viewports */
  .sticky-cta .msg-long { display: none; }
  .sticky-cta .msg-short { display: inline; }
}
.sticky-cta .msg-short { display: none; }

/* ---------- LEAD-GEN: EXIT INTENT MODAL ---------- */
.exit-modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(7, 24, 44, 0.78);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.exit-modal-bg.show {
  display: flex;
  animation: fadeIn 0.25s ease;
}
.exit-modal {
  background: #fff;
  border-radius: 18px;
  max-width: 540px;
  width: 100%;
  padding: 36px 36px 32px 36px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  position: relative;
  animation: modalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.exit-modal .close-x {
  position: absolute;
  top: 14px; right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--muted);
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.exit-modal .close-x:hover { background: var(--bg); color: var(--ink); }
.exit-modal .badge {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.exit-modal h3 {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  line-height: 1.15;
  margin: 0 0 12px 0;
  color: var(--ink);
  font-weight: 800;
}
.exit-modal h3 em { font-style: italic; color: var(--orange); }
.exit-modal p {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 22px 0;
}
.exit-modal .form-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.exit-modal input[type=email] {
  flex: 1;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
.exit-modal input[type=email]:focus { border-color: var(--orange); }
.exit-modal button[type=submit] {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 13px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.exit-modal button[type=submit]:hover { background: #ff7252; }
.exit-modal .micro {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.4;
}
.exit-modal .perks {
  display: flex;
  gap: 16px;
  margin: 18px 0 22px 0;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--ink-soft);
  flex-wrap: wrap;
}
.exit-modal .perks span {
  display: inline-flex; align-items: center; gap: 6px;
}
.exit-modal .perks span::before {
  content: "✓";
  color: var(--success);
  font-weight: 800;
}
.exit-modal .success {
  text-align: center;
  padding: 20px 0 0 0;
}
.exit-modal .success .check {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 28px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px auto;
}
.exit-modal .success h4 {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  margin: 0 0 8px 0;
}

/* ---------- INLINE LEAD CAPTURE ---------- */
.lead-capture {
  background: linear-gradient(135deg, var(--surface) 0%, var(--sky) 100%);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 28px 32px;
  margin: 32px 0;
}
.lead-capture h4 {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  margin: 0 0 8px 0;
  color: var(--ink);
  font-weight: 800;
}
.lead-capture p {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0 0 16px 0;
}
.lead-capture form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.lead-capture input[type=email] {
  flex: 1;
  min-width: 220px;
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 14.5px;
  font-family: inherit;
  background: #fff;
  outline: none;
}
.lead-capture input[type=email]:focus { border-color: var(--orange); }
.lead-capture button {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.lead-capture button:hover { background: #ff7252; }
.lead-capture .micro {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.4;
}

/* ---------- UTILITY CLASSES ---------- */
.hide { display: none !important; }
.fade-in { animation: fadeIn 0.4s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.spin {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ======================================================
   MOBILE UX HARDENING — phase 3 audit fixes (May 2026)
   ====================================================== */

/* 1. Prevent header CTA from wrapping at 320px + 768-820px breakpoints.
   "Book a call" was wrapping to 2 lines on iPhone SE and iPad mini portrait. */
nav.site .btn,
header.site .cta { white-space: nowrap; }

/* 2. Header brand link — bump to 44x44 minimum touch target.
   Was 173x38 (failed WCAG 2.5.5). Padding lets the click area expand without
   altering visual layout. */
.brand {
  min-height: 44px;
  padding: 4px 0;
}

/* 3. Tighten header at iPad mini boundary (~700-820px) to keep all 4 nav links
   visible without crowding the CTA. */
@media (max-width: 820px) and (min-width: 761px) {
  nav.site { gap: 14px; }
  nav.site a { font-size: 12.5px; }
  nav.site .btn { padding: 10px 14px; font-size: 12.5px; }
}

/* 4. Form inputs — set 16px font baseline so iOS Safari does NOT auto-zoom
   on focus. Was rendering ~13-15px on selects/inputs across all 3 forms. */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="url"],
select,
textarea {
  font-size: 16px;
  font-family: inherit;
}
/* Range sliders don't trigger zoom — leave their styling alone. */

/* 5. Sticky CTA bar — hide in mobile landscape under 480px viewport height.
   Was eating 37-42% of vertical space on phones tilted to landscape. */
@media (orientation: landscape) and (max-height: 480px) {
  .sticky-cta { display: none !important; }
}

/* 6. Demo-index nav chips on demos.html — bump to 44px min-height.
   Was 43h (one px below WCAG threshold). */
.demo-index a,
.demo-index .chip,
.demo-index button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

