/* v9-dialogue — «Разговор»: the page as print dialogue */
:root {
  --paper: #eef1f4;
  --paper-deep: #e3e8ed;
  --ink: #1c2330;
  --ink-soft: #4f5967;
  --rule: #c9d1d9;
  --accent: #2f6f73;
  --accent-deep: #255a5d;
  --field: #ffffff;
  --serif: "Literata", "Georgia", serif;
  --sans: "Commissioner", system-ui, sans-serif;
  --measure: 62ch;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variation-settings: "opsz" 14;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }

.talk {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2rem var(--gutter) 4rem;
}

/* exchanges: a pause between them */
.exchange { padding: 2rem 0 1.25rem; }
.exchange + .exchange { border-top: 1px solid var(--rule); }
.exchange--faq .q { margin-top: 1.5rem; }
.exchange--faq .q:first-child { margin-top: 0; }

/* the asking voice */
.q {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink-soft);
  margin: 1.75rem 0 0.6rem;
  letter-spacing: 0.005em;
}
.exchange > .q:first-child { margin-top: 0; }

/* the answering voice: hanging em dash in accent */
.a {
  position: relative;
  padding-left: 1.4rem;
  max-width: var(--measure);
}
.a::before {
  content: "—";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 600;
}
.a > p { margin: 0 0 0.9rem; }
.a > p:last-child { margin-bottom: 0; }
.muted { color: var(--ink-soft); }
.aside { font-family: var(--sans); font-size: 0.95rem; }

/* hero */
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-variation-settings: "opsz" 72;
  font-size: clamp(2.25rem, 9vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0 0 0.6rem;
  text-wrap: balance;
}
.hero .lede { font-size: 1.25rem; line-height: 1.4; font-variation-settings: "opsz" 24; margin-bottom: 0.5rem; }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { margin: 0 0 0.35rem; }
.facts li:last-child { margin: 0; }

/* answers as choices */
.answers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.answer {
  font: inherit;
  font-family: var(--serif);
  font-size: 1.0625rem;
  color: var(--ink-soft);
  background: none;
  border: 0;
  padding: 0.15rem 0 0.15rem 1.25rem;
  position: relative;
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.25s ease-out;
}
.answer::before {
  content: "—";
  position: absolute; left: 0; top: 0.15rem;
  color: var(--rule);
  transition: color 0.25s ease-out;
}
.answer:hover { color: var(--ink); }
.answer[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.answer[aria-pressed="true"]::before { color: var(--accent); }

/* the one action */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0.85rem 1.4rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(28, 35, 48, 0.14);
  transition: background 0.2s ease-out, transform 0.2s ease-out, box-shadow 0.2s ease-out;
}
.btn:hover { background: var(--accent-deep); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(28, 35, 48, 0.18); }
.btn:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(28, 35, 48, 0.16); }
.btn:disabled, .btn[data-loading] { background: var(--ink-soft); border-color: var(--ink-soft); cursor: progress; transform: none; box-shadow: none; }
.btn[data-loading]::after { content: "…"; }
.btn--quiet { color: var(--accent-deep); background: transparent; border-color: var(--accent); box-shadow: none; margin-top: 0.5rem; }
.btn--quiet:hover { background: var(--paper-deep); color: var(--ink); box-shadow: none; }
.hero .btn { margin: 0.25rem 0 0.75rem; }

/* concepts: a short glossary, three distinct lines */
.concepts { margin: 1.25rem 0 0; padding: 0; }
.concepts div { display: grid; grid-template-columns: minmax(9ch, 12rem) 1fr; gap: 0.25rem 1rem; padding: 0.55rem 0; border-top: 1px solid var(--rule); }
.concepts div:last-child { border-bottom: 1px solid var(--rule); }
.concepts dt { font-weight: 600; }
.concepts dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 480px) { .concepts div { grid-template-columns: 1fr; gap: 0; } }

/* steps: the one true sequence */
.steps { margin: 0.5rem 0 1rem; padding-left: 1.5rem; }
.steps li { margin: 0 0 0.4rem; padding-left: 0.25rem; }
.steps li::marker { font-family: var(--sans); font-weight: 700; color: var(--accent); }

/* people */
.person { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1.25rem; align-items: start; margin: 0.5rem 0 1rem; }
.photo {
  aspect-ratio: 4 / 5;
  background: var(--paper-deep);
  border: 1px dashed var(--rule);
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.85rem;
  text-align: center;
  padding: 0.5rem;
}
.person__name { font-weight: 600; font-size: 1.15rem; margin: 0 0 0.4rem; }
.person__text p { margin: 0 0 0.6rem; }
@media (max-width: 480px) { .person { grid-template-columns: 5.5rem 1fr; gap: 1rem; } }

/* form: the asking voice writes their own line */
.note { font-family: var(--sans); font-size: 0.9rem; color: var(--ink-soft); border: 1px solid var(--rule); border-radius: 6px; padding: 0.5rem 0.75rem; display: inline-block; }
.form { margin-top: 1.25rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
legend, .field > label { display: block; font-family: var(--sans); font-weight: 500; font-size: 0.95rem; margin-bottom: 0.5rem; padding: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choice {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--sans); font-size: 0.95rem;
  background: var(--field); border: 1px solid var(--rule); border-radius: 6px;
  padding: 0.55rem 0.85rem; cursor: pointer;
  transition: border-color 0.2s ease-out, background 0.2s ease-out;
}
.choice:hover { border-color: var(--ink-soft); }
.choice:has(input:checked) { border-color: var(--accent); background: #e6f0f0; }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice input { margin: 0; accent-color: var(--accent); }
.field { margin: 0 0 1.25rem; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field textarea {
  font: inherit; font-family: var(--sans); font-size: 1rem;
  width: 100%; max-width: 28rem;
  color: var(--ink); background: var(--field);
  border: 1px solid var(--rule); border-radius: 6px;
  padding: 0.7rem 0.85rem;
  caret-color: var(--accent);
  transition: border-color 0.2s ease-out;
}
.field input:hover, .field textarea:hover { border-color: var(--ink-soft); }
.field input:focus-visible, .field textarea:focus-visible { border-color: var(--accent); outline-offset: 1px; }
.field input::placeholder, .field textarea::placeholder { color: #6b7684; }
.field input:disabled { background: var(--paper-deep); }
.field input:user-invalid { border-color: #a23b2f; }
.hint { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-soft); margin: 0.5rem 0 0; max-width: 48rem; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-family: var(--sans); font-size: 0.95rem; cursor: pointer; }
.check input { margin: 0.3rem 0 0; accent-color: var(--accent); flex: none; }
.form .btn { margin-top: 0.25rem; }

.done { border: 1px solid var(--accent); border-radius: 8px; padding: 1.25rem 1.25rem 1rem; background: #e6f0f0; margin-top: 1rem; }
.done__title { font-family: var(--sans); font-weight: 700; font-size: 1.1rem; margin: 0 0 0.6rem; }
.done p { margin: 0 0 0.5rem; }

/* countdown: measured change, no spinning */
.countdown__label { font-family: var(--sans); color: var(--ink-soft); margin: 0 0 0.5rem; }
.countdown__numbers { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0 0 0.5rem; }
.num b { font-weight: 600; font-size: clamp(1.9rem, 6vw, 2.6rem); font-variant-numeric: tabular-nums; font-variation-settings: "opsz" 48; line-height: 1.1; }
.num small { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-soft); }
.countdown__live, .countdown__ended { display: none; font-weight: 600; margin: 0 0 0.5rem; }
.countdown[data-state="live"] .countdown__numbers, .countdown[data-state="live"] .countdown__label,
.countdown[data-state="ended"] .countdown__numbers, .countdown[data-state="ended"] .countdown__label { display: none; }
.countdown[data-state="live"] .countdown__live { display: block; }
.countdown[data-state="ended"] .countdown__ended { display: block; }
.countdown__date { margin: 0; color: var(--ink-soft); }

/* footer */
.exchange--footer { padding-bottom: 0; }
.exchange--footer .a { font-size: 0.95rem; }

/* one motion moment: the first exchange arrives line by line */
@media (prefers-reduced-motion: no-preference) {
  .hero > * { animation: arrive 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .hero > :nth-child(2) { animation-delay: 0.12s; }
  .hero > :nth-child(3) { animation-delay: 0.32s; }
  .hero > :nth-child(4) { animation-delay: 0.44s; }
  .hero > :nth-child(5) { animation-delay: 0.6s; }
  .hero > :nth-child(6) { animation-delay: 0.72s; }
  .hero > :nth-child(7) { animation-delay: 0.84s; }
  .hero > :nth-child(8) { animation-delay: 0.96s; }
  @keyframes arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* wider screens: questions sit in the margin, answers carry the measure */
@media (min-width: 900px) {
  .talk { max-width: 60rem; padding-top: 4rem; }
  .exchange { display: grid; grid-template-columns: 14rem 1fr; column-gap: 2.5rem; row-gap: 0.75rem; padding: 2.5rem 0 1.75rem; }
  .q { grid-column: 1; margin: 0.35rem 0 0; text-align: right; }
  .a { grid-column: 2; }
  .exchange--faq .q { margin-top: 0.35rem; }
  .hero h1 { margin-top: -0.35rem; }
}
