/*
Theme Name: Astro Observatory
Description: Horoscope atlas, lunar calendar, tarot and personal chakra map.
Version: 2.0.0
Requires PHP: 8.0
*/

:root {
  color-scheme: light;
  --ink: #212c2a;
  --muted: #4f5c55;
  --base: #f4f3ed;
  --night: #142525;
  --panel: #e9ece4;
  --line: #c7cec1;
  --peach: #9b3d27;
  --teal: #24584e;
  --brass: #e8c492;
  --ivory: #fff4df;
  --punch: #ae422a;
  --serif: Georgia, "Times New Roman", serif;
  --mono: "Cascadia Mono", Consolas, monospace;
  --sans: "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--base); color: var(--ink); font: 16px/1.55 var(--sans); }
main { min-height: 65vh; }
a { text-decoration: none; color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }
::selection { background: var(--peach); color: var(--night); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.08; margin: 0; overflow-wrap: anywhere; }
p { margin: 0; }
.wrap { width: min(1240px, calc(100% - 112px)); margin-inline: auto; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 10; clip-path: inset(50%); padding: 8px 16px; background: var(--night); color: var(--ivory); }
.skip:focus { clip-path: none; }
.header { background: var(--base); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.brand { display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; font: 400 27px/1 var(--serif); color: var(--ink); }
.brand span { display: grid; place-items: center; width: 32px; aspect-ratio: 1; border: 1px solid currentColor; border-radius: 50%; color: var(--peach); margin-right: 5px; }
.brand span::before {
  content: ""; display: block; width: 18px; aspect-ratio: 1; background: currentColor;
  clip-path: polygon(50% 0,57% 35%,82% 18%,65% 43%,100% 50%,65% 57%,82% 82%,57% 65%,50% 100%,43% 65%,18% 82%,35% 57%,0 50%,35% 43%,18% 18%,43% 35%);
}
.brand b { color: var(--peach); font-style: italic; font-weight: 400; }
.nav { display: flex; gap: 32px; align-items: center; font-size: .9rem; color: var(--muted); }
.nav a:hover, .text-link:hover, .crumbs a:hover { color: var(--peach); }
.primary, .outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 14px; width: fit-content;
  min-height: 46px; border: 1px solid transparent; border-radius: 24px; padding: 9px 18px;
  font-size: .9rem; font-weight: 650; line-height: 1.35;
}
.primary { background: var(--punch); color: #fff9eb; }
.primary:hover { background: #853422; }
.outline { border-color: #809086; background: transparent; color: var(--teal); }
.outline:hover { background: var(--panel); }
.header-cta { border: 0; border-bottom: 1px solid #9ca89b; border-radius: 0; padding-inline: 0; min-height: 30px; }
.header-cta:hover { border-color: var(--peach); background: transparent; color: var(--peach); }
.eyebrow { color: var(--peach); font: .85rem/1.45 var(--sans); }
.hero {
  --ivory: #f3f7ff; --brass: #ffd6ac;
  isolation: isolate; position: relative; display: grid; justify-items: center; padding-bottom: 27px;
  color: var(--ivory); background: #050e21; border-bottom: 3px solid #507690;
}
.hero :focus-visible, .sky-dialog :focus-visible { outline-color: var(--brass); }
.hero-sky { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.celestial-art { position: absolute; inset: 0; display: block; pointer-events: none; }
.celestial-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
.hero-sky .celestial-art { opacity: .86; }
.hero-sky canvas { position: relative; width: 100%; height: 100%; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.atlas-labels { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.atlas-label {
  position: absolute; inset: 0 auto auto 0; display: flex; align-items: center; height: 24px; padding-inline: 8px;
  border: 1px solid #7994b7; border-radius: 2px; background: #0b1b33; color: var(--ivory);
  font: 600 12px/1 "Segoe UI", sans-serif; white-space: nowrap;
}
.hero.is-atlas-target { cursor: pointer; }
.hero-content { padding-top: 24px; text-align: center; }
.hero h1 { font-size: 3.35rem; margin: 0 0 10px; text-shadow: 0 1px 12px #030917; }
.forecast-periods {
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); width: min(100%, 368px); margin-inline: auto; color: #d9e5f6;
  border-bottom: 1px solid #8ba5c57d;
}
.forecast-periods a {
  display: grid; place-items: center; min-height: 41px; border-bottom: 2px solid transparent;
  font-size: .9rem; white-space: nowrap;
}
.forecast-periods a[aria-current=page] { border-color: var(--brass); color: var(--ivory); font-weight: 650; }
.forecast-periods a:hover { color: var(--ivory); background: #d8e8ff20; }
.atlas-stage { position: relative; width: 100%; }
.hero.is-atlas-ready .atlas-stage { height: clamp(444px, calc(100svh - 352px), 642px); }
.forecast-signs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0 10px; width: min(calc(100% - 36px), 368px); margin: 12px auto 0; }
.forecast-signs a {
  display: grid; align-items: center; min-height: 38px; padding: 2px 5px;
  font: 1.14rem/1.16 var(--serif); text-decoration: underline;
  text-decoration-color: #b4cbee9c; text-underline-offset: 4px; text-decoration-thickness: 1px;
  text-shadow: 0 1px 5px #020611, 0 0 9px #020611;
}
.hero.is-atlas-ready .forecast-signs { position: absolute; inset: 0; display: block; width: auto; margin: 0; pointer-events: none; }
.hero.is-atlas-ready .forecast-signs a { position: absolute; top: 0; left: 0; pointer-events: auto; white-space: nowrap; }
.forecast-signs a:is(.is-selected,:hover,:focus-visible) { color: var(--brass); text-decoration-color: currentColor; }
.model-tools button { width: 42px; min-height: 42px; border: 0; border-radius: 50%; background: transparent; color: var(--brass); font-size: 1.35rem; }
.model-tools button:hover { background: #344d4d; }
.zodiac { padding-top: 41px; scroll-margin-top: 20px; }
.section-head { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin-bottom: 20px; }
h2 { font-size: 2.85rem; }
.periods { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 1px solid #a9b4a7; border-radius: 23px; width: fit-content; }
.periods button, .periods a { min-height: 36px; padding: 7px 14px; border: 0; border-radius: 19px; background: transparent; color: var(--muted); font-size: .86rem; white-space: nowrap; }
.periods button[aria-pressed=true], .periods a[aria-current=page] { background: var(--teal); color: #fff9eb; }
.periods button:hover:not([aria-pressed=true]), .periods a:hover:not([aria-current=page]) { background: var(--panel); color: var(--ink); }
.zodiac-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); border-bottom: 1px solid var(--line); }
.sign-card { min-width: 0; min-height: 102px; padding: 14px 8px; position: relative; display: flex; align-items: center; gap: 9px; border-top: 1px solid var(--line); transition: background .2s; }
.sign-mark { width: 37px; aspect-ratio: 1; display: grid; place-items: center; flex: none; font: 1.42rem/1 var(--serif); border: 1px solid #94a59a; border-radius: 50%; color: var(--teal); background: color-mix(in srgb, var(--sign) 24%, var(--base)); }
.sign-info { display: grid; gap: 4px; }
.sign-info strong { font: 400 1.18rem/1.1 var(--serif); overflow-wrap: anywhere; }
.sign-info small { font-size: .72rem; color: var(--muted); }
.sign-card:hover, .sign-card.is-selected, .sign-card:focus-visible { background: var(--panel); }
.zodiac .sign-card { min-height: 155px; flex-direction: column; justify-content: center; text-align: center; gap: 7px; }
.zodiac .sign-card:has(.sign-etching:not([hidden])) .sign-mark { display: none; }
.sign-etching { display: block; width: 80px; height: 80px; }
.journal { margin-top: 66px; margin-bottom: 60px; }
.text-link { color: var(--teal); font-size: .86rem; text-decoration: underline; text-underline-offset: 4px; }
.journal-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
.journal-card { border-bottom: 1px solid var(--line); }
.journal-card:hover { border-color: var(--peach); }
.journal-card:hover h3 { color: var(--peach); }
.journal-art { display: block; width: 100%; height: auto; aspect-ratio: 13/6; background: var(--night); }
.journal-copy { padding: 16px 0 18px; }
.journal-copy h3 { margin-bottom: 8px; font-size: 1.55rem; }
.journal-copy > p:last-child { font-size: .92rem; color: var(--muted); }
.footer { border-top: 1px solid var(--line); background: var(--panel); }
.footer-inner { min-height: 99px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; padding-block: 20px; color: var(--muted); font-size: .85rem; }
.footer-inner > a:last-child { color: var(--teal); }
.reading { max-width: 980px; padding-block: 30px 52px; }
.reading-body { padding-top: 1px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; color: var(--muted); font-size: .8rem; }
.reading h1, .result-heading h1 { margin: 10px 0 16px; font-size: 3.65rem; }
.intro { color: var(--muted); max-width: 650px; font-size: 1.1rem; }
.celestial-heading {
  isolation: isolate; position: relative; min-height: 245px; display: grid; align-items: center;
  overflow: hidden; border-bottom: 2px solid #426a87; color: #f3f7ff; background: #050e21;
}
.celestial-heading .celestial-art { z-index: -1; opacity: .49; }
.celestial-heading .celestial-art img { object-position: center 93%; }
.celestial-heading-content { max-width: 980px; padding-block: 30px 38px; text-shadow: 0 2px 12px #020611, 0 1px 4px #020611; }
.celestial-heading h1 { margin: 8px 0 14px; max-width: 825px; font-size: 3.4rem; }
.celestial-heading :is(.intro,.crumbs) { color: #dce7fa; }
.celestial-heading .crumbs { margin-bottom: 22px; }
.celestial-heading .crumbs a:hover, .celestial-heading .eyebrow { color: #ffdbb5; }
.celestial-heading :focus-visible { outline-color: #ffdbb5; }
.celestial-heading-sign {
  min-height: 340px;
  background: #020510;
}
.celestial-heading-sign::before {
  content: ""; position: absolute; z-index: -2; inset: 0; opacity: .73;
  background: url("assets/celestial/night-field.webp") center / cover;
}
.celestial-heading-sign .celestial-art {
  display: grid; grid-template: minmax(0,1fr) / minmax(0,1fr); place-items: center;
  inset-inline: 50% max(10px,calc((100% - 1200px) / 2));
  opacity: 1; mix-blend-mode: screen;
}
.celestial-heading-sign .celestial-art img {
  width: auto; max-width: 100%; height: 100%; min-height: 0; aspect-ratio: 1; object-fit: contain; object-position: center;
  mask-image: radial-gradient(circle closest-side, #000 89%, transparent 100%);
}
.celestial-heading-sign .reading-head > * { max-width: 55%; }
.celestial-glyph { margin-right: 9px; color: #9ccefc; font: 1.15em/1 "Segoe UI Symbol", serif; }
.celestial-heading + .journal { margin-top: 32px; }
.reading .zodiac-grid { margin-top: 26px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.period-links { margin-top: 25px; }
.prose { max-width: 720px; }
.prose p { margin-block: 17px; color: var(--ink); font: 1.15rem/1.65 var(--serif); }
.sign-reading .prose p:first-child::first-letter { float: left; margin: 3px 5px 0 0; font-size: 2.65rem; line-height: .78; color: var(--peach); }
.period-directory { margin-block: 45px 0; padding-block: 21px 0; border-top: 1px solid var(--line); }
.period-directory h2, .overview-section h2 { font-size: 1.95rem; }
.period-directory ul {
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px 18px;
  padding: 0; margin: 12px 0 0; list-style: none;
}
.period-directory a, .editorial-links a, .overview-sign h3 a {
  color: var(--teal); text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 4px; text-decoration-color: #7d9b8c;
}
.period-directory a:hover, .editorial-links a:hover, .overview-sign h3 a:hover { color: var(--peach); text-decoration-color: currentColor; }
.period-directory a { display: inline-flex; align-items: center; min-height: 38px; }
.overview-section { margin-top: 34px; }
.overview-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 32px; margin-top: 14px; }
.overview-sign { border-top: 1px solid var(--line); padding-block: 15px; }
.overview-sign h3, .forecast-topics h3 { font-size: 1.42rem; }
.overview-dates { margin-top: 5px; color: var(--muted); font-size: .77rem; }
.overview-preview { margin-top: 8px; font: 1.1rem/1.55 var(--serif); }
.overview-faq h2 { margin-bottom: 13px; }
.overview-faq details { border-top: 1px solid var(--line); padding: 10px 0; max-width: 720px; }
.overview-faq details:last-child { border-bottom: 1px solid var(--line); }
.overview-faq summary { cursor: pointer; font-weight: 550; padding-block: 4px; }
.overview-faq details p { padding: 8px 0 3px; color: var(--muted); }
.editorial-links { display: flex; gap: 7px 22px; flex-wrap: wrap; padding-block: 17px; margin-block: 22px 12px; border-top: 1px solid var(--line); font-size: .93rem; }
.forecast-topics { border-top: 1px solid var(--line); margin-top: 25px; }
.forecast-topics h2, .forecast-idea h2 { margin-top: 21px; margin-bottom: 18px; }
.forecast-topics p { margin-block: 6px 18px; }
.forecast-idea { margin-top: 22px; padding-left: 16px; border-left: 2px solid #a97660; }
.forecast-idea h2 { font-size: 1.65rem; margin-block: 0 7px; }
.forecast-idea p { margin-block: 0; }
.weekly-edition-link { margin-block: 16px 21px; font-size: .92rem; }
.weekly-edition-link a { display: inline-block; color: var(--teal); text-decoration: underline; text-underline-offset: 4px; padding-block: 7px; }
.weekly-edition-link a:is(:hover,:focus-visible) { color: var(--peach); }
.forecast-story { max-width: 67ch; margin-block: 13px 22px; }
.forecast-story > :is(h2,h3) { color: var(--peach); margin-block: 0 13px; font: 1.65rem/1.2 var(--serif); }
.forecast-story > p { font: 1.12rem/1.65 var(--serif); margin-block: 10px 0; }
.portal-body .forecast-story > p { margin-top: 10px; }
.prose h2 { margin-top: 30px; font-size: 1.9rem; }
.reading > .prose { margin-top: 26px; }
.related { padding-bottom: 60px; }
.related h2 { font-size: 1.85rem; margin-bottom: 15px; }
.index-page { padding-bottom: 12px; }
.index-page + .journal { margin-top: 20px; }
.ritual { display: flex; align-items: center; gap: 32px; max-width: 740px; margin-block: 26px; border-block: 1px solid var(--line); padding-block: 20px; }
.ritual canvas { width: 152px; max-width: 36%; height: auto; }
.ritual p { margin-top: 12px; }
.tarot-tool {
  --tarot-color: #edd1a4;
  display: grid; grid-template-columns: minmax(400px, 1.5fr) minmax(0, 1fr); align-items: center; gap: 24px;
  margin-block: 28px; padding: 12px 30px 12px 8px; border-block: 4px double #ac7460;
  background: #3d2929; color: var(--ivory);
}
.tarot-tool :focus-visible, .result-scene :focus-visible, .lunar :focus-visible { outline-color: var(--brass); }
.tarot-stage {
  --fan-step: 61px; --card-width: 129px;
  position: relative; display: grid; place-items: center; height: 286px; min-width: 0; isolation: isolate;
}
.tarot-stage::before, .tarot-stage::after {
  content: ""; position: absolute; z-index: -1; width: 210px; aspect-ratio: 1; border: 1px solid #644558;
  border-radius: 50%; opacity: .55; pointer-events: none;
}
.tarot-stage::after { width: 244px; border-style: dashed; opacity: .32; }
.tarot-card {
  --card-x: calc(var(--offset) * var(--fan-step));
  --card-y: max(calc(var(--offset) * 9px),calc(var(--offset) * -9px));
  --card-angle: calc(var(--offset) * 10deg);
  position: absolute; display: block; width: var(--card-width); aspect-ratio: 5/8;
  padding: 0; border: 0; border-radius: 7px; background: transparent;
  transform: translate(var(--card-x),var(--card-y)) rotate(var(--card-angle));
  transition: transform 430ms cubic-bezier(.23,.8,.27,1), opacity 220ms ease;
  perspective: 900px;
}
.tarot-card:not([aria-disabled=true]):is(:hover,:focus-visible) {
  transform: translate(var(--card-x),calc(var(--card-y) - 19px)) rotate(var(--card-angle));
  z-index: 2;
}
.tarot-card__turn {
  position: absolute; inset: 0; display: block; transform-style: preserve-3d;
  transition: transform 570ms cubic-bezier(.35,.05,.24,1) 90ms;
}
.tarot-card__back, .tarot-card__face {
  position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; border-radius: 7px;
  border: 1px solid #c78979; backface-visibility: hidden;
  box-shadow: 0 12px 30px #07040db0;
}
.tarot-card__back { color: #ffcfaa; background: #2d1b35 var(--tarot-back, none) center / cover; }
.tarot-tool.is-ready .tarot-card__back > span { display: none; }
.tarot-card__face { transform: rotateY(180deg); background: #171120; }
.tarot-card__face > canvas { width: 100%; height: 100%; display: block; }
.tarot-tool.is-revealed .tarot-card { cursor: default; }
.tarot-tool.is-revealed .tarot-card:not(.is-picked) { opacity: 0; pointer-events: none; }
.tarot-card.is-picked { z-index: 3; transform: translateY(-3px) rotate(0) scale(1.12); }
.tarot-card.is-picked .tarot-card__turn { transform: rotateY(180deg); }
.tarot-tool.is-restored .tarot-card, .tarot-tool.is-restored .tarot-card__turn { transition: none; }
.tarot-reading { display: grid; align-content: center; gap: 9px; min-height: 150px; }
.tarot-reading .eyebrow { color: var(--tarot-color); }
.tarot-reading h2 { font-size: 2rem; }
.tarot-reading p:not(.eyebrow) { color: #f0d7c5; max-width: 31ch; }
.journal-art-large { max-width: 740px; margin-top: 24px; aspect-ratio: auto; }
.personal-form { max-width: 660px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-top: 36px; }
label { display: grid; gap: 7px; font-size: .9rem; color: var(--muted); }
input, select { min-height: 44px; min-width: 0; width: 100%; padding: 6px 10px; border: 1px solid #89968b; border-radius: 5px; background: #fffdf5; color: var(--ink); }
.personal-form .primary, .form-error { grid-column: 1/-1; }
.form-error { color: #9a2419; }
.result-heading { padding-block: 24px 18px; }
.result-heading h1 { font-size: 2.6rem; }
.result-scene { position: relative; isolation: isolate; background: #090c16; border-block: 1px solid #343347; color: var(--ivory); color-scheme: dark; }
.result-scene canvas { display: block; width: 100%; height: clamp(420px, 70svh, 720px); touch-action: none; cursor: grab; }
.result-scene canvas:active { cursor: grabbing; }
.webgl-error { padding: 32px; text-align: center; }
.model-selection { position: absolute; top: 14px; left: max(18px, calc((100% - 1240px) / 2)); color: var(--chakra-color); font: .85rem var(--mono); pointer-events: none; }
.result-scene:has(canvas[hidden]) .model-selection { display: none; }
.model-tools { display: flex; position: absolute; bottom: 14px; right: 16px; border: 1px solid #89968b; border-radius: 24px; background: #171e23; }
.personal-details { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 26px 38px; padding-block: 30px 50px; }
.personal-details .prose { grid-column: 1/-1; }
.personal-details h2 { font-size: 1.95rem; margin-bottom: 10px; }
.chakra-detail { border-left: 1px solid var(--line); padding-left: 24px; }
.chakra-detail p, .chakra-detail li { color: var(--muted); }
.chakra-choice { display: grid; width: 100%; min-height: 40px; grid-template-columns: minmax(105px, 1.2fr) minmax(40px,1fr) 40px; gap: 10px; align-items: center; padding: 5px 8px; background: none; border: 1px solid transparent; border-radius: 5px; text-align: left; font-size: .88rem; }
.chakra-choice[aria-pressed=true] { border-color: var(--line); background: var(--panel); }
.chakra-bar { height: 5px; border-radius: 5px; background: #344642; overflow: hidden; }
.chakra-bar i { height: 100%; display: block; }

.starlit {
  --base: #0e1f33;
  --ink: #eef4fc;
  --muted: #bccce1;
  --panel: #142e48;
  --line: #41607d;
  --teal: #b0dbfa;
  --peach: #f3cda0;
  --star-field: url("assets/celestial/night-field.webp");
  color: var(--ink);
  background-color: #0a1526;
  background-repeat: no-repeat;
}
.starlit-shell {
  background-image: linear-gradient(90deg, #09172955, #091729d9 35%, #091729ed 64%, #09172965), var(--star-field);
  background-position: center, center 65%;
  background-size: auto, max(100%, 840px) auto;
}
.starlit-shell .header-cta { border-bottom-color: #7593b0; }
.starlit-shell .header-cta:hover { border-bottom-color: var(--peach); }
.starlit-catalog {
  background-image: linear-gradient(180deg, #0a15265c, #0a152682 205px, #0a1526 clamp(390px, 41vw, 680px)), var(--star-field);
  background-position: center, center top;
  background-size: auto, max(100%, 950px) auto;
}
.starlit-almanac { padding-bottom: 34px; }
.starlit-journal {
  display: flow-root;
  background-image: linear-gradient(180deg, #0a1526 0, #0a152666 36%, #0a152696 67%, #0a1526 100%), var(--star-field);
  background-position: center, center bottom;
  background-size: auto, max(100%, 950px) auto;
}
.starlit-journal .journal { margin-top: 26px; }
.starlit :is(.period-directory,.editorial-links,.overview-sign h3) a { text-decoration-color: #759cb9; }
.starlit .sign-mark { border-color: #64839f; }
.starlit .sign-card:is(:hover,:focus-visible,.is-selected) { background: #1e426568; }
.starlit .sign-card:is(:hover,:focus-visible) .sign-etching { filter: drop-shadow(0 0 10px #8dccfb66); }
.starlit .periods { border-color: #6a8ca9; }
.starlit .periods a[aria-current=page] { background: #b0dbfa; color: #101c2e; }
.starlit :focus-visible { outline-color: var(--peach); }

.library-inner { padding-block: 6px 64px; }
.library-guides { padding-block: 22px 33px; }
.library-guides h2 { font-size: 2.25rem; margin-bottom: 15px; }
.library-guides-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 31px; margin: 0; padding: 0; list-style: none; }
.library-guides-list li { --guide-accent: #ead0a6; min-width: 0; border-top: 1px solid var(--line); padding-block: 13px 15px; }
.library-guides-list li[data-group=moon] { --guide-accent: #b7d6ff; }
.library-guides-list li[data-group=tarot] { --guide-accent: #e6baf1; }
.library-guides-list li[data-group=forecasts] { --guide-accent: #a4dacc; }
.library-guides-list li[data-group=compatibility] { --guide-accent: #f0bcad; }
.library-guide-group { color: var(--guide-accent); font-size: .79rem; }
.library-guides-list h3 { margin-top: 4px; font-size: 1.27rem; line-height: 1.26; }
.library-guides-list h3 a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.library-guides-list h3 a:is(:hover,:focus-visible) { color: var(--guide-accent); text-decoration-color: currentColor; }
.library-guide-description { margin-top: 6px; color: var(--muted); font-size: .91rem; }
@media (max-width: 650px) {
  .library-guides-list { grid-template-columns: minmax(0, 1fr); }
  .library-guides h2 { font-size: 1.9rem; }
}
.library-nav { display: flex; flex-wrap: wrap; gap: 4px 22px; border-block: 1px solid var(--line); padding-block: 9px; }
.library-nav a { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; color: var(--teal); font-size: .91rem; }
.library-nav a span { color: var(--muted); font-size: .72em; }
.library-nav a:hover, .library-list a:hover { color: var(--peach); }
.library-section { margin-top: 40px; scroll-margin-top: 20px; }
.library-section h2 { font-size: 2.25rem; margin-bottom: 6px; }
.library-section .intro { font-size: .95rem; }
.library-list { list-style: none; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0 24px; padding: 0; margin: 18px 0 0; }
.library-list li { border-top: 1px solid var(--line); }
.library-list a { display: grid; grid-template-columns: 74px minmax(0,1fr); align-items: center; gap: 12px; min-height: 69px; padding: 10px 0; font: 1.08rem/1.27 var(--serif); overflow-wrap: anywhere; }
.library-list img { width: 74px; height: 42px; object-fit: cover; display: block; }
.library-masthead {
  background-image: linear-gradient(#0a15264f, #0a1526), var(--star-field);
  background-size: cover;
  background-position: center top;
  padding-block: 23px 0;
}
.library-heading { max-width: 1000px; }
.library-heading .crumbs { margin-bottom: 16px; }
.library-heading h1 { font-size: 3rem; max-width: 880px; margin-bottom: 24px; }
.library-cover { margin-inline: auto; border-bottom: 2px solid #426a87; }
.library-cover img { width: 100%; height: auto; aspect-ratio: 16/7; display: block; }
.library-reading { max-width: 880px; padding-top: 23px; }
.library-prose { max-width: none; }
.library-prose h2 { max-width: 38ch; }
.library-prose p, .library-prose ul, .library-prose ol { max-width: 71ch; }
.library-prose .journal-lead { font-size: 1.29rem; }
.library-prose table { width: 100%; margin-block: 20px 24px; border-collapse: collapse; font-size: .89rem; line-height: 1.45; }
.library-prose caption { text-align: left; color: var(--muted); margin-bottom: 9px; }
.library-prose :is(td,th) { padding: .6em .5em; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.library-prose th { color: var(--peach); overflow-wrap: normal; }
.library-prose dd { margin: 4px 0 15px; color: var(--muted); }
.library-prose li, .library-related li { margin-block: 8px; }
.library-prose a, .library-related a { color: var(--teal); text-decoration: underline; text-underline-offset: 4px; }
.journal-diagram { margin: 24px 0 32px; }
.journal-diagram img { display: block; max-width: 100%; height: auto; }
.journal-diagram figcaption, .journal-source { margin-top: 7px; color: var(--muted); font-size: .88rem; }
.library-related { padding-top: 21px; border-top: 1px solid var(--line); margin-top: 35px; }
.library-related h2 { font-size: 1.78rem; }

@media (max-width: 1150px) {
  .wrap { width: calc(100% - 64px); }
}
@media (min-width: 761px) and (max-height: 760px) {
  .hero-content { padding-top: 17px; }
  .hero h1 { font-size: 2.75rem; margin-bottom: 6px; }
  .hero { padding-bottom: 21px; }
}
@media (max-width: 960px) {
  .celestial-heading h1 { font-size: 3rem; }
  .library-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .zodiac .sign-card { min-height: 144px; }
  .sign-info strong { font-size: 1.04rem; }
  .sign-info small { font-size: .69rem; }
}
@media (max-width: 760px) {
  .wrap { width: calc(100% - 36px); }
  .header-inner { min-height: 62px; gap: 12px; flex-wrap: wrap; padding-block: 8px; }
  .header-cta { min-height: 36px; padding: 5px 0; font-size: .75rem; gap: 5px; }
  .brand { font-size: 1.28rem; }
  .brand span { width: 28px; margin-right: 2px; }
  .nav { order: 3; width: 100%; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 6px; font-size: .82rem; }
  .hero { padding-bottom: 22px; }
  .hero-content { width: min(392px,calc(100% - 48px)); padding-top: 20px; }
  .hero h1 { font-size: 2.9rem; margin-bottom: 8px; }
  .hero.is-atlas-ready .atlas-stage { height: clamp(308px, calc(100svh - 345px), 389px); }
  .forecast-signs a { min-height: 34px; padding-inline: 4px; font-size: .89rem; }
  .section-head { align-items: start; flex-direction: column; gap: 12px; }
  h2 { font-size: 2rem; }
  .zodiac { padding-top: 28px; }
  .zodiac-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .reading .zodiac-grid, .related .zodiac-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .zodiac .sign-card { min-height: 133px; }
  .sign-etching { width: 64px; height: 64px; }
  .sign-card { min-height: 78px; }
  .journal { margin-block: 46px; }
  .starlit-shell { background-position: center, left 50%; }
  .starlit-catalog { background-position: center, left top; }
  .starlit-almanac {
    background-image: linear-gradient(180deg, #0a15265c, #0a152682 205px, #0a1526 390px, #0a1526 calc(100% - 316px), #0a15269e calc(100% - 90px), #0a1526), var(--star-field), var(--star-field);
    background-position: center, left top, right bottom;
    background-size: auto, 950px auto, 950px auto;
  }
  .starlit-almanac .period-directory { margin-top: 32px; }
  .starlit-journal {
    background-image: linear-gradient(180deg, #0a1526, #0a152689 138px, #0a1526 390px, #0a1526 calc(100% - 390px), #0a152680 calc(100% - 138px), #0a1526), var(--star-field), var(--star-field);
    background-position: center, right top, left bottom;
    background-size: auto, 950px auto, 950px auto;
  }
  .starlit-journal .journal { margin-top: 13px; }
  .journal-grid { grid-template-columns: 1fr; }
  .library-list { grid-template-columns: 1fr; }
  .library-heading h1 { font-size: 2.14rem; margin-bottom: 17px; }
  .library-section h2 { font-size: 1.83rem; }
  .library-section { margin-top: 31px; }
  .library-nav { gap: 0 16px; }
  .period-directory ul { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
  .reading h1 { font-size: 2.65rem; }
  .celestial-heading h1 { font-size: 2.3rem; }
  .celestial-heading-content { padding-block: 24px 28px; }
  .celestial-heading-sign { min-height: 0; }
  .celestial-heading-sign .celestial-art { inset: auto 0 0; height: 221px; }
  .celestial-heading-sign .reading-head { padding-bottom: 227px; }
  .celestial-heading-sign .reading-head > * { max-width: 100%; }
  .personal-form, .personal-details { grid-template-columns: 1fr; }
  .chakra-detail { border-left: 0; border-top: 1px solid var(--line); padding: 14px 0 0; }
  .tarot-tool { grid-template-columns: minmax(0,1fr); gap: 0; padding: 4px 14px 18px; }
  .tarot-stage { --fan-step: 40px; --card-width: 100px; height: 222px; }
  .tarot-stage::before { width: 150px; }
  .tarot-stage::after { width: 178px; }
  .tarot-reading { min-height: 96px; }
  .tarot-reading h2 { font-size: 1.6rem; }
}
@media (max-width: 370px) {
  .hero h1 { font-size: 2.55rem; }
  .hero.is-atlas-ready .atlas-stage { height: 316px; }
  .forecast-signs { column-gap: 5px; }
  .forecast-signs a { padding-inline: 3px; font-size: .79rem; }
  .hero.is-atlas-ready .forecast-signs a { min-height: 30px; }
  .sign-card { padding: 8px; gap: 7px; }
  .sign-mark { width: 29px; font-size: 1.14rem; }
  .sign-info strong { font-size: .87rem; }
  .periods button, .periods a { padding-inline: 10px; }
  .ritual { gap: 15px; }
  .tarot-stage { --fan-step: 31px; --card-width: 94px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; }
}
