/*
  Responderme site styles. Built on tokens.css; follows DESIGN.md.
  No raw colors, sizes or spacing here: use the tokens.
*/

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--space-5);
  scroll-padding-bottom: 7rem; /* keeps focused items clear of the action bar */
}

body {
  margin: 0;
  padding-bottom: 5.5rem; /* room for the action bar on phones */
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-text);
  background: var(--color-bg);
  overflow-wrap: break-word;
}

h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }

h1, h2 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  text-wrap: balance;
}
h1 { font-size: var(--text-display); line-height: var(--leading-display); }
h2 { font-size: var(--text-h2); line-height: var(--leading-h2); }
h3 { font-size: var(--text-h3); line-height: var(--leading-h3); font-weight: var(--weight-bold); }

p, li, dd { max-width: var(--measure); }
strong, b { font-weight: var(--weight-bold); }
.lead { font-size: var(--text-lead); line-height: var(--leading-lead); }
.small { font-size: var(--text-small); line-height: var(--leading-small); }
.muted { color: var(--color-text-muted); }
.num { font-family: var(--font-display); font-size: 1.2em; line-height: 1; white-space: nowrap; }

:focus-visible {
  outline: var(--focus-width) solid var(--color-focus);
  outline-offset: var(--focus-offset);
}

.icon {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  z-index: 30;
  padding: var(--space-3) var(--space-4);
  background: var(--color-inverse-bg);
  color: var(--color-inverse-text);
  font-weight: var(--weight-bold);
  border-radius: var(--radius-sm);
  transform: translateY(-300%);
}
.skip:focus { transform: none; }

/* ---------- Links ---------- */
a { color: inherit; }
.prose a, .text-link, .lang-link, .site-footer a {
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  transition: background-color var(--duration) var(--ease);
}
.prose a:hover, .text-link:hover, .lang-link:hover, .site-footer a:hover {
  background: var(--color-accent-soft);
}

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); background: var(--color-bg); }
.alt { background: var(--color-bg-alt); }
.band-ink { background: var(--color-bg); color: var(--color-text); }
.stack > * + * { margin-top: var(--space-4); }

.head { margin-bottom: var(--space-7); }
.head::before {
  content: "";
  display: block;
  width: var(--space-7);
  height: var(--stripe);
  margin-bottom: var(--space-4);
  background: var(--color-accent);
  transform-origin: left center;
}
.head p { margin-top: var(--space-4); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--target-main);
  padding: var(--space-2) var(--space-5);
  border: var(--border-thick) solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: var(--weight-bold);
  line-height: var(--leading-h3);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration) var(--ease), border-color var(--duration) var(--ease), color var(--duration) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: var(--target-min); padding-inline: var(--space-4); }
.btn-primary { background: var(--color-accent); color: var(--color-ink); border-color: var(--color-button-border); }
.btn-primary:hover { background: var(--color-accent-hover); }
.btn-secondary { background: transparent; color: var(--color-text); border-color: var(--color-text); }
.btn-secondary:hover { background: var(--color-bg-alt); }
.alt .btn-secondary:hover { background: var(--color-bg); }
.btn-call { background: var(--color-inverse-bg); color: var(--color-inverse-text); border-color: var(--color-inverse-bg); }
.btn-call:hover { background: var(--color-inverse-hover); border-color: var(--color-inverse-hover); }
.btn[aria-disabled="true"] { background: var(--color-border); border-color: var(--color-border); color: var(--color-text-muted); cursor: not-allowed; }

.actions { display: grid; gap: var(--space-3); margin-top: var(--space-6); }

/* ---------- Header ---------- */
.site-header {
  background: var(--color-bg);
  border-bottom: var(--border-thin) solid var(--color-border);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--header-height);
  padding-block: var(--space-2);
}
.brand { display: grid; gap: var(--space-1); text-decoration: none; }
.brand svg { display: block; height: 1.625rem; width: auto; fill: currentColor; }
.brand-line { font-size: var(--text-small); line-height: var(--leading-label); font-weight: var(--weight-bold); }
.header-actions { display: flex; align-items: center; gap: var(--space-4); }
.lang-link { display: inline-flex; align-items: center; min-height: var(--target-min); padding-inline: var(--space-2); font-weight: var(--weight-bold); }
.site-header .btn-call { display: none; }

/* ---------- Hero ---------- */
.hero { padding-block: var(--space-7) var(--section-y); }
.hero-grid { display: grid; gap: var(--space-7); align-items: center; }
.hero .lead { margin-top: var(--space-5); }
.hero .note { margin-top: var(--space-4); }

/* Job text */
.jobtext { max-width: 23rem; }
.phone {
  padding: var(--space-4);
  background: var(--color-bg);
  border: var(--border-thick) solid var(--color-text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
}
.jt-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-size: var(--text-small);
  line-height: var(--leading-small);
  font-weight: var(--weight-bold);
  color: var(--color-success);
}
.jt-status span { color: var(--color-text-muted); font-weight: var(--weight-regular); }
.bubble {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
}
.jt-row { position: relative; }
.jt-row dt { font-size: var(--text-small); line-height: var(--leading-small); font-weight: var(--weight-bold); color: var(--color-text-muted); }
.jt-row dd { line-height: var(--leading-h3); }
.jt-problem::before {
  content: "";
  position: absolute;
  inset: calc(var(--space-1) * -1) calc(var(--space-2) * -1);
  background: var(--color-accent-soft);
  border-radius: var(--radius-sm);
}
.jt-problem dt, .jt-problem dd { position: relative; }
.jt-problem dt { color: var(--color-text); }
.jobtext figcaption { margin-top: var(--space-3); font-size: var(--text-small); color: var(--color-text-muted); }

/* ---------- Problem ---------- */
.scene { font-size: var(--text-lead); line-height: var(--leading-lead); }
.stats { display: grid; gap: var(--space-6); margin-top: var(--space-7); }
.stat { padding-left: var(--space-4); border-left: var(--stripe) solid var(--color-accent); }
.stat-num { display: block; font-family: var(--font-display); font-size: var(--text-stat); line-height: var(--leading-stat); font-weight: var(--weight-bold); }
.stat-claim { margin-top: var(--space-2); font-size: var(--text-lead); line-height: var(--leading-lead); }
.stat-source { margin-top: var(--space-2); font-size: var(--text-small); line-height: var(--leading-small); color: var(--color-text-muted); }

/* ---------- Steps ---------- */
.steps { display: grid; gap: var(--space-6); counter-reset: step; }
.step { display: grid; grid-template-columns: auto 1fr; align-content: start; gap: var(--space-4); counter-increment: step; }
.step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: var(--target-main);
  height: var(--target-main);
  background: var(--color-accent);
  color: var(--color-ink);
  border: var(--border-thick) solid var(--color-button-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: var(--text-h2);
  line-height: 1;
  font-weight: var(--weight-bold);
}
.step p { margin-top: var(--space-2); }

/* ---------- Demo and sample calls ---------- */
.demo-call { margin-top: var(--space-6); }
.samples { display: grid; gap: var(--space-5); margin-top: var(--space-7); }
.sample {
  padding: var(--space-5);
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
}
.tag {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  border: var(--border-thin) solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: var(--text-label);
  line-height: var(--leading-label);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}
.sample h3 { margin-top: var(--space-3); }
.sample > p { margin-top: var(--space-2); }
.player { margin-top: var(--space-4); }
.player audio { display: block; width: 100%; }
.player-ui { display: flex; align-items: center; gap: var(--space-4); }
.player-btn { flex: none; width: var(--target-main); padding: 0; }
.player-track { flex: 1; min-width: 0; }
.player-time { font-size: var(--text-small); white-space: nowrap; }
.player-seek {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: var(--target-min);
  margin: 0;
  background: transparent;
  cursor: pointer;
  accent-color: var(--color-accent);
}
.player-seek::-webkit-slider-runnable-track { height: var(--space-2); background: var(--color-border-strong); border-radius: var(--radius-sm); }
.player-seek::-moz-range-track { height: var(--space-2); background: var(--color-border-strong); border-radius: var(--radius-sm); }
.player-seek::-moz-range-progress { height: var(--space-2); background: var(--color-accent); border-radius: var(--radius-sm); }
.player-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: var(--space-5);
  height: var(--space-5);
  margin-top: calc(var(--space-2) * -1);
  background: var(--color-accent);
  border: var(--border-thick) solid var(--color-bg);
  border-radius: var(--radius-sm);
}
.player-seek::-moz-range-thumb {
  width: var(--space-5);
  height: var(--space-5);
  background: var(--color-accent);
  border: var(--border-thick) solid var(--color-bg);
  border-radius: var(--radius-sm);
}

details { border-top: var(--border-thin) solid var(--color-border); }
summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--target-main);
  padding-block: var(--space-3);
  font-weight: var(--weight-bold);
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary .icon { transition: transform var(--duration) var(--ease); }
details[open] > summary .icon { transform: rotate(180deg); }
.sample details { margin-top: var(--space-4); border-color: var(--color-border-strong); }
.transcript { padding-bottom: var(--space-4); }
.transcript p + p { margin-top: var(--space-3); }
.transcript .translation { font-size: var(--text-small); line-height: var(--leading-small); color: var(--color-text-muted); }
.samples-note { margin-top: var(--space-5); font-size: var(--text-small); color: var(--color-text-muted); }

/* ---------- What you get ---------- */
.gets { display: grid; gap: var(--space-5); }
.gets li { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); }
.gets .icon { margin-top: 0.15em; color: var(--color-success); }

/* ---------- Trades ---------- */
.trades li { padding-block: var(--space-5); border-top: var(--border-thin) solid var(--color-border-strong); max-width: none; }
.trades li:last-child { border-bottom: var(--border-thin) solid var(--color-border-strong); }
.call-label { margin-top: var(--space-3); font-size: var(--text-small); line-height: var(--leading-small); font-weight: var(--weight-bold); color: var(--color-text-muted); }
.trades blockquote { margin: var(--space-1) 0 0; padding-left: var(--space-4); border-left: var(--stripe) solid var(--color-accent); max-width: var(--measure); }
.area { margin-top: var(--space-6); }

/* ---------- Pricing ---------- */
.pricing {
  position: relative;
  max-width: 46rem;
  padding: calc(var(--space-6) + var(--stripe)) var(--space-5) var(--space-6);
  border: var(--border-thick) solid var(--color-text);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.pricing::before { content: ""; position: absolute; inset: 0 0 auto 0; height: var(--stripe); background: var(--color-accent); }
.price-rows { display: grid; gap: var(--space-6); }
.price { display: block; font-family: var(--font-display); font-size: var(--text-stat); line-height: var(--leading-stat); font-weight: var(--weight-bold); }
.price-unit { font-size: var(--text-h3); line-height: var(--leading-h3); font-weight: var(--weight-bold); }
.price-row p { margin-top: var(--space-2); }
.price-terms { margin-top: var(--space-6); padding-top: var(--space-5); border-top: var(--border-thin) solid var(--color-border); }
.price-terms li + li { margin-top: var(--space-2); }
.pricing .btn { margin-top: var(--space-6); width: 100%; }

/* ---------- More ---------- */
.more { display: grid; gap: var(--space-5); }
.more-close { margin-top: var(--space-6); }

/* ---------- Questions ---------- */
.faq { max-width: 46rem; }
.faq details:last-child { border-bottom: var(--border-thin) solid var(--color-border); }
.faq summary { font-size: var(--text-h3); line-height: var(--leading-h3); }
.faq details p { padding-bottom: var(--space-5); }

/* ---------- Form ---------- */
.setup-grid { display: grid; gap: var(--space-7); }
.form { display: grid; gap: var(--space-5); max-width: 34rem; }
.field label, .group legend { display: block; margin-bottom: var(--space-3); font-weight: var(--weight-bold); }
.field input {
  display: block;
  width: 100%;
  min-height: var(--target-main);
  padding: var(--space-2) var(--space-4);
  font: inherit;
  color: var(--color-text);
  background: var(--color-bg);
  border: var(--border-thick) solid var(--color-border-strong);
  border-radius: var(--radius-sm);
}
.field input:focus { border-color: var(--color-text); }
.choice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--target-min);
  padding-block: var(--space-1);
  cursor: pointer;
}
.choice input { flex: none; width: 1.75rem; height: 1.75rem; margin: 0; accent-color: var(--color-focus); }
.consent { align-items: flex-start; font-size: var(--text-small); line-height: var(--leading-small); }
.consent input { margin-top: var(--space-1); }
.invalid input[type="text"], .invalid input[type="tel"] { border-color: var(--color-error); }
.field-error { display: flex; gap: var(--space-2); margin-top: var(--space-2); font-size: var(--text-small); line-height: var(--leading-small); font-weight: var(--weight-bold); color: var(--color-error); }
.field-error .icon { width: 1.25rem; height: 1.25rem; margin-top: 0.1em; }
.error-summary { padding: var(--space-4); background: var(--color-error-soft); border-left: var(--stripe) solid var(--color-error); border-radius: var(--radius-sm); }
.error-summary h3 { color: var(--color-error); }
.error-summary li { margin-top: var(--space-2); }
.error-summary a { text-decoration-line: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.hp { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
.sent { display: grid; grid-template-columns: auto 1fr; gap: var(--space-4); max-width: 34rem; padding: var(--space-5); background: var(--color-success-soft); border-radius: var(--radius-md); }
.sent .icon { width: 2rem; height: 2rem; color: var(--color-success); }
.sent p { margin-top: var(--space-2); }
.sent h1 { font-family: var(--font-body); font-size: var(--text-h3); line-height: var(--leading-h3); text-wrap: wrap; }
.reach { font-size: var(--text-lead); line-height: var(--leading-lead); }

/* ---------- Footer ---------- */
.site-footer { padding-block: var(--space-8); font-size: var(--text-small); line-height: var(--leading-small); }
.site-footer svg.wm { display: block; height: 1.625rem; width: auto; fill: currentColor; }
.footer-grid { display: grid; gap: var(--space-5); margin-top: var(--space-5); }
.footer-grid li + li { margin-top: var(--space-2); }
.site-footer a { display: inline-flex; align-items: center; min-height: var(--target-min); }
.site-footer .lang-link { padding-inline: 0; }

/* ---------- Mobile action bar ---------- */
.action-bar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  padding: var(--space-3) var(--gutter) calc(var(--space-3) + env(safe-area-inset-bottom));
  background: var(--color-bg);
  border-top: var(--border-thin) solid var(--color-border);
  box-shadow: var(--shadow-float);
}
.action-bar .btn { min-height: var(--target-min); padding-inline: var(--space-3); }
body:has(.form :is(input, button):focus-visible) .action-bar { display: none; }

/* ---------- Legal pages ---------- */
.legal { max-width: 46rem; }
.legal h1 { font-size: var(--text-h2); line-height: var(--leading-h2); }
.legal h2 { margin-top: var(--space-7); font-family: var(--font-body); font-size: var(--text-h3); line-height: var(--leading-h3); }
.legal p, .legal ul { margin-top: var(--space-4); }
.legal ul { list-style: disc; padding-left: var(--space-5); }
.legal li + li { margin-top: var(--space-2); }

/* ---------- Wider screens ---------- */
@media (min-width: 600px) {
  .actions { grid-template-columns: repeat(2, max-content); }
  .gets { grid-template-columns: 1fr 1fr; column-gap: var(--space-7); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .pricing { padding-inline: var(--space-6); }
  .pricing .btn { width: auto; }
}

@media (min-width: 900px) {
  :root { --header-height: 4.5rem; }
  html { scroll-padding-top: calc(var(--header-height) + var(--space-5)); scroll-padding-bottom: var(--space-5); }
  body { padding-bottom: 0; }
  .action-bar { display: none; }
  .site-header { position: sticky; top: 0; z-index: 20; }
  .site-header .btn-call { display: inline-flex; }
  .hero { padding-top: var(--space-9); }
  .hero-grid { grid-template-columns: 1.25fr 0.75fr; }
  .jobtext { justify-self: end; width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; column-gap: var(--space-7); }
  .steps { grid-template-columns: repeat(3, 1fr); column-gap: var(--space-7); }
  .step { grid-template-columns: 1fr; }
  .samples { grid-template-columns: 1fr 1fr; align-items: start; }
  .price-rows { grid-template-columns: 1fr 1fr; column-gap: var(--space-7); }
  .more { grid-template-columns: repeat(3, 1fr); column-gap: var(--space-7); }
  .setup-grid { grid-template-columns: 1.2fr 0.8fr; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

@media (min-width: 1200px) {
  .hero { padding-top: var(--space-10); }
}

/* ---------- Motion (DESIGN.md section 8) ----------
   Move and fade only. Nothing loops. Nothing that starts by itself runs
   longer than five seconds. All of it is off under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  /* 1. The job text arriving: plays once, ends at 4.1s on the static design */
  .jt-status, .jt-row { animation: jt-in 0.4s var(--ease) both; animation-delay: calc(0.3s + var(--i, 0) * 0.55s); }
  .jt-problem::before { animation: jt-fade 0.5s var(--ease) both; animation-delay: 3.6s; }

  /* 2. The stripe drawing in as its section scrolls into view */
  @supports (animation-timeline: view()) {
    .head::before {
      animation: stripe-in linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 30%;
    }
  }

  /* 3. Cross-fade between pages, including the language switch */
  @view-transition { navigation: auto; }
}

@keyframes jt-in { from { opacity: 0; transform: translateY(var(--space-2)); } }
@keyframes jt-fade { from { opacity: 0; } }
@keyframes stripe-in { from { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}
