/* ============================================================
   HearBack — hearback.in
   Answer-call green on green-biased neutrals.
   Tokens first; components only ever read tokens.
   ============================================================ */

:root {
  /* color */
  --accent: #0e7c5b;          /* line green */
  --accent-strong: #0a6046;
  --accent-soft: rgba(14, 124, 91, 0.10);
  --on-accent: #ffffff;
  --bg: #f6f7f4;              /* paper, green-biased */
  --surface: #ffffff;
  --surface-2: #eef1ec;
  --ink: #161d19;
  --ink-2: #3c4842;
  --muted: #5f6d64;
  --rule: #dde3dc;
  --card-border: #e2e7e0;
  --shadow: 0 1px 2px rgba(22, 29, 25, 0.05), 0 16px 40px -20px rgba(22, 29, 25, 0.22);

  /* the call ticket is deep green-black in BOTH themes */
  --ticket-bg: #0b1512;
  --ticket-surface: #101d18;
  --ticket-rule: #22352c;
  --ticket-ink: #dfe9e2;
  --ticket-muted: #7d9187;
  --ticket-accent: #46cf9a;

  /* type */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-body: 1.0625rem;
  --fs-lg: 1.1875rem;
  --fs-h3: 1.1875rem;
  --fs-h2: clamp(1.75rem, 3.4vw, 2.375rem);
  --fs-h1: clamp(2.375rem, 5.6vw, 3.75rem);

  /* rhythm */
  --space-section: clamp(4.5rem, 10vw, 7.5rem);
  --radius: 14px;
  --radius-sm: 9px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #3cc492;
    --accent-strong: #5ad3a6;
    --accent-soft: rgba(60, 196, 146, 0.12);
    --on-accent: #07130e;
    --bg: #0c110f;              /* pitch, green-biased */
    --surface: #121814;
    --surface-2: #171f1a;
    --ink: #e8eee9;
    --ink-2: #c2cdc5;
    --muted: #8fa096;
    --rule: #242f28;
    --card-border: #26332b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 16px 40px -20px rgba(0, 0, 0, 0.6);
    --ticket-bg: #0d1713;
    --ticket-rule: #26392f;
  }
}

/* ---------------------------------------------------------- */
/* base                                                        */
/* ---------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, figure { margin: 0; }

img, svg { display: block; max-width: 100%; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3.5rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; color: var(--on-accent); }

.container {
  max-width: 72.5rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

/* mono voice — the telephony layer */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------------------------------------------------------- */
/* buttons                                                     */
/* ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover {
  background: var(--accent-strong);
  color: var(--on-accent);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--muted);
  background: var(--surface-2);
}

.btn svg { flex: none; }

/* ---------------------------------------------------------- */
/* header / nav                                                */
/* ---------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg); /* fallback when color-mix is unsupported */
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 750;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); }
.brand-mark { color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
}
.site-nav a:hover { color: var(--ink); }
.site-nav .btn {
  padding: 0.5rem 1rem;
  font-size: var(--fs-sm);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  color: var(--ink);
  padding: 0.45rem 0.55rem;
  cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .icon-close { display: none; }

@media (max-width: 46rem) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem clamp(1.25rem, 5vw, 2.5rem) 1.25rem;
  }
  .site-nav a {
    padding: 0.8rem 0.25rem;
    border-bottom: 1px solid var(--rule);
    font-size: 1rem;
  }
  .site-nav a:last-of-type { border-bottom: 0; }
  .site-nav .btn {
    margin-top: 0.75rem;
    justify-content: center;
    padding: 0.8rem 1rem;
  }
  .site-header.nav-open .site-nav { display: flex; }
  .site-header.nav-open .icon-menu { display: none; }
  .site-header.nav-open .icon-close { display: block; }
}

/* ---------------------------------------------------------- */
/* sections                                                    */
/* ---------------------------------------------------------- */

.section { padding-block: var(--space-section); }
.section + .section { border-top: 1px solid var(--rule); }

.section-head {
  max-width: 40rem;
  display: grid;
  gap: 0.9rem;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

h2 {
  font-size: var(--fs-h2);
  font-weight: 750;
  letter-spacing: -0.022em;
  line-height: 1.12;
  text-wrap: balance;
}

.lede {
  color: var(--muted);
  font-size: var(--fs-lg);
  max-width: 65ch;
}

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

.hero { padding-block: clamp(3.5rem, 8vw, 6.5rem); }

.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
}

.hero-copy { display: grid; gap: 1.5rem; justify-items: start; }

h1 {
  font-size: var(--fs-h1);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
}
h1 .cold { color: var(--muted); }
h1 .hot { color: var(--accent); }

.hero-sub {
  color: var(--muted);
  font-size: var(--fs-lg);
  max-width: 54ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.trust-line {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  letter-spacing: 0.01em;
  line-height: 1.8;
  max-width: 44ch;
}
.trust-line strong { color: var(--ink-2); font-weight: 500; }

/* --- the call ticket ---------------------------------------- */

.ticket {
  background: var(--ticket-bg);
  color: var(--ticket-ink);
  border: 1px solid var(--ticket-rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.55;
  overflow: hidden;
}

.ticket-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--ticket-rule);
  color: var(--ticket-muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ticket-live {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ticket-accent);
}
.ticket-live .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ticket-accent);
}
@media (prefers-reduced-motion: no-preference) {
  .ticket-live .dot { animation: pulse 1.6s ease-in-out infinite; }
  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
  }
}

.ticket-timer { color: var(--ticket-ink); font-size: 0.8125rem; }

.ticket-meta {
  padding: 0.7rem 1.15rem;
  border-bottom: 1px solid var(--ticket-rule);
  color: var(--ticket-muted);
  font-size: 0.75rem;
  display: grid;
  gap: 0.15rem;
}
.ticket-meta em { font-style: normal; color: var(--ticket-accent); }

.ticket-body {
  padding: 1rem 1.15rem;
  display: grid;
  gap: 0.7rem;
}

.line { display: grid; grid-template-columns: 3.2rem 1fr; gap: 0.6rem; }
.line .who { color: var(--ticket-muted); font-size: 0.75rem; padding-top: 0.1em; }
.line.ai .who { color: var(--ticket-accent); }
.line p { color: var(--ticket-ink); }

.ticket-results {
  border-top: 1px solid var(--ticket-rule);
  background: var(--ticket-surface);
  padding: 0.9rem 1.15rem;
  display: grid;
  gap: 0.45rem;
}
.result {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  color: var(--ticket-ink);
}
.result svg {
  flex: none;
  width: 13px;
  height: 13px;
  color: var(--ticket-accent);
  align-self: center;
}
.result .r-label { color: var(--ticket-muted); }

/* staged reveal — only when motion is allowed */
@media (prefers-reduced-motion: no-preference) {
  .ticket [data-stage] {
    opacity: 0;
    transform: translateY(6px);
    animation: stage-in 0.5s ease forwards;
  }
  .ticket [data-stage="1"] { animation-delay: 0.30s; }
  .ticket [data-stage="2"] { animation-delay: 0.85s; }
  .ticket [data-stage="3"] { animation-delay: 1.55s; }
  .ticket [data-stage="4"] { animation-delay: 2.25s; }
  .ticket [data-stage="5"] { animation-delay: 2.95s; }
  .ticket [data-stage="6"] { animation-delay: 3.55s; }
  .ticket [data-stage="7"] { animation-delay: 3.95s; }
  .ticket [data-stage="8"] { animation-delay: 4.35s; }
  @keyframes stage-in {
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 56rem) {
  .hero .container { grid-template-columns: 1fr; }
  .ticket { max-width: 34rem; }
}

/* ---------------------------------------------------------- */
/* how it works                                                */
/* ---------------------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  list-style: none;
  padding: 0;
}

.step {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem 1.6rem;
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.step-icon {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
}
.step-icon svg { width: 22px; height: 22px; }

.step-num {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  letter-spacing: 0.08em;
}

.step h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.25;
}
.step p { color: var(--muted); font-size: var(--fs-sm); }

@media (max-width: 62rem) {
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 36rem) {
  .steps { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------- */
/* features                                                    */
/* ---------------------------------------------------------- */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.feature {
  border: 1px solid var(--card-border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem 1.6rem;
  display: grid;
  gap: 0.8rem;
  align-content: start;
}

.feature-icon {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
}
.feature-icon svg { width: 22px; height: 22px; }

.feature h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.25;
}
.feature p { color: var(--muted); font-size: var(--fs-sm); }

@media (max-width: 62rem) {
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 36rem) {
  .features { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------- */
/* pricing                                                     */
/* ---------------------------------------------------------- */

.pricing-card {
  max-width: 36rem;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pricing-head {
  padding: 1.75rem 1.75rem 1.5rem;
  display: grid;
  gap: 0.5rem;
}
.pricing-head h3 {
  font-size: 1.5rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.pricing-head p { color: var(--muted); font-size: var(--fs-sm); }

.rate-card {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-sm);
  border-top: 1px solid var(--rule);
  margin: 0;
}
.rate-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 1.75rem;
}
.rate-row + .rate-row { border-top: 1px solid var(--rule); }
.rate-row dt { color: var(--ink-2); }
.rate-row dt small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-family: var(--font-sans);
}
.rate-row dd {
  margin-left: auto;
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

.rate-fill {
  flex: 1;
  border-bottom: 1px dotted var(--rule);
  transform: translateY(-0.3em);
  min-width: 1.5rem;
}

.pricing-note {
  border-top: 1px solid var(--rule);
  background: var(--surface-2);
  padding: 1.25rem 1.75rem 1.5rem;
  display: grid;
  gap: 1rem;
}
.pricing-note p {
  color: var(--muted);
  font-size: var(--fs-sm);
}
.pricing-note .btn { justify-self: start; }

/* ---------------------------------------------------------- */
/* faq                                                         */
/* ---------------------------------------------------------- */

.faq-list {
  max-width: 46rem;
  border-top: 1px solid var(--rule);
}

.faq-list details { border-bottom: 1px solid var(--rule); }

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.15rem 0.25rem;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: var(--fs-body);
  color: var(--ink);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary:hover { color: var(--accent); }

.faq-list summary .plus {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 0.2s ease;
}
.faq-list details[open] summary .plus { transform: rotate(45deg); color: var(--accent); }

.faq-body {
  padding: 0 0.25rem 1.4rem;
  color: var(--muted);
  font-size: var(--fs-sm);
  max-width: 62ch;
  display: grid;
  gap: 0.7rem;
}

/* ---------------------------------------------------------- */
/* closing CTA                                                 */
/* ---------------------------------------------------------- */

.closing {
  text-align: left;
}
.closing .container {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
}
.closing h2 { max-width: 22ch; }

/* ---------------------------------------------------------- */
/* footer                                                      */
/* ---------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 3rem 3.5rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  justify-content: space-between;
}

.footer-brand {
  display: grid;
  gap: 0.6rem;
  max-width: 24rem;
}
.footer-brand p {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.footer-links {
  display: flex;
  gap: 3.5rem;
  flex-wrap: wrap;
}
.footer-col {
  display: grid;
  gap: 0.55rem;
  align-content: start;
}
.footer-col .footer-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.footer-col a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: var(--fs-sm);
}
.footer-col a:hover { color: var(--accent); }

.footer-meta {
  width: 100%;
  margin-top: 0.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
}

/* ---------------------------------------------------------- */
/* legal pages (privacy / terms)                               */
/* ---------------------------------------------------------- */

.legal {
  max-width: 44rem;
  margin-inline: auto;
  padding: clamp(3rem, 8vw, 5rem) clamp(1.25rem, 5vw, 2.5rem) 5rem;
  display: grid;
  gap: 1.1rem;
}
.legal h1 {
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  margin-bottom: 0.25rem;
}
.legal .legal-updated {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.legal h2 {
  font-size: 1.375rem;
  margin-top: 1.5rem;
}
.legal p, .legal li { color: var(--ink-2); font-size: 1rem; }
.legal ul { padding-left: 1.25rem; display: grid; gap: 0.5rem; }
.legal strong { color: var(--ink); }
