@font-face {
  font-family: "Playfair Display";
  src: url("../PlayfairDisplay-Cyrillic.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Golos Text";
  src: url("../GolosText-Cyrillic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #12241f;
  --forest: #1c3b33;
  --sage: #557168;
  --sage-light: #c3d0ca;
  --ivory: #efede4;
  --paper: #faf9f5;
  --brass: #a87e45;
  --brass-soft: #e8dcc6;
  --attention: #8c4a3f;
  --attention-soft: #f0e2de;
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --step: 8px;
  --measure: 62ch;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(18, 36, 31, 0.06), 0 8px 24px rgba(18, 36, 31, 0.04);
}

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

html {
  min-width: 320px;
  background: var(--ivory);
  color: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(18, 36, 31, 0.025) 1px, transparent 1px) 0 0 / 100% 8px,
    var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button,
label,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-color: var(--brass);
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--forest);
  color: var(--paper);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(calc(100% - 40px), 720px);
  margin-inline: auto;
}

.document-header {
  border-bottom: 1px solid rgba(28, 59, 51, 0.16);
  background: rgba(239, 237, 228, 0.94);
}

.document-header__inner {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.document-logo {
  display: block;
  width: 174px;
  text-decoration: none;
}

.document-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.document-phone {
  color: var(--forest);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.document-main {
  min-height: calc(100vh - 192px);
  padding-block: 72px 96px;
}

.eyebrow {
  display: block;
  margin-bottom: 16px;
  color: var(--sage);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

h1,
h2 {
  max-width: var(--measure);
  margin: 0;
  color: var(--forest);
  font-family: var(--font-display);
  font-weight: 500;
}

h1 {
  font-size: 44px;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

h2 {
  font-size: 28px;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

p {
  max-width: var(--measure);
  margin: 0;
}

.lede {
  margin-top: 24px;
  color: var(--sage);
  font-size: 19px;
  line-height: 1.55;
}

.intro-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 40px 0 32px;
  padding-block: 20px;
  border-block: 1px solid var(--sage-light);
}

.intro-meta span {
  padding-inline: 16px;
  color: var(--forest);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

.intro-meta span:first-child {
  padding-left: 0;
  text-align: left;
}

.intro-meta span + span {
  border-left: 1px solid var(--sage-light);
}

.intro-meta span:last-child {
  padding-right: 0;
  text-align: right;
}

.source-note {
  margin-top: 24px;
  padding-left: 20px;
  border-left: 1px solid var(--brass);
  color: var(--sage);
  font-size: 14px;
  line-height: 1.55;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border: 1px solid var(--forest);
  border-radius: var(--radius);
  background: var(--forest);
  color: var(--paper);
  cursor: pointer;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
}

.button:hover {
  background: #284a40;
}

.button--quiet {
  background: transparent;
  color: var(--forest);
}

.button--quiet:hover {
  background: rgba(28, 59, 51, 0.05);
}

.button:focus-visible,
.icon-button:focus-visible,
.answer-option input:focus-visible + span,
.age-option input:focus-visible + span,
.field input:focus-visible,
.consent input:focus-visible + span,
a:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.quiz-stage {
  position: relative;
}

.quiz-counter {
  margin-bottom: 12px;
  color: var(--sage);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.progress-wave {
  width: 100%;
  height: 28px;
  display: block;
  margin-bottom: 44px;
  overflow: visible;
}

.progress-wave__base,
.progress-wave__value {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.progress-wave__base {
  stroke: var(--sage-light);
}

.progress-wave__value {
  stroke: var(--brass);
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.question-card {
  min-height: 360px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend,
.question-title {
  max-width: var(--measure);
  margin: 0 0 12px;
  padding: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
}

.question-help {
  margin-bottom: 24px;
  color: var(--sage);
  font-size: 14px;
  line-height: 1.5;
}

.answer-list {
  display: grid;
  gap: 10px;
}

.answer-option {
  position: relative;
  display: block;
  cursor: pointer;
}

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

.answer-option span {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--sage-light);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.45;
}

.answer-option span::before {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1px solid var(--sage);
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px var(--paper);
  content: "";
}

.answer-option--checkbox span::before {
  border-radius: 2px;
}

.answer-option:hover span {
  border-color: var(--forest);
}

.answer-option input:checked + span {
  border-color: var(--brass);
  background: var(--brass-soft);
}

.answer-option input:checked + span::before {
  border-color: var(--brass);
  background: var(--brass);
}

.answer-option--checkbox input:checked + span::after {
  position: absolute;
  top: 22px;
  left: 21px;
  width: 8px;
  height: 5px;
  border-bottom: 2px solid var(--paper);
  border-left: 2px solid var(--paper);
  content: "";
  transform: rotate(-45deg);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--forest);
  font-size: 14px;
  font-weight: 600;
}

.field input {
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--sage-light);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}

.field input:hover {
  border-color: var(--sage);
}

.field--spaced {
  margin-top: 16px;
}

.calculated-value {
  min-height: 26px;
  margin-top: 16px;
  color: var(--sage);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.validation-message {
  min-height: 24px;
  margin-top: 12px;
  color: var(--attention);
  font-size: 14px;
}

.question-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
}

.question-actions .button:only-child {
  margin-left: auto;
}

.result-panel {
  padding: 40px;
  border-top: 3px solid var(--brass);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.result-score {
  display: block;
  margin-bottom: 10px;
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 64px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
}

.result-range {
  display: block;
  margin-bottom: 24px;
  color: var(--forest);
  font-weight: 700;
}

.result-panel p + p {
  margin-top: 18px;
}

.result-panel ul {
  margin: 16px 0 24px;
  padding-left: 22px;
}

.result-panel li + li {
  margin-top: 8px;
}

.disclaimer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--sage-light);
  color: var(--sage);
  font-size: 14px;
  line-height: 1.5;
}

.child-layout {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.age-rail {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 0;
  padding-block: 4px;
}

.age-rail::before,
.age-rail__fill {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 8px;
  width: 1px;
  content: "";
}

.age-rail::before {
  background: var(--sage-light);
}

.age-rail__fill {
  bottom: auto;
  height: var(--age-progress, 0%);
  background: var(--brass);
  transition: height 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.age-rail__item {
  position: relative;
  min-height: 48px;
  display: flex;
  align-items: center;
  padding-left: 28px;
  color: var(--sage);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.age-rail__item::before {
  position: absolute;
  left: 4px;
  z-index: 1;
  width: 9px;
  height: 9px;
  border: 2px solid var(--ivory);
  border-radius: 50%;
  background: var(--sage-light);
  box-shadow: 0 0 0 1px var(--sage-light);
  content: "";
}

.age-rail__item.is-current {
  color: var(--forest);
  font-weight: 600;
}

.age-rail__item.is-current::before,
.age-rail__item.is-passed::before {
  background: var(--brass);
  box-shadow: 0 0 0 1px var(--brass);
}

.age-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.age-option {
  position: relative;
  cursor: pointer;
}

.age-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.age-option span {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid var(--sage-light);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--forest);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.age-option:hover span {
  border-color: var(--forest);
}

.age-option input:checked + span {
  border-color: var(--brass);
  background: var(--brass-soft);
}

.checklist-section + .checklist-section {
  margin-top: 40px;
}

.checklist-section > legend {
  margin-bottom: 20px;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
}

.checklist-attention {
  padding: 24px;
  border-left: 3px solid var(--attention);
  background: var(--attention-soft);
}

.checklist-attention .answer-option span {
  background: rgba(250, 249, 245, 0.58);
}

.checklist-attention .answer-option input:checked + span {
  border-color: var(--attention);
  background: #ead5cf;
}

.hub-grid {
  display: grid;
  gap: 1px;
  margin-top: 48px;
  border-block: 1px solid var(--sage-light);
  background: var(--sage-light);
}

.hub-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding: 30px 0;
  background: var(--ivory);
  color: inherit;
  text-decoration: none;
}

.hub-card::after {
  align-self: center;
  color: var(--brass);
  content: "↗";
  font-size: 22px;
}

.hub-card h2 {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
}

.hub-card p {
  margin-top: 8px;
  color: var(--sage);
  font-size: 15px;
}

.hub-card:hover h2 {
  color: var(--forest);
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-underline-offset: 0.22em;
}

.privacy-callout {
  margin-top: 48px;
  padding: 24px;
  border: 1px solid var(--sage-light);
  background: rgba(250, 249, 245, 0.52);
  color: var(--sage);
  font-size: 15px;
}

.document-footer {
  padding-block: 32px;
  border-top: 1px solid rgba(28, 59, 51, 0.16);
  color: var(--sage);
  font-size: 14px;
}

.document-footer__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
}

.document-footer p + p {
  margin-top: 8px;
}

.document-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
}

.other-quizzes {
  white-space: nowrap;
}

.document-footer__home {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-weight: 650;
  color: var(--forest, #1c3b33);
  text-decoration: none;
}

.document-footer__home::before {
  content: "\2190";
  font-size: 1.05em;
  line-height: 1;
  transition: transform 200ms ease;
}

.document-footer__home:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.document-footer__home:hover::before {
  transform: translateX(-3px);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 36, 31, 0.64);
}

.booking-dialog {
  position: relative;
  width: min(100%, 520px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 40px;
  border-top: 3px solid var(--brass);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(18, 36, 31, 0.25);
}

.booking-dialog h2 {
  padding-right: 40px;
}

.booking-dialog > p {
  margin-top: 14px;
  color: var(--sage);
  font-size: 15px;
}

.icon-button {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--forest);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.booking-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.consent {
  position: relative;
  display: block;
  cursor: pointer;
}

.consent input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.consent span {
  display: block;
  padding-left: 30px;
  color: var(--sage);
  font-size: 13px;
  line-height: 1.5;
}

.consent span::before {
  position: absolute;
  top: 2px;
  left: 0;
  width: 18px;
  height: 18px;
  border: 1px solid var(--sage);
  border-radius: 2px;
  content: "";
}

.consent input:checked + span::before {
  border-color: var(--brass);
  background: var(--brass);
  box-shadow: inset 0 0 0 4px var(--paper);
}

.booking-privacy {
  color: var(--sage);
  font-size: 13px;
  line-height: 1.5;
}

.booking-status {
  min-height: 22px;
  color: var(--attention);
  font-size: 14px;
}

.booking-status.is-success {
  color: var(--forest);
}

.print-only {
  display: none;
}

@media (max-width: 767px) {
  body {
    font-size: 16px;
  }

  .page-shell {
    width: min(calc(100% - 32px), 720px);
  }

  .document-header__inner {
    min-height: 68px;
  }

  .document-logo {
    width: 138px;
  }

  .document-phone {
    font-size: 14px;
  }

  .document-main {
    padding-block: 48px 64px;
  }

  h1 {
    font-size: 32px;
    line-height: 1.15;
  }

  h2 {
    font-size: 24px;
  }

  .desktop-break {
    display: none;
  }

  .lede {
    margin-top: 20px;
    font-size: 17px;
  }

  .intro-meta {
    grid-template-columns: 1fr;
    margin-top: 32px;
    padding-block: 8px;
  }

  .intro-meta span,
  .intro-meta span:first-child,
  .intro-meta span:last-child {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 10px 0;
    text-align: left;
  }

  .intro-meta span + span {
    border-top: 1px solid var(--sage-light);
    border-left: 0;
  }

  .progress-wave {
    margin-bottom: 32px;
  }

  legend,
  .question-title {
    font-size: 18px;
  }

  .question-card {
    min-height: 0;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .question-actions {
    margin-top: 24px;
  }

  .result-panel,
  .booking-dialog {
    padding: 28px 22px;
  }

  .result-score {
    font-size: 48px;
  }

  .child-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .age-rail {
    position: relative;
    top: auto;
    grid-template-columns: repeat(7, minmax(48px, 1fr));
    gap: 0;
    margin-inline: -16px;
    padding: 0 16px 14px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .age-rail::before,
  .age-rail__fill {
    top: 8px;
    bottom: auto;
    left: 40px;
    height: 1px;
  }

  .age-rail::before {
    right: 40px;
    width: auto;
  }

  .age-rail__fill {
    width: var(--age-progress, 0%);
    max-width: calc(100% - 80px);
  }

  .age-rail__item {
    min-width: 54px;
    min-height: 44px;
    display: block;
    padding: 24px 4px 0;
    text-align: center;
  }

  .age-rail__item::before {
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
  }

  .age-options {
    grid-template-columns: 1fr 1fr;
  }

  .checklist-attention {
    margin-inline: -4px;
    padding: 20px 16px;
  }

  .document-footer__inner {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hub-card {
    padding: 24px 0;
  }
}

@media (max-width: 420px) {
  .document-phone {
    max-width: 116px;
    line-height: 1.2;
    text-align: right;
  }

  .age-options {
    grid-template-columns: 1fr;
  }

  .button-row .button {
    width: 100%;
  }
}

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

@media print {
  @page {
    margin: 18mm;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .document-header,
  .document-footer,
  .intro-screen,
  .quiz-counter,
  .progress-wave,
  .age-rail,
  .button-row,
  .question-actions,
  .modal-backdrop,
  .disclaimer {
    display: none !important;
  }

  .document-main {
    padding: 0;
  }

  .page-shell,
  .child-layout {
    width: 100%;
    display: block;
  }

  .result-panel {
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .print-only {
    display: block !important;
  }

  .print-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #777;
  }

  .print-header strong {
    display: block;
    font-family: var(--font-body);
    font-size: 18pt;
  }

  .print-selections {
    margin-top: 24px;
  }

  .print-selections h3 {
    margin: 20px 0 8px;
    font-size: 12pt;
  }
}
