/* Many Happy Orbits: the planet-age calculator.
   Layout: one column of reading width; the calculator opens wide, with the orbit rings
   beside their numbers (stacked on phones). The rings are the one loud thing; everything else is quiet.
   Dark-first: a night ground lit by the Sun's gold, each world in its own colour. */

@font-face { font-family: "Bricolage Grotesque"; src: url(fonts/BricolageGrotesque-ExtraBold.woff) format("woff"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url(fonts/SourceSans3-Regular.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url(fonts/SourceSans3-Semibold.woff) format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url(fonts/SourceSans3-It.woff) format("woff"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --ground: #0c1024; --panel: #141a35; --line: #2a3158; --ink: #edf0f8; --muted: #9aa3c4;
  --sun: #f5b843; --link: #aac4ff; --focus: #f5b843; --on-sun: #1d1606;
  --w-mercury: #bdb4aa; --w-venus: #ecc86c; --w-earth: #5d9fe4; --w-mars: #e86e43;
  --w-jupiter: #e4ab6e; --w-saturn: #e9d394; --w-uranus: #8fd8dd; --w-neptune: #8196f4;
  --display: "Bricolage Grotesque", "Avenir Next Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 10px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) {
  --ground: #f3f5fb; --panel: #ffffff; --line: #d5dbeb; --ink: #121735; --muted: #535c7f;
  --sun: #e39a1c; --link: #2a4db5; --focus: #2a4db5; --on-sun: #1d1606;
  --w-mercury: #7a7066; --w-venus: #b8891f; --w-earth: #2c6db3; --w-mars: #bd4a22;
  --w-jupiter: #a9692b; --w-saturn: #977a27; --w-uranus: #23919a; --w-neptune: #3f54b9;
  color-scheme: light; } }
:root[data-theme="light"] {
  --ground: #f3f5fb; --panel: #ffffff; --line: #d5dbeb; --ink: #121735; --muted: #535c7f;
  --sun: #e39a1c; --link: #2a4db5; --focus: #2a4db5; --on-sun: #1d1606;
  --w-mercury: #7a7066; --w-venus: #b8891f; --w-earth: #2c6db3; --w-mars: #bd4a22;
  --w-jupiter: #a9692b; --w-saturn: #977a27; --w-uranus: #23919a; --w-neptune: #3f54b9;
  color-scheme: light; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 1.0625rem/1.55 var(--body); }
a { color: var(--link); }
h1, h2 { font-family: var(--display); font-weight: 800; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.35rem, 3.4vw, 1.75rem); line-height: 1.15; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px;
  max-width: 72rem; margin: 0 auto; padding-inline: 16px; padding-block: 14px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font: 800 1.05rem var(--display); color: var(--ink); text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.bar nav { display: flex; gap: 18px; font-size: .95rem; }
.bar nav a { color: var(--muted); text-decoration: none; }
.bar nav a:hover { color: var(--ink); }

.wrap { max-width: 72rem; margin: 0 auto; padding-inline: 16px; padding-block: 8px 48px; display: grid; gap: 56px; }
.wrap > *, .calc > *, .others-wrap > * { min-width: 0; }     /* let the wide table scroll in its own box */
.hero { display: grid; gap: 14px; padding-top: 18px; }
.hero h1 { font-size: clamp(2.3rem, 7.4vw, 4.6rem); line-height: 1.02; max-width: 15ch; }
.dek { margin: 0; color: var(--muted); font-size: clamp(1.05rem, 2.2vw, 1.25rem); max-width: 52ch; }

/* calculator */
.calc { display: grid; gap: 22px; }
.people { display: flex; flex-wrap: wrap; gap: 8px; }
.person { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 7px 16px; cursor: pointer;
  font-weight: 600; min-height: 40px; }
.person[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.person.add { background: none; border-style: dashed; color: var(--muted); font-weight: 400; }
.entry { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; }
.field { display: grid; gap: 4px; min-width: 0; flex: 1 1 12rem; max-width: 20rem; }
.field span { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.field input { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 46px; width: 100%; }
.ghost { background: none; border: 1px solid transparent; color: var(--muted); padding: 10px 12px; border-radius: 8px; cursor: pointer; min-height: 46px; }
.ghost:hover { border-color: var(--line); color: var(--ink); }
.example, .msg { margin: -8px 0 0; color: var(--muted); font-style: italic; }
.msg { font-style: normal; color: var(--ink); }

.result { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px 40px; align-items: start; }
.rings { margin: 0; display: grid; gap: 14px; min-width: 0; }
.rings-head { display: grid; gap: 6px; }
.rings-head p { margin: 0; color: var(--muted); font-size: .95rem; max-width: 46ch; }
.rings-art svg { width: 100%; max-width: 34rem; height: auto; display: block; }
.rings-art .lap { fill: var(--ink); font-family: var(--body); font-weight: 600; paint-order: stroke; stroke: var(--ground); stroke-width: 3px; stroke-linejoin: round; }
.rings-art .arc { transition: d .5s ease; }

.side { display: grid; gap: 20px; min-width: 0; }
.today { margin: 0; padding: 12px 14px; border-radius: var(--radius); background: var(--sun); color: var(--on-sun); font-weight: 600; }
.highlights { margin: 0; display: grid; gap: 12px; }
.highlights div { display: grid; gap: 2px; }
.highlights dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.highlights dd { margin: 0; display: grid; }
.highlights dd b { font: 800 1.3rem/1.2 var(--display); }
.highlights dd span { color: var(--muted); font-variant-numeric: tabular-nums; }
.legend { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.legend li { display: grid; grid-template-columns: 14px minmax(5.2rem, auto) 4.2rem minmax(0, 1fr); gap: 10px; align-items: baseline;
  font-variant-numeric: tabular-nums; }
.legend .sw { width: 12px; height: 12px; border-radius: 50%; background: var(--c); align-self: center; }
.legend .nm { font-weight: 600; }
.legend .ag { text-align: right; font-weight: 600; }
.legend .nx { color: var(--muted); font-size: .92rem; min-width: 0; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn { display: inline-block; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px;
  padding: 10px 16px; min-height: 44px; cursor: pointer; font-weight: 600; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.primary { background: var(--sun); color: var(--on-sun); border-color: var(--sun); }
.btn.primary[aria-disabled="true"] { background: none; color: var(--muted); border-color: var(--line); cursor: default; }

.family { display: grid; gap: 12px; }
.family-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.family-list li { display: grid; grid-template-columns: 7.5rem minmax(0, 8rem) minmax(0, 1fr) auto; gap: 12px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.family-list .when { color: var(--muted); }
.family-list .who { font-weight: 600; overflow-wrap: anywhere; }
.family-list .rare { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--on-sun);
  background: var(--sun); border-radius: 4px; padding: 1px 6px; }

.others-wrap { display: grid; gap: 12px; }
.others-wrap h2 { font-size: clamp(1.15rem, 2.8vw, 1.4rem); }
.scroll { overflow-x: auto; }
.others { border-collapse: collapse; width: 100%; min-width: 30rem; font-variant-numeric: tabular-nums; }
.others th, .others td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.others thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.others tbody th { font-weight: 600; }
.others .num { text-align: right; padding-right: 24px; }
.others .grp th { padding-top: 18px; font: 800 .95rem var(--display); color: var(--muted); border-bottom-color: transparent; }
.others .pend { color: var(--muted); font-style: italic; }

/* the product */
.calendar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px 40px; align-items: center;
  padding-top: 40px; border-top: 1px solid var(--line); }
.pitch { display: grid; gap: 14px; justify-items: start; }
.pitch p { margin: 0; max-width: 52ch; }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.shots img { width: 100%; height: auto; border-radius: 6px; display: block; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }

.how, .faq { display: grid; gap: 14px; max-width: 46rem; }
.facts { margin: 0; padding-left: 1.1em; display: grid; gap: 10px; }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 0; color: var(--muted); max-width: 60ch; }

.foot { max-width: 72rem; margin: 0 auto; padding-inline: 16px; padding-block: 24px 40px; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line); }
.foot p { margin: 0; max-width: 70ch; }

@media (max-width: 56rem) {
  .result, .calendar { grid-template-columns: minmax(0, 1fr); }
  .rings-art svg { margin-inline: auto; }
}
@media (max-width: 30rem) {
  .legend li { grid-template-columns: 14px minmax(0, 1fr) 3.6rem; }
  .legend .nx { grid-column: 2 / -1; margin-top: -4px; }
  .others { min-width: 0; }
  .others td .muted { display: block; font-size: .9rem; }
  .family-list li { display: flex; flex-wrap: wrap; gap: 2px 10px; }
  .family-list .when { flex-basis: 100%; font-size: .88rem; }
}
@media (prefers-reduced-motion: reduce) { .rings-art .arc { transition: none; } }
