@font-face {
  font-family: "Barlow";
  font-weight: 400;
  font-style: normal;
  src: url("assets/fonts/Barlow-400.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Barlow";
  font-weight: 600;
  font-style: normal;
  src: url("assets/fonts/Barlow-600.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Barlow";
  font-weight: 700;
  font-style: normal;
  src: url("assets/fonts/Barlow-700.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Barlow";
  font-weight: 800;
  font-style: normal;
  src: url("assets/fonts/Barlow-800.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Barlow";
  font-weight: 900;
  font-style: normal;
  src: url("assets/fonts/Barlow-900.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Novecento slab";
  font-weight: 700;
  font-style: normal;
  src: url("assets/fonts/NovecentoSlab-Bold.woff2") format("woff2"),
       url("assets/fonts/NovecentoSlab-Bold.woff") format("woff");
  font-display: swap;
}

:root {
  --cro-primary: #009cb6;
  --cro-secondary: #ffffff;
  --cro-text: #1d1d1b;
  --cro-accent: #76b82a;
  --cro-sand: #f3f4f0;
  --cro-magenta: #b01968;
  --cro-purple: #5c2482;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
  --radius: 26px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Barlow", sans-serif;
  color: var(--cro-text);
  background: radial-gradient(circle at top, rgba(0, 156, 182, 0.12), transparent 45%),
    linear-gradient(165deg, #f3f4f0 0%, #ffffff 40%, #e8f7f8 100%);
  min-height: 100vh;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px clamp(16px, 4vw, 64px) 18px;
  position: relative;
  overflow: hidden;
}


.site-header {
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 1;
  flex-wrap: nowrap;
}

.logo img {
  width: clamp(120px, 24vw, 180px);
  height: auto;
  display: block;
}

.header-meta {
  display: flex;
  flex-direction: column;
  gap: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.header-tag {
  font-size: 0.75rem;
  color: var(--cro-magenta);
  font-weight: 700;
}

.header-title {
  font-family: "Novecento slab", "Barlow", sans-serif;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  white-space: nowrap;
}

.app {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 0 24px;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--cro-secondary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 42px);
  width: min(720px, 100%);
  margin: 0 auto;
}

h1,
h2 {
  font-family: "Novecento slab", "Barlow", sans-serif;
  text-transform: uppercase;
  margin-top: 0;
  letter-spacing: 0.04em;
  hyphens: auto;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

p {
  line-height: 1.6;
  font-size: 1rem;
}

.screen {
  display: none;
  width: 100%;
}

.screen.active {
  display: block;
  animation: screen-in 0.35s ease;
}

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

.actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 26px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.btn-primary {
  background: var(--cro-primary);
  color: var(--cro-secondary);
  box-shadow: 0 12px 30px rgba(0, 156, 182, 0.25);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  background: #08a9c6;
}

.btn:focus {
  outline: none;
  box-shadow: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: var(--cro-text);
  border: 2px solid rgba(29, 29, 27, 0.18);
}

.question-card {
  display: flex;
  flex-direction: column;
}

.question-stage {
  position: relative;
  overflow: hidden;
  transition: height 0.45s ease;
  will-change: height;
  margin: 0 calc(-1 * clamp(24px, 4vw, 42px));
  padding: 0 clamp(24px, 4vw, 42px);
}

.question-content {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.question-content.is-clone {
  position: absolute;
  inset: 0;
  width: 100%;
  pointer-events: none;
}

.question-content.slide-in-right {
  animation: slide-in-right 0.42s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.question-content.slide-in-left {
  animation: slide-in-left 0.42s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.question-content.slide-out-left {
  animation: slide-out-left 0.42s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

.question-content.slide-out-right {
  animation: slide-out-right 0.42s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-out-left {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-60px);
  }
}

@keyframes slide-out-right {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(60px);
  }
}

.question-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.question-progress {
  flex: 1;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--cro-sand);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cro-primary), var(--cro-accent));
  transition: width 0.3s ease;
}

.question-count {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  color: var(--cro-magenta);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.question-count-label {
  font-size: 0.7rem;
}

.question-count-wheel {
  display: inline-flex;
  gap: 4px;
  font-family: "Novecento slab", "Barlow", sans-serif;
  font-size: 1.6rem;
  line-height: 1em;
}

.question-count-wheel--tens,
.question-count-wheel--ones {
  display: block;
  position: relative;
  height: 1em;
  width: 1.1rem;
  overflow: hidden;
}

.question-count-value {
  display: block;
  height: 1em;
  transition: transform 0.35s ease;
}

.question-count-wheel--tens.is-animating .question-count-value,
.question-count-wheel--ones.is-animating .question-count-value {
  transform: translateY(-100%);
}

.options {
  display: grid;
  gap: 12px;
}

.option {
  text-align: left;
  border-radius: 18px;
  padding: 16px 18px;
  border: 2px solid transparent;
  background: rgba(243, 244, 240, 0.6);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  color: var(--cro-text);
  -webkit-text-fill-color: var(--cro-text);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  hyphens: auto;
  text-wrap: balance;
}

.option-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cro-magenta);
}

.option-text {
  display: block;
  margin-top: 6px;
}

.option:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 156, 182, 0.4);
}

.option:focus,
.option:focus-visible,
.option:active {
  outline: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
  background: rgba(243, 244, 240, 0.6) !important;
}

.option.selected {
  border-color: var(--cro-primary);
  background: rgba(0, 156, 182, 0.12);
}

.question-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.results-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  position: relative;
}

.loading-visual {
  position: relative;
  height: 120px;
  width: 200px;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.loading-visual.is-visible {
  opacity: 1;
  transform: scale(1);
}

.loading-visual.is-hidden {
  height: 0;
  margin: 0;
  opacity: 0;
  transform: scale(0.96);
  overflow: hidden;
}

.loading-gear {
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 6px dashed rgba(0, 156, 182, 0.6);
  top: 18px;
  left: 8px;
  animation: spin 1.8s linear infinite;
}

.loading-gear--small {
  width: 50px;
  height: 50px;
  border-width: 5px;
  border-color: rgba(176, 25, 104, 0.6);
  top: 2px;
  left: 92px;
  animation-duration: 1.4s;
  animation-direction: reverse;
}

.loading-gear--accent {
  width: 40px;
  height: 40px;
  border-width: 4px;
  border-color: rgba(118, 184, 42, 0.6);
  top: 68px;
  left: 64px;
  animation-duration: 1.1s;
}

.loading-copy {
  max-width: 420px;
}

.loading-image {
  width: min(420px, 100%);
}

.loading-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
  box-shadow: none;
}

.loading-card .actions {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  margin-top: 0;
}

.loading-card .actions.is-visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.confetti span {
  position: absolute;
  width: 10px;
  height: 6px;
  border-radius: 2px;
  top: 78%;
  left: 50%;
  opacity: 0;
}

.confetti.is-active {
  opacity: 1;
}

.confetti.is-active span {
  animation: confetti-burst 1.2s ease forwards;
}

.confetti span:nth-child(1) { background: #009cb6; transform: translate(-50%, -50%) rotate(12deg); }
.confetti span:nth-child(2) { background: #b01968; transform: translate(-50%, -50%) rotate(-18deg); }
.confetti span:nth-child(3) { background: #76b82a; transform: translate(-50%, -50%) rotate(24deg); }
.confetti span:nth-child(4) { background: #009cb6; transform: translate(-50%, -50%) rotate(-6deg); }
.confetti span:nth-child(5) { background: #b01968; transform: translate(-50%, -50%) rotate(30deg); }
.confetti span:nth-child(6) { background: #76b82a; transform: translate(-50%, -50%) rotate(-24deg); }
.confetti span:nth-child(7) { background: #009cb6; transform: translate(-50%, -50%) rotate(18deg); }
.confetti span:nth-child(8) { background: #b01968; transform: translate(-50%, -50%) rotate(-12deg); }
.confetti span:nth-child(9) { background: #76b82a; transform: translate(-50%, -50%) rotate(6deg); }
.confetti span:nth-child(10) { background: #009cb6; transform: translate(-50%, -50%) rotate(-30deg); }
.confetti span:nth-child(11) { background: #b01968; transform: translate(-50%, -50%) rotate(36deg); }
.confetti span:nth-child(12) { background: #76b82a; transform: translate(-50%, -50%) rotate(-36deg); }
.confetti span:nth-child(13) { background: #009cb6; transform: translate(-50%, -50%) rotate(8deg); }
.confetti span:nth-child(14) { background: #b01968; transform: translate(-50%, -50%) rotate(-16deg); }
.confetti span:nth-child(15) { background: #76b82a; transform: translate(-50%, -50%) rotate(22deg); }
.confetti span:nth-child(16) { background: #009cb6; transform: translate(-50%, -50%) rotate(-8deg); }
.confetti span:nth-child(17) { background: #b01968; transform: translate(-50%, -50%) rotate(28deg); }
.confetti span:nth-child(18) { background: #76b82a; transform: translate(-50%, -50%) rotate(-20deg); }

@keyframes confetti-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6) rotate(0deg);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x, 0px)), calc(-50% + var(--y, 0px)))
      rotate(90deg);
  }
}

.confetti span:nth-child(1) { --x: -120px; --y: -80px; }
.confetti span:nth-child(2) { --x: 80px; --y: -110px; }
.confetti span:nth-child(3) { --x: -40px; --y: -130px; }
.confetti span:nth-child(4) { --x: 140px; --y: -50px; }
.confetti span:nth-child(5) { --x: -150px; --y: -20px; }
.confetti span:nth-child(6) { --x: 110px; --y: 20px; }
.confetti span:nth-child(7) { --x: -90px; --y: 40px; }
.confetti span:nth-child(8) { --x: 50px; --y: 70px; }
.confetti span:nth-child(9) { --x: -10px; --y: 90px; }
.confetti span:nth-child(10) { --x: 160px; --y: -10px; }
.confetti span:nth-child(11) { --x: -70px; --y: 110px; }
.confetti span:nth-child(12) { --x: 20px; --y: -90px; }
.confetti span:nth-child(13) { --x: -130px; --y: -60px; }
.confetti span:nth-child(14) { --x: 100px; --y: -120px; }
.confetti span:nth-child(15) { --x: -20px; --y: -150px; }
.confetti span:nth-child(16) { --x: 150px; --y: 10px; }
.confetti span:nth-child(17) { --x: -110px; --y: 70px; }
.confetti span:nth-child(18) { --x: 30px; --y: -110px; }

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

.results-lead {
  margin-top: -8px;
  color: rgba(29, 29, 27, 0.7);
}

.results-list {
  display: grid;
  gap: 12px;
}

.result-card {
  border-radius: 18px;
  border: 1px solid rgba(29, 29, 27, 0.1);
  padding: 12px 16px;
  background: #ffffff;
}

.result-card.is-top {
  border-color: rgba(0, 156, 182, 0.6);
  background: linear-gradient(135deg, rgba(0, 156, 182, 0.12), rgba(176, 25, 104, 0.08));
  box-shadow: 0 18px 36px rgba(0, 156, 182, 0.15);
}

.debug-panel {
  border-radius: 16px;
  background: rgba(0, 156, 182, 0.08);
  padding: 12px 14px;
  font-size: 0.85rem;
  color: rgba(29, 29, 27, 0.75);
}

.debug-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 6px;
}

.debug-score {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(29, 29, 27, 0.08);
}

.result-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 700;
}

.result-summary span {
  font-size: 1rem;
}

.result-bar {
  height: 6px;
  background: var(--cro-sand);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.result-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--cro-magenta), var(--cro-primary));
}

.result-detail {
  margin-top: 12px;
  color: rgba(29, 29, 27, 0.85);
  line-height: 1.6;
}

.result-debug {
  margin-top: 8px;
  font-size: 0.85rem;
  color: rgba(29, 29, 27, 0.65);
}

details[open] .result-summary {
  color: var(--cro-primary);
}

.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(29, 29, 27, 0.7);
  padding-top: 4px;
  position: relative;
  z-index: 1;
}

.footer-links {
  display: inline-flex;
  gap: 16px;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--cro-primary);
}

@media (max-width: 720px) {
  .site-header {
    flex-direction: row;
    align-items: center;
  }

  .question-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .loading-card .btn,
  .screen-intro .btn,
  .screen-results .btn {
    font-size: 1.05rem;
    padding: 14px 28px;
  }

  .header-title {
    font-size: 1.05rem;
  }

  .header-tag {
    font-size: 0.7rem;
  }

}

@media (hover: none) and (pointer: coarse) {
  .btn:hover,
  .option:hover {
    transform: none;
    border-color: transparent;
  }
}
