@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Playfair+Display:wght@700;800&display=swap");

:root {
  --red-950: #360000;
  --red-900: #520202;
  --red-800: #740505;
  --red-700: #930909;
  --red-600: #b31212;
  --yellow: #fff200;
  --yellow-soft: #fff7a6;
  --cream: #fffced;
  --ink: #2a1717;
  --muted: #765d5d;
  --line: rgba(117, 5, 5, 0.14);
  --white: #ffffff;
  --shadow: 0 24px 60px rgba(72, 0, 0, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 242, 0, 0.13), transparent 28%),
    linear-gradient(180deg, #fffdf3 0%, #fff8dc 48%, #fffdf7 100%);
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
}

button {
  font: inherit;
}

button:focus-visible,
.option-card:focus-visible,
.library-card:focus-visible {
  outline: 4px solid rgba(255, 242, 0, 0.85);
  outline-offset: 3px;
}

.site-header {
  position: relative;
  z-index: 5;
  background: var(--red-900);
  box-shadow: 0 12px 30px rgba(72, 0, 0, 0.22);
}

.brain-banner {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center;
  background: var(--red-900);
}

.app-shell {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 52px 0 64px;
}

.ambient {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(8px);
  pointer-events: none;
  opacity: 0.35;
  animation: drift 9s ease-in-out infinite alternate;
}

.ambient-one {
  width: 320px;
  height: 320px;
  right: -120px;
  top: 32%;
  background: rgba(255, 225, 0, 0.32);
}

.ambient-two {
  width: 250px;
  height: 250px;
  left: -100px;
  bottom: 8%;
  background: rgba(147, 9, 9, 0.15);
  animation-delay: -3s;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 280px;
  align-items: center;
  gap: 48px;
  margin-bottom: 34px;
  padding: 20px 4px 8px;
}

.eyebrow,
.step-kicker,
.result-label,
.modal-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--red-700);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow::before,
.step-kicker::before,
.result-label::before {
  content: "";
  width: 26px;
  height: 3px;
  border-radius: 99px;
  background: var(--yellow);
  box-shadow: 0 0 0 1px rgba(147, 9, 9, 0.12);
}

.hero h1,
.section-heading h2,
.result-header h2 {
  margin: 9px 0 12px;
  color: var(--red-900);
  font-family: "Playfair Display", serif;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 0.98;
}

.hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

.hero-orbit {
  position: relative;
  width: 230px;
  height: 230px;
  margin-inline: auto;
  border-radius: 50%;
  background: radial-gradient(circle, #fff92a 0 27%, #ffd900 28% 36%, transparent 37%);
  filter: drop-shadow(0 18px 30px rgba(90, 0, 0, 0.2));
  animation: float 4s ease-in-out infinite;
}

.hero-orbit::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 2px dashed rgba(115, 5, 5, 0.28);
  border-radius: 50%;
  animation: spin 16s linear infinite;
}

.core {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 3;
  transform: translate(-50%, -50%);
  color: var(--red-900);
  font-family: "Playfair Display", serif;
  font-size: 4rem;
  font-weight: 800;
}

.orbit {
  position: absolute;
  z-index: 4;
  width: 28px;
  height: 28px;
  border: 5px solid var(--cream);
  border-radius: 50%;
  background: var(--red-700);
  box-shadow: 0 7px 14px rgba(83, 0, 0, 0.25);
}

.orbit-a {
  top: 8px;
  left: 93px;
}

.orbit-b {
  right: 2px;
  bottom: 59px;
}

.orbit-c {
  left: 8px;
  bottom: 41px;
}

.progress-card {
  margin-bottom: 22px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 30px rgba(91, 0, 0, 0.08);
  backdrop-filter: blur(14px);
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: #f1dfc7;
}

.progress-fill {
  width: 25%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red-700), var(--yellow));
  transition: width 0.45s cubic-bezier(.2,.8,.2,1);
}

.decision-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 22px;
  align-items: start;
}

.selection-panel,
.live-panel,
.result-section,
.scale-library,
.safety-note {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(15px);
}

.selection-panel {
  min-height: 560px;
  padding: 30px;
  border-radius: 28px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.panel-heading h2 {
  margin: 8px 0 0;
  color: var(--red-900);
  font-family: "Playfair Display", serif;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.step-description {
  margin: 14px 0 24px;
  color: var(--muted);
  line-height: 1.65;
}

.ghost-button,
.secondary-button,
.primary-button {
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.ghost-button {
  padding: 10px 13px;
  color: var(--red-700);
  background: #fff2cf;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 12px 20px;
}

.primary-button {
  color: var(--red-950);
  background: linear-gradient(135deg, var(--yellow), #ffd600);
  box-shadow: 0 12px 24px rgba(192, 156, 0, 0.25);
}

.secondary-button {
  color: var(--red-800);
  background: #fff;
  border: 1px solid rgba(116, 5, 5, 0.2);
}

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

.primary-button:hover {
  box-shadow: 0 16px 28px rgba(192, 156, 0, 0.34);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none !important;
}

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

.option-card {
  position: relative;
  min-height: 122px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(117, 5, 5, 0.14);
  border-radius: 20px;
  color: var(--ink);
  background: linear-gradient(145deg, #fff, #fffaf0);
  cursor: pointer;
  text-align: left;
  transition: transform 0.23s ease, border-color 0.23s ease, box-shadow 0.23s ease;
  animation: cardIn 0.45s both;
}

.option-card::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  right: -40px;
  bottom: -48px;
  border-radius: 50%;
  background: rgba(255, 242, 0, 0.28);
  transition: transform 0.3s ease;
}

.option-card:hover {
  transform: translateY(-4px);
  border-color: rgba(147, 9, 9, 0.38);
  box-shadow: 0 14px 26px rgba(93, 0, 0, 0.11);
}

.option-card:hover::after {
  transform: scale(1.35);
}

.option-card.selected {
  border-color: var(--red-700);
  color: var(--red-950);
  background: linear-gradient(145deg, #fffbd1, #fff);
  box-shadow: 0 0 0 3px rgba(255, 242, 0, 0.38), 0 16px 30px rgba(91, 0, 0, 0.13);
}

.option-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  border-radius: 14px;
  color: var(--yellow);
  background: var(--red-800);
  font-size: 1.25rem;
  box-shadow: 0 8px 16px rgba(91, 0, 0, 0.16);
}

.option-title {
  display: block;
  margin-bottom: 5px;
  font-size: 1rem;
  font-weight: 800;
}

.option-copy {
  display: block;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.45;
}

.option-check {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(116, 5, 5, 0.22);
  border-radius: 50%;
  color: var(--red-900);
  background: white;
  font-size: 0.8rem;
  font-weight: 900;
}

.option-card.selected .option-check {
  border-color: var(--yellow);
  background: var(--yellow);
}

.navigation-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
}

.live-panel {
  position: sticky;
  top: 18px;
  padding: 26px;
  border-radius: 28px;
  background: linear-gradient(180deg, var(--red-900), var(--red-700));
  color: white;
}

.live-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--yellow-soft);
  font-weight: 800;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 0 rgba(255, 242, 0, 0.65);
  animation: pulse 1.8s infinite;
}

.journey-list {
  display: grid;
  gap: 10px;
  min-height: 250px;
}

.journey-empty {
  display: grid;
  place-items: center;
  min-height: 170px;
  padding: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
}

.journey-item {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  animation: slideIn 0.35s both;
}

.journey-number {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 10px;
  color: var(--red-950);
  background: var(--yellow);
  font-size: 0.78rem;
  font-weight: 900;
}

.journey-item strong {
  display: block;
  font-size: 0.9rem;
}

.journey-item span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.67);
  font-size: 0.78rem;
  line-height: 1.4;
}

.hint-card {
  display: flex;
  gap: 11px;
  margin-top: 22px;
  padding: 15px;
  border-radius: 18px;
  color: var(--red-950);
  background: var(--yellow);
}

.hint-icon {
  font-size: 1.4rem;
}

.hint-card p {
  margin: 0;
  font-size: 0.83rem;
  font-weight: 700;
  line-height: 1.45;
}

.result-section {
  position: relative;
  margin-top: 28px;
  padding: 34px;
  overflow: hidden;
  border-radius: 30px;
  animation: resultReveal 0.7s both;
}

.hidden {
  display: none !important;
}

.result-celebration span {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--yellow);
  animation: pop 2.2s infinite ease-in-out;
}

.result-celebration span:nth-child(1) { top: 24px; right: 11%; }
.result-celebration span:nth-child(2) { top: 80px; right: 4%; animation-delay: .2s; }
.result-celebration span:nth-child(3) { bottom: 45px; left: 4%; animation-delay: .4s; }
.result-celebration span:nth-child(4) { top: 34%; left: 2%; animation-delay: .6s; }
.result-celebration span:nth-child(5) { bottom: 25px; right: 19%; animation-delay: .8s; }

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: center;
}

.result-header h2 {
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  line-height: 0.95;
}

.result-header p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.confidence-ring {
  --score: 92;
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background:
    radial-gradient(circle closest-side, white 76%, transparent 77% 100%),
    conic-gradient(var(--red-700) calc(var(--score) * 1%), #f0dfc7 0);
  box-shadow: 0 14px 28px rgba(83, 0, 0, 0.14);
}

.confidence-ring div {
  text-align: center;
}

.confidence-ring strong,
.confidence-ring span {
  display: block;
}

.confidence-ring strong {
  color: var(--red-900);
  font-size: 1.45rem;
}

.confidence-ring span {
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 700;
  text-transform: uppercase;
}

.result-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 18px;
  margin-top: 28px;
}

.why-card,
.caution-card {
  padding: 24px;
  border-radius: 22px;
}

.why-card {
  border: 1px solid rgba(147, 9, 9, 0.14);
  background: #fffdf4;
}

.caution-card {
  color: #fff;
  background: linear-gradient(145deg, var(--red-900), var(--red-700));
}

.why-card h3,
.caution-card h3,
.alternatives h3 {
  margin: 0 0 10px;
}

.why-card p,
.caution-card p {
  margin: 0;
  line-height: 1.65;
}

.caution-card p {
  color: rgba(255, 255, 255, 0.78);
}

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.feature-pill {
  padding: 8px 10px;
  border-radius: 99px;
  color: var(--red-900);
  background: #fff1a5;
  font-size: 0.78rem;
  font-weight: 800;
}

.alternatives {
  margin-top: 25px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.alternatives-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
}

.alternatives-heading p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.alternative-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.alternative-card {
  padding: 16px;
  border-radius: 18px;
  background: #fff7dc;
}

.alternative-card strong {
  color: var(--red-900);
}

.alternative-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.result-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.scale-library {
  margin-top: 34px;
  padding: 34px;
  border-radius: 30px;
}

.section-heading {
  max-width: 760px;
}

.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 24px;
}

.library-card {
  position: relative;
  min-height: 190px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, #fff, #fff9e8);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.library-card:hover {
  transform: translateY(-5px) rotate(-0.3deg);
  box-shadow: 0 16px 26px rgba(91, 0, 0, 0.11);
}

.library-card::before {
  content: attr(data-index);
  position: absolute;
  right: -3px;
  bottom: -20px;
  color: rgba(147, 9, 9, 0.06);
  font-family: "Playfair Display", serif;
  font-size: 7rem;
  font-weight: 800;
}

.library-card .library-code {
  display: inline-flex;
  padding: 7px 9px;
  border-radius: 10px;
  color: var(--yellow);
  background: var(--red-800);
  font-size: 0.8rem;
  font-weight: 900;
}

.library-card h3 {
  position: relative;
  z-index: 2;
  margin: 14px 0 8px;
  color: var(--red-900);
}

.library-card p {
  position: relative;
  z-index: 2;
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.library-more {
  position: absolute;
  z-index: 2;
  left: 20px;
  bottom: 18px;
  color: var(--red-700);
  font-size: 0.8rem;
  font-weight: 800;
}

.safety-note {
  display: flex;
  gap: 20px;
  margin-top: 28px;
  padding: 26px;
  border-radius: 24px;
  color: white;
  background: linear-gradient(135deg, var(--red-950), var(--red-700));
}

.safety-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: var(--red-950);
  background: var(--yellow);
  font-size: 1.4rem;
  font-weight: 900;
}

.safety-note h2 {
  margin: 0 0 7px;
  font-size: 1.15rem;
}

.safety-note p {
  margin: 0;
  color: rgba(255,255,255,.74);
  line-height: 1.6;
}

footer {
  padding: 24px 20px 38px;
  color: #876d6d;
  text-align: center;
  font-size: 0.8rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  z-index: 2;
  width: min(650px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 30px;
  border-radius: 28px;
  background: #fffdf5;
  box-shadow: 0 28px 70px rgba(0,0,0,.28);
  animation: modalIn .3s both;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  color: var(--red-900);
  background: #fff0cd;
  cursor: pointer;
  font-size: 1.4rem;
}

.modal-card h2 {
  margin: 10px 40px 7px 0;
  color: var(--red-900);
  font-family: "Playfair Display", serif;
  font-size: 2.1rem;
}

.modal-subtitle {
  color: var(--muted);
}

.modal-body {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.modal-row {
  padding: 15px;
  border-radius: 16px;
  background: #fff6d8;
}

.modal-row strong {
  display: block;
  margin-bottom: 5px;
  color: var(--red-800);
}

.modal-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes resultReveal {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 14px rgba(255,242,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,242,0,0); }
}

@keyframes float {
  50% { transform: translateY(-10px) rotate(2deg); }
}

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

@keyframes drift {
  to { transform: translate3d(30px, -35px, 0) scale(1.08); }
}

@keyframes pop {
  50% { transform: translateY(-12px) scale(1.3); opacity: .7; }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-orbit {
    display: none;
  }

  .decision-grid,
  .result-layout {
    grid-template-columns: 1fr;
  }

  .live-panel {
    position: static;
  }

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

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 34px;
  }

  .selection-panel,
  .live-panel,
  .result-section,
  .scale-library {
    padding: 22px;
    border-radius: 23px;
  }

  .options-grid,
  .library-grid,
  .alternative-cards {
    grid-template-columns: 1fr;
  }

  .panel-heading,
  .result-header,
  .alternatives-heading,
  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .confidence-ring {
    width: 108px;
    height: 108px;
  }

  .navigation-row {
    flex-direction: column-reverse;
  }

  .navigation-row button,
  .result-actions button {
    width: 100%;
  }

  .brain-banner {
    width: 100%;
    height: auto;
    min-height: 0;
    object-fit: contain;
  }
}
