:root {
  --bg: #FBF6EC;
  --bg-2: #F4ECDC;
  --surface: #FFFDF8;
  --primary: #3D7A4A;
  --primary-2: #2E5E39;
  --primary-soft: rgba(61, 122, 74, 0.10);
  --accent: #C2873B;
  --accent-soft: rgba(194, 135, 59, 0.14);
  --text: #2B2620;
  --muted: #756E62;
  --line: rgba(61, 122, 74, 0.18);
  --line-soft: rgba(43, 38, 32, 0.10);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 48px -24px rgba(46, 94, 57, 0.45);
  --shadow-sm: 0 8px 24px -16px rgba(46, 94, 57, 0.4);
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--bg-2), transparent 60%),
    var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, rgba(194,135,59,0.55), transparent),
    radial-gradient(1.2px 1.2px at 78% 12%, rgba(61,122,74,0.45), transparent),
    radial-gradient(1.6px 1.6px at 42% 32%, rgba(194,135,59,0.4), transparent),
    radial-gradient(1.1px 1.1px at 88% 44%, rgba(43,38,32,0.25), transparent),
    radial-gradient(1.5px 1.5px at 22% 62%, rgba(61,122,74,0.35), transparent),
    radial-gradient(1.2px 1.2px at 66% 78%, rgba(194,135,59,0.4), transparent);
  opacity: 0.7;
}

.shell {
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  padding: 0 22px;
  position: relative;
  z-index: 1;
}

/* ---------- header ---------- */
.site-header {
  position: relative;
  z-index: 1;
  padding: 22px 0 6px;
}
.site-header .shell {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand-mark {
  color: var(--accent);
  font-size: 1.35rem;
  line-height: 1;
}
.brand-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: 0.2px;
}
.brand-tag {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- hero ---------- */
.hero {
  padding: 30px 0 8px;
  text-align: center;
}
.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary-2);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 5.2vw, 3.1rem);
  line-height: 1.12;
  margin: 0 auto 16px;
  max-width: 18ch;
  letter-spacing: -0.3px;
}
.hero h1 .accent {
  color: var(--primary);
  font-style: italic;
}
.lede {
  max-width: 56ch;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 1.06rem;
}

/* ---------- form card ---------- */
.ask-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  max-width: 560px;
  margin: 0 auto;
  text-align: left;
  display: grid;
  gap: 20px;
}
.field { display: grid; gap: 9px; }
.field label,
.field-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}
input[type="date"] {
  font-family: var(--sans);
  font-size: 1.02rem;
  color: var(--text);
  padding: 13px 15px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: #fff;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="date"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* segmented period selector */
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  padding: 6px;
}
.seg {
  position: relative;
  text-align: center;
  border-radius: 9px;
  cursor: pointer;
}
.seg input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.seg span {
  display: block;
  padding: 11px 8px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--muted);
  transition: all 0.15s ease;
}
.seg input:hover + span { color: var(--primary-2); }
.seg input:checked + span {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.seg input:focus-visible + span {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  padding: 15px 20px;
  cursor: pointer;
  transition: background 0.15s, transform 0.08s;
}
.btn-primary:hover { background: var(--primary-2); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }

.form-error {
  margin: -4px 0 0;
  color: #b3402e;
  font-size: 0.94rem;
  font-weight: 500;
}

/* ---------- loader ---------- */
.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 0 10px;
  color: var(--muted);
}
.orbit {
  width: 46px;
  height: 46px;
  border: 2px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  position: relative;
}
.orbit span {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: var(--accent);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- result ---------- */
.result { padding-top: 34px; }
.horoscope-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
  animation: rise 0.4s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.hc-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
}
.hc-glyph {
  flex: none;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 2.2rem;
  color: var(--primary);
  background: radial-gradient(circle at 30% 30%, #fff, var(--bg-2));
  border: 1px solid var(--line);
}
.hc-sign {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.7rem;
  margin: 0 0 4px;
}
.hc-meta { margin: 0; color: var(--muted); font-size: 0.94rem; }
.hc-intro {
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--primary-2);
  margin: 0 0 24px;
}
.hc-sections { display: grid; gap: 20px; }
.hc-section h3 {
  font-family: var(--serif);
  font-size: 1.12rem;
  margin: 0 0 6px;
  color: var(--text);
}
.hc-section h3::before {
  content: "✦";
  color: var(--accent);
  margin-right: 8px;
  font-size: 0.85em;
}
.hc-section p { margin: 0; color: var(--text); }

.hc-advice {
  margin-top: 26px;
  padding: 18px 20px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.hc-advice-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.hc-advice-text { margin: 0; font-size: 1.02rem; }

.hc-cache {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hc-cache::before { content: "♻"; color: var(--primary); }

/* ---------- wheel ---------- */
.wheel { padding: 56px 0 10px; }
.wheel-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.4rem;
  text-align: center;
  margin: 0 0 24px;
}
.wheel-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.wheel-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 16px 8px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  text-align: center;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.wheel-item .glyph { font-size: 1.7rem; color: var(--primary); }
.wheel-name { font-weight: 600; font-size: 0.92rem; }
.wheel-dates { font-size: 0.74rem; color: var(--muted); }
.wheel-item.is-active {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-3px);
}
.wheel-item.is-active .glyph { color: var(--primary-2); }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 56px;
  padding: 26px 0 40px;
  border-top: 1px solid var(--line-soft);
}
.site-footer p {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
}

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .wheel-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .ask-card { padding: 20px; }
  .horoscope-card { padding: 22px; }
  .hc-head { gap: 14px; }
  .hc-glyph { width: 60px; height: 60px; font-size: 1.9rem; }
  .wheel-grid { grid-template-columns: repeat(2, 1fr); }
}
