/* FOCUS — How It Works section
   Designed to drop into focussurgery.org section rhythm.
   Inherits Inter, navy/green/mint palette from the marketing site. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: #0F2240;
  background: #fff;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

:root {
  --navy: #0F2240;
  --navy-deep: #0A1A33;
  --navy-soft: #1B2F4F;
  --green: #2D6A4F;
  --green-hover: #245A42;
  --mint: #95D5B2;
  --mint-soft: #D8EFE0;
  --white: #fff;
  --gray: #F8F9FA;
  --gray-2: #F1F4F8;
  --muted: #6B7C93;
  --border: #E2E8F0;
  --text-body: #4A5568;
  --text-body-soft: #3A4F6A;
  --escalate: #DC2626;
  --escalate-bg: #FEE2E2;
  --escalate-border: #F87171;
  --warn: #EA580C;
  --warn-bg: #FED7AA;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ─── Section frame ─── */

.hfw-section {
  padding: 110px 0 120px;
  background: var(--gray);
  position: relative;
  overflow: hidden;
}
.hfw-section.dark { background: var(--navy); color: #fff; }

.hfw-header { max-width: 760px; margin-bottom: 64px; }
.hfw-eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .75rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 14px;
}
.dark .hfw-eyebrow {
  color: var(--mint);
  background: rgba(149,213,178,.12);
  padding: 6px 14px;
  border-radius: 20px;
}
.hfw-title {
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.1;
  margin-bottom: 20px;
  text-wrap: pretty;
}
.dark .hfw-title { color: #fff; }
.hfw-title em { font-style: normal; color: var(--green); }
.dark .hfw-title em { color: var(--mint); }
.hfw-lede {
  font-size: 1.125rem;
  color: var(--text-body-soft);
  line-height: 1.65;
  max-width: 640px;
  text-wrap: pretty;
}
.dark .hfw-lede { color: rgba(255,255,255,.72); }

/* ─── The five-stage rail ─── */

.hfw-rail-wrap { position: relative; }

.hfw-rail {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  position: relative;
  align-items: stretch;
}

/* Connector path drawn behind cards */
.hfw-rail::before {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  top: 60px;
  height: 2px;
  background: repeating-linear-gradient(
    to right,
    var(--border) 0 8px,
    transparent 8px 14px
  );
  z-index: 0;
}
.dark .hfw-rail::before {
  background: repeating-linear-gradient(
    to right,
    rgba(255,255,255,.18) 0 8px,
    transparent 8px 14px
  );
}

.hfw-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.hfw-stage-num {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: 0 2px 20px rgba(15,34,64,.07);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  position: relative;
  transition: transform .25s, box-shadow .25s;
}
.dark .hfw-stage-num {
  background: var(--navy-soft);
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 2px 20px rgba(0,0,0,.3);
}
.hfw-stage-num:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(15,34,64,.12); }
.dark .hfw-stage-num:hover { box-shadow: 0 8px 28px rgba(0,0,0,.45); }

.hfw-stage-num-label {
  position: absolute;
  top: -10px;
  background: var(--green);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .14em;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}
.dark .hfw-stage-num-label { background: var(--mint); color: var(--navy-deep); }

.hfw-stage-icon {
  width: 38px; height: 38px;
  color: var(--green);
  stroke-width: 1.5;
}
.dark .hfw-stage-icon { color: var(--mint); }

.hfw-stage-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -.01em;
}
.dark .hfw-stage-title { color: #fff; }

.hfw-stage-text {
  font-size: .85rem;
  color: var(--text-body);
  text-align: center;
  line-height: 1.55;
  text-wrap: pretty;
}
.dark .hfw-stage-text { color: rgba(255,255,255,.62); }

/* Active stage halo */
.hfw-stage.is-active .hfw-stage-num {
  border-color: var(--green);
  box-shadow: 0 0 0 6px rgba(45,106,79,.14), 0 8px 24px rgba(15,34,64,.12);
  transform: translateY(-3px);
}
.dark .hfw-stage.is-active .hfw-stage-num {
  border-color: var(--mint);
  box-shadow: 0 0 0 6px rgba(149,213,178,.14), 0 8px 24px rgba(0,0,0,.4);
}
.hfw-stage.is-active .hfw-stage-icon {
  animation: hfw-pulse 1.4s ease-in-out infinite;
}
@keyframes hfw-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* ─── Demo theatre — phone + escalation card ─── */

.hfw-theatre {
  margin-top: 88px;
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  gap: 44px;
  align-items: center;
  position: relative;
}

.hfw-theatre-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hfw-theatre-label {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.dark .hfw-theatre-label { color: var(--mint); }
.hfw-theatre-h {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.02em;
  line-height: 1.2;
  margin-bottom: 4px;
}
.dark .hfw-theatre-h { color: #fff; }
.hfw-theatre-p {
  font-size: .92rem;
  color: var(--text-body);
  line-height: 1.65;
  text-wrap: pretty;
}
.dark .hfw-theatre-p { color: rgba(255,255,255,.7); }

/* Phone */
.hfw-phone-wrap {
  display: flex;
  justify-content: center;
  position: relative;
}

.hfw-phone {
  width: 320px;
  height: 640px;
  background: #1A2236;
  border-radius: 44px;
  padding: 14px;
  box-shadow:
    0 0 0 2px #2A3348,
    0 30px 60px -20px rgba(15,34,64,.4),
    0 12px 28px rgba(15,34,64,.18);
  position: relative;
}
.hfw-phone-screen {
  width: 100%;
  height: 100%;
  background: #ECE5DD; /* WhatsApp-ish neutral */
  border-radius: 32px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.hfw-phone-notch {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 110px; height: 26px;
  background: #1A2236;
  border-radius: 0 0 18px 18px;
  z-index: 5;
}

.hfw-msg-header {
  background: #075E54;
  color: #fff;
  padding: 38px 18px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .78rem;
}
.hfw-msg-back { font-size: 1.1rem; opacity: .9; }
.hfw-msg-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: -.02em;
}
.hfw-msg-name { font-weight: 700; line-height: 1.1; }
.hfw-msg-status { font-size: .65rem; opacity: .75; line-height: 1.1; }

.hfw-msg-body {
  flex: 1;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  background: #ECE5DD;
  position: relative;
}
.hfw-msg-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.4) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,.3) 0 1px, transparent 1px);
  background-size: 80px 80px, 60px 60px;
  pointer-events: none;
}

.hfw-bubble {
  max-width: 78%;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: .78rem;
  line-height: 1.4;
  position: relative;
  box-shadow: 0 1px 1px rgba(0,0,0,.08);
  animation: hfw-bubble-in .35s ease-out both;
}
@keyframes hfw-bubble-in {
  from { opacity: 0; transform: translateY(8px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.hfw-bubble.received {
  background: #fff;
  color: #111B21;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.hfw-bubble.sent {
  background: #DCF8C6;
  color: #111B21;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  font-weight: 600;
}
.hfw-bubble.sent.danger { background: #FFD7D7; color: #6E1A1A; }
.hfw-bubble.received.alert {
  background: #FEF3C7;
  color: #6B4A0F;
  border: 1px solid #F59E0B;
  font-weight: 500;
}
.hfw-bubble-time {
  display: block;
  font-size: .58rem;
  color: rgba(0,0,0,.4);
  text-align: right;
  margin-top: 2px;
  font-weight: 400;
}
.hfw-bubble-question {
  font-size: .68rem;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 4px;
}

.hfw-typing {
  align-self: flex-start;
  background: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 4px;
  box-shadow: 0 1px 1px rgba(0,0,0,.08);
}
.hfw-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #999;
  animation: hfw-typing 1.2s ease-in-out infinite;
}
.hfw-typing span:nth-child(2) { animation-delay: .2s; }
.hfw-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes hfw-typing {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.hfw-channel-tag {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(255,255,255,.95);
  color: var(--navy);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .14em;
  padding: 4px 8px;
  border-radius: 6px;
  z-index: 6;
  text-transform: uppercase;
}
.hfw-channel-tag.sms { background: var(--warn-bg); color: #7C2D12; }

.hfw-phone-base {
  position: absolute;
  bottom: -34px;
  left: 50%;
  transform: translateX(-50%);
  width: 86%;
  height: 36px;
  background: radial-gradient(ellipse at center, rgba(15,34,64,.18) 0%, transparent 70%);
  filter: blur(4px);
  z-index: -1;
}

/* Side annotation arrows */
.hfw-anno {
  position: relative;
  background: var(--white);
  border-radius: 14px;
  padding: 22px 22px;
  box-shadow: 0 2px 20px rgba(15,34,64,.07), 0 0 0 1px var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dark .hfw-anno {
  background: var(--navy-soft);
  box-shadow: 0 2px 20px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.06);
}
.hfw-anno.with-rule { border-top: 4px solid var(--green); }
.dark .hfw-anno.with-rule { border-top-color: var(--mint); }

.hfw-anno-row {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: .85rem;
  color: var(--text-body);
  line-height: 1.5;
}
.dark .hfw-anno-row { color: rgba(255,255,255,.72); }
.hfw-anno-row svg {
  width: 16px; height: 16px;
  color: var(--green); flex-shrink: 0;
  margin-top: 3px;
  stroke-width: 2;
}
.dark .hfw-anno-row svg { color: var(--mint); }

/* Live escalation card on the right */
.hfw-escalation {
  background: #fff;
  border-radius: 14px;
  border-left: 4px solid var(--escalate-border);
  padding: 18px 20px;
  box-shadow: 0 12px 32px rgba(220,38,38,.18), 0 0 0 1px var(--border);
  position: relative;
  transform: translateX(20px);
  opacity: 0;
  transition: opacity .35s ease, transform .35s ease;
}
.hfw-escalation.visible { transform: translateX(0); opacity: 1; }
.dark .hfw-escalation { background: var(--navy-soft); }
.hfw-esc-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--escalate-bg);
  color: var(--escalate);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.hfw-esc-tag .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--escalate);
  animation: hfw-blink 1.1s ease-in-out infinite;
}
@keyframes hfw-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}
.hfw-esc-h {
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
  letter-spacing: -.01em;
}
.dark .hfw-esc-h { color: #fff; }
.hfw-esc-meta {
  font-size: .72rem;
  color: var(--muted);
  margin-bottom: 12px;
  font-family: 'JetBrains Mono', monospace;
}
.hfw-esc-row {
  display: flex; justify-content: space-between;
  padding: 6px 0;
  font-size: .8rem;
  border-top: 1px solid var(--border);
}
.dark .hfw-esc-row { border-top-color: rgba(255,255,255,.08); }
.hfw-esc-row:first-of-type { border-top: 0; }
.hfw-esc-row .q { color: var(--text-body); }
.dark .hfw-esc-row .q { color: rgba(255,255,255,.7); }
.hfw-esc-row .a {
  font-weight: 700;
  color: var(--navy);
}
.dark .hfw-esc-row .a { color: #fff; }
.hfw-esc-row .a.flag { color: var(--escalate); }

.hfw-esc-cta {
  margin-top: 14px;
  display: flex; gap: 8px;
}
.hfw-esc-btn {
  flex: 1;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  border: 0;
  font-family: inherit;
}
.hfw-esc-btn.primary { background: var(--escalate); color: #fff; }
.hfw-esc-btn.primary:hover { background: #B91C1C; }
.hfw-esc-btn.secondary { background: var(--gray); color: var(--navy); }
.dark .hfw-esc-btn.secondary { background: rgba(255,255,255,.08); color: #fff; }

/* Stat strip */
.hfw-stats {
  margin-top: 96px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.hfw-stat {
  background: #fff;
  border-radius: 14px;
  padding: 28px 26px;
  box-shadow: 0 2px 20px rgba(15,34,64,.05), 0 0 0 1px var(--border);
}
.dark .hfw-stat {
  background: var(--navy-soft);
  box-shadow: 0 2px 20px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.06);
}
.hfw-stat-num {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--navy);
  letter-spacing: -.025em;
  line-height: 1;
  margin-bottom: 6px;
}
.dark .hfw-stat-num { color: #fff; }
.hfw-stat-num em {
  font-style: normal;
  color: var(--green);
  font-size: 1.3rem;
  font-weight: 800;
  margin-left: 2px;
  letter-spacing: 0;
}
.dark .hfw-stat-num em { color: var(--mint); }
.hfw-stat-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-body);
  line-height: 1.5;
  text-wrap: pretty;
}
.dark .hfw-stat-label { color: rgba(255,255,255,.65); }

/* Cycle bar — pacing controls */
.hfw-cycle-bar {
  position: absolute;
  top: 32px; right: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 22px;
  padding: 6px 6px 6px 18px;
  box-shadow: 0 2px 14px rgba(15,34,64,.07), 0 0 0 1px var(--border);
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-body);
  z-index: 5;
}
.dark .hfw-cycle-bar {
  background: var(--navy-soft);
  color: rgba(255,255,255,.7);
  box-shadow: 0 2px 14px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.06);
}
.hfw-cycle-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 0;
  background: var(--green);
  color: #fff;
  font-size: .8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dark .hfw-cycle-btn { background: var(--mint); color: var(--navy); }
.hfw-cycle-btn:hover { background: var(--green-hover); }

/* Timepoint scrub */
.hfw-timeline {
  margin-top: 56px;
  background: #fff;
  border-radius: 14px;
  padding: 26px 28px;
  box-shadow: 0 2px 20px rgba(15,34,64,.05), 0 0 0 1px var(--border);
}
.dark .hfw-timeline {
  background: var(--navy-soft);
  box-shadow: 0 2px 20px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.06);
}
.hfw-timeline-h {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 22px;
}
.hfw-timeline-h h4 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.01em;
}
.dark .hfw-timeline-h h4 { color: #fff; }
.hfw-timeline-h span {
  font-size: .72rem;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}
.hfw-timeline-track {
  position: relative;
  height: 56px;
  margin: 0 14px;
}
.hfw-timeline-line {
  position: absolute; left: 0; right: 0; top: 16px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
}
.dark .hfw-timeline-line { background: rgba(255,255,255,.1); }
.hfw-timeline-fill {
  position: absolute; left: 0; top: 16px;
  height: 2px;
  background: var(--green);
  border-radius: 2px;
  transition: width .8s ease;
}
.dark .hfw-timeline-fill { background: var(--mint); }
.hfw-tp {
  position: absolute;
  transform: translateX(-50%);
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.hfw-tp-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--border);
  transition: all .25s ease;
}
.dark .hfw-tp-dot { background: var(--navy-soft); border-color: rgba(255,255,255,.18); }
.hfw-tp.done .hfw-tp-dot { background: var(--green); border-color: var(--green); }
.hfw-tp.active .hfw-tp-dot {
  background: #fff;
  border-color: var(--green);
  box-shadow: 0 0 0 5px rgba(45,106,79,.2);
  transform: scale(1.15);
}
.dark .hfw-tp.done .hfw-tp-dot { background: var(--mint); border-color: var(--mint); }
.dark .hfw-tp.active .hfw-tp-dot {
  border-color: var(--mint);
  box-shadow: 0 0 0 5px rgba(149,213,178,.2);
}
.hfw-tp-label {
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-body);
  white-space: nowrap;
  margin-top: 24px;
  font-feature-settings: "tnum";
}
.dark .hfw-tp-label { color: rgba(255,255,255,.7); }
.hfw-tp.active .hfw-tp-label { color: var(--green); }
.dark .hfw-tp.active .hfw-tp-label { color: var(--mint); }

/* Goal note */
.hfw-goal {
  margin-top: 48px;
  background: #fff;
  border-left: 4px solid var(--green);
  padding: 22px 28px;
  border-radius: 0 14px 14px 0;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-shadow: 0 2px 20px rgba(15,34,64,.05);
}
.dark .hfw-goal {
  background: rgba(149,213,178,.08);
  border-left-color: var(--mint);
}
.hfw-goal-icon {
  width: 36px; height: 36px;
  flex-shrink: 0;
  background: var(--mint-soft);
  color: var(--green);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.dark .hfw-goal-icon { background: rgba(149,213,178,.18); color: var(--mint); }
.hfw-goal-icon svg { width: 20px; height: 20px; stroke-width: 2; }
.hfw-goal-text {
  font-size: .98rem;
  color: var(--text-body-soft);
  line-height: 1.65;
  text-wrap: pretty;
}
.dark .hfw-goal-text { color: rgba(255,255,255,.78); }
.hfw-goal-text strong {
  color: var(--navy);
  font-weight: 800;
}
.dark .hfw-goal-text strong { color: #fff; }

/* Background flourish */
.hfw-bg-blob {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  z-index: 0;
}
.hfw-bg-blob-1 {
  top: -120px; right: -120px;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(45,106,79,.06) 0%, transparent 70%);
}
.hfw-bg-blob-2 {
  bottom: -100px; left: -80px;
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(45,106,79,.05) 0%, transparent 70%);
}
.dark .hfw-bg-blob-1 {
  background: radial-gradient(circle, rgba(45,106,79,.3) 0%, transparent 70%);
}
.dark .hfw-bg-blob-2 {
  background: radial-gradient(circle, rgba(149,213,178,.08) 0%, transparent 70%);
}
.hfw-section > .container { position: relative; z-index: 1; }

/* Responsive */
@media (max-width: 1024px) {
  .hfw-theatre { grid-template-columns: 1fr; gap: 32px; }
  .hfw-theatre-side { max-width: 480px; margin: 0 auto; width: 100%; }
}
@media (max-width: 900px) {
  .hfw-rail { grid-template-columns: 1fr 1fr; }
  .hfw-rail::before { display: none; }
  .hfw-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .hfw-rail { grid-template-columns: 1fr; }
  .hfw-stats { grid-template-columns: 1fr; }
  .hfw-cycle-bar { position: static; margin-top: 18px; }
}
