@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("./fonts/inter-cyrillic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("./fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --ink-950: #081017;
  --ink-900: #0a1016;
  --ink-875: #0f151c;
  --ink-850: #15212d;
  --ink-800: #1a2734;
  --ink-700: #31404f;
  --ink-650: #3a4a5b;
  --text: #f3f5f7;
  --muted: #99a6b5;
  --muted-strong: #b8c2ce;
  --gold: #f6b631;
  --gold-strong: #ffc442;
  --gold-soft: #332d1f;
  --teal: #43d6c4;
  --danger: #ff746f;
  --focus: #88dfd5;
  --radius-small: 8px;
  --radius-medium: 12px;
  font-family: "Inter Variable", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink-950);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--ink-950);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled),
a {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 76%, transparent);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(390px, 1fr);
  min-height: 100vh;
  background: var(--ink-900);
}

.assessment-pane {
  display: flex;
  min-width: 0;
  min-height: 100vh;
  flex-direction: column;
  padding: 30px clamp(32px, 2.4vw, 40px) 48px;
  background: var(--ink-900);
}

.topbar {
  display: flex;
  min-height: 92px;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.wordmark {
  color: var(--gold);
  font-size: 33px;
  font-weight: 780;
  letter-spacing: -0.045em;
  line-height: 1;
  text-decoration: none;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #748292;
  font-size: 20px;
  font-weight: 520;
}

.breadcrumb strong {
  color: var(--muted-strong);
  font-weight: 560;
}

.state-view {
  width: 100%;
  max-width: 905px;
}

.question-view {
  display: flex;
  min-height: calc(100vh - 170px);
  flex: 1;
  flex-direction: column;
  padding-top: clamp(31px, 4vh, 42px);
}

.question-heading {
  max-width: 840px;
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 21px;
  color: var(--muted-strong);
  font-size: 28px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.progress-copy > span:first-child {
  color: var(--text);
}

.progress-saved {
  display: none;
  color: #657484;
  font-size: 11px;
  font-weight: 520;
}

.segmented-progress {
  display: grid;
  grid-auto-columns: minmax(24px, 1fr);
  grid-auto-flow: column;
  gap: 10px;
  width: min(100%, 765px);
  margin-bottom: 53px;
}

.progress-segment {
  height: 7px;
  border-radius: 999px;
  background: #293643;
}

.progress-segment.is-current,
.progress-segment.is-complete {
  background: var(--gold);
}

.question-heading h1,
.paused-view h1,
.result-view h1,
.error-view h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(36px, 3.25vw, 48px);
  font-weight: 560;
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.question-prompt {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.question-view.has-pair-set .question-prompt {
  display: none;
}

.answer-area {
  width: 100%;
  margin-top: clamp(25px, 3.5vh, 37px);
}

.answer-field {
  min-width: 0;
  margin: 0 0 25px;
  padding: 0;
  border: 0;
}

.field-label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 650;
}

.set-summary {
  display: grid;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.set-expression {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 26px;
}

.set-name {
  display: inline;
  width: 25px;
  color: var(--text);
  font-size: 26px;
  font-style: italic;
  font-weight: 520;
}

.set-equals {
  color: #6e7e8f;
}

.set-values {
  font-weight: 580;
  letter-spacing: 0.01em;
}

.field-instruction {
  margin: 0 0 28px;
  color: #8f9cad;
  font-size: 19px;
}

.pair-matrix-wrap {
  max-width: 905px;
  overflow-x: auto;
  border: 1px solid var(--ink-700);
  border-radius: var(--radius-medium);
  background: #101a24;
}

.pair-matrix {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  table-layout: fixed;
}

.pair-matrix th,
.pair-matrix td {
  height: 84px;
  padding: 6px;
  border-right: 1px solid var(--ink-700);
  border-bottom: 1px solid var(--ink-700);
  text-align: center;
}

.pair-matrix tr:last-child th,
.pair-matrix tr:last-child td {
  border-bottom: 0;
}

.pair-matrix th:last-child,
.pair-matrix td:last-child {
  border-right: 0;
}

.matrix-corner {
  width: 162px;
  color: #e8edf2;
  font-size: 22px;
  font-weight: 580;
}

.matrix-heading {
  color: #e8edf2;
  font-size: 22px;
  font-weight: 650;
}

.pair-cell {
  display: flex;
  width: 100%;
  min-height: 72px;
  align-items: center;
  justify-content: center;
  gap: 15px;
  border: 1px solid #3b4958;
  border-radius: 7px;
  background: transparent;
  color: #d8dee6;
  font-size: 25px;
  font-weight: 560;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.pair-cell:hover:not(:disabled) {
  border-color: #4b5c6e;
  background: var(--ink-800);
}

.pair-cell.is-selected {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold-strong);
}

.pair-check {
  display: none;
  width: 27px;
  height: 27px;
  filter: brightness(0) saturate(100%) invert(82%) sepia(74%) saturate(833%) hue-rotate(334deg)
    brightness(99%) contrast(95%);
}

.pair-cell.is-selected .pair-check {
  display: block;
}

.pair-cell:disabled,
.binary-option:disabled {
  cursor: default;
}

.binary-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 170px));
  gap: 12px;
}

.binary-option {
  min-height: 54px;
  border: 1px solid var(--ink-650);
  border-radius: var(--radius-small);
  background: #111c27;
  color: var(--muted-strong);
  font-weight: 620;
}

.binary-option:hover:not(:disabled),
.binary-option.is-selected {
  border-color: #c99b31;
  background: var(--gold-soft);
  color: var(--gold-strong);
}

.choice-list {
  display: grid;
  max-width: 680px;
  gap: 10px;
}

.choice-option {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 13px;
  min-height: 58px;
  padding: 16px 18px;
  border: 1px solid var(--ink-650);
  border-radius: var(--radius-small);
  background: #111c27;
  color: var(--muted-strong);
  cursor: pointer;
}

.choice-option:has(input:checked) {
  border-color: #c99b31;
  background: var(--gold-soft);
  color: var(--text);
}

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

.choice-marker {
  position: relative;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 1px solid #627284;
  border-radius: 50%;
}

.choice-option input:checked + .choice-marker {
  border-color: var(--gold);
}

.choice-option input:checked + .choice-marker::after {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--gold);
  content: "";
}

.choice-option:has(input:focus-visible) {
  outline: 3px solid color-mix(in srgb, var(--focus) 76%, transparent);
  outline-offset: 3px;
}

.choice-copy {
  font-size: 14px;
  line-height: 1.5;
}

.number-input {
  width: min(100%, 280px);
  height: 58px;
  padding: 0 18px;
  border: 1px solid var(--ink-650);
  border-radius: var(--radius-small);
  background: #111c27;
  color: var(--text);
  font-size: 20px;
  font-weight: 620;
}

.evaluation-panel {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 14px;
  max-width: 640px;
  margin-top: 23px;
  padding: 17px 19px;
  border: 1px solid var(--ink-650);
  border-radius: var(--radius-small);
  background: #111c27;
}

.evaluation-panel.is-pass {
  border-color: #27685f;
  background: #102923;
}

.evaluation-panel.is-fail {
  border-color: #75433f;
  background: #2a1b1b;
}

.evaluation-icon {
  width: 22px;
  height: 22px;
  filter: brightness(0) saturate(100%) invert(76%) sepia(25%) saturate(920%) hue-rotate(118deg)
    brightness(100%) contrast(94%);
}

.evaluation-panel.is-fail .evaluation-icon {
  filter: brightness(0) saturate(100%) invert(60%) sepia(91%) saturate(1322%) hue-rotate(316deg)
    brightness(106%) contrast(103%);
}

.evaluation-panel strong {
  font-size: 14px;
}

.evaluation-panel p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.question-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px 26px;
  margin-top: auto;
  padding-top: 21px;
}

.button {
  display: inline-flex;
  min-height: 74px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 24px;
  border-radius: var(--radius-small);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.button img {
  width: 17px;
  height: 17px;
  filter: brightness(0) invert(1);
}

.button-primary {
  min-width: 390px;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #171308;
}

.button-primary img {
  filter: brightness(0);
}

.button-primary:hover:not(:disabled) {
  border-color: var(--gold-strong);
  background: var(--gold-strong);
  transform: translateY(-1px);
}

.button-primary:disabled {
  border-color: #66552a;
  background: #66552a;
  color: #2e291c;
  cursor: not-allowed;
}

.button-secondary {
  min-width: 340px;
  border: 1px solid #425263;
  background: transparent;
  color: var(--muted-strong);
}

.button-secondary:hover:not(:disabled) {
  border-color: #607387;
  background: var(--ink-800);
  color: var(--text);
}

.button-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.autosave-note {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--teal);
  font-size: 18px;
}

.autosave-note.is-active {
  color: var(--teal);
}

.autosave-note > img {
  width: 29px;
  height: 29px;
  filter: brightness(0) saturate(100%) invert(76%) sepia(25%) saturate(920%) hue-rotate(118deg)
    brightness(100%) contrast(94%);
}

.autosave-note > span {
  display: grid;
  gap: 5px;
}

.autosave-note strong {
  font-weight: 540;
}

.autosave-note small {
  color: #7d8a9b;
  font-size: 16px;
}

.support-pane {
  min-width: 0;
  min-height: 100vh;
  padding: 104px clamp(34px, 3.2vw, 48px) 50px;
  border-left: 1px solid #23313e;
  background: var(--ink-875);
}

.support-sticky {
  position: sticky;
  top: 48px;
  max-width: 410px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.support-pane h2 {
  margin: 0;
  color: var(--text);
  font-size: 29px;
  font-weight: 680;
  letter-spacing: -0.035em;
}

.support-intro {
  margin: 30px 0 23px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.65;
}

.hint-button {
  display: grid;
  width: min(100%, 300px);
  min-height: 74px;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 15px;
  padding: 13px 29px;
  border: 2px solid var(--gold);
  border-radius: var(--radius-small);
  background: transparent;
  text-align: left;
}

.hint-button:hover:not(:disabled) {
  border-color: #a98536;
  background: #28271f;
}

.hint-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.hint-button > img:first-child,
.hint-card-heading img {
  width: 32px;
  height: 32px;
  filter: brightness(0) saturate(100%) invert(82%) sepia(74%) saturate(833%) hue-rotate(334deg)
    brightness(99%) contrast(95%);
}

.hint-button span {
  display: grid;
  gap: 2px;
}

.hint-button strong {
  color: var(--gold-strong);
  font-size: 21px;
  font-weight: 520;
}

.hint-disclaimer {
  max-width: 330px;
  margin: 23px 0 0;
  color: #8390a1;
  font-size: 17px;
  line-height: 1.6;
}

.hint-card {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid #756132;
  border-radius: var(--radius-small);
  background: var(--gold-soft);
}

.hint-card-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold-strong);
  font-size: 13px;
}

.hint-card-heading img {
  width: 18px;
  height: 18px;
}

.hint-card p {
  margin: 10px 0 0;
  color: #dbd1b9;
  font-size: 13px;
  line-height: 1.6;
}

.support-rule {
  height: 1px;
  margin: 25px 0 0;
  background: #4a5867;
}

.support-pane h3 {
  margin: 0 0 16px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 690;
}

.support-list {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  color: #8e9ba9;
  font-size: 12px;
  line-height: 1.55;
  list-style: none;
}

.support-list li {
  position: relative;
  padding-left: 19px;
}

.support-list li::before {
  position: absolute;
  top: 0.7em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
  content: "";
}

.support-footnote {
  margin: 28px 0 0;
  padding-left: 14px;
  border-left: 2px solid #384857;
  color: #657483;
  font-size: 11px;
  line-height: 1.6;
}

.loading-view,
.paused-view,
.result-view,
.error-view {
  display: flex;
  min-height: calc(100vh - 170px);
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding-bottom: 8vh;
}

.loading-view {
  align-items: center;
  color: var(--muted);
}

.loading-mark {
  width: 34px;
  height: 34px;
  filter: brightness(0) saturate(100%) invert(82%) sepia(74%) saturate(833%) hue-rotate(334deg)
    brightness(99%) contrast(95%);
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.state-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  margin-bottom: 25px;
  border: 1px solid #4e5f6f;
  border-radius: 14px;
  background: var(--ink-800);
}

.state-icon img {
  width: 25px;
  height: 25px;
  filter: brightness(0) invert(1);
}

.state-icon-gold {
  border-color: #705d2d;
  background: var(--gold-soft);
}

.state-icon-gold img {
  filter: brightness(0) saturate(100%) invert(82%) sepia(74%) saturate(833%) hue-rotate(334deg)
    brightness(99%) contrast(95%);
}

.state-icon-teal {
  border-color: #28675f;
  background: #102923;
}

.state-icon-teal img {
  filter: brightness(0) saturate(100%) invert(76%) sepia(25%) saturate(920%) hue-rotate(118deg)
    brightness(100%) contrast(94%);
}

.state-icon-error {
  border-color: #75433f;
  background: #2a1b1b;
}

.state-icon-error img {
  filter: brightness(0) saturate(100%) invert(60%) sepia(91%) saturate(1322%) hue-rotate(316deg)
    brightness(106%) contrast(103%);
}

.paused-view > p:not(.eyebrow),
.result-summary,
.error-view > p:not(.eyebrow) {
  max-width: 620px;
  margin: 16px 0 30px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.button-with-icon {
  margin-top: 4px;
}

.score-card {
  display: flex;
  width: min(100%, 550px);
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 21px 23px;
  border: 1px solid var(--ink-650);
  border-radius: var(--radius-medium);
  background: #111c27;
  color: var(--muted);
}

.score-card strong {
  color: var(--gold);
  font-size: 31px;
  letter-spacing: -0.04em;
}

.result-recommendation {
  display: grid;
  width: min(100%, 550px);
  gap: 5px;
  margin-bottom: 26px;
  padding: 21px 23px;
  border: 1px solid #28675f;
  border-radius: var(--radius-medium);
  background: #102923;
}

.result-label {
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.result-recommendation strong {
  font-size: 15px;
}

.result-recommendation p {
  margin: 2px 0 0;
  color: #91a9a5;
  font-size: 12px;
  line-height: 1.6;
}

.toast {
  position: fixed;
  z-index: 10;
  right: 28px;
  bottom: 28px;
  max-width: min(430px, calc(100vw - 40px));
  padding: 14px 17px;
  border: 1px solid #75433f;
  border-radius: var(--radius-small);
  background: #2a1b1b;
  box-shadow: 0 16px 40px rgb(0 0 0 / 30%);
  color: #ffd5d3;
  font-size: 13px;
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.8fr);
  }

  .assessment-pane {
    padding-right: 45px;
    padding-left: 45px;
  }

  .support-pane {
    padding-right: 34px;
    padding-left: 34px;
  }

  .breadcrumb span:first-child,
  .progress-saved {
    display: none;
  }
}

@media (max-width: 780px) {
  .app-shell {
    display: block;
  }

  .assessment-pane {
    min-height: auto;
    padding: 25px 22px 34px;
  }

  .topbar {
    align-items: flex-start;
    justify-content: space-between;
  }

  .breadcrumb {
    max-width: 190px;
    justify-content: flex-end;
    text-align: right;
  }

  .question-view,
  .loading-view,
  .paused-view,
  .result-view,
  .error-view {
    min-height: auto;
    padding-top: 42px;
    padding-bottom: 30px;
  }

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

  .button-primary,
  .button-secondary {
    flex: 1 1 220px;
  }

  .autosave-note {
    width: 100%;
    margin: 4px 0 0;
  }

  .support-pane {
    min-height: auto;
    padding: 34px 22px 44px;
    border-top: 1px solid #23313e;
    border-left: 0;
  }

  .support-sticky {
    position: static;
    max-width: none;
  }
}

@media (max-width: 520px) {
  .question-heading h1,
  .paused-view h1,
  .result-view h1,
  .error-view h1 {
    font-size: 31px;
  }

  .set-summary {
    display: grid;
    gap: 11px;
  }

  .pair-matrix-wrap {
    margin-right: -22px;
    border-radius: 10px 0 0 10px;
  }

  .binary-choice {
    grid-template-columns: repeat(2, 1fr);
  }
}

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