/* style.css */
:root {
  color-scheme: dark;
  --bg: #050b18;
  --bg-deep: #030812;
  --panel: rgba(11, 25, 48, .78);
  --panel-bright: rgba(20, 41, 71, .72);
  --line: rgba(173, 211, 255, .14);
  --line-bright: rgba(173, 220, 255, .28);
  --text: #edf6ff;
  --muted: #9eafc5;
  --soft: #6d819d;
  --gold: #ffc56b;
  --cyan: #7fddff;
  --green: #75e3b1;
  --shadow: 0 28px 80px rgba(0, 0, 0, .34);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, .24);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #eaf2fb;
    --bg-deep: #dce9f5;
    --panel: rgba(255, 255, 255, .8);
    --panel-bright: rgba(255, 255, 255, .92);
    --line: rgba(28, 70, 115, .15);
    --line-bright: rgba(28, 92, 150, .27);
    --text: #0a1b30;
    --muted: #4c627d;
    --soft: #70849c;
    --shadow: 0 22px 54px rgba(35, 73, 117, .14);
    --shadow-soft: 0 10px 28px rgba(35, 73, 117, .1);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eaf2fb;
  --bg-deep: #dce9f5;
  --panel: rgba(255, 255, 255, .8);
  --panel-bright: rgba(255, 255, 255, .92);
  --line: rgba(28, 70, 115, .15);
  --line-bright: rgba(28, 92, 150, .27);
  --text: #0a1b30;
  --muted: #4c627d;
  --soft: #70849c;
  --shadow: 0 22px 54px rgba(35, 73, 117, .14);
  --shadow-soft: 0 10px 28px rgba(35, 73, 117, .1);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 84% -12%, rgba(37, 113, 208, .28), transparent 35rem),
    radial-gradient(circle at 2% 44%, rgba(57, 168, 218, .11), transparent 27rem),
    radial-gradient(circle at 60% 105%, rgba(94, 53, 160, .12), transparent 31rem),
    var(--bg);
  color: var(--text);
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .3;
  background-image: radial-gradient(rgba(255,255,255,.16) .6px, transparent .7px);
  background-size: 5px 5px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

button,
input { font: inherit; }

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

button:disabled {
  cursor: wait;
  opacity: .58;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.app-shell {
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 38px;
}

.topbar,
.top-actions,
.brand,
.panel-heading,
.panel-topline,
.sky-place,
.place-name,
.sun-times,
.orbit-status,
footer {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  min-height: 46px;
}

.top-actions { gap: 9px; }

.brand {
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}

.brand strong {
  display: block;
  letter-spacing: .24em;
  font-size: 1rem;
  line-height: 1;
}

.brand small {
  display: block;
  color: var(--soft);
  font-size: .61rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  margin-top: 5px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  position: relative;
  display: grid;
  place-items: center;
}

.brand-mark::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffd56f;
  box-shadow: 0 0 13px #ffb139, 0 0 25px rgba(255,177,57,.35);
}

.brand-mark i {
  position: absolute;
  border: 1px solid rgba(129, 219, 255, .65);
  border-radius: 50%;
  transform: rotate(-25deg);
}

.brand-mark i:nth-child(1) { width: 30px; height: 12px; }
.brand-mark i:nth-child(2) { width: 22px; height: 22px; }
.brand-mark i:nth-child(3) { width: 14px; height: 29px; }

.icon-button,
.pause-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  transition: background .2s ease, border-color .2s ease, transform .2s ease, color .2s ease, box-shadow .2s ease;
}

.icon-button:hover,
.pause-button:hover {
  background: rgba(126, 215, 255, .13);
  border-color: rgba(126, 215, 255, .48);
  box-shadow: 0 8px 18px rgba(13, 54, 92, .2);
  transform: translateY(-1px);
}

.icon-button:active,
.pause-button:active { transform: scale(.96); }

.icon-button.enabled {
  color: var(--gold);
  border-color: rgba(255, 197, 107, .55);
  background: rgba(255, 197, 107, .08);
}

.icon-button svg,
.pause-button svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.8;
}

.hero {
  padding: clamp(58px, 9vw, 124px) 2px 46px;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: end;
}

.hero-copy { max-width: 640px; }

.eyebrow,
.section-kicker {
  color: var(--cyan);
  font-size: .67rem;
  letter-spacing: .16em;
  font-weight: 800;
  margin: 0 0 12px;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  margin: 0 8px 1px 0;
  box-shadow: 0 0 0 5px rgba(117, 227, 177, .12), 0 0 12px rgba(117,227,177,.55);
  animation: pulse-dot 2.2s ease-in-out infinite;
}

.hero h1 {
  font-size: clamp(2.75rem, 7vw, 6.25rem);
  line-height: .9;
  letter-spacing: -.075em;
  margin: 0;
  text-wrap: balance;
}

.hero h1 em {
  font-weight: 450;
  font-style: normal;
  color: #aee4ff;
  text-shadow: 0 0 32px rgba(112,211,255,.16);
}

.intro {
  max-width: 470px;
  margin: 24px 0 0;
  color: var(--muted);
  line-height: 1.68;
  font-size: 1rem;
}

.date-card {
  border-left: 1px solid var(--line-bright);
  padding: 8px 0 8px 22px;
  min-width: 168px;
  margin-bottom: 5px;
}

.date-card span,
.date-card small {
  color: var(--soft);
  font-size: .67rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  display: block;
}

.date-card strong {
  display: block;
  color: var(--text);
  letter-spacing: -.055em;
  font-size: 1.55rem;
  padding: 9px 0 4px;
  font-variant-numeric: tabular-nums;
}

.panel {
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--panel-bright), var(--panel));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  border-radius: 24px;
}

.sky-panel { overflow: hidden; }

.panel-topline {
  justify-content: space-between;
  padding: 26px 28px 19px;
  gap: 12px;
}

.panel-heading {
  justify-content: space-between;
  gap: 13px;
}

.panel-heading h2,
.panel-topline h2 {
  font-size: clamp(1.16rem, 2vw, 1.48rem);
  letter-spacing: -.045em;
  margin: 0;
}

.section-kicker { margin-bottom: 7px; }

.orbit-status {
  color: var(--soft);
  gap: 8px;
  font-size: .7rem;
  white-space: nowrap;
}

.orbit-status span:first-child {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 9px var(--green);
}

.solar-stage {
  height: clamp(280px, 35vw, 420px);
  position: relative;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #071325;
}

#spaceCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.stage-overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
  padding: 19px;
  display: flex;
  justify-content: space-between;
  align-items: end;
}

.selected-world {
  display: flex;
  gap: 10px;
  max-width: 310px;
  padding: 12px 14px;
  border: 1px solid rgba(207, 235, 255, .18);
  border-radius: 14px;
  background: rgba(5, 13, 28, .68);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.selected-world small {
  color: #a2b9cf;
  letter-spacing: .11em;
  font-size: .58rem;
  font-weight: 800;
}

.selected-world strong {
  display: block;
  font-size: .96rem;
  margin: 3px 0;
}

.selected-world p {
  color: #c0d1e1;
  font-size: .7rem;
  line-height: 1.34;
  margin: 0;
}

.world-pip {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
  margin-top: 6px;
  background: var(--planet-color, #4fa9f5);
  box-shadow: 0 0 11px var(--planet-color, #4fa9f5);
}

.pause-button {
  pointer-events: auto;
  background: rgba(5, 13, 28, .7);
  width: 44px;
  height: 44px;
}

.pause-button svg { width: 16px; }

.planet-rail {
  padding: 14px 16px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.planet-rail::-webkit-scrollbar { display: none; }

.planet-chip {
  min-height: 44px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  padding: 0 11px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: .73rem;
  font-weight: 750;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.planet-chip:hover,
.planet-chip.active {
  color: var(--text);
  background: rgba(153, 212, 255, .1);
  border-color: rgba(147, 210, 255, .2);
}

.planet-chip:hover { transform: translateY(-1px); }

.planet-chip i {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
}

.planet-chip i.earth { background: #4fa9f5; }
.planet-chip i.mercury { background: #b8a596; }
.planet-chip i.venus { background: #d99a56; }
.planet-chip i.mars { background: #d76a4c; }
.planet-chip i.jupiter { background: #e7b377; width: 14px; }
.planet-chip i.saturn { background: #dfcc91; width: 14px; border-radius: 45%; }
.planet-chip i.neptune { background: #517fd7; }

.grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
  margin-top: 18px;
}

.location-panel,
.moon-panel {
  padding: 28px;
  min-height: 442px;
}

.outline-button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(128, 206, 255, .05);
  color: var(--text);
  font-size: .73rem;
  font-weight: 750;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.outline-button:hover {
  background: rgba(128, 206, 255, .13);
  border-color: var(--line-bright);
  box-shadow: 0 8px 20px rgba(42, 108, 159, .12);
  transform: translateY(-1px);
}

.outline-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.7;
}

.search-form {
  display: flex;
  align-items: center;
  margin: 27px 0 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  min-height: 53px;
  overflow: hidden;
  background: rgba(0, 0, 0, .1);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.search-form:focus-within {
  border-color: rgba(127, 221, 255, .58);
  box-shadow: 0 0 0 4px rgba(127,221,255,.08);
}

.search-form > svg {
  width: 19px;
  margin: 0 10px 0 15px;
  stroke: var(--soft);
  fill: none;
  stroke-width: 1.8;
  flex: 0 0 auto;
}

.search-form input {
  color: var(--text);
  background: transparent;
  min-width: 0;
  flex: 1;
  width: 100%;
  border: 0;
  outline: 0;
  font-size: .87rem;
}

.search-form input::placeholder { color: var(--soft); }

.search-form button {
  align-self: stretch;
  border: 0;
  color: #06111d;
  background: var(--cyan);
  padding: 0 16px;
  font-size: .72rem;
  font-weight: 850;
  transition: background .18s ease;
}

.search-form button:hover { background: #c1efff; }

.sky-place {
  justify-content: space-between;
  gap: 12px;
}

.place-name {
  gap: 10px;
  min-width: 0;
}

.place-name small,
.temperature small {
  display: block;
  color: var(--soft);
  font-size: .6rem;
  font-weight: 750;
  letter-spacing: .1em;
}

.place-name strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 225px;
  font-size: .89rem;
  margin-top: 4px;
}

.place-orb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: radial-gradient(circle at 37% 32%, #fff4ae 0 11%, #ffc855 22%, #f2942d 52%, #bb4d24);
  box-shadow: 0 0 18px rgba(255, 183, 75, .48);
}

.place-orb.night {
  background: radial-gradient(circle at 32% 30%, #dae7ff 0 10%, #8fa9e5 18%, #536ca9 55%, #263d71);
  box-shadow: 0 0 18px rgba(98, 138, 235, .4);
}

.temperature { text-align: right; }

.temperature strong {
  display: block;
  font-size: 1.8rem;
  letter-spacing: -.08em;
  line-height: 1;
  margin-bottom: 4px;
}

.temperature small {
  letter-spacing: 0;
  text-transform: none;
  font-size: .7rem;
  font-weight: 500;
}

.sun-arc-wrap { padding: 25px 4px 0; }

.sun-arc {
  height: 136px;
  position: relative;
  overflow: hidden;
}

.arc-track {
  position: absolute;
  left: 7%;
  width: 86%;
  height: 201px;
  top: 13px;
  border: 1px solid rgba(255, 205, 115, .62);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  box-shadow: 0 -12px 25px rgba(255,184,85,.05);
}

.horizon {
  position: absolute;
  bottom: 2px;
  height: 1px;
  width: 45%;
  background: rgba(154, 202, 245, .4);
}

.horizon-left { left: 0; }
.horizon-right { right: 0; }

.sun-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  transition: left .22s ease, top .22s ease, opacity .4s ease;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffe28b;
  box-shadow: 0 0 0 6px rgba(255, 201, 102, .12), 0 0 22px #ffbd4d;
}

.sun-marker span {
  display: block;
  border: 1px solid rgba(255,255,255,.65);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin: 8px;
}

.sun-marker.below { opacity: .48; }

.sun-times {
  justify-content: space-between;
  text-align: center;
}

.sun-times div { width: 33%; }

.sun-times small {
  display: block;
  font-size: .59rem;
  color: var(--soft);
  font-weight: 750;
  letter-spacing: .1em;
}

.sun-times strong {
  display: block;
  padding-top: 6px;
  font-size: .84rem;
}

.solar-noon strong { color: var(--gold); }

.sun-preview {
  margin-top: 19px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.sun-preview label {
  display: block;
  color: var(--soft);
  font-size: .59rem;
  letter-spacing: .1em;
  font-weight: 800;
  text-transform: uppercase;
}

.sun-preview-controls {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 10px;
}

.sun-preview input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d99148, #ffe48d 48%, #d99148);
  cursor: pointer;
}

.sun-preview input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff2b8;
  border: 2px solid #e19b3d;
  box-shadow: 0 0 0 4px rgba(255,197,107,.15), 0 0 13px rgba(255,197,107,.55);
}

.sun-preview input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff2b8;
  border: 2px solid #e19b3d;
  box-shadow: 0 0 0 4px rgba(255,197,107,.15), 0 0 13px rgba(255,197,107,.55);
}

.sun-preview input:disabled { opacity: .35; cursor: not-allowed; }

.sun-preview button {
  min-height: 44px;
  min-width: 56px;
  padding: 0 12px;
  border: 1px solid rgba(255,197,107,.27);
  border-radius: 9px;
  color: var(--gold);
  background: rgba(255,197,107,.06);
  font-size: .69rem;
  font-weight: 800;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.sun-preview button:hover:not(:disabled) {
  color: #fff5cc;
  background: rgba(255,197,107,.14);
  transform: translateY(-1px);
}

.sun-preview p {
  color: var(--muted);
  font-size: .67rem;
  margin: 9px 0 0;
  min-height: 1em;
}

.data-note {
  color: var(--soft);
  font-size: .65rem;
  margin: 18px 0 0;
}

.moon-layout {
  display: flex;
  align-items: center;
  gap: 19px;
  min-height: 180px;
}

.moon-scene {
  height: 154px;
  width: 154px;
  flex: 0 0 154px;
  display: grid;
  place-items: center;
  position: relative;
}

.moon-glow {
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(160,205,255,.23), transparent 70%);
  animation: breathe 4s ease-in-out infinite;
}

.moon-disc {
  --shadow-pos: 40%;
  position: relative;
  width: 105px;
  height: 105px;
  overflow: hidden;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fbfdff 0 3%, #d7deec 38%, #9ba9c1 100%);
  box-shadow: inset -12px -11px 22px rgba(59,75,105,.25), 0 0 30px rgba(178,210,255,.3);
}

.moon-light {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: radial-gradient(circle at var(--shadow-pos) 48%, transparent 0 45%, rgba(5,12,26,.94) 51%);
  transition: background .9s ease;
}

.moon-disc.waning .moon-light { transform: scaleX(-1); }

.moon-crater {
  position: absolute;
  z-index: 2;
  border-radius: 50%;
  background: rgba(101, 117, 145, .22);
  box-shadow: inset 2px 2px 2px rgba(255,255,255,.22);
}

.crater-a { width: 15px; height: 15px; top: 27px; left: 26px; }
.crater-b { width: 10px; height: 10px; top: 65px; left: 57px; }
.crater-c { width: 8px; height: 8px; top: 42px; right: 19px; }

.moon-reading strong {
  font-size: 1.2rem;
  letter-spacing: -.04em;
}

.moon-reading p {
  color: var(--muted);
  font-size: .79rem;
  line-height: 1.56;
  margin: 9px 0 12px;
}

.moon-day {
  font-size: .62rem;
  color: var(--gold);
  border: 1px solid rgba(255,197,107,.28);
  border-radius: 99px;
  padding: 6px 8px;
  letter-spacing: .08em;
  font-weight: 800;
  background: rgba(255,197,107,.05);
}

.illumination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.illumination > span {
  height: 5px;
  width: 80px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(177, 201, 231, .18);
}

.illumination > span i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #91d6ff, #f4f4e1);
  transition: width .7s;
}

.illumination b {
  font-weight: 600;
  color: var(--soft);
  font-size: .64rem;
  white-space: nowrap;
}

.fact-card {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 9px;
}

.fact-index {
  color: var(--cyan);
  font-size: .59rem;
  letter-spacing: .12em;
  font-weight: 800;
}

.fact-card p {
  font-size: .79rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 9px 0;
  min-height: 38px;
}

.fact-card button,
.text-button {
  min-height: 32px;
  padding: 0;
  color: var(--text);
  border: 0;
  background: none;
  font-size: .72rem;
  font-weight: 800;
  transition: color .18s ease, transform .18s ease;
}

.fact-card button:hover,
.text-button:hover {
  color: var(--cyan);
  transform: translateX(2px);
}

.fact-card button span,
.text-button span {
  color: var(--cyan);
  font-size: 1rem;
  padding-left: 5px;
}

.learn-panel {
  margin-top: 18px;
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: .92fr 1.08fr;
  min-height: 294px;
}

.learn-intro {
  padding: 39px;
  align-self: center;
}

.learn-intro h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  line-height: .98;
  letter-spacing: -.065em;
}

.learn-intro > p:not(.section-kicker) {
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.67;
  max-width: 400px;
  margin: 18px 0;
}

.spectrum-art {
  min-height: 294px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(155deg, #07182b 3%, #155084 49%, #ef8a48 100%);
}

.spectrum-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 75% 20%, rgba(255,225,137,.42), transparent 23%), linear-gradient(to top, rgba(4,13,28,.63), transparent 50%);
}

.spectrum-sun {
  position: absolute;
  z-index: 2;
  left: 9%;
  top: 23%;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #ffe69a;
  box-shadow: 0 0 27px 10px rgba(255,198,93,.5);
  animation: sun-float 5s ease-in-out infinite;
}

.ray {
  position: absolute;
  z-index: 1;
  left: 21%;
  top: 38%;
  transform-origin: left center;
  height: 3px;
  border-radius: 10px;
}

.ray-blue {
  width: 57%;
  background: linear-gradient(90deg, rgba(255,255,255,.9), rgba(100,207,255,.9), transparent);
  transform: rotate(-8deg);
  box-shadow: 0 20px 0 rgba(100,207,255,.18), 0 -20px 0 rgba(100,207,255,.17);
}

.ray-gold {
  width: 66%;
  background: linear-gradient(90deg, rgba(255,255,255,.9), #ffd46b, transparent);
  transform: rotate(22deg);
  box-shadow: 0 -14px 0 rgba(255,187,76,.3);
}

.atmosphere {
  position: absolute;
  z-index: 2;
  width: 160%;
  height: 190px;
  bottom: -128px;
  left: -29%;
  border: 2px solid rgba(152,229,255,.65);
  border-radius: 50% 50% 0 0;
  box-shadow: 0 -12px 25px rgba(93,206,255,.14);
}

.planet-curve {
  position: absolute;
  z-index: 3;
  width: 150%;
  height: 150px;
  bottom: -120px;
  left: -25%;
  background: #071d31;
  border-radius: 50% 50% 0 0;
  box-shadow: 0 -12px 27px rgba(61,185,213,.46);
}

.spectrum-label {
  position: absolute;
  z-index: 4;
  color: rgba(238,250,255,.86);
  font-size: .57rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.label-sun { left: 5%; top: 14%; }
.label-air { right: 13%; bottom: 34%; }
.label-eye { right: 9%; top: 27%; }

footer {
  justify-content: space-between;
  padding: 26px 2px 0;
  color: var(--soft);
  font-size: .64rem;
  letter-spacing: .03em;
}

dialog {
  width: min(620px, calc(100% - 30px));
  color: var(--text);
  background: #0b1930;
  border: 1px solid rgba(151,213,255,.26);
  box-shadow: 0 30px 100px rgba(0,0,0,.7);
  border-radius: 22px;
  padding: 36px;
}

dialog::backdrop {
  background: rgba(1, 6, 16, .74);
  backdrop-filter: blur(5px);
}

.dialog-close {
  position: absolute;
  right: 13px;
  top: 11px;
  width: 44px;
  height: 44px;
  color: var(--text);
  background: transparent;
  border: 0;
  font-size: 1.8rem;
}

dialog h2 {
  font-size: clamp(1.75rem, 5vw, 2.7rem);
  line-height: 1;
  letter-spacing: -.06em;
  margin: 0;
  max-width: 410px;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 28px 0;
}

.lesson-grid div {
  padding: 15px;
  background: rgba(124,197,255,.08);
  border: 1px solid rgba(155,219,255,.12);
  border-radius: 13px;
}

.lesson-grid span {
  color: var(--cyan);
  font-size: .67rem;
  font-weight: 800;
}

.lesson-grid strong {
  font-size: .8rem;
  line-height: 1.25;
  display: block;
  margin: 11px 0 6px;
}

.lesson-grid p {
  color: var(--muted);
  line-height: 1.45;
  font-size: .71rem;
  margin: 0;
}

.primary-button {
  min-height: 45px;
  border: 0;
  border-radius: 10px;
  color: #06111d;
  background: var(--cyan);
  font-weight: 800;
  font-size: .76rem;
  padding: 0 17px;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.primary-button:hover {
  background: #c1efff;
  box-shadow: 0 9px 20px rgba(81, 205, 255, .2);
  transform: translateY(-1px);
}

@keyframes breathe {
  50% { transform: scale(1.13); opacity: .62; }
}

@keyframes pulse-dot {
  50% { box-shadow: 0 0 0 7px rgba(117,227,177,.04), 0 0 15px rgba(117,227,177,.72); }
}

@keyframes sun-float {
  50% { transform: translateY(-5px) scale(1.03); }
}

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

@media (max-width: 780px) {
  .hero {
    align-items: start;
    flex-direction: column;
    padding-top: 62px;
  }

  .date-card {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 15px 0 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
    width: 100%;
  }

  .date-card strong { padding: 0; }
  .date-card small { margin-left: auto; }

  .grid,
  .learn-panel { grid-template-columns: 1fr; }

  .moon-panel,
  .learn-panel { min-height: 0; }

  .spectrum-art {
    min-height: 245px;
    order: -1;
  }
}

@media (max-width: 500px) {
  .app-shell {
    width: min(100% - 18px, 1240px);
    padding-top: 14px;
  }

  .brand small { display: none; }

  .hero { padding: 48px 3px 32px; }
  .hero h1 { font-size: 2.92rem; }
  .intro { font-size: .9rem; }

  .panel-topline,
  .location-panel,
  .moon-panel {
    padding-left: 18px;
    padding-right: 18px;
  }

  .panel-topline {
    padding-top: 21px;
    padding-bottom: 17px;
  }

  .orbit-status { display: none; }
  .solar-stage { height: 292px; }

  .selected-world { max-width: 214px; }

  .selected-world p {
    max-height: 32px;
    overflow: hidden;
  }

  .location-panel,
  .moon-panel { min-height: auto; }

  .moon-layout { gap: 4px; }

  .moon-scene {
    transform: scale(.83);
    width: 124px;
    flex-basis: 124px;
    margin-left: -13px;
  }

  .moon-reading p { font-size: .72rem; }
  .illumination > span { width: 59px; }

  .learn-intro { padding: 30px 22px; }

  .lesson-grid {
    grid-template-columns: 1fr;
    margin: 21px 0;
  }

  footer {
    gap: 8px;
    align-items: start;
    flex-direction: column;
  }

  dialog { padding: 29px 21px; }

  .sun-preview-controls { gap: 8px; }
}
