:root {
  --bg: #FFF6F0;
  --ink: #2B1B2E;
  --flame: #FF4D6D;
  --gold: #FFB703;
  --deep: #7B2D5E;
  --card: #FFFFFF;
  --line: rgba(43, 27, 46, 0.12);
  --font-display: "Baloo 2", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  overflow-x: hidden;
  position: relative;
}

h1, h2, .result-word, .brand, .step-num {
  font-family: var(--font-display);
}

.icon-heart, .icon-spark {
  display: inline-block;
  flex-shrink: 0;
}

/* Ambient background embers */
.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.ember {
  position: absolute;
  color: var(--flame);
  opacity: 0.10;
  width: 2.2rem;
  height: 2.2rem;
  animation: drift 14s ease-in-out infinite;
}
.ember.e1 { top: 8%; left: 6%; animation-delay: 0s; }
.ember.e2 { top: 22%; right: 10%; color: var(--gold); animation-delay: 2s; }
.ember.e3 { top: 60%; left: 4%; animation-delay: 4s; }
.ember.e4 { top: 75%; right: 8%; color: var(--gold); animation-delay: 1s; }
.ember.e5 { top: 40%; right: 20%; animation-delay: 3s; }
.ember.e6 { top: 90%; left: 30%; color: var(--gold); animation-delay: 5s; }

@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-22px) rotate(8deg); }
}

/* Header */
.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem clamp(1.25rem, 5vw, 4rem);
}
.brand {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.brand-mark { color: var(--flame); width: 1.15rem; height: 1.15rem; flex-shrink: 0; }
.site-nav { display: flex; gap: 1.75rem; }
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}
.site-nav a:hover, .site-nav a:focus-visible { opacity: 1; }

@media (max-width: 600px) {
  .site-nav { gap: 1rem; }
  .site-nav a { font-size: 0.85rem; }
}

/* Hero */
.hero {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) 1.5rem 5rem;
  text-align: center;
}
.eyebrow {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--deep);
  font-size: 0.85rem;
  text-transform: uppercase;
  margin: 0 0 1rem;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.08;
  margin: 0 0 1.25rem;
  color: var(--ink);
}
.hero-sub {
  font-size: 1.1rem;
  color: rgba(43,27,46,0.72);
  max-width: 540px;
  margin: 0 auto 2.5rem;
}

/* Calculator card */
.calc-card {
  background: var(--card);
  border-radius: 28px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: 0 24px 60px -20px rgba(123, 45, 94, 0.28);
  border: 1px solid var(--line);
}
.name-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.field { flex: 1; text-align: left; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  color: var(--deep);
}
.field input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 2px solid var(--line);
  font-size: 1.05rem;
  font-family: var(--font-body);
  background: #FFFBF8;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus-visible {
  outline: none;
  border-color: var(--flame);
  box-shadow: 0 0 0 4px rgba(255,77,109,0.15);
}
.divider {
  flex: 0 0 auto;
  padding-top: 1.5rem;
}
.divider-heart {
  display: inline-block;
  width: 1.3rem;
  height: 1.3rem;
  color: var(--flame);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}
@keyframes pulseRotated {
  0%, 100% { transform: rotate(90deg) scale(1); }
  50% { transform: rotate(90deg) scale(1.18); }
}

@media (max-width: 560px) {
  .name-row { flex-direction: column; }
  .divider { padding-top: 0; }
  .divider-heart { animation-name: pulseRotated; }
}

.btn-primary {
  width: 100%;
  margin-top: 1.5rem;
  padding: 1rem;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--flame), var(--deep));
  color: white;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 24px -8px rgba(255,77,109,0.55);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.privacy-note {
  margin: 0.85rem 0 0;
  font-size: 0.78rem;
  color: rgba(43,27,46,0.5);
}

.btn-secondary {
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--deep);
  border-radius: 14px;
  background: transparent;
  color: var(--deep);
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.btn-secondary:hover { background: var(--deep); color: white; }
.btn-secondary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Feedback */
.feedback {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.feedback-label {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(43,27,46,0.6);
}
.feedback-buttons {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}
.feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #FFFBF8;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.feedback-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.feedback-btn:hover { border-color: var(--deep); }
.feedback-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.feedback-btn:active .feedback-icon { transform: scale(1.35) rotate(-8deg); }

.feedback-btn.selected.like {
  border-color: var(--flame);
  background: rgba(255,77,109,0.08);
}
.feedback-btn.selected.dislike {
  border-color: var(--deep);
  background: rgba(123,45,94,0.08);
}
.feedback-btn.selected .feedback-icon { transform: scale(1.25); }

.feedback-btn[disabled] {
  cursor: default;
  opacity: 0.6;
}
.feedback-btn[disabled]:hover { border-color: var(--line); }

.feedback-thanks {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--deep);
  animation: rise 0.3s ease;
}

/* Share */
.share-block {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.share-label {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(43,27,46,0.6);
}
.share-buttons {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--flame), var(--deep));
  color: white;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 8px 18px -8px rgba(255,77,109,0.5);
}
.share-btn:hover { transform: translateY(-1px); }
.share-btn:active { transform: translateY(0); }
.share-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.share-icon { width: 17px; height: 17px; }

.share-note {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--deep);
  animation: rise 0.3s ease;
}

/* Result stage */
.result-stage { margin-top: 2rem; }

.flames-track {
  display: flex;
  justify-content: center;
  gap: clamp(0.4rem, 2vw, 1rem);
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.flames-track .letter {
  position: relative;
  color: var(--ink);
  transition: color 0.4s ease, opacity 0.4s ease;
}
.flames-track .letter.burned {
  color: rgba(43,27,46,0.25);
}
.flames-track .letter.burned::after {
  content: "";
  position: absolute;
  left: -4px; right: -4px; top: 50%;
  height: 3px;
  background: var(--flame);
  transform: scaleX(0);
  transform-origin: left;
  animation: strike 0.35s ease forwards;
}
.flames-track .letter.winner {
  color: var(--flame);
  transform: scale(1.3);
}
@keyframes strike {
  to { transform: scaleX(1); }
}

.result-panel {
  background: var(--card);
  border-radius: 28px;
  padding: clamp(1.75rem, 4vw, 2.5rem);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px -20px rgba(123, 45, 94, 0.24);
  animation: rise 0.5s ease;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-kicker {
  margin: 0;
  font-weight: 600;
  color: var(--deep);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.result-word {
  font-size: clamp(2rem, 6vw, 3rem);
  margin: 0.3rem 0 0.75rem;
  color: var(--flame);
}
.result-desc {
  color: rgba(43,27,46,0.75);
  max-width: 460px;
  margin: 0 auto 1.75rem;
}

.love-meter { max-width: 360px; margin: 0 auto; }
.love-meter-track {
  height: 14px;
  border-radius: 999px;
  background: rgba(123,45,94,0.1);
  overflow: hidden;
}
.love-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--flame));
  transition: width 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}
.love-percent {
  margin: 0.6rem 0 0;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--deep);
}

/* How it works */
.how-it-works, .meanings, .faq {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.how-it-works h2, .meanings h2, .faq h2 {
  text-align: center;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  margin-bottom: 2rem;
}
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
@media (max-width: 760px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
}
.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.5rem 1.25rem;
}
.step-num {
  display: block;
  color: var(--flame);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.step p { margin: 0; font-size: 0.95rem; color: rgba(43,27,46,0.75); }

.meanings-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (max-width: 640px) {
  .meanings-grid { grid-template-columns: 1fr; }
}
.meanings-grid li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.1rem 1.25rem;
  font-size: 0.95rem;
  color: rgba(43,27,46,0.8);
}
.meanings-grid strong { color: var(--ink); }

.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.85rem;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.faq details p {
  margin: 0.75rem 0 0.25rem;
  color: rgba(43,27,46,0.75);
  font-size: 0.95rem;
}

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  color: rgba(43,27,46,0.55);
  font-size: 0.85rem;
}
.site-footer p { margin: 0.3rem 0; }
.footer-links a { color: var(--deep); text-decoration: none; font-weight: 600; }
.footer-links a:hover { text-decoration: underline; }
