/* Westbrook AI — public website.
   Colours follow the agreed brief: dark charcoal, white headings, yellow
   buttons, yellow nav buttons with black text, current page marked with a
   thin blue border. One type family (Archivo): expanded width for headings,
   normal width for reading text. */

:root {
  --charcoal: #2b2d31;
  --charcoal-deep: #222428;
  --charcoal-raised: #34373c;
  --line: #45484e;
  --white: #ffffff;
  --text: #d6d9de;
  --muted: #a3a8b0;
  --yellow: #ffd23f;
  --yellow-press: #f2c21f;
  --black: #000000;
  --blue: #4c9bff;
  --radius-button: 999px;
  --radius-panel: 18px;
  --wrap: 1120px;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--charcoal);
  color: var(--text);
  font-family: 'Archivo', system-ui, sans-serif;
  font-variation-settings: 'wdth' 100;
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1, h2, h3 {
  color: var(--white);
  font-variation-settings: 'wdth' 118;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.3rem; letter-spacing: 0; line-height: 1.25; }

p { margin: 0 0 1em; max-width: 62ch; }

a { color: var(--yellow); }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--yellow); color: var(--black); padding: 8px 14px; border-radius: 8px; z-index: 10;
}
.skip:focus { left: 16px; }

/* ---------- Header ---------- */

.site-header {
  background: var(--charcoal-deep);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 0 14px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--white); text-decoration: none;
  font-weight: 800; font-size: 1.3rem; font-variation-settings: 'wdth' 118;
  letter-spacing: -0.01em;
}
.brand-tile {
  width: 38px; height: 38px; border-radius: 9px; background: var(--yellow);
  display: grid; place-items: center; flex: none;
}
.brand-tile svg { width: 38px; height: 38px; }
.header-phone {
  color: var(--white); text-decoration: none; font-weight: 700;
  font-size: 1.05rem; white-space: nowrap;
}
.header-phone:hover { color: var(--yellow); }
.header-phone span { color: var(--muted); font-weight: 500; margin-right: 6px; }

.nav { padding: 0 0 16px; }
.nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.nav a {
  display: inline-block;
  background: var(--yellow); color: var(--black);
  text-decoration: none; font-weight: 700; font-size: 0.95rem;
  padding: 9px 18px; border-radius: var(--radius-button);
  border: 2px solid var(--yellow);
}
.nav a:hover { background: var(--yellow-press); border-color: var(--yellow-press); }
.nav a[aria-current="page"] { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }

@media (max-width: 640px) {
  .header-phone span { display: none; }
  .brand { font-size: 1.15rem; }
  .nav ul { display: grid; grid-template-columns: 1fr 1fr; }
  .nav li:last-child { grid-column: 1 / -1; }
  .nav a { display: block; text-align: center; padding: 10px 8px; font-size: 0.86rem; }
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--yellow); color: var(--black);
  font: inherit; font-weight: 700; text-decoration: none;
  padding: 14px 24px; border-radius: var(--radius-button); border: 2px solid var(--yellow);
  cursor: pointer;
}
.button:hover { background: var(--yellow-press); border-color: var(--yellow-press); }
.button.secondary { background: transparent; color: var(--white); border-color: var(--line); }
.button.secondary:hover { border-color: var(--white); }
.button[disabled] { opacity: 0.45; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- Sections ---------- */

main { display: block; }
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section.deep { background: var(--charcoal-deep); }
.lead { font-size: 1.2rem; color: var(--text); }
.page-intro { padding: clamp(48px, 7vw, 80px) 0 clamp(32px, 5vw, 56px); }
.page-intro p { font-size: 1.2rem; }

/* ---------- Home hero ---------- */

.hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 6vw, 72px);
  align-items: center;
  padding: clamp(48px, 7vw, 88px) 0;
}
@media (max-width: 880px) { .hero { grid-template-columns: 1fr; } }

/* ---------- Phone demo ---------- */

.phone {
  position: relative; justify-self: center;
  width: min(330px, 100%);
  background: #141518;
  border: 1.5px solid var(--yellow);
  border-radius: 52px;
  padding: 11px;
  box-shadow: inset 0 0 0 3px #2a2c31;
}
.phone-btn { position: absolute; width: 4px; background: var(--yellow); border-radius: 3px; }
.phone-btn-vol { left: -5.5px; top: 140px; height: 64px; }
.phone-btn-power { right: -5.5px; top: 170px; height: 88px; }
.phone-screen {
  position: relative;
  background: var(--charcoal-deep);
  border-radius: 42px;
  padding: 14px 14px 10px;
  display: flex; flex-direction: column;
  min-height: 640px;
}
.phone-island { width: 96px; height: 28px; border-radius: 20px; background: #000; margin: 0 auto 10px; }
.phone-home { width: 120px; height: 5px; border-radius: 3px; background: #6b6f77; margin: 10px auto 0; }
.phone-top {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.78rem; color: var(--muted); padding: 0 8px 10px;
}
.phone-top [data-timer] { font-variant-numeric: tabular-nums; }
.phone-status { display: flex; align-items: center; gap: 8px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.phone[data-state="ringing"] .status-dot { background: var(--yellow); animation: blink 0.8s steps(2) infinite; }
.phone[data-state="talking"] .status-dot { background: #57d17c; }
@keyframes blink { 50% { opacity: 0.2; } }

.caller-card {
  text-align: center; padding: 4px 10px 14px; border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.caller-avatar {
  width: 60px; height: 60px; border-radius: 50%; margin-bottom: 8px;
  display: grid; place-items: center;
  background: var(--charcoal-raised); color: var(--yellow) !important;
  font-weight: 800; font-size: 1.1rem !important; letter-spacing: 0.02em;
}
.phone[data-state="ringing"] .caller-avatar { animation: pulse 1.2s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,210,63,0.5); } 100% { box-shadow: 0 0 0 16px rgba(255,210,63,0); } }
.caller-card strong { display: block; color: var(--white); font-size: 1.15rem; }
.caller-card span { font-size: 0.85rem; color: var(--muted); }

.transcript {
  list-style: none; margin: 0; padding: 16px 4px 4px;
  display: flex; flex-direction: column; gap: 10px;
  flex: 1 1 auto; min-height: 300px; max-height: 300px; overflow-y: auto;
  scroll-behavior: smooth;
}
.bubble {
  max-width: 86%; padding: 10px 14px; border-radius: 16px;
  font-size: 0.93rem; line-height: 1.45;
}
.bubble small { display: block; font-size: 0.75rem; font-weight: 700; margin-bottom: 2px; }
.bubble.agent { align-self: flex-start; background: var(--charcoal-raised); color: var(--white); border-bottom-left-radius: 4px; }
.bubble.agent small { color: var(--yellow); }
.bubble.caller { align-self: flex-end; background: var(--yellow); color: var(--black); border-bottom-right-radius: 4px; }
.bubble.caller small { color: #5a4a00; }
.bubble[hidden] { display: none; }
.bubble.speaking { box-shadow: 0 0 0 2px var(--blue); }
.bubble.new { animation: rise 0.25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.transcript-empty {
  margin: auto; text-align: center; color: var(--muted); font-size: 0.9rem; max-width: 24ch;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.center-play {
  width: 88px; height: 88px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--yellow); color: var(--black);
  display: grid; place-items: center;
  box-shadow: 0 0 0 10px rgba(255,210,63,0.12);
  transition: transform 0.2s;
}
.center-play:hover { transform: scale(1.06); }
.center-play svg { width: 38px; height: 38px; margin-left: 4px; }
.ring-bars { display: none; align-items: center; gap: 7px; height: 88px; }
.ring-bars i { display: block; width: 10px; border-radius: 5px; background: var(--yellow); animation: bars 0.9s ease-in-out infinite; }
.ring-bars i:nth-child(1), .ring-bars i:nth-child(5) { height: 24px; animation-delay: 0s; }
.ring-bars i:nth-child(2), .ring-bars i:nth-child(4) { height: 48px; animation-delay: 0.15s; }
.ring-bars i:nth-child(3) { height: 72px; animation-delay: 0.3s; }
@keyframes bars { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }
.phone[data-state="ringing"] .center-play { display: none; }
.phone[data-state="ringing"] .ring-bars { display: flex; }
.phone[data-state="ringing"] .empty-text::before { content: "Calling Brookfield Plumbing…"; }
.phone[data-state="ringing"] .empty-text { font-size: 0; }
.phone[data-state="ringing"] .empty-text::before { font-size: 0.9rem; }

.phone-controls { padding-top: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.call-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: none; border: 0; padding: 4px 12px; cursor: pointer;
  font: inherit; color: var(--text); font-size: 0.85rem; font-weight: 600;
  border-radius: 16px;
}
.call-circle {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  background: #2fbf63; color: #fff;
  transition: background 0.2s, transform 0.2s;
}
.call-circle svg { width: 28px; height: 28px; transition: transform 0.2s; }
.call-btn:hover .call-circle { transform: scale(1.05); }
.phone[data-state="ringing"] .call-circle,
.phone[data-state="talking"] .call-circle { background: #e5484d; }
.phone[data-state="ringing"] .call-circle svg,
.phone[data-state="talking"] .call-circle svg { transform: rotate(135deg); }
.phone-note { font-size: 0.8rem; color: var(--muted); text-align: center; margin: 0; min-height: 1.2em; }

/* ---------- Steps (a real sequence) ---------- */

.steps {
  list-style: none; margin: 40px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  counter-reset: step;
  border-top: 1px solid var(--line);
}
.steps li { padding: 24px 24px 8px 0; counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--yellow); color: var(--black); font-weight: 800;
  margin-bottom: 16px;
}
.steps h3 { font-size: 1.1rem; }
.steps p { font-size: 0.98rem; color: var(--muted); }
@media (max-width: 880px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Voices ---------- */

.voices { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 32px; }
@media (max-width: 720px) { .voices { grid-template-columns: 1fr; } }
.voice {
  background: var(--charcoal-raised); border-radius: var(--radius-panel);
  padding: 28px; display: flex; flex-direction: column; gap: 6px;
}
.voice-head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.voice-initial {
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid var(--yellow); color: var(--yellow);
  display: grid; place-items: center; font-weight: 800; font-size: 1.4rem;
  font-variation-settings: 'wdth' 118; flex: none;
}
.voice h3 { margin: 0; font-size: 1.6rem; }
.voice-meta { color: var(--muted); font-size: 0.9rem; }
.voice p { color: var(--text); }
.voice .button { align-self: flex-start; margin-top: auto; }
.play-icon { width: 14px; height: 14px; }
.voice-note { font-size: 0.85rem; color: var(--muted); margin: 6px 0 0; min-height: 1.3em; }

/* ---------- Pricing ---------- */

.price-panel {
  margin-top: 32px; border: 1.5px solid var(--yellow); border-radius: var(--radius-panel);
  padding: clamp(24px, 4vw, 40px);
  display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 5vw, 56px); align-items: center;
}
@media (max-width: 720px) { .price-panel { grid-template-columns: 1fr; } }
.price { color: var(--white); font-weight: 800; font-variation-settings: 'wdth' 125; line-height: 1; }
.price strong { font-size: clamp(3.2rem, 8vw, 5rem); display: block; letter-spacing: -0.03em; }
.price span { font-size: 1.05rem; color: var(--muted); font-weight: 600; font-variation-settings: 'wdth' 100; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ticks li { padding-left: 32px; position: relative; }
.ticks li::before {
  content: ''; position: absolute; left: 0; top: 4px; width: 20px; height: 20px; border-radius: 5px;
  background: var(--yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* ---------- Business list ---------- */

.business-list { margin: 32px 0 0; padding: 0; border-top: 1px solid var(--line); }
.business-list div {
  display: grid; grid-template-columns: minmax(180px, 0.8fr) 2fr; gap: 24px;
  padding: 24px 0; border-bottom: 1px solid var(--line);
}
.business-list dt { color: var(--white); font-weight: 800; font-size: 1.25rem; font-variation-settings: 'wdth' 118; }
.business-list dd { margin: 0; }
@media (max-width: 640px) { .business-list div { grid-template-columns: 1fr; gap: 6px; } }

/* ---------- Two-column text ---------- */

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 6vw, 72px); }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

/* ---------- Form ---------- */

.notice {
  background: var(--charcoal-raised); border-left: 4px solid var(--yellow);
  border-radius: 10px; padding: 18px 22px; margin-bottom: 28px; max-width: 640px;
}
.notice strong { color: var(--white); display: block; font-size: 1.1rem; }
.notice p { margin: 4px 0 0; }
form.demo { display: grid; gap: 18px; max-width: 640px; }
.field { display: grid; gap: 6px; }
.field label, fieldset legend { color: var(--white); font-weight: 700; font-size: 0.95rem; }
.field input {
  font: inherit; color: var(--white); background: var(--charcoal-deep);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
.field input:disabled { opacity: 0.6; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
fieldset legend { margin-bottom: 8px; width: 100%; }
.choice {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--radius-button); padding: 8px 16px; opacity: 0.6;
}

/* ---------- CTA band ---------- */

.cta-band { background: var(--yellow); color: var(--black); }
.cta-band h2 { color: var(--black); }
.cta-band p { color: #2b2400; }
.cta-band .button { background: var(--black); color: var(--yellow); border-color: var(--black); }
.cta-band .button:hover { background: #1a1a1a; }
.cta-band .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.cta-band .wrap > div { max-width: 640px; }

/* ---------- Footer ---------- */

.site-footer { background: var(--charcoal-deep); border-top: 1px solid var(--line); padding: 40px 0; font-size: 0.92rem; color: var(--muted); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: center; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; padding: 0; }
.footer-links a { color: var(--text); text-decoration: none; }
.footer-links a:hover { color: var(--yellow); }

@media (max-width: 400px) { .phone-screen { min-height: 600px; } .transcript { min-height: 260px; max-height: 260px; } }

/* Desktop and laptop: the whole first screen (header, words and the full
   phone) fits the window, whatever its height. The phone sizes itself to
   the window and the headline shrinks a little on shorter screens. */
@media (min-width: 881px) {
  .hero { padding: clamp(16px, 3vh, 48px) 0 clamp(20px, 3.5vh, 56px); }
  .hero h1 { font-size: clamp(2.2rem, min(5.4vw, 7.4vh), 4rem); }
  .hero .lead { font-size: clamp(1rem, 2.1vh, 1.2rem); }
  .hero .actions { margin-top: clamp(14px, 2.6vh, 28px); }
  .phone-screen { min-height: 0; height: clamp(380px, calc(100svh - 230px), 640px); }
  .transcript { flex: 1 1 0; min-height: 0; max-height: none; }
}
@media (min-width: 881px) and (max-height: 860px) {
  .phone { border-radius: 44px; padding: 9px; }
  .phone-screen { border-radius: 36px; padding: 10px 12px 8px; }
  .phone-island { width: 84px; height: 24px; margin-bottom: 6px; }
  .phone-top { padding-bottom: 6px; }
  .caller-card { padding-bottom: 8px; }
  .caller-avatar { width: 40px; height: 40px; margin-bottom: 4px; font-size: 0.85rem !important; }
  .caller-card strong { font-size: 1rem; }
  .caller-card span { font-size: 0.78rem; }
  .center-play { width: 68px; height: 68px; box-shadow: 0 0 0 7px rgba(255,210,63,0.12); }
  .center-play svg { width: 30px; height: 30px; }
  .ring-bars { height: 68px; }
  .transcript-empty { gap: 10px; font-size: 0.82rem; }
  .bubble { padding: 8px 12px; font-size: 0.86rem; }
  .phone-controls { padding-top: 8px; }
  .call-circle { width: 52px; height: 52px; }
  .call-circle svg { width: 24px; height: 24px; }
  .call-btn { gap: 4px; font-size: 0.8rem; }
  .phone-home { margin-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; }
  .ring-bars i { transform: none; }
}

/* Short laptop windows (e.g. a MacBook with the browser not full screen):
   tighten the header and phone so the first screen still fits. */
@media (min-width: 881px) and (max-height: 700px) {
  .header-row { padding: 10px 0 8px; }
  .brand { font-size: 1.1rem; }
  .brand-tile { width: 32px; height: 32px; border-radius: 8px; }
  .brand-tile svg { width: 32px; height: 32px; }
  .nav { padding-bottom: 10px; }
  .nav a { padding: 6px 14px; font-size: 0.85rem; }
  .hero { padding: 12px 0 14px; gap: 40px; }
  .hero h1 { font-size: clamp(2rem, min(5vw, 6.6vh), 3rem); }
  .hero p { margin-bottom: 0.6em; font-size: 0.95rem; }
  .hero .actions { margin-top: 12px; }
  .hero .actions .button { padding: 10px 18px; }
  .phone-screen { height: max(330px, calc(100svh - 145px)); }
  .phone-btn-vol { top: 90px; height: 48px; }
  .phone-btn-power { top: 115px; height: 64px; }
  .caller-avatar { display: none !important; }
  .caller-card strong { font-size: 0.95rem; }
  .phone-note { min-height: 0; }
  .center-play { width: 60px; height: 60px; }
  .ring-bars { height: 60px; }
  .call-circle { width: 46px; height: 46px; }
}

