/* ====================================================================
   Western natal chart card (reading/_astro-chart, 2026-10-28)
   Always a dark "planisphere" card — same look on the classic paper theme and the
   astro "cosmos" theme. Static file (no build); cache-busted with ?v=filemtime.
   Palette: indigo night, starlight gold, aurora teal (soft aspects), coral (hard aspects),
   element colours fire / earth / air / water.
   ==================================================================== */
.ac-card {
  --ac-ink: #0b0f26;
  --ac-ink-2: #121a3e;
  --ac-star: #eef0fa;
  --ac-mist: #aeb6da;
  --ac-dim: #8a93bc;
  --ac-gold: #e9c77b;
  --ac-teal: #5ed6c4;
  --ac-coral: #ee8a7a;
  --ac-fire: #f0906a;
  --ac-earth: #d9bc7e;
  --ac-air: #bcc8f0;
  --ac-water: #6fa0f0;
  position: relative;
  isolation: isolate;
  margin: 0 auto;
  max-width: 46rem;
  padding: 1.5rem 1rem 1.25rem;
  border-radius: 22px;
  color: var(--ac-star);
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(94, 214, 196, .08), transparent 60%),
    radial-gradient(90% 50% at 100% 100%, rgba(233, 199, 123, .07), transparent 60%),
    linear-gradient(180deg, #111739 0%, #0b0f26 100%);
  box-shadow: inset 0 0 0 1px rgba(233, 199, 123, .22), 0 30px 60px -34px rgba(4, 6, 20, .9);
  overflow: hidden;
}
/* fine grain + faint constellation scatter */
.ac-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .5;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, .7), transparent 60%),
    radial-gradient(1px 1px at 82% 9%, rgba(255, 255, 255, .55), transparent 60%),
    radial-gradient(1.2px 1.2px at 91% 44%, rgba(233, 199, 123, .7), transparent 60%),
    radial-gradient(1px 1px at 6% 62%, rgba(255, 255, 255, .5), transparent 60%),
    radial-gradient(1px 1px at 70% 92%, rgba(255, 255, 255, .45), transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .05 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}
.ac-card-head { text-align: center; margin-bottom: .75rem; }
.ac-card-title {
  margin: 0;
  font-family: var(--font-display-tc, "Noto Serif TC", serif);
  font-size: clamp(1.35rem, 4.6vw, 1.75rem);
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--ac-gold);
}
.ac-card-sub { margin: .35rem 0 0; font-size: .8125rem; color: var(--ac-mist); letter-spacing: .02em; }
.ac-sep { display: inline-block; width: 4px; height: 4px; margin: 0 .55em .18em; border-radius: 50%; background: rgba(233, 199, 123, .55); }

/* ---- wheel stage ---- */
.ac-stage { position: relative; margin: 0 auto; width: 100%; max-width: 620px; aspect-ratio: 1 / 1; }
.ac-stage > svg.ac-wheel { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; transition: opacity .7s ease; }
.ac-stage > canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; transition: opacity .9s ease;
  /* soft round edge so the star field never shows as a square */
  -webkit-mask-image: radial-gradient(circle closest-side, #000 90%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 90%, transparent 100%);
}
.ac-stage[data-state="playing"] > svg.ac-wheel { opacity: 0; transition-duration: .25s; }
.ac-stage[data-state="done"] > canvas.ac3d-fx { opacity: 0; }
.ac-replay {
  position: absolute;
  right: 0;
  bottom: -.25rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .7rem;
  border: 1px solid rgba(233, 199, 123, .35);
  border-radius: 999px;
  background: rgba(11, 15, 38, .72);
  color: var(--ac-mist);
  font-size: .75rem;
  cursor: pointer;
}
.ac-replay:hover { color: var(--ac-gold); border-color: rgba(233, 199, 123, .6); }
.ac-replay:focus-visible { outline: 2px solid var(--ac-gold); outline-offset: 2px; }
.ac-replay[hidden] { display: none; }

/* static fallback: aspect lines draw in once (no 3D, motion allowed) */
.ac-stage.is-draw .ac-asp:not([stroke-dasharray]) { stroke-dasharray: 600; stroke-dashoffset: 600; animation: acDraw 1.6s cubic-bezier(.3, .7, .2, 1) forwards; }
.ac-stage.is-draw .ac-asp[stroke-dasharray] { animation: acFade 1.4s ease both; }
.ac-stage.is-draw .ac-asp:nth-child(3n+1) { animation-delay: .15s; }
.ac-stage.is-draw .ac-asp:nth-child(3n+2) { animation-delay: .35s; }
.ac-stage.is-draw [data-layer="planets"] > g { animation: acFade .9s ease both; }
@keyframes acDraw { to { stroke-dashoffset: 0; } }
@keyframes acFade { from { opacity: 0; } to { opacity: 1; } }

/* ---- legend ---- */
.ac-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem 1rem; margin: .9rem 0 0; padding: 0; list-style: none; font-size: .75rem; color: var(--ac-mist); }
.ac-legend li { display: inline-flex; align-items: center; gap: .4rem; }
.ac-key { display: inline-block; width: 18px; height: 0; border-top: 2px solid; }
.ac-key-soft { border-color: var(--ac-teal); }
.ac-key-hard { border-color: var(--ac-coral); border-top-style: dashed; }
.ac-key-axis { border-color: var(--ac-gold); }
.ac-key-r, .ac-retro { color: var(--ac-coral); font-weight: 700; font-size: .7rem; }
.ac-retro { margin-left: .2rem; }

.ac-note {
  margin: 1rem auto 0;
  max-width: 36rem;
  padding: .75rem .95rem;
  border-radius: 12px;
  background: rgba(94, 214, 196, .07);
  box-shadow: inset 0 0 0 1px rgba(94, 214, 196, .28);
  font-size: .875rem;
  line-height: 1.75;
  color: #d6dbf0;
}
.ac-note strong { color: var(--ac-teal); font-weight: 600; }

/* constellation-line divider */
.ac-divider { display: flex; justify-content: center; margin: 1.25rem 0 .5rem; color: var(--ac-gold); }
.ac-divider svg { width: min(320px, 80%); height: 24px; }

.ac-h3 { margin: 1rem 0 .55rem; font-size: .9375rem; font-weight: 700; letter-spacing: .08em; color: var(--ac-gold); }

/* ---- planets table ---- */
.ac-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ac-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.ac-table th, .ac-table td { padding: .5rem .4rem; text-align: left; border-bottom: 1px solid rgba(174, 182, 218, .14); white-space: nowrap; }
.ac-table thead th { font-size: .72rem; font-weight: 500; color: var(--ac-dim); letter-spacing: .06em; border-bottom-color: rgba(233, 199, 123, .3); }
.ac-table tbody th { font-weight: 500; color: var(--ac-star); }
.ac-table tr.is-axis th, .ac-table tr.is-axis td { background: rgba(233, 199, 123, .06); }
.ac-pl, .ac-sign { display: inline-flex; align-items: center; gap: .45rem; }
.ac-pl svg { width: 20px; height: 20px; color: var(--ac-star); flex: none; }
.ac-pl svg.is-lum { color: #f2d58e; }
.ac-pl-axis { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 20px; padding: 0 .3rem; border-radius: 6px; background: rgba(233, 199, 123, .16); color: var(--ac-gold); font-size: .68rem; font-weight: 700; letter-spacing: .04em; }
.ac-sign { padding: .12rem .55rem .12rem .3rem; border-radius: 999px; background: color-mix(in srgb, var(--el, #aeb6da) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--el, #aeb6da) 40%, transparent); color: var(--ac-star); }
.ac-sign svg { width: 18px; height: 18px; color: var(--el); flex: none; }
[data-el="fire"] { --el: var(--ac-fire, #f0906a); }
[data-el="earth"] { --el: var(--ac-earth, #d9bc7e); }
[data-el="air"] { --el: var(--ac-air, #bcc8f0); }
[data-el="water"] { --el: var(--ac-water, #6fa0f0); }
.ac-deg { font-variant-numeric: tabular-nums; color: #d9ddf0; }
.ac-house { color: var(--ac-mist); }

/* ---- elements & aspects ---- */
.ac-grid2 { display: grid; gap: .25rem 2rem; grid-template-columns: 1fr; margin-top: .5rem; }
@media (min-width: 640px) { .ac-grid2 { grid-template-columns: 1fr 1fr; } }
.ac-elements { margin: 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.ac-elements li { display: grid; grid-template-columns: 4.8rem 1fr 1.5rem; align-items: center; gap: .6rem; font-size: .8125rem; color: var(--ac-mist); }
.ac-elements li.is-dominant { color: var(--ac-star); }
.ac-el-name { display: inline-flex; align-items: center; gap: .4rem; }
.ac-el-dot { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; font-size: .7rem; font-weight: 700; color: #0b0f26; background: var(--el); }
.ac-el-bar { height: 6px; border-radius: 999px; background: rgba(174, 182, 218, .12); overflow: hidden; }
.ac-el-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--el) 55%, transparent), var(--el)); }
.ac-el-count { text-align: right; font-variant-numeric: tabular-nums; }
.ac-modes { display: flex; flex-wrap: wrap; gap: .4rem; margin: .7rem 0 0; font-size: .75rem; }
.ac-modes span { padding: .15rem .55rem; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(174, 182, 218, .25); color: var(--ac-mist); }
.ac-modes span.is-dominant { color: var(--ac-gold); box-shadow: inset 0 0 0 1px rgba(233, 199, 123, .55); }
.ac-aspects { margin: 0; padding: 0; list-style: none; display: grid; gap: .35rem; font-size: .8125rem; }
.ac-aspects li { display: flex; justify-content: space-between; gap: .75rem; padding: .3rem 0; border-bottom: 1px dashed rgba(174, 182, 218, .14); }
.ac-asp-pair { color: var(--ac-star); }
.ac-asp-sym { display: inline-block; width: 13px; height: 13px; margin: 0 .4rem; vertical-align: -1px; }
.ac-aspects li[data-nature="soft"] .ac-asp-sym { color: var(--ac-teal); }
.ac-aspects li[data-nature="hard"] .ac-asp-sym { color: var(--ac-coral); }
.ac-aspects li[data-nature="fusion"] .ac-asp-sym { color: var(--ac-gold); }
.ac-asp-type { color: var(--ac-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ac-foot { margin: 1rem 0 0; text-align: center; font-size: .75rem; color: var(--ac-dim); }

@media (min-width: 768px) {
  .ac-card { padding: 2rem 2rem 1.5rem; }
}
/* phones: the card bleeds into the reading card's padding so the wheel gets the full width */
@media (max-width: 639px) {
  .ac-card { margin-left: -1.25rem; margin-right: -1.25rem; padding: 1.25rem .5rem 1rem; border-radius: 16px; }
  .ac-card .ac-table-wrap, .ac-card .ac-grid2, .ac-card .ac-note, .ac-card .ac-h3, .ac-card .ac-foot, .ac-card .ac-legend { margin-left: .5rem; margin-right: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ac-stage > svg.ac-wheel, .ac-stage > canvas { transition: none; }
}

/* ====================================================================
   Start page: 12-sign dial (reading/_astro-start-intro)
   ==================================================================== */
.ac-dial-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 132px 1fr;
  grid-template-areas: "dial text" "list list";
  align-items: center;
  gap: .9rem 1.1rem;
  max-width: 42rem;
  margin: 0 auto 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 20px;
  color: #eef0fa;
  background:
    radial-gradient(80% 120% at 0% 50%, rgba(94, 214, 196, .1), transparent 60%),
    linear-gradient(160deg, #141b44 0%, #0b0f26 100%);
  box-shadow: inset 0 0 0 1px rgba(233, 199, 123, .22), 0 24px 50px -34px rgba(4, 6, 20, .9);
}
.ac-dial { grid-area: dial; width: 132px; height: 132px; overflow: visible; }
.ac-dial-ring { fill: none; stroke: #e9c77b; stroke-opacity: .55; stroke-width: 1.2; }
.ac-dial-ring.is-in { stroke-opacity: .3; stroke-dasharray: 1 4; }
.ac-dial-tick { stroke: #e9c77b; stroke-opacity: .28; stroke-width: 1; }
.ac-dial-rot { transform-box: view-box; transform-origin: 120px 120px; transition: transform 1.1s cubic-bezier(.22, .8, .2, 1); }
.ac-dial-sign { opacity: .55; transition: opacity .5s ease; }
.ac-dial-sign.is-on { opacity: 1; filter: drop-shadow(0 0 6px currentColor); }
.ac-dial-pin { fill: #5ed6c4; }
.ac-dial-text { grid-area: text; min-width: 0; }
.ac-dial-k { margin: 0; font-size: .75rem; letter-spacing: .1em; color: #aeb6da; }
.ac-dial-v { margin: .15rem 0 .2rem; font-family: var(--font-display-tc, "Noto Serif TC", serif); font-size: 1.1rem; color: #aeb6da; letter-spacing: .08em; }
.ac-dial-wrap.has-sign .ac-dial-v { font-size: 1.6rem; color: #e9c77b; }
.ac-dial-n { margin: 0; font-size: .75rem; line-height: 1.6; color: #8a93bc; }
.ac-dial-list { grid-area: list; display: grid; gap: .35rem; margin: 0; padding: .75rem 0 0; border-top: 1px solid rgba(233, 199, 123, .16); list-style: none; font-size: .8125rem; color: #d6dbf0; }
.ac-dial-list li { position: relative; padding-left: 1.1rem; }
.ac-dial-list li::before { content: ""; position: absolute; left: .15rem; top: .55em; width: 5px; height: 5px; transform: rotate(45deg); background: #5ed6c4; }
@media (min-width: 640px) {
  .ac-dial-wrap { grid-template-columns: 150px 1fr 1fr; grid-template-areas: "dial text list"; padding: 1.1rem 1.4rem; }
  .ac-dial { width: 150px; height: 150px; }
  .ac-dial-list { padding: 0 0 0 1rem; border-top: 0; border-left: 1px solid rgba(233, 199, 123, .16); }
}
@media (prefers-reduced-motion: reduce) {
  .ac-dial-rot, .ac-dial-sign { transition: none; }
}
