/* =========================================================
   LoveTester.org — Homepage / Love Tester
   File: /assets/css/home.css
   Only styles unique to the homepage tool.
   Shared styles live in global.css.
   ========================================================= */

/* Hero decoration unique to the homepage */
.home-hero-orb {
  position: absolute;
  border-radius: 999px;
  opacity: .25;
  pointer-events: none;
}

.home-hero-orb-a {
  width: 240px;
  height: 240px;
  right: -85px;
  top: -70px;
  background: #fff;
}

.home-hero-orb-b {
  width: 190px;
  height: 190px;
  left: -85px;
  bottom: -95px;
  background: #ffd9eb;
}

.home-hero-cta {
  margin-top: 23px;
}

/* Tool layout */
.home-tool-section {
  position: relative;
  z-index: 4;
  margin-top: -25px;
  padding-bottom: 44px;
}

.home-tool-layout {
  display: grid;
  gap: 18px;
  align-items: start;
}

.home-calculator-card {
  overflow: hidden;
}

.home-love-badge {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--surface-2);
  font-size: 1.55rem;
}

.home-name-grid {
  display: grid;
  gap: 14px;
}

.home-input-wrap {
  position: relative;
}

.home-input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand);
  pointer-events: none;
}

.home-input-wrap input {
  padding-left: 42px;
}

.home-name-divider {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  place-self: center;
  border-radius: 999px;
  color: var(--brand);
  background: var(--surface-2);
}

/* Result */
.home-result-area {
  display: none;
  margin: 22px -22px -22px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.home-result-area.show {
  display: block;
  animation: homeResultIn .38s ease both;
}

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

.home-result-header {
  padding: 17px 22px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2), var(--brand-3));
}

.home-result-header .result-label {
  color: rgba(255,255,255,.8);
}

.home-result-pair {
  margin-top: 4px;
  font-size: clamp(1.12rem, 5vw, 1.5rem);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.home-result-main {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 22px 22px 12px;
  text-align: center;
}

.home-progress-ring {
  position: relative;
  width: 142px;
  height: 142px;
}

.home-progress-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.home-progress-ring circle {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s ease-out;
}

.home-bg-circle {
  stroke: color-mix(in srgb, var(--brand) 14%, var(--line));
}

.home-progress-circle {
  stroke: var(--brand);
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
}

.home-score-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--brand);
  font-size: 2.15rem;
  font-weight: 900;
  letter-spacing: -.04em;
}

.home-result-copy h3 {
  margin: 0 0 3px;
  font-size: clamp(1.55rem, 6vw, 2.15rem);
  letter-spacing: -.04em;
}

.home-result-copy p {
  margin: 0;
  color: var(--muted);
}

.home-breakdown {
  padding: 6px 22px 20px;
}

.home-breakdown-item + .home-breakdown-item {
  margin-top: 12px;
}

.home-breakdown-label {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 5px;
  font-size: .9rem;
  font-weight: 720;
}

.home-breakdown-label strong {
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.home-breakdown-track {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, var(--surface-2));
}

.home-breakdown-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
  transition: width 1s ease-out;
}

.home-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 22px 10px;
}

.home-result-disclaimer {
  margin: 8px 22px 20px;
  color: var(--muted);
  font-size: .82rem;
}

/* Score guide */
.home-score-guide-card h2 {
  margin: 5px 0 16px;
  font-size: 1.4rem;
  line-height: 1.2;
  letter-spacing: -.03em;
}

.home-score-guide {
  display: grid;
  gap: 9px;
}

.home-score-guide div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface-2) 55%, var(--surface));
}

.home-score-guide b {
  color: var(--brand);
}

.home-score-guide span {
  text-align: right;
  color: var(--muted);
  font-size: .88rem;
}

.home-small-note {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: .88rem;
}

.home-mini-tool-link {
  margin-top: 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border-radius: 14px;
  background: var(--surface-2);
  text-decoration: none;
}

.home-mini-tool-link > span:first-child {
  font-size: 1.4rem;
}

.home-mini-tool-link strong,
.home-mini-tool-link small {
  display: block;
}

.home-mini-tool-link small {
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.35;
}

/* Article image */
.home-article-image {
  margin: 28px 0 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.home-article-image img {
  display: block;
  width: 100%;
}

/* Home-only loader decoration */
.home-loader-heart {
  font-size: 3rem;
  animation: homeLoaderBeat .8s ease-in-out infinite;
}

@keyframes homeLoaderBeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.22); }
}

@media (min-width: 640px) {
  .home-calculator-card {
    padding: 28px;
  }

  .home-name-grid {
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
  }

  .home-name-divider {
    margin-bottom: 25px;
  }

  .home-result-area {
    margin: 26px -28px -28px;
  }

  .home-result-main {
    grid-template-columns: auto 1fr;
    align-items: center;
    justify-items: stretch;
    text-align: left;
    gap: 22px;
  }
}

@media (min-width: 880px) {
  .home-tool-section {
    margin-top: -32px;
    padding-bottom: 54px;
  }

  .home-tool-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .home-score-guide-card {
    position: sticky;
    top: 92px;
  }
}

@media (max-width: 480px) {
  .home-result-actions .primary-btn,
  .home-result-actions .secondary-btn {
    width: 100%;
  }
}
