:root {
  --bg: #0b1020;
  --bg-2: #121a33;
  --panel: rgba(16, 24, 48, 0.88);
  --line: rgba(212, 175, 106, 0.22);
  --gold: #d4af6a;
  --gold-2: #f0d9a0;
  --text: #e8e4d9;
  --muted: #9aa3b8;
  --muted-dim: color-mix(in srgb, var(--muted) 32%, black);
  --danger: #e07a6a;
  --ok: #7dcea0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(80, 100, 180, 0.25), transparent 50%),
    radial-gradient(ellipse at 90% 10%, rgba(212, 175, 106, 0.08), transparent 40%),
    linear-gradient(180deg, #0b1020 0%, #070b16 100%);
}

.top {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 24px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.top-nav {
  display: flex;
  flex: 1;
  justify-content: flex-end;
  gap: 16px;
}

.top-nav a,
.drawer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.top-nav a.active,
.top-nav a:hover,
.drawer-nav a.active,
.drawer-nav a:hover {
  color: var(--gold);
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin: 0;
  margin-left: auto;
  padding: 10px;
  background: transparent;
  color: var(--gold);
  border: 0;
  border-radius: 8px;
}

.menu-toggle:hover { filter: none; background: rgba(212, 175, 106, 0.08); }

.menu-toggle-bar {
  display: block;
  height: 1.5px;
  width: 100%;
  background: currentColor;
  border-radius: 1px;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(7, 11, 22, 0.55);
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  width: min(300px, 86vw);
  height: 100%;
  padding: 28px 24px 32px;
  background: #101830;
  border-left: 1px solid var(--line);
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.28);
}

.drawer-label {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-size: 18px;
}

body.menu-open { overflow: hidden; }

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 24px 64px;
}

h1, h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  margin: 0 0 8px;
}

h1 { font-size: 36px; }
h2 { font-size: 26px; color: var(--gold-2); }

.person-name {
  color: var(--gold-2);
  margin: 8px 0 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h2 {
  margin-bottom: 0;
}

.panel-head .person-name {
  margin: 0;
}

.lede, .hint, .birth-line, .dasha-line {
  color: var(--muted);
  margin: 0 0 16px;
}

.birth-line {
  margin: 4px 0 6px;
}

.dasha-line {
  margin: 0 0 12px;
}

.eclipse-line {
  color: var(--muted);
  margin: 0 0 10px;
}

.eclipse-hint {
  color: var(--muted);
  font-size: 0.92em;
  margin: 0 0 12px;
}

.eclipse-line:last-child {
  margin-bottom: 0;
}

.panel-head-rule {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.sade-home-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.eclipse-kind {
  color: var(--gold-2);
  font-weight: 600;
}

.eclipse-kind-lunar {
  color: var(--gold);
}

.eclipse-all {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.eclipse-all:hover {
  color: var(--gold);
}

.year-nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 8px;
}

.year-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.year-nav a:hover {
  color: var(--gold);
}

.year-current {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 26px;
  font-weight: 500;
  color: var(--gold-2);
}

.year-nav-spacer {
  min-width: 4.5em;
}

.eclipse-card {
  padding-right: 0;
}

.eclipse-meta {
  margin: 0;
  color: var(--muted);
}

.eclipse-corridor {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.eclipse-corridor:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.eclipse-corridor.is-past {
  opacity: 0.55;
}

.eclipse-corridor-span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.eclipse-corridor-events {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  color: var(--muted);
}

.eclipse-corridor-events li {
  padding: 6px 0;
}

.eclipse-glyph {
  display: inline-block;
  width: 1.15em;
  margin-right: 0.35em;
  color: var(--gold-2);
  font-weight: 400;
}

.eclipse-corridor-events li.is-adjacent {
  opacity: 0.7;
}

.eclipse-corridor-now {
  color: var(--gold-2);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 28px;
  margin: 18px 0;
}

.panel-plain {
  border: none;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

input {
  background: #0c1224;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}

input:focus {
  outline: 1px solid var(--gold);
}

.field-select {
  display: block;
  background: #0c1224;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding-right: 10px;
  overflow: hidden;
}

.field-select:focus-within {
  outline: 1px solid var(--gold);
}

.field-select input[type="date"],
.field-select input[type="time"] {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 10px 8px 10px 12px;
  outline: none;
}

.field-select input[type="date"]::-webkit-calendar-picker-indicator,
.field-select input[type="time"]::-webkit-calendar-picker-indicator {
  margin: 0;
}

.form button[type="submit"] {
  display: block;
  width: 100%;
  margin: 8px 0 32px;
}

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row.three { grid-template-columns: 1fr 1fr 1fr; }

button,
a.btn {
  background: var(--gold);
  color: #1a1408;
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

button:hover,
a.btn:hover { filter: brightness(1.05); }

.landing-hero { margin-top: 8px; }

.landing-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.landing-actions { margin: 20px 0 8px; }

.landing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 8px 0 24px;
}

.landing-card {
  display: block;
  text-decoration: none;
  color: inherit;
  margin: 0;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.landing-card h2 { margin-bottom: 8px; }

.landing-card p {
  margin: 0;
  color: var(--muted);
}

.landing-card:hover { border-color: var(--gold); }

.guest-cta {
  color: var(--muted);
  margin: 0 0 16px;
}

.guest-cta a { color: var(--gold); }

.banner.error {
  background: rgba(224, 122, 106, 0.12);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
}

.geo-results {
  list-style: none;
  margin: -8px 0 12px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c1224;
  max-height: 220px;
  overflow: auto;
}

.geo-results li {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}

.geo-results li:hover { background: #182244; }

.geo-results li.geo-empty {
  cursor: default;
  color: var(--muted);
}

.geo-results li.geo-empty:hover { background: transparent; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--muted-dim);
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tr.slow td { color: var(--gold-2); }
td.planet {
  font-weight: 600;
  white-space: nowrap;
  min-width: 13.5em;
}
a.planet-link {
  color: inherit;
  text-decoration: none;
}
a.planet-link:hover {
  color: var(--gold);
}
.remain {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.92em;
}
tr.slow td.remain,
tr.slow .remain {
  color: rgba(232, 228, 217, 0.62);
}
.sign-icon {
  font-size: 1.05em;
}
td.house { font-variant-numeric: tabular-nums; font-size: 18px; }
.col-alert { width: 44px; padding-left: 4px; padding-right: 4px; }
.alert-cell { text-align: center; vertical-align: middle; }
.alert-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--muted-dim);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.alert-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  filter: none;
}
.alert-btn:disabled {
  cursor: default;
  opacity: 0.45;
}
.alert-btn:disabled:hover {
  border-color: var(--muted-dim);
  color: var(--muted);
}
.alert-icon {
  width: 18px;
  height: 18px;
  display: block;
}
.mono { font-variant-numeric: tabular-nums; }

.back {
  margin: 8px 0 4px;
}
.back a {
  color: var(--gold);
  text-decoration: none;
}
.back a:hover { text-decoration: underline; }

.planet-card-layout {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  align-items: start;
}

.planet-art {
  margin: 0;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
}

.planet-glyph {
  font-size: 144px;
  line-height: 1;
  color: var(--gold-2);
  opacity: 0.85;
}

.planet-card-body .stats {
  margin-top: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 20px;
  margin: 18px 0 0;
}
.stats dt {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 4px;
}
.stats dd {
  margin: 0;
  font-size: 18px;
}

.alerts {
  list-style: none;
  margin: 0;
  padding: 0;
}

.alerts li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.info-btn {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: transparent;
  color: var(--gold);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  font-style: italic;
  line-height: 24px;
  cursor: pointer;
}

.info-btn:hover {
  background: var(--gold);
  color: #1a1408;
  filter: none;
}

.popup {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.popup[hidden] {
  display: none;
}

.popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 11, 22, 0.72);
}

.popup-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  min-height: 180px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 44px 24px 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.popup-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  color: var(--gold-2);
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.popup-close:hover {
  color: var(--gold);
  filter: none;
  background: transparent;
}

body.popup-open {
  overflow: hidden;
}

.year-break {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--gold-2);
  margin: 28px 0 4px;
}
.lede + .year-break {
  margin-top: 12px;
}

.sade-panel {
  position: relative;
}

.sade-panel h2 {
  padding-right: 40px;
}

.sade-info {
  position: absolute;
  top: 24px;
  right: 28px;
}

.sade-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 8;
  width: min(360px, 70vw);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #121a33;
  color: var(--text);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.sade-info:hover .sade-tooltip,
.sade-info:focus .sade-tooltip,
.sade-info:focus-visible .sade-tooltip {
  display: block;
}

.sade-panel > .dasha-line,
.sade-panel > .eclipse-hint {
  padding-bottom: 16px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--muted-dim);
}

.eclipse-summary {
  color: var(--muted);
  margin: 0 0 8px;
}

.sade-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 20px;
}

.sade-period {
  position: relative;
  padding-bottom: 16px;
  padding-right: 44px;
  border-bottom: 1px solid var(--muted-dim);
}

.sade-alert {
  position: absolute;
  top: 0;
  right: 0;
}

.sade-period:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.sade-period.is-past {
  opacity: 0.55;
}

.sade-period-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
  margin: 0 0 8px;
}

.sade-age {
  color: var(--gold-2);
  font-weight: 600;
}

.sade-dates {
  color: var(--text);
}

.sade-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.sade-badge-now {
  background: #249a58;
  color: #fff;
}

.sade-badge-past {
  background: #5c6e82;
  color: #fff;
}

.sade-badge-future {
  background: #b85a22;
  color: #fff;
}

.sade-phases {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
}

.sade-phases li {
  padding: 4px 0;
}

.sade-phases li.is-current {
  color: var(--gold-2);
}

.sade-phase-dates {
  margin-left: 8px;
  font-variant-numeric: tabular-nums;
}

.natal-panel {
  position: relative;
}

.natal-panel h2 {
  padding-right: 40px;
}

.natal-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 28px;
  align-items: start;
  margin-top: 4px;
  padding-right: 36px;
}

.natal-chart-col {
  margin: 0;
  min-width: 0;
}

.natal-chart-col h2 {
  padding-right: 0;
  margin: 0 0 4px;
  text-align: center;
  font-size: 22px;
}

.natal-print {
  position: absolute;
  top: 22px;
  right: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--gold);
}

.natal-print:hover {
  background: transparent;
  color: var(--gold-2);
  filter: none;
}

.print-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.natal-svg {
  display: block;
  width: 100%;
  max-width: 400px;
  height: auto;
  margin: 0 auto;
}

.natal-frame {
  fill: none;
  stroke: #d4af6a;
  stroke-width: 1.15;
  opacity: 0.55;
}

.natal-sign-num {
  fill: var(--muted);
  font-size: 11px;
  text-anchor: middle;
  dominant-baseline: middle;
}

.natal-glyph {
  fill: var(--text);
  font-size: 17px;
  font-weight: 400;
  text-anchor: middle;
  dominant-baseline: middle;
}

.natal-r {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.natal-gap {
  fill: transparent;
}

.natal-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 20px;
  margin: 24px auto 0;
  max-width: 420px;
  text-align: center;
}

.natal-keys dt {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 4px;
}

.natal-keys dd {
  margin: 0;
  font-size: 17px;
}

@media (max-width: 700px) {
  .landing-grid { grid-template-columns: 1fr; }
  .top { flex-direction: row; align-items: center; flex-wrap: nowrap; }
  .top-nav { display: none; }
  .row, .row.three { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .planet-card-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .planet-card-body { width: 100%; }
  .planet-card-body .panel-head { justify-content: center; }
  .natal-charts { grid-template-columns: 1fr; }
}

@media print {
  .sky,
  .top,
  .nav-drawer,
  .nav-backdrop,
  .menu-toggle,
  .natal-print {
    display: none !important;
  }

  html, body {
    background: #fff;
    color: #1a1408;
  }

  .person-name,
  h2 {
    color: #1a1408;
  }

  .birth-line,
  .natal-keys dt {
    color: #5c5648;
  }

  .panel {
    background: none;
    border: none;
    padding: 0;
    margin: 12px 0;
  }

  .natal-frame {
    stroke: #1a1408;
    opacity: 0.7;
  }

  .natal-glyph {
    fill: #1a1408;
  }

  .natal-sign-num,
  .natal-r {
    fill: #5c5648;
  }
}
