*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --sky-deep: oklch(12% 0.04 275);
  --sky-surface: oklch(20% 0.04 278);
  --green: oklch(42% 0.1 162);
  --green-glow: oklch(50% 0.12 162);
  --green-dim: oklch(30% 0.06 162);
  --green-deep: oklch(18% 0.05 162);
  --gold: oklch(82% 0.1 85);
  --gold-dim: oklch(65% 0.06 85);
  --text: oklch(93% 0.008 80);
  --text-secondary: oklch(72% 0.02 275);
  --text-muted: oklch(58% 0.02 275);
  --card-bg: oklch(17% 0.035 278);
  --card-border: oklch(30% 0.04 275);
  --card-border-bright: oklch(40% 0.05 275);
  --btn-text: oklch(98% 0.02 162);
  --cta-text: oklch(72% 0.015 162);
  --cta-text-muted: oklch(62% 0.015 162);
  --green-advice: oklch(62% 0.10 162);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

body {
  font-family: 'Lato', system-ui, -apple-system, sans-serif;
  background: var(--sky-deep);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100dvh;
}

/* --- Stars --- */
#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: var(--text);
  opacity: 0.3;
  animation: twinkle ease-in-out infinite alternate;
}

.star--bright {
  background: var(--gold);
  opacity: 0.6;
  box-shadow: 0 0 4px var(--gold-dim);
}

@keyframes twinkle {
  from { opacity: 0.15; transform: scale(0.8); }
  to { opacity: 0.7; transform: scale(1.2); }
}

/* --- Layout --- */
main {
  position: relative;
  z-index: 1;
}

section {
  padding-inline: 1.5rem;
}

/* --- Hero --- */
.hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-block: 3rem;
  position: relative;
  background:
    radial-gradient(ellipse 90% 50% at 50% 0%, oklch(22% 0.10 280 / 0.5), transparent),
    radial-gradient(ellipse 40% 45% at 75% 55%, oklch(20% 0.08 300 / 0.3), transparent),
    radial-gradient(ellipse 50% 30% at 20% 70%, oklch(18% 0.06 200 / 0.15), transparent);
}

.hero__clover {
  display: none;
}

.hero__logo {
  position: relative;
  z-index: 1;
  height: clamp(28px, 5vw, 40px);
  width: auto;
  opacity: 0.5;
  margin-bottom: 3.5rem;
  animation: heroFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero__title {
  position: relative;
  z-index: 1;
  font-family: 'Young Serif', 'Georgia', serif;
  font-size: clamp(2.6rem, 9vw, 5.5rem);
  font-weight: 400;
  line-height: 1.08;
  color: var(--text);
  max-width: 12ch;
  margin-bottom: 1.5rem;
  animation: heroFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.hero__sub {
  position: relative;
  z-index: 1;
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 28ch;
  margin-bottom: 4rem;
  line-height: 1.6;
  animation: heroFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

.hero__sub::before {
  content: '✦';
  display: block;
  font-size: 0.6rem;
  color: var(--gold-dim);
  letter-spacing: 1em;
  margin-bottom: 1.25rem;
  opacity: 0.6;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Date form --- */
.date-form {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 320px;
  animation: heroFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

.date-form__label {
  width: 100%;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.date-form__selects {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.date-form__select {
  flex: 1;
  width: 0;
  min-width: 0;
  padding: 0.9rem 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background-color: var(--sky-surface);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  color-scheme: dark;
  cursor: pointer;
}

.date-form__select:invalid {
  color: var(--text-muted);
}

.date-form__select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px oklch(42% 0.1 162 / 0.15);
}

#birth-month {
  flex: 1.8;
}

/* --- Seeking selector --- */
.seeking {
  width: 100%;
  border: none;
  padding: 0;
  margin-top: 0.5rem;
}

.seeking__legend {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
  width: 100%;
}

.seeking__optional {
  opacity: 0.6;
}

.seeking__options {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.seeking__btn {
  flex: 1;
  padding: 0.55rem 0.25rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--card-border);
  border-radius: 100px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.seeking__btn:hover {
  color: var(--text);
  border-color: var(--card-border-bright);
}

.seeking__btn--active {
  color: var(--text);
  background: var(--sky-surface);
  border-color: var(--gold-dim);
}

.seeking__btn:focus-visible {
  outline: 2px solid var(--green-glow);
  outline-offset: 2px;
}

.date-form__btn {
  width: 100%;
  padding: 1rem 2rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--btn-text);
  background: var(--green);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.3s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 0 24px -4px oklch(42% 0.1 162 / 0.3);
}

.date-form__btn:hover {
  background: var(--green-glow);
  box-shadow: 0 0 32px -4px oklch(50% 0.12 162 / 0.45);
}

.date-form__btn:active {
  transform: scale(0.97);
}

.date-form__btn:focus-visible {
  outline: 2px solid var(--green-glow);
  outline-offset: 2px;
}

/* --- Result --- */
.result {
  padding-block: 4rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(2.5rem) scale(0.97);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.result--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* --- Horoscope card --- */
.card {
  width: 100%;
  max-width: 400px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 3px;
  padding: 3rem 2rem 2rem;
  position: relative;
  text-align: center;
  outline: 1px solid var(--card-border);
  outline-offset: 6px;
  box-shadow:
    0 0 80px -15px oklch(42% 0.1 162 / 0.15),
    0 25px 70px -20px oklch(12% 0.04 275 / 0.6);
}

.card__corner {
  position: absolute;
  font-size: 0.7rem;
  color: var(--gold);
  opacity: 0.4;
  line-height: 1;
}

.card__corner--tl { top: 12px; left: 14px; }
.card__corner--br { bottom: 12px; right: 14px; }

img.card__corner {
  width: 16px;
  height: auto;
  opacity: 0.2;
}

img.card__corner.card__corner--tr { top: 12px; right: 14px; }
img.card__corner.card__corner--bl { bottom: 12px; left: 14px; }

.card__symbol {
  font-size: 3.2rem;
  line-height: 1;
  margin-bottom: 0.75rem;
  color: var(--gold);
  text-shadow:
    0 0 20px oklch(80% 0.1 85 / 0.3),
    0 0 50px oklch(80% 0.08 85 / 0.12);
}

.card__name {
  font-family: 'Young Serif', 'Georgia', serif;
  font-size: clamp(1.6rem, 5.5vw, 2rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 0.4rem;
  overflow-wrap: break-word;
  outline: none;
}

.card__tagline {
  font-size: 0.9rem;
  color: var(--gold-dim);
  font-style: italic;
  margin-bottom: 2rem;
  line-height: 1.45;
  padding-inline: 0.25rem;
}

.card__divider {
  width: 4rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  margin: 0 auto 2rem;
}

.card__section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.6rem;
}

.card__personality {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  text-align: left;
  margin-bottom: 2.25rem;
}

.card__prophecy {
  font-family: 'Young Serif', 'Georgia', serif;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.6;
  text-align: left;
  margin-bottom: 1.5rem;
}

.card__seeking {
  font-family: 'Young Serif', 'Georgia', serif;
  font-size: 0.9rem;
  color: var(--gold-dim);
  line-height: 1.5;
  text-align: center;
  margin-bottom: 1.25rem;
  font-style: italic;
}

.card__advice {
  font-size: 0.85rem;
  color: var(--green-advice);
  line-height: 1.6;
  text-align: center;
  padding: 1.5rem 0.75rem 0.75rem;
  border-top: 1px solid oklch(30% 0.05 162 / 0.4);
  font-style: italic;
}

/* --- Share button --- */
.share-btn {
  margin-top: 1.5rem;
  padding: 0.85rem 1.5rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--card-border);
  border-radius: 100px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.share-btn:hover {
  color: var(--text);
  border-color: var(--card-border-bright);
}

.share-btn:focus-visible {
  outline: 2px solid var(--green-glow);
  outline-offset: 2px;
}

.retry-btn {
  margin-top: 0.75rem;
  border: none;
  opacity: 0.7;
}

.retry-btn:hover {
  opacity: 1;
}

/* --- CTA section --- */
.cta {
  padding-block: 2rem 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cta__inner {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin-top: 1rem;
  padding: 2.75rem 1.75rem 2.25rem;
  background:
    radial-gradient(ellipse 120% 80% at 50% 100%, oklch(25% 0.09 162 / 0.4), transparent),
    radial-gradient(ellipse 80% 40% at 50% 0%, oklch(20% 0.06 275 / 0.3), transparent),
    var(--green-deep);
  border: 1px solid oklch(32% 0.07 162 / 0.5);
  border-radius: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.cta__clover {
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 140px;
  height: auto;
  opacity: 0.06;
  pointer-events: none;
}

.cta__lead {
  position: relative;
  font-family: 'Young Serif', 'Georgia', serif;
  font-size: clamp(1.25rem, 4.5vw, 1.6rem);
  font-weight: 400;
  color: var(--text);
  margin-bottom: 0.6rem;
  max-width: 22ch;
  line-height: 1.3;
}

.cta__pitch {
  position: relative;
  font-size: 0.9rem;
  color: var(--cta-text);
  max-width: 32ch;
  margin-bottom: 2.25rem;
  line-height: 1.6;
}

.cta__swish-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2.5rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--btn-text);
  background: var(--green);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s, box-shadow 0.3s;
  -webkit-tap-highlight-color: transparent;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 30px -4px oklch(42% 0.1 162 / 0.35);
}

.cta__swish-btn:hover {
  background: var(--green-glow);
  box-shadow: 0 0 40px -4px oklch(50% 0.12 162 / 0.5);
}

.cta__swish-btn:active {
  transform: scale(0.97);
}

.cta__swish-btn:focus-visible {
  outline: 2px solid var(--green-glow);
  outline-offset: 2px;
}

.cta__adult,
.cta__minor {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cta__next-steps {
  position: relative;
  font-size: 0.8rem;
  color: var(--cta-text-muted);
  font-style: italic;
  margin-bottom: 1rem;
  max-width: 30ch;
  line-height: 1.5;
}

.cta__manual {
  position: relative;
  font-size: 0.8rem;
  color: var(--cta-text-muted);
  line-height: 1.7;
  max-width: 32ch;
  text-align: center;
}

.cta__manual strong {
  color: oklch(75% 0.02 162);
  font-weight: 600;
}

.cta__divider {
  position: relative;
  width: 2.5rem;
  height: 1px;
  background: oklch(30% 0.05 162 / 0.5);
  margin: 1.5rem auto;
}

.cta__fine-print {
  position: relative;
  font-size: 0.75rem;
  color: var(--cta-text-muted);
  max-width: 32ch;
  line-height: 1.55;
}

.cta__fine-print a {
  color: oklch(65% 0.02 162);
  text-decoration: underline;
  text-underline-offset: 2px;
  padding-block: 0.25rem;
}

.cta__fine-print a:focus-visible {
  outline: 2px solid var(--green-glow);
  outline-offset: 2px;
}

/* --- Footer --- */
.footer {
  padding: 4rem 1.5rem 3.5rem;
  text-align: center;
  display: flex;
  justify-content: center;
}

.footer__logo-link {
  display: inline-block;
  padding: 0.75rem;
  opacity: 0.35;
  transition: opacity 0.2s;
}

.footer__logo-link:hover {
  opacity: 0.6;
}

.footer__logo-link:focus-visible {
  outline: 2px solid var(--green-glow);
  outline-offset: 4px;
  opacity: 0.6;
}

.footer__logo {
  height: 32px;
  width: auto;
}

/* --- Swish hint --- */
.cta__swish-hint {
  font-size: 0.8rem;
  color: var(--cta-text-muted);
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

/* --- QR block --- */
.cta__qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.cta__qr-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--cta-text);
}

.cta__qr-img {
  width: 180px;
  height: 180px;
  border-radius: 12px;
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 100px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- Utility --- */
[hidden] {
  display: none !important;
}

/* --- Media queries --- */
@media (min-width: 640px) {
  section {
    padding-inline: 2.5rem;
  }

  .card {
    max-width: 440px;
    padding: 3.5rem 3rem 2.5rem;
  }

  .cta__inner {
    padding: 3rem 3rem 2.75rem;
  }
}

@media (min-width: 1024px) {
  .hero {
    background:
      radial-gradient(ellipse 65% 45% at 50% 0%, oklch(22% 0.10 280 / 0.5), transparent),
      radial-gradient(ellipse 30% 35% at 80% 50%, oklch(20% 0.08 300 / 0.3), transparent),
      radial-gradient(ellipse 35% 25% at 15% 65%, oklch(18% 0.06 200 / 0.15), transparent);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .star { animation: none; opacity: 0.3; }
  .result { transition: none; }
  .hero__logo,
  .hero__title,
  .hero__sub,
  .date-form { animation: none; }
  html { scroll-behavior: auto; }
}
