:root {
  --navy: #063b78;
  --navy-deep: #052f61;
  --blue: #1560bd;
  --red: #ce2438;
  --yellow: #f5c842;
  --cream: #fffdf5;
  --paper: #f4f7fb;
  --ink: #10233d;
  --muted: #69768a;
  --line: #dce4ef;
  --soft-blue: #eaf2ff;
  --white: #ffffff;
  --shadow: 0 26px 70px rgba(7, 38, 77, 0.16);
}

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

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(21, 96, 189, 0.09) 1px, transparent 1px);
  background-size: 22px 22px;
  font-family: "DM Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(245, 200, 66, 0.7);
  outline-offset: 3px;
}

.site-shell {
  width: min(1480px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: 20px clamp(16px, 3vw, 46px) 32px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  margin-bottom: 18px;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand__sun {
  display: grid;
  width: 50px;
  height: 50px;
  color: var(--navy);
  place-items: center;
  background: var(--yellow);
  border: 2px solid var(--navy);
  border-radius: 50%;
}

.brand__sun svg {
  width: 34px;
  fill: currentColor;
}

.brand__name {
  font: 800 0.98rem/1 "Manrope", sans-serif;
  letter-spacing: -0.03em;
}

.brand__sub {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.flag-mark {
  position: relative;
  display: grid;
  grid-template-rows: 1fr 1fr;
  width: 62px;
  height: 40px;
  overflow: hidden;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 5px 14px rgba(16, 35, 61, 0.13);
}

.flag-mark__blue { background: #0038a8; }
.flag-mark__red { background: #ce1126; }

.flag-mark__triangle {
  position: absolute;
  inset: 0 auto 0 0;
  display: grid;
  width: 31px;
  color: #f7ca18;
  font-size: 0.64rem;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  place-items: center start;
  padding-left: 7px;
  background: #fff;
}

.experience {
  display: grid;
  grid-template-columns: minmax(360px, 0.8fr) minmax(540px, 1.2fr);
  min-height: calc(100svh - 122px);
  overflow: hidden;
  background: var(--white);
  border: 1px solid #d9e3f0;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.story-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 680px;
  padding: clamp(28px, 3.2vw, 48px);
  overflow: hidden;
  color: #fff;
  background: var(--navy);
  border-bottom: 14px solid var(--red);
}

.story-panel::before,
.story-panel::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.story-panel::before {
  top: -110px;
  right: -110px;
  width: 260px;
  height: 260px;
  background: var(--yellow);
  border-radius: 50%;
}

.story-panel::after {
  right: -45px;
  bottom: 82px;
  width: 150px;
  height: 150px;
  border: 24px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.story-panel__top,
.portrait-wrap,
.story-panel__bottom {
  position: relative;
  z-index: 1;
}

.kicker {
  margin: 0 0 14px;
  color: #a9cfff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.story-panel__quote {
  max-width: 400px;
  margin: 0;
  font: 700 clamp(1.7rem, 2.7vw, 2.9rem)/1.04 "Manrope", sans-serif;
  letter-spacing: -0.05em;
}

.story-panel__quote em {
  color: var(--yellow);
  font-style: normal;
}

.portrait-wrap {
  align-self: center;
  width: min(390px, 92%);
  margin: 20px 0;
}

.portrait-rays {
  position: absolute;
  inset: -30px;
  background: repeating-conic-gradient(from -4deg, rgba(245, 200, 66, 0.25) 0deg 7deg, transparent 7deg 22deg);
  border-radius: 50%;
}

.portrait {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(300px, 39vh, 430px);
  object-fit: cover;
  object-position: center 18%;
  background: var(--soft-blue);
  border: 5px solid #fff;
  border-radius: 190px 190px 24px 24px;
  box-shadow: 0 22px 46px rgba(2, 25, 53, 0.32);
}

.portrait-label {
  position: absolute;
  right: -14px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  min-width: 150px;
  padding: 13px 16px;
  color: var(--ink);
  background: var(--yellow);
  border: 3px solid #fff;
  box-shadow: 7px 7px 0 var(--red);
  transform: rotate(-2deg);
}

.portrait-label strong {
  font: 800 1rem/1.1 "Manrope", sans-serif;
}

.portrait-label span {
  margin-top: 3px;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
}

.story-panel__bottom {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  align-items: center;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.story-panel__bottom .stars {
  grid-row: 1 / 3;
  color: var(--yellow);
  font-size: 0.72rem;
  letter-spacing: -0.13em;
  writing-mode: vertical-rl;
}

.story-panel__bottom .stars span { color: #fff; }

.story-panel__bottom p {
  margin: 0;
  color: #dbe9fb;
  font-size: 0.8rem;
  line-height: 1.4;
}

.quiz-panel {
  display: grid;
  min-width: 0;
  padding: clamp(28px, 4.3vw, 66px);
  background-color: var(--cream);
  background-image:
    linear-gradient(rgba(6, 59, 120, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 59, 120, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  place-items: center;
}

.quiz-card {
  display: flex;
  flex-direction: column;
  width: min(730px, 100%);
  min-height: 560px;
}

.progress {
  flex: 0 0 auto;
  margin-bottom: clamp(34px, 6vh, 62px);
}

.progress__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.progress__meta strong { color: var(--navy); }

.progress__track {
  height: 6px;
  overflow: hidden;
  background: #dfe7f2;
  border-radius: 999px;
}

.progress__track span {
  display: block;
  width: 20%;
  height: 100%;
  background: var(--red);
  border-radius: inherit;
  box-shadow: 0 0 0 1px rgba(206, 36, 56, 0.15);
  transition: width 350ms cubic-bezier(0.22, 1, 0.36, 1);
}

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  animation: screen-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.screen--active { display: flex; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen__content { flex: 1; }

.screen__content--intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 8px;
}

.mobile-portrait { display: none; }

.section-label,
.question-number {
  margin: 0 0 20px;
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.section-label {
  display: flex;
  gap: 9px;
  align-items: center;
}

.section-label span {
  display: inline-block;
  width: 24px;
  height: 3px;
  background: var(--red);
}

h1,
h2,
p { margin-top: 0; }

h1,
h2 {
  margin-bottom: 0;
  font-family: "Manrope", sans-serif;
  letter-spacing: -0.055em;
}

h1 {
  max-width: 730px;
  font-size: clamp(2.35rem, 4.2vw, 4.65rem);
  font-weight: 800;
  line-height: 0.99;
}

h1 em {
  color: var(--blue);
  font-style: normal;
}

h2 {
  max-width: 670px;
  font-size: clamp(2rem, 3.8vw, 3.8rem);
  font-weight: 800;
  line-height: 1.04;
}

.lede {
  max-width: 540px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.16rem);
  line-height: 1.55;
}

.intro-meta {
  display: flex;
  gap: 22px;
  margin-top: 30px;
  color: #536177;
  font-size: 0.77rem;
  font-weight: 700;
}

.intro-meta span {
  display: flex;
  gap: 8px;
  align-items: center;
}

.intro-meta span::before {
  width: 8px;
  height: 8px;
  content: "";
  background: var(--yellow);
  border: 2px solid var(--navy);
  border-radius: 50%;
}

.primary-button,
.telegram-button {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 70px;
  margin-top: 36px;
  padding: 10px 12px 10px 26px;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  background: var(--navy);
  border: 0;
  border-radius: 14px;
  box-shadow: 8px 8px 0 rgba(206, 36, 56, 0.95);
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.primary-button:hover,
.telegram-button:hover {
  background: var(--blue);
  box-shadow: 5px 5px 0 var(--yellow);
  transform: translate(3px, 3px);
}

.button-arrow {
  display: grid;
  width: 48px;
  height: 48px;
  color: var(--navy);
  font-size: 1.35rem;
  place-items: center;
  background: var(--yellow);
  border-radius: 10px;
}

.question-hint {
  margin: 16px 0 28px;
  color: var(--muted);
  font-size: 0.88rem;
}

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

.answer-button {
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 72px;
  padding: 14px 18px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.answer-button::before {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  content: "";
  border: 2px solid #a8b4c3;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px #fff;
}

.answer-button:hover {
  background: var(--soft-blue);
  border-color: var(--blue);
  transform: translateY(-2px);
}

.answer-button.is-selected {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.answer-button.is-selected::before {
  background: var(--yellow);
  border-color: #fff;
  box-shadow: inset 0 0 0 4px var(--navy);
}

#loading-screen {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.analysis-visual {
  position: relative;
  display: grid;
  width: 164px;
  height: 164px;
  margin-bottom: 34px;
  place-items: center;
}

.analysis-visual svg {
  position: absolute;
  inset: 0;
  width: 100%;
  fill: var(--yellow);
  stroke: var(--navy);
  stroke-width: 0.6px;
  animation: spin 8s linear infinite;
}

.analysis-visual strong {
  position: relative;
  z-index: 1;
  color: var(--navy);
  font: 800 1.8rem/1 "Manrope", sans-serif;
  letter-spacing: -0.05em;
}

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

.loading-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loading-copy h2 { font-size: clamp(2rem, 4vw, 3.4rem); }

.analysis-bar {
  width: min(400px, 84%);
  height: 6px;
  margin-top: 34px;
  overflow: hidden;
  background: #dfe7f2;
  border-radius: 999px;
}

.analysis-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--red);
  transition: width 120ms linear;
}

.screen--result { justify-content: space-between; }

.result-content { position: relative; }

.result-badge {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 22px;
  color: var(--navy);
  font-size: 1.5rem;
  font-weight: 800;
  place-items: center;
  background: var(--yellow);
  border: 3px solid var(--navy);
  border-radius: 50%;
  box-shadow: 7px 7px 0 rgba(206, 36, 56, 0.95);
}

.result-content h2 { font-size: clamp(1.8rem, 3.15vw, 3rem); }

.next-steps {
  display: grid;
  gap: 9px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.next-steps li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 13px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.next-steps li > span {
  display: grid;
  width: 34px;
  height: 34px;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  place-items: center;
  background: var(--blue);
  border-radius: 50%;
}

.next-steps p,
.next-steps strong {
  display: block;
  margin: 0;
}

.next-steps strong {
  font-size: 0.86rem;
  line-height: 1.35;
}

.result-action {
  position: sticky;
  bottom: 0;
  padding-top: 20px;
  background: linear-gradient(transparent, var(--cream) 24%);
}

.telegram-button {
  justify-content: flex-start;
  margin-top: 0;
  background: #229ed9;
  box-shadow: 8px 8px 0 var(--navy);
}

.telegram-button:hover { background: #1587bd; }

.telegram-button svg {
  width: 25px;
  fill: currentColor;
}

.telegram-button span:nth-of-type(1) { flex: 1; }

@media (max-width: 1050px) {
  .experience {
    grid-template-columns: minmax(300px, 0.68fr) minmax(470px, 1.32fr);
  }

  .story-panel { padding: 32px; }
  .quiz-panel { padding: 42px; }
  .portrait-wrap { width: min(330px, 94%); }
}

@media (max-width: 780px) {
  .site-shell { padding: 12px 10px 18px; }

  .site-header {
    min-height: 48px;
    padding: 0 6px;
    margin-bottom: 12px;
  }

  .brand__sun {
    width: 43px;
    height: 43px;
  }

  .brand__sun svg { width: 29px; }
  .brand__sub { display: none; }
  .flag-mark { width: 52px; height: 34px; }

  .experience {
    display: block;
    min-height: calc(100svh - 84px);
    border-radius: 20px;
  }

  .story-panel { display: none; }

  .quiz-panel {
    min-height: calc(100svh - 84px);
    padding: 24px 22px;
    place-items: stretch;
  }

  .quiz-card { min-height: calc(100svh - 132px); }
  .progress { margin-bottom: 34px; }

  .mobile-portrait {
    display: flex;
    align-items: flex-end;
    width: 106px;
    height: 106px;
    margin-bottom: 24px;
  }

  .mobile-portrait img {
    width: 92px;
    height: 92px;
    object-fit: cover;
    object-position: center 15%;
    border: 3px solid var(--navy);
    border-radius: 50%;
    box-shadow: 6px 6px 0 var(--yellow);
  }

  .mobile-portrait span {
    margin: 0 0 7px -16px;
    padding: 6px 8px;
    color: var(--yellow);
    font-size: 0.52rem;
    letter-spacing: -0.12em;
    white-space: nowrap;
    background: var(--red);
    border: 2px solid #fff;
    border-radius: 999px;
  }

  .screen__content--intro { justify-content: flex-start; }

  h1 { font-size: clamp(2.15rem, 9.8vw, 4.2rem); }
  h2 { font-size: clamp(2rem, 9vw, 3.15rem); }

  .answers { grid-template-columns: 1fr; }
  .answer-button { min-height: 64px; }
  .result-content h2 { font-size: clamp(1.7rem, 7.4vw, 2.5rem); }
  .next-steps { margin-top: 20px; }
}

@media (max-width: 430px) {
  .brand__name { font-size: 0.84rem; }
  .quiz-panel { padding-inline: 18px; }

  .section-label {
    margin-bottom: 16px;
    font-size: 0.62rem;
  }

  .mobile-portrait {
    width: 88px;
    height: 82px;
    margin-bottom: 18px;
  }

  .mobile-portrait img { width: 78px; height: 78px; }
  .lede { margin-top: 18px; }

  .intro-meta {
    gap: 14px;
    margin-top: 22px;
    font-size: 0.67rem;
  }

  .primary-button,
  .telegram-button {
    min-height: 62px;
    margin-top: 26px;
    box-shadow: 5px 5px 0 var(--red);
  }

  .button-arrow { width: 42px; height: 42px; }
  .question-hint { margin-bottom: 20px; }
  .answer-button { min-height: 58px; }

  .next-steps li {
    grid-template-columns: 34px 1fr;
    padding: 10px 12px;
  }

  .next-steps li > span { width: 28px; height: 28px; }
  .next-steps strong { font-size: 0.78rem; }

}

@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;
  }
}
