:root {
  --ink: #1f1714;
  --soft-ink: rgba(31, 23, 20, 0.82);
  --muted: #76665b;
  --copper: #9a5638;
  --copper-soft: rgba(154, 86, 56, 0.28);
  --paper: rgba(255, 250, 242, 0.78);
  --paper-strong: rgba(255, 252, 246, 0.93);
  --line: rgba(43, 31, 26, 0.18);
  --rose: #d9766e;
}

* {
  box-sizing: border-box;
}

html {
  background: #f4efe7;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(
      ellipse 75% 50% at 50% 0%,
      rgba(243, 160, 92, 0.48),
      rgba(243, 160, 92, 0.12) 42%,
      transparent 66%
    ),
    linear-gradient(rgba(246, 241, 232, 0.36), rgba(246, 241, 232, 0.74)),
    url("/comp-gap/assets/zodiac-engraving-bg.png") center top / cover no-repeat fixed,
    #f4efe7;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 17%, rgba(31, 23, 20, 0.16), transparent 240px),
    linear-gradient(
      90deg,
      rgba(255, 250, 242, 0.22),
      rgba(255, 250, 242, 0.76) 48%,
      rgba(255, 250, 242, 0.18)
    );
}

.shell {
  display: grid;
  gap: 34px;
  place-items: center;
  min-height: 100vh;
  padding: clamp(18px, 4vw, 54px);
}

.intro-card {
  width: min(100%, 560px);
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid rgba(35, 25, 21, 0.16);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 30px 80px rgba(35, 25, 21, 0.12);
  backdrop-filter: blur(9px);
  text-align: center;
}

.brand-mark {
  display: block;
  width: auto;
  height: 42px;
  margin: 0 auto 18px;
}

h1 {
  margin: 0 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 7vw, 58px);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: 0;
  word-spacing: -0.1em;
}

h1 em {
  font-style: italic;
}

.tagline {
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.01em;
}

.dob-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--copper);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
}

input,
select {
  min-height: 50px;
  width: 100%;
  border: 1px solid rgba(154, 86, 56, 0.28);
  border-radius: 12px;
  padding: 0 13px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.82);
  font: inherit;
  outline: none;
}

select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--copper) 50%) calc(100% - 18px) 21px / 7px 7px
      no-repeat,
    linear-gradient(135deg, var(--copper) 50%, transparent 50%) calc(100% - 13px) 21px / 7px 7px
      no-repeat,
    rgba(255, 253, 248, 0.82);
  padding: 0 38px 0 13px;
}

input:focus,
select:focus {
  border-color: rgba(154, 86, 56, 0.8);
  box-shadow: 0 0 0 3px rgba(217, 118, 110, 0.18);
}

.relationship-field {
  grid-column: 1 / -1;
}

button {
  grid-column: 1 / -1;
  min-height: 52px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: #fff9f0;
  background: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease;
}

button:hover {
  background: #3b2a23;
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.66;
  transform: none;
}

.status {
  min-height: 19px;
  margin: 14px 0 0;
  color: var(--copper);
  font-size: 13px;
}

.receipt-panel {
  width: min(100%, 900px);
}

.is-hidden {
  display: none;
}

.astro-receipt {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(38, 27, 22, 0.22);
  padding: clamp(22px, 4vw, 38px);
  background:
    linear-gradient(rgba(255, 252, 246, 0.91), rgba(255, 249, 241, 0.91)),
    url("/comp-gap/assets/zodiac-engraving-bg.png") center 30% / 150% auto no-repeat;
  box-shadow: 0 32px 88px rgba(35, 25, 21, 0.18);
}

.astro-receipt::before,
.astro-receipt::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(38, 27, 22, 0.14);
  pointer-events: none;
}

.astro-receipt::after {
  inset: 26px;
  border-color: rgba(154, 86, 56, 0.18);
}

.receipt-topline,
.receipt-hero,
.sign-strip,
.gap-section,
.chart-section,
.summary,
.receipt-list,
.note {
  position: relative;
  z-index: 1;
}

.receipt-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid rgba(38, 27, 22, 0.16);
  padding-bottom: 12px;
  color: var(--copper);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.receipt-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.receipt-logo {
  height: 15px;
  width: auto;
}

.receipt-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 24px;
  align-items: end;
  padding: 28px 0 22px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--copper);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 7vw, 74px);
  font-weight: 500;
  line-height: 0.96;
}

.gap-score {
  display: grid;
  min-height: 154px;
  align-content: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--copper-soft);
  background: rgba(255, 246, 237, 0.72);
  text-align: center;
}

.gap-score .score-line strong {
  display: block;
  color: var(--copper);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  line-height: 0.9;
}

.gap-score #matchScore {
  font-size: 48px;
}

.gap-score #gapScore {
  font-size: 28px;
  color: var(--ink);
}

.gap-score .score-line span {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gap-score .gap-line {
  border-top: 1px solid rgba(154, 86, 56, 0.25);
  padding-top: 10px;
}

.sign-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-block: 1px solid rgba(38, 27, 22, 0.16);
}

.sign-strip div {
  min-height: 74px;
  padding: 14px;
}

.sign-strip div + div {
  border-left: 1px solid rgba(38, 27, 22, 0.16);
}

.sign-strip span {
  display: block;
  margin-bottom: 6px;
  color: var(--copper);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.sign-strip strong {
  font-size: 22px;
}

.gap-section {
  display: grid;
  grid-template-columns: minmax(190px, 0.35fr) minmax(0, 0.65fr);
  gap: 18px;
  align-items: center;
  margin: 22px 0;
  padding: 16px;
  border: 1px solid var(--copper-soft);
  background: rgba(255, 250, 244, 0.66);
}

.gap-meter-wrap {
  display: grid;
  gap: 10px;
  align-content: center;
}

#gapMeterValue {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--copper);
}

.gap-meter {
  height: 18px;
  border: 1px solid rgba(154, 86, 56, 0.35);
  background:
    repeating-linear-gradient(90deg, transparent 0 33px, rgba(154, 86, 56, 0.18) 34px 35px),
    rgba(255, 244, 235, 0.76);
}

.gap-meter span {
  display: block;
  width: 35%;
  height: 100%;
  background: linear-gradient(90deg, rgba(154, 86, 56, 0.5), rgba(217, 118, 110, 0.9));
}

.gap-text {
  display: grid;
  gap: 12px;
}

#gapCopy {
  margin: 0;
  color: var(--soft-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1.12;
}

.song-line {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.01em;
}

.song-link {
  color: var(--copper);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.song-link:hover {
  color: #7e3f27;
}

.chart-section {
  display: grid;
  justify-items: center;
}

.radar {
  width: min(100%, 460px);
}

.radar svg {
  display: block;
  width: 100%;
}

.radar line,
.grid-poly {
  fill: none;
  stroke: rgba(154, 86, 56, 0.36);
  stroke-width: 1.4;
}

.grid-poly.faint {
  stroke-dasharray: 3 4;
}

.score-poly {
  fill: rgba(217, 118, 110, 0.22);
  stroke: var(--rose);
  stroke-width: 2;
}

.radar circle {
  fill: var(--rose);
}

/* axis names + levels now render inside the SVG; keep this list visually hidden for screen readers */
.axis-labels {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.axis-category {
  fill: var(--copper);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.axis-value {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.summary {
  max-width: 720px;
  margin: 22px auto 18px;
  color: var(--soft-ink);
  font-size: 16px;
  line-height: 1.65;
  text-align: center;
}

.receipt-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 20px;
  margin: 0;
  border-top: 1px solid rgba(38, 27, 22, 0.16);
}

.receipt-list div {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 12px;
  border-bottom: 1px solid rgba(38, 27, 22, 0.12);
  padding: 13px 0;
}

dt {
  color: var(--copper);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

dd {
  margin: 0;
  color: #3d2c26;
  font-size: 14px;
  line-height: 1.45;
}

.note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.ditto-cta {
  position: relative;
  z-index: 1;
  margin: 26px 0 0;
  padding-top: 24px;
  border-top: 1px solid rgba(38, 27, 22, 0.16);
  text-align: center;
}

.ditto-cta p {
  max-width: 540px;
  margin: 0 auto 22px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(21px, 3vw, 28px);
  line-height: 1.3;
}

.ditto-btn {
  display: inline-block;
  padding: 18px 46px;
  border-radius: 999px;
  background: var(--copper);
  color: #fff9f0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(154, 86, 56, 0.35);
  animation: ctaShake 3s ease-in-out infinite;
  transition: background 160ms ease;
}

.ditto-btn:hover {
  background: #7e3f27;
}

@keyframes ctaShake {
  0%,
  88%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  90% {
    transform: translateX(-3px) rotate(-2deg);
  }
  91% {
    transform: translateX(3px) rotate(2deg);
  }
  93% {
    transform: translateX(-3px) rotate(-2deg);
  }
  95% {
    transform: translateX(3px) rotate(2deg);
  }
  97% {
    transform: translateX(-2px) rotate(-1deg);
  }
  99% {
    transform: translateX(0) rotate(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ditto-btn {
    animation: none;
  }
}

@media (max-width: 760px) {
  .shell {
    align-content: center;
  }

  .dob-form,
  .receipt-hero,
  .sign-strip,
  .gap-section,
  .chart-section,
  .receipt-list {
    grid-template-columns: 1fr;
  }

  .receipt-hero {
    align-items: stretch;
  }

  .gap-score {
    min-height: 128px;
  }

  .chart-section {
    justify-items: center;
  }

  .axis-labels {
    width: 100%;
  }

  .sign-strip div + div {
    border-left: 0;
    border-top: 1px solid rgba(38, 27, 22, 0.16);
  }
}

@media (max-width: 460px) {
  .shell {
    padding: 14px;
  }

  .intro-card,
  .astro-receipt {
    padding: 24px;
  }

  h1 {
    font-size: 38px;
  }

  .radar {
    width: 100%;
  }

  .receipt-list div {
    grid-template-columns: 1fr;
  }
}
