:root {
  color-scheme: dark;
  --bg: #070a19;
  --bg-2: #101734;
  --surface: rgba(14, 19, 45, 0.82);
  --surface-strong: rgba(20, 27, 63, 0.94);
  --text: #f7f1df;
  --muted: #b9b8cf;
  --line: rgba(231, 199, 120, 0.24);
  --gold: #e8c46b;
  --gold-2: #ffdf8a;
  --violet: #8d6cff;
  --blue: #4da4ff;
  --error: #ff8a8a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f3ec;
  --bg-2: #ebe7f7;
  --surface: rgba(255, 253, 247, 0.88);
  --surface-strong: rgba(255, 252, 244, 0.96);
  --text: #171629;
  --muted: #5c5b72;
  --line: rgba(108, 81, 34, 0.22);
  --gold: #9f6d1f;
  --gold-2: #c99330;
  --violet: #654ee2;
  --blue: #1d66b2;
  --shadow: 0 20px 60px rgba(41, 31, 74, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(7, 10, 25, 0.7), var(--bg) 58%),
    url("assets/celestial-hero.png") top center / min(1800px, 160vw) auto no-repeat,
    radial-gradient(circle at 80% 0%, rgba(141, 108, 255, 0.22), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

[data-theme="light"] body {
  background:
    linear-gradient(180deg, rgba(247, 243, 236, 0.74), var(--bg) 62%),
    url("assets/celestial-hero.png") top center / min(1800px, 160vw) auto no-repeat,
    radial-gradient(circle at 80% 0%, rgba(141, 108, 255, 0.16), transparent 34%),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.82) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(232, 196, 107, 0.75) 1px, transparent 1.5px);
  background-position: 12px 42px, 80px 120px;
  background-size: 160px 160px, 230px 230px;
  opacity: 0.42;
  animation: drift-stars 24s linear infinite;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 14px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid rgba(232, 196, 107, 0.12);
  background: rgba(7, 10, 25, 0.76);
  backdrop-filter: blur(18px);
}

[data-theme="light"] .site-header {
  background: rgba(247, 243, 236, 0.78);
}

.brand,
.site-header nav,
.primary-action,
.submit-button,
.outline-button,
.share-actions button,
.history-head button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold-2);
}

.wheel-sign {
  position: absolute;
  color: var(--muted);
  font-size: clamp(0.55rem, 1.6vw, 0.75rem);
  font-weight: 800;
  transform: translate(-50%, -50%);
}

.site-header nav {
  gap: clamp(10px, 3vw, 28px);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-header nav a:hover {
  color: var(--gold-2);
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--gold-2);
  cursor: pointer;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 440px);
  align-items: center;
  min-height: calc(100svh - 72px);
  padding: clamp(72px, 10vw, 130px) clamp(20px, 6vw, 88px) clamp(54px, 8vw, 90px);
  overflow: hidden;
}

.hero-content {
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold-2);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.1rem, 8vw, 6.9rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero p:not(.eyebrow) {
  max-width: 660px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.7;
}

.primary-action,
.submit-button,
.outline-button,
.share-actions button {
  min-height: 48px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.primary-action,
.submit-button {
  gap: 12px;
  margin-top: 18px;
  padding: 0 24px;
  border: 1px solid rgba(255, 223, 138, 0.55);
  background: linear-gradient(135deg, var(--gold-2), #b88734);
  color: #17110b;
  font-weight: 850;
  box-shadow: 0 14px 34px rgba(232, 196, 107, 0.22);
}

.primary-action:hover,
.submit-button:hover,
.outline-button:hover,
.share-actions button:hover,
.icon-button:hover {
  transform: translateY(-2px);
}

.hero-orbit {
  position: relative;
  justify-self: center;
  width: min(36vw, 420px);
  min-width: 260px;
  aspect-ratio: 1;
}

.orbit-ring,
.orbit-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.orbit-ring {
  border: 1px solid rgba(232, 196, 107, 0.35);
  animation: rotate 28s linear infinite;
}

.ring-one::before,
.ring-two::before {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--gold-2);
  box-shadow: 0 0 24px var(--gold-2);
}

.ring-one::before {
  top: 16%;
  left: 18%;
}

.ring-two {
  inset: 14%;
  border-color: rgba(141, 108, 255, 0.5);
  animation-duration: 18s;
  animation-direction: reverse;
}

.ring-two::before {
  right: 8%;
  bottom: 24%;
  background: var(--violet);
  box-shadow: 0 0 22px var(--violet);
}

.orbit-core {
  inset: 30%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: radial-gradient(circle, rgba(255, 223, 138, 0.18), rgba(141, 108, 255, 0.12), transparent 70%);
}

section {
  padding: clamp(54px, 8vw, 92px) clamp(20px, 6vw, 88px);
}

.section-heading {
  max-width: 820px;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 4.2vw, 4rem);
  letter-spacing: 0;
}

.workspace,
.results-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(300px, 1.05fr);
  gap: 24px;
  align-items: stretch;
}

.calc-form,
.wheel-panel,
.profile-panel,
.actions-panel,
.results-empty,
.info-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.calc-form {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 4vw, 34px);
}

.calc-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 700;
}

.calc-form small {
  color: var(--gold);
  font-weight: 650;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

[data-theme="light"] input {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(35, 29, 55, 0.14);
}

input:focus {
  border-color: var(--gold-2);
  box-shadow: 0 0 0 4px rgba(232, 196, 107, 0.14);
}

.form-error {
  min-height: 22px;
  margin: 0;
  color: var(--error);
  font-weight: 700;
}

.submit-button {
  width: 100%;
  margin-top: 0;
}

.wheel-panel {
  display: grid;
  align-content: center;
  gap: 18px;
  min-height: 520px;
  padding: clamp(20px, 4vw, 34px);
}

.zodiac-wheel {
  --sun-angle: 0deg;
  --asc-angle: 180deg;
  position: relative;
  width: min(100%, 520px);
  aspect-ratio: 1;
  margin: auto;
  border-radius: 50%;
  background:
    conic-gradient(from -90deg, rgba(232, 196, 107, 0.24), rgba(141, 108, 255, 0.14), rgba(77, 164, 255, 0.18), rgba(232, 196, 107, 0.24)),
    repeating-conic-gradient(from -90deg, transparent 0deg 28deg, rgba(255, 255, 255, 0.24) 28deg 30deg);
  border: 1px solid rgba(232, 196, 107, 0.38);
  box-shadow: inset 0 0 34px rgba(0, 0, 0, 0.26), 0 0 60px rgba(141, 108, 255, 0.16);
}

.zodiac-wheel::before,
.zodiac-wheel::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 49%;
  border-radius: 99px;
  transform-origin: 50% 0;
}

.zodiac-wheel::before {
  background: linear-gradient(var(--gold-2), transparent);
  transform: rotate(var(--sun-angle));
}

.zodiac-wheel::after {
  background: linear-gradient(var(--violet), transparent);
  transform: rotate(var(--asc-angle));
}

.wheel-center {
  position: absolute;
  inset: 31%;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-strong);
}

.wheel-center span,
.profile-stats span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.wheel-center strong {
  color: var(--gold-2);
  font-size: clamp(1rem, 2.8vw, 1.5rem);
}

.wheel-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border-radius: 50%;
}

.sun-dot {
  background: var(--gold-2);
}

.asc-dot {
  background: var(--violet);
}

.results-empty {
  padding: 28px;
  color: var(--muted);
}

.profile-panel,
.actions-panel {
  padding: clamp(20px, 4vw, 34px);
}

.profile-head,
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.profile-head h3 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  letter-spacing: 0;
}

.accuracy {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--gold-2);
  font-size: 0.78rem;
  font-weight: 800;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 26px 0;
}

.profile-stats div {
  min-height: 96px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

[data-theme="light"] .profile-stats div {
  background: rgba(255, 255, 255, 0.62);
}

.profile-stats strong {
  display: block;
  margin-top: 8px;
  color: var(--gold-2);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
}

.interpretation {
  color: var(--muted);
  line-height: 1.78;
}

.interpretation h4 {
  margin: 22px 0 8px;
  color: var(--text);
}

.actions-panel {
  align-self: start;
}

.actions-panel h3 {
  margin-bottom: 14px;
}

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

.share-actions button,
.outline-button,
.history-head button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.outline-button {
  width: 100%;
  margin: 14px 0 24px;
}

.history-panel {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.history-head h3 {
  margin: 0;
}

.history-head button {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  cursor: pointer;
}

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.history-item {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.history-item strong,
.history-item span {
  display: block;
}

.history-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

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

.info-grid article {
  padding: clamp(22px, 4vw, 34px);
}

.info-grid p,
.site-footer {
  color: var(--muted);
  line-height: 1.75;
}

.site-footer {
  padding: 28px clamp(20px, 6vw, 88px) 44px;
  border-top: 1px solid rgba(232, 196, 107, 0.12);
  font-size: 0.92rem;
}

.sky span {
  position: fixed;
  pointer-events: none;
}

.star {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-2);
  box-shadow: 0 0 18px var(--gold-2);
  animation: pulse 3.8s ease-in-out infinite;
}

.star-a {
  left: 17%;
  top: 23%;
}

.star-b {
  right: 18%;
  top: 34%;
  animation-delay: 1s;
}

.star-c {
  left: 72%;
  top: 14%;
  animation-delay: 2s;
}

.constellation {
  width: 150px;
  height: 90px;
  opacity: 0.42;
  background:
    linear-gradient(22deg, transparent 16%, rgba(232, 196, 107, 0.44) 17%, transparent 19%),
    linear-gradient(150deg, transparent 35%, rgba(141, 108, 255, 0.38) 36%, transparent 38%),
    radial-gradient(circle at 18% 62%, var(--gold-2) 0 2px, transparent 3px),
    radial-gradient(circle at 48% 34%, var(--gold-2) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 70%, var(--gold-2) 0 2px, transparent 3px);
  animation: float-constellation 9s ease-in-out infinite;
}

.constellation-a {
  left: 7%;
  top: 52%;
}

.constellation-b {
  right: 8%;
  top: 62%;
  transform: scale(0.82) rotate(18deg);
  animation-delay: 1.4s;
}

.constellation-c {
  right: 24%;
  top: 18%;
  transform: scale(0.62) rotate(-16deg);
  animation-delay: 2.6s;
}

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

@keyframes drift-stars {
  to {
    background-position: 172px 202px, 310px 350px;
  }
}

@keyframes pulse {
  50% {
    opacity: 0.35;
    transform: scale(1.8);
  }
}

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

@media (max-width: 920px) {
  .site-header nav {
    display: none;
  }

  .hero,
  .workspace,
  .results-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-orbit {
    width: min(80vw, 360px);
  }

  .profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .site-header {
    min-height: 64px;
  }

  h1 {
    font-size: clamp(2.7rem, 15vw, 4.4rem);
  }

  .profile-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-stats,
  .share-actions {
    grid-template-columns: 1fr;
  }

  .wheel-panel {
    min-height: 380px;
  }
}

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

@media print {
  body {
    background: #fff;
    color: #111;
  }

  .site-header,
  .hero,
  .calculator-shell,
  .actions-panel,
  .info-section,
  .site-footer,
  .sky,
  .results-empty {
    display: none !important;
  }

  .results-section {
    padding: 0;
  }

  .results-grid {
    display: block;
  }

  .profile-panel {
    box-shadow: none;
    border: 0;
    color: #111;
  }
}
