:root {
  --hero-overfill: 110px;
  --blue: #6a98ff;
  --pink: #ffa6cf;
  --lilac: #b99fe5;
  --gold: #ffdf87;
  --mint: #eaf8ef;
  --ink: #26325d;
  --ink-soft: rgba(38, 50, 93, 0.72);
  --ink-faint: rgba(38, 50, 93, 0.52);
  --surface: rgba(255, 255, 255, 0.54);
  --surface-strong: rgba(255, 255, 255, 0.76);
  --border: rgba(255, 255, 255, 0.66);
  --line: rgba(105, 90, 152, 0.16);
  --shadow: 0 28px 72px rgba(91, 85, 145, 0.18);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Roboto", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 250, 241, 0.5)),
    url("./assets/hero-sea-moon.png");
  background-size: cover;
  background-attachment: scroll;
  background-position: center;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(130deg, rgba(106, 152, 255, 0.14), transparent 38%),
    linear-gradient(310deg, rgba(255, 166, 207, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(255, 223, 135, 0.12), rgba(255, 255, 255, 0.42));
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select {
  font: inherit;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 20;
  transform: translateX(-50%);
  width: min(1160px, calc(100% - 28px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(22px) saturate(1.1);
  box-shadow: 0 16px 48px rgba(91, 85, 145, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-family: "Comfortaa", cursive;
  font-weight: 700;
  color: var(--ink);
}

.brand img {
  width: 36px;
  height: 44px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 14px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.42);
}

.hero {
  position: relative;
  min-height: calc(var(--hero-height, 100vh) + var(--hero-overfill));
  display: grid;
  align-items: end;
  padding: 126px 20px 72px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(37, 42, 83, 0.54), rgba(37, 42, 83, 0.16) 48%, rgba(255, 255, 255, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(38, 50, 93, 0.1) 100%),
    url("./assets/hero-sea-moon.png");
  background-size: cover;
  background-position: center;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  min-width: 0;
  margin: 0 auto;
  color: #fff;
  text-shadow: 0 16px 42px rgba(38, 50, 93, 0.34);
}

.eyebrow {
  margin: 0 0 14px;
  color: #7b65c1;
  font-family: "Comfortaa", cursive;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: rgba(255, 223, 135, 0.98);
}

h1,
h2,
h3 {
  font-family: "Comfortaa", cursive;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(48px, 9vw, 118px);
  line-height: 0.96;
}

.hero-question {
  margin: 18px 0 0;
  max-width: 720px;
  overflow-wrap: anywhere;
  font-family: "Comfortaa", cursive;
  font-size: clamp(25px, 4vw, 48px);
  line-height: 1.12;
  color: #fff9db;
}

.hero-question span {
  display: inline-block;
  min-height: 1.2em;
  transition: opacity 0.26s ease, transform 0.26s ease;
}

.hero-question span.is-changing {
  opacity: 0;
  transform: translateY(8px);
}

.hero-copy {
  margin: 20px 0 0;
  max-width: 620px;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
}

.hero-actions,
.quiz-actions,
.messenger-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-btn,
.secondary-btn,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.primary-btn {
  color: #26325d;
  background: linear-gradient(135deg, #ffdf87, #ffa6cf 58%, #9bc1ff);
  box-shadow: 0 18px 40px rgba(91, 85, 145, 0.22);
}

.secondary-btn {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.68);
}

.ghost-link {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(14px);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-link:hover {
  transform: translateY(-2px);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 2;
  transform: translateX(-50%);
  color: rgba(38, 50, 93, 0.72);
  font-size: 14px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 10px 16px;
  backdrop-filter: blur(18px);
}

.section {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
  padding: 84px 0;
}

.about-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.86fr);
  gap: 34px;
  align-items: center;
}

.section-copy,
.visual-panel,
.topic,
.quiz-shell,
.result-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.34)),
    linear-gradient(180deg, rgba(255, 223, 135, 0.12), rgba(185, 159, 229, 0.08));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px) saturate(1.08);
}

.section-copy {
  padding: clamp(24px, 4vw, 48px);
}

.section-copy h2,
.section-head h2,
.quiz-intro h2,
.result-card h2 {
  margin: 0;
  font-size: clamp(31px, 5vw, 58px);
  line-height: 1.04;
}

.section-copy p,
.quiz-intro p,
.topic p,
.result-card p {
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.62;
}

.strong-line {
  margin-top: 22px;
  color: var(--ink) !important;
  font-weight: 700;
}

.visual-panel {
  padding: 10px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.24)),
    url("./assets/clouds-soft.png");
  background-size: cover;
  background-position: center;
}

.visual-panel img {
  width: 100%;
  aspect-ratio: 1 / 1.12;
  object-fit: cover;
  border-radius: 18px;
}

.section-head {
  margin-bottom: 24px;
  max-width: 760px;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.topic {
  min-height: 248px;
  padding: 22px;
}

.topic span {
  display: inline-flex;
  color: #7b65c1;
  font-family: "Comfortaa", cursive;
  font-weight: 700;
}

.topic h3 {
  margin: 42px 0 0;
  font-size: 22px;
  line-height: 1.15;
}

.topic p {
  margin: 14px 0 0;
  font-size: 15px;
}

.quiz-section {
  padding-bottom: 96px;
}

.quiz-shell {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 28px;
  align-items: start;
  padding: clamp(18px, 3vw, 28px);
  background:
    linear-gradient(180deg, rgba(246, 247, 251, 0.86), rgba(255, 255, 255, 0.46)),
    url("./assets/clouds-soft.png");
  background-size: cover;
  background-position: center;
}

.quiz-intro {
  position: sticky;
  top: 104px;
  padding: 18px 4px 18px 12px;
}

.quiz-card,
.result-card {
  min-width: 0;
  padding: clamp(18px, 3vw, 30px);
}

.quiz-card {
  background: rgba(231, 233, 239, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  box-shadow: 0 18px 54px rgba(91, 85, 145, 0.14);
}

.progress {
  height: 8px;
  margin-bottom: 26px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(38, 50, 93, 0.1);
}

.progress div {
  width: 14.28%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--pink), var(--gold));
  transition: width 0.25s ease;
}

.quiz-step {
  display: none;
}

.quiz-step.is-active {
  display: block;
}

.step-label {
  margin: 0 0 10px;
  color: var(--ink-faint);
  font-size: 14px;
  font-weight: 700;
}

.quiz-step h3 {
  margin: 0 0 22px;
  font-size: clamp(25px, 3.2vw, 38px);
  line-height: 1.1;
}

.choice-grid {
  display: grid;
  gap: 10px;
}

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

.choice {
  display: block;
}

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

.choice span {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  color: #3b70cb;
  font-weight: 700;
  transition: border 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.choice input:checked + span {
  color: var(--ink);
  border-color: rgba(106, 152, 255, 0.64);
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(106, 152, 255, 0.18), 0 10px 24px rgba(71, 103, 171, 0.12);
}

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

.field + .field {
  margin-top: 14px;
}

.field label {
  color: var(--ink-faint);
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border: 1px solid rgba(105, 90, 152, 0.18);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: rgba(106, 152, 255, 0.66);
  box-shadow: 0 0 0 4px rgba(106, 152, 255, 0.12);
}

.field-note {
  margin: 10px 0 0;
  color: var(--ink-faint);
  font-size: 14px;
  line-height: 1.5;
}

.compatibility-extra {
  display: none;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 223, 135, 0.42);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.38);
}

.compatibility-extra.is-visible {
  display: block;
}

.form-error {
  min-height: 22px;
  margin-top: 18px;
  color: #b9496c;
  font-weight: 700;
}

.quiz-actions {
  justify-content: space-between;
}

.quiz-actions .secondary-btn {
  min-width: 120px;
}

.quiz-actions .primary-btn {
  min-width: 150px;
}

.result-card[hidden] {
  display: none;
}

.result-card {
  grid-column: 2;
}

.arcana-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 24px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.72);
}

.arcana-box > span {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  font-family: "Comfortaa", cursive;
  font-size: 36px;
  font-weight: 700;
  color: var(--ink);
  background: linear-gradient(135deg, var(--gold), var(--pink), var(--blue));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.56);
}

.arcana-box h3,
.answer-preview h3 {
  margin: 0;
  font-size: 21px;
}

.arcana-box p {
  margin: 8px 0 0;
}

.answer-preview {
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.58);
}

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

.messenger-btn {
  display: grid;
  justify-items: center;
  gap: 9px;
  min-height: 118px;
  padding: 18px 12px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 22px;
  color: #376fcf;
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 14px 30px rgba(71, 103, 171, 0.12);
  transition: transform 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
}

.messenger-btn:hover,
.messenger-btn.is-tapped {
  transform: translateY(-2px);
  border-color: rgba(106, 152, 255, 0.62);
  box-shadow: 0 18px 36px rgba(71, 103, 171, 0.18);
}

.messenger-btn-primary {
  color: var(--ink);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 217, 0.84));
}

.messenger-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, #6a98ff, #ffa6cf);
  font-family: "Comfortaa", cursive;
  font-size: 16px;
  font-weight: 700;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 20px 42px;
  color: var(--ink-faint);
  font-size: 14px;
}

.footer img {
  width: 28px;
  height: 28px;
}

@media (max-width: 980px) {
  .question-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .about-section,
  .quiz-shell {
    grid-template-columns: 1fr;
  }

  .quiz-intro {
    position: static;
    padding: 8px 4px;
  }

  .result-card {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  body {
    background-attachment: scroll;
  }

  .site-header {
    top: 10px;
    left: 10px;
    width: auto;
    transform: none;
    border-radius: 24px;
  }

  .brand span {
    display: none;
  }

  .nav-links {
    display: none;
  }

  .hero {
    min-height: calc(var(--hero-height, 100vh) + var(--hero-overfill));
    padding: 112px 18px 64px;
  }

  .hero-bg {
    background-position: 64% 50%;
  }

  .hero-inner {
    text-align: left;
    width: calc(100vw - 36px);
    max-width: calc(100vw - 36px);
  }

  .hero-copy {
    max-width: min(100%, 330px);
    overflow-wrap: anywhere;
  }

  .hero-question {
    max-width: 330px;
    font-size: 25px;
  }

  .hero-actions,
  .quiz-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .messenger-actions {
    grid-template-columns: 1fr;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-link {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .hero-actions .primary-btn,
  .hero-actions .ghost-link {
    width: calc(100vw - 36px);
    max-width: calc(100vw - 36px);
  }

  .section {
    width: min(100% - 22px, 1160px);
    padding: 56px 0;
  }

  .section-copy,
  .topic,
  .quiz-card,
  .result-card {
    border-radius: 20px;
  }

  .question-grid,
  .choice-grid.two {
    grid-template-columns: 1fr;
  }

  .topic {
    min-height: 0;
  }

  .topic h3 {
    margin-top: 22px;
  }

  .arcana-box {
    grid-template-columns: 1fr;
  }
}
