/* ==========================================================================
   Ascendant: an observatory plate, not a crystal ball.

   The visual argument of this site is that the astronomy is real and the
   interpretation is editorial, so the design borrows from scientific atlases:
   a dark plate, hairline rules, gilt glyphs, tabular figures, and prose set
   like a journal. Aspect tone is the only place colour carries meaning
   (phosphor green for ease, signal red for friction), and it is used nowhere
   else, so a green line on the wheel always means the same thing.
   ========================================================================== */

:root {
  /* Ground */
  --void:        #06080c;
  --plate:       #0b0f15;
  --plate-hi:    #111823;
  --plate-warm:  #14161b;

  /* Ink */
  --ink:         #eeece3;
  --ink-dim:     #99a3b1;
  --ink-faint:   #616b7a;
  --rule:        rgba(238, 236, 227, 0.11);
  --rule-strong: rgba(238, 236, 227, 0.22);

  /* Instruments */
  --gilt:        #d9b465;
  --gilt-dim:    #8c7440;
  --phosphor:    #56c9a0;
  --signal:      #e2574c;
  --bone:        #e6e0cd;

  /* Elements, used at low alpha behind the zodiac band */
  --fire:  #e08a4c;
  --earth: #9aa872;
  --air:   #86aad6;
  --water: #7d8ad6;

  --serif:   "Newsreader", Georgia, "Times New Roman", serif;
  --display: "Instrument Serif", "Newsreader", Georgia, serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --shell: 78rem;
  --measure: 62ch;

  --step--1: clamp(0.78rem, 0.76rem + 0.10vw, 0.84rem);
  --step-0:  clamp(1.02rem, 0.99rem + 0.16vw, 1.14rem);
  --step-1:  clamp(1.28rem, 1.20rem + 0.40vw, 1.56rem);
  --step-2:  clamp(1.70rem, 1.50rem + 0.95vw, 2.40rem);
  --step-3:  clamp(2.30rem, 1.80rem + 2.40vw, 4.00rem);
  --step-4:  clamp(3.00rem, 2.00rem + 4.60vw, 6.50rem);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  font-weight: 300;
  line-height: 1.62;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Atmosphere: a cold sky gradient, a hairline grid, and a film of grain.
   All three are fixed and non-interactive so scrolling reveals content
   against a still background, like a plate under glass. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 78% -10%, rgba(86, 120, 190, 0.16), transparent 62%),
    radial-gradient(90% 70% at 8% 108%, rgba(217, 180, 101, 0.09), transparent 60%),
    linear-gradient(180deg, #080b11 0%, var(--void) 45%, #04060a 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.shell {
  width: min(100% - 2.5rem, var(--shell));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 99;
  background: var(--gilt);
  color: var(--void);
  padding: 0.6rem 1rem;
  font-family: var(--mono);
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 1px solid var(--gilt);
  outline-offset: 3px;
}

/* --- type ---------------------------------------------------------------- */

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.012em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }

p { margin: 0 0 1.1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-color: var(--rule-strong); text-underline-offset: 0.22em; }
a:hover { text-decoration-color: var(--gilt); }

strong { font-weight: 500; }

/* The recurring small-caps monospace label. Used for every piece of chrome
   so the interface reads as apparatus and the serif is reserved for content. */
.label {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}

.lede {
  font-size: var(--step-1);
  line-height: 1.42;
  color: var(--ink-dim);
  font-weight: 300;
  max-width: var(--measure);
}

.prose { max-width: var(--measure); }
.prose h3 { margin: 2.4rem 0 0.7rem; }
.prose h3:first-child { margin-top: 0; }

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* --- masthead ------------------------------------------------------------ */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--void) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.1rem;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  text-decoration: none;
}
.wordmark-glyph { color: var(--gilt); font-size: 1.1rem; }
.wordmark-text {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.85rem, 2vw, 1.9rem);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav a { text-decoration: none; color: var(--ink-dim); transition: color 0.2s var(--ease); }
.nav a:hover { color: var(--ink); }
.nav a.is-current { color: var(--gilt); }
.nav-quiet { color: var(--ink-faint) !important; }
.nav-quiet:hover { color: var(--ink-dim) !important; }

.nav-cta {
  color: var(--void) !important;
  background: var(--gilt);
  padding: 0.45rem 0.9rem;
  border-radius: 1px;
}
.nav-cta:hover { background: var(--bone); }

/* --- footer -------------------------------------------------------------- */

.footer {
  margin-top: 7rem;
  border-top: 1px solid var(--rule);
  padding: 2.6rem 0 3.4rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem 3rem;
  align-items: flex-start;
  justify-content: space-between;
}
.footer-note {
  max-width: 44ch;
  font-size: var(--step--1);
  color: var(--ink-faint);
  line-height: 1.6;
  margin: 0;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.3rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.footer-nav a { color: var(--ink-faint); text-decoration: none; }
.footer-nav a:hover { color: var(--gilt); }

/* --- page furniture ------------------------------------------------------ */

.section { padding-block: clamp(3.2rem, 7vw, 6rem); }
.section-tight { padding-block: clamp(2.2rem, 4vw, 3.4rem); }

.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.4rem 2.5rem;
  padding-block: clamp(2.4rem, 5vw, 4rem) 1.6rem;
  border-bottom: 1px solid var(--rule);
}

/* --- hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  padding-block: clamp(3.5rem, 9vw, 8rem) clamp(3rem, 7vw, 6rem);
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.hero-title {
  font-size: var(--step-4);
  line-height: 0.92;
  letter-spacing: -0.025em;
}
.hero-title em {
  font-style: italic;
  color: var(--gilt);
}

.hero-lede { margin-top: 1.6rem; }

.hero-actions {
  margin-top: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.4rem;
  align-items: center;
}

/* The rotating ring: decorative, deliberately slow, and behind everything.
   One rotation every six minutes is slow enough to read as drift rather than
   animation, which is the point. */
.hero-ring {
  position: absolute;
  right: -6%;
  top: 50%;
  translate: 0 -50%;
  width: min(40rem, 60vw);
  aspect-ratio: 1;
  z-index: 1;
  opacity: 0.55;
  animation: drift 360s linear infinite;
}
.hero-ring .diagram { width: 100%; height: 100%; }

@keyframes drift { to { rotate: -360deg; } }

/* --- buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.85rem 1.6rem;
  border: 1px solid var(--gilt);
  background: var(--gilt);
  color: var(--void);
  text-decoration: none;
  border-radius: 1px;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), translate 0.2s var(--ease);
}
.btn:hover { background: var(--bone); border-color: var(--bone); translate: 0 -1px; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}
.btn-ghost:hover { background: transparent; border-color: var(--gilt); color: var(--gilt); }

.btn-danger { background: transparent; color: var(--signal); border-color: var(--signal); }
.btn-danger:hover { background: var(--signal); color: var(--void); border-color: var(--signal); }

.btn-sm { padding: 0.55rem 1rem; font-size: 0.68rem; }

/* --- panels -------------------------------------------------------------- */

.panel {
  border: 1px solid var(--rule);
  background: linear-gradient(180deg, var(--plate-hi), var(--plate));
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border-radius: 2px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--rule);
}

.note {
  border-left: 2px solid var(--gilt-dim);
  padding: 0.2rem 0 0.2rem 1.3rem;
  margin: 2rem 0;
  color: var(--ink-dim);
  font-size: 0.96em;
  max-width: var(--measure);
}

/* --- the live sky panel -------------------------------------------------- */

.sky-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.sky-cell {
  background: var(--plate);
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: background 0.25s var(--ease);
}
.sky-cell:hover { background: var(--plate-hi); }

.sky-body {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.sky-body .glyph { font-size: 1.15rem; color: var(--gilt); letter-spacing: 0; }

.sky-position {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.sky-position .sign { color: var(--ink-dim); }

.retro { color: var(--signal); font-size: 0.72rem; }

/* --- reading ------------------------------------------------------------- */

.reading-head { padding-block: clamp(2.5rem, 6vw, 5rem) 2rem; }

.reading-headline {
  font-size: var(--step-3);
  line-height: 1.0;
  max-width: 18ch;
}

.reading-glance {
  font-family: var(--serif);
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--ink);
  max-width: 52ch;
  margin-top: 1.6rem;
}

.advice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 2.6rem;
}
.advice-cell { background: var(--plate); padding: 1.5rem 1.6rem; }
.advice-cell .label { margin-bottom: 0.7rem; }
.advice-do .label { color: var(--phosphor); }
.advice-dont .label { color: var(--signal); }
.advice-cell p { font-size: 1.03rem; line-height: 1.5; }

/* One passage per transit. The tone bar down the left is the only thing that
   differs between them, which makes a friction day visible at a glance. */
.passage {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  gap: 0 1.6rem;
  padding: 1.8rem 0;
  border-top: 1px solid var(--rule);
}
.passage-index {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  padding-top: 0.45rem;
  border-left: 2px solid var(--tone, var(--rule-strong));
  padding-left: 0.8rem;
}
.passage-title { font-size: var(--step-1); }
.passage-body { margin-top: 0.6rem; max-width: var(--measure); color: var(--ink-dim); }

.passage[data-tone="harmonious"] { --tone: var(--phosphor); }
.passage[data-tone="friction"]   { --tone: var(--signal); }
.passage[data-tone="neutral"]    { --tone: var(--bone); }

.orb-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.orb-meta b { color: var(--ink-dim); font-weight: 400; }

/* A hairline gauge: how close to exact this transit is. */
.orb-gauge {
  --fill: 0;
  position: relative;
  width: 4.5rem;
  height: 2px;
  background: var(--rule-strong);
  align-self: center;
}
.orb-gauge::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--fill) * 100%);
  background: var(--tone, var(--gilt));
}

.day-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.day-nav a { color: var(--ink-dim); text-decoration: none; }
.day-nav a:hover { color: var(--gilt); }
.day-nav span { color: var(--ink-faint); }

/* --- chart page ---------------------------------------------------------- */

.chart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 3.6rem);
  align-items: start;
  padding-block: 2.6rem;
}

.wheel-holder { position: sticky; top: 5.6rem; }

.wheel { width: 100%; height: auto; display: block; }

.system-switch {
  display: flex;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 1.4rem;
}
.system-switch a {
  flex: 1;
  background: var(--plate);
  padding: 0.65rem 0.5rem;
  text-align: center;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.system-switch a:hover { color: var(--ink); background: var(--plate-hi); }
.system-switch a.is-current { color: var(--void); background: var(--gilt); }

/* The placements table, set like an ephemeris. */
.ephemeris { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.82rem; }
.ephemeris th {
  text-align: left;
  font-weight: 400;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 0.6rem 0.6rem 0;
  border-bottom: 1px solid var(--rule-strong);
}
.ephemeris td {
  padding: 0.62rem 0.6rem 0.62rem 0;
  border-bottom: 1px solid var(--rule);
  font-variant-numeric: tabular-nums;
  vertical-align: baseline;
}
.ephemeris tr:hover td { background: rgba(217, 180, 101, 0.045); }
.ephemeris .cell-body { color: var(--ink); white-space: nowrap; }
.ephemeris .cell-body .glyph { color: var(--gilt); margin-right: 0.45rem; }
.ephemeris .cell-sign { color: var(--ink-dim); }
.ephemeris .cell-house { color: var(--ink-faint); text-align: right; }
.ephemeris .cell-gloss {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--ink-dim);
  line-height: 1.4;
}

.aspect-list { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.aspect-row {
  background: var(--plate);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.4rem 1rem;
  align-items: center;
  padding: 0.8rem 1rem;
  border-left: 2px solid var(--tone, var(--rule-strong));
}
.aspect-row[data-tone="harmonious"] { --tone: var(--phosphor); }
.aspect-row[data-tone="friction"]   { --tone: var(--signal); }
.aspect-row[data-tone="neutral"]    { --tone: var(--bone); }
.aspect-pair { font-family: var(--mono); font-size: 0.82rem; color: var(--ink); }
.aspect-pair .glyph { color: var(--gilt); }
.aspect-orb { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.aspect-gloss { grid-column: 1 / -1; font-size: 0.94rem; color: var(--ink-dim); line-height: 1.45; }

.polarity-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.polarity { background: var(--plate); padding: 1.1rem 1.2rem; }
.polarity h4 { font-family: var(--display); font-weight: 400; font-size: 1.1rem; margin: 0 0 0.5rem; }
.polarity dl { margin: 0; font-size: 0.9rem; }
.polarity dt { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); margin-top: 0.6rem; }
.polarity dd { margin: 0.15rem 0 0; color: var(--ink-dim); }

/* --- forms --------------------------------------------------------------- */

.form { max-width: 34rem; }
.field { margin-bottom: 1.7rem; position: relative; }
.field > label,
.field > .label { display: block; margin-bottom: 0.5rem; }

.hint { font-size: 0.82rem; color: var(--ink-faint); margin-top: 0.45rem; line-height: 1.45; }

input[type="text"], input[type="date"], input[type="time"], input[type="search"], select {
  width: 100%;
  background: var(--plate);
  border: 1px solid var(--rule-strong);
  border-radius: 1px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.95rem;
  padding: 0.8rem 0.9rem;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
input:focus, select:focus { outline: none; border-color: var(--gilt); background: var(--plate-hi); }
input::placeholder { color: var(--ink-faint); }

/* Date and time inputs render their own picker glyph; tint it to match. */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.75) sepia(0.4) saturate(2) hue-rotate(5deg);
  cursor: pointer;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-faint) 50%),
                    linear-gradient(135deg, var(--ink-faint) 50%, transparent 50%);
  background-position: calc(100% - 1.1rem) 1.15rem, calc(100% - 0.75rem) 1.15rem;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.4rem;
}

.check { display: flex; align-items: flex-start; gap: 0.7rem; cursor: pointer; }
.check input { accent-color: var(--gilt); width: 1rem; height: 1rem; margin-top: 0.3rem; flex: none; }
.check span { font-size: 0.94rem; color: var(--ink-dim); }

.combo { position: relative; }
.combo-list {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 4px);
  z-index: 15;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--plate-hi);
  border: 1px solid var(--rule-strong);
  max-height: 17rem;
  overflow-y: auto;
}
.combo-list:empty, .combo-list[hidden] { display: none; }
.combo-list li {
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.84rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
}
.combo-list li:last-child { border-bottom: 0; }
.combo-list li:hover, .combo-list li[aria-selected="true"] { background: var(--gilt); color: var(--void); }
.combo-list li .tz { color: var(--ink-faint); font-size: 0.72rem; }
.combo-list li:hover .tz, .combo-list li[aria-selected="true"] .tz { color: rgba(6, 8, 12, 0.7); }

.chosen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.55rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--gilt-dim);
  background: rgba(217, 180, 101, 0.07);
  font-family: var(--mono);
  font-size: 0.8rem;
}
.chosen[hidden] { display: none; }
.chosen .tz { color: var(--ink-faint); }

.alert {
  border: 1px solid var(--signal);
  border-left-width: 2px;
  background: rgba(226, 87, 76, 0.08);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.8rem;
  font-size: 0.94rem;
}
.alert-ok { border-color: var(--phosphor); background: rgba(86, 201, 160, 0.08); }

/* --- learn --------------------------------------------------------------- */

.toc { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.toc-item {
  background: var(--plate);
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) auto;
  gap: 1.2rem;
  align-items: baseline;
  padding: 1.35rem 1.4rem;
  text-decoration: none;
  transition: background 0.25s var(--ease);
}
.toc-item:hover { background: var(--plate-hi); }
.toc-item:hover .toc-arrow { color: var(--gilt); translate: 4px 0; }
.toc-number { font-family: var(--mono); font-size: 0.8rem; color: var(--gilt-dim); }
.toc-title { font-family: var(--display); font-size: var(--step-1); }
.toc-dek { grid-column: 2; font-size: 0.94rem; color: var(--ink-faint); margin-top: 0.25rem; }
.toc-arrow { color: var(--ink-faint); transition: color 0.25s var(--ease), translate 0.25s var(--ease); }

.figure { margin: 2.6rem 0; text-align: center; }
.figure .diagram { width: min(24rem, 100%); height: auto; }
.figure .diagram-wide { width: min(32rem, 100%); }
.figcaption {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-top: 0.9rem;
}

.data-table { width: 100%; border-collapse: collapse; margin: 2rem 0; font-size: 0.94rem; }
.data-table th {
  text-align: left;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 1rem 0.6rem 0;
  border-bottom: 1px solid var(--rule-strong);
}
.data-table td {
  padding: 0.65rem 1rem 0.65rem 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-dim);
  vertical-align: top;
}
.data-table td:first-child { color: var(--ink); font-family: var(--mono); font-size: 0.86rem; white-space: nowrap; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 3.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
}
.pager a { text-decoration: none; max-width: 20rem; }
.pager .label { margin-bottom: 0.35rem; }
.pager strong { font-family: var(--display); font-size: var(--step-1); font-weight: 400; }
.pager a:hover strong { color: var(--gilt); }
.pager-next { text-align: right; margin-left: auto; }

/* --- the wheel ----------------------------------------------------------- */

.wheel text, .diagram text { text-anchor: middle; }

/* The zodiac symbols default to emoji presentation, which pulls them out of
   the page font and renders them as coloured pictographs. The markup appends
   U+FE0E; this is the belt-and-braces for browsers that honour the property
   instead. Applied to every element that can carry a sign glyph. */
.sign-glyph, .legend-sign, .glyph, .toc-number, .sky-body .glyph {
  font-variant-emoji: text;
}

.wheel-rim { fill: none; stroke: var(--rule); stroke-width: 1; }
.wheel-ring { fill: none; stroke: var(--rule-strong); stroke-width: 1; }
.wheel-ring-faint { stroke: var(--rule); }

.zone { stroke: none; }
.zone-fire  { fill: color-mix(in srgb, var(--fire) 9%, transparent); }
.zone-earth { fill: color-mix(in srgb, var(--earth) 9%, transparent); }
.zone-air   { fill: color-mix(in srgb, var(--air) 9%, transparent); }
.zone-water { fill: color-mix(in srgb, var(--water) 9%, transparent); }

.zone-text-fire  { fill: var(--fire); }
.zone-text-earth { fill: var(--earth); }
.zone-text-air   { fill: var(--air); }
.zone-text-water { fill: var(--water); }

.sign-glyph { fill: var(--bone); font-size: 30px; font-family: var(--serif); }

.tick { stroke: var(--rule); stroke-width: 1; }
.tick-major { stroke: var(--rule-strong); }
.tick-cusp { stroke: var(--ink-faint); stroke-width: 1.4; }
.tick-body { stroke: var(--gilt); stroke-width: 1.6; }

.cusp { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 5; }
.cusp-angular { stroke: var(--ink-faint); stroke-width: 1.3; stroke-dasharray: none; }

.house-number { fill: var(--ink-faint); font-family: var(--mono); font-size: 15px; }
.angle-label { fill: var(--gilt); font-family: var(--mono); font-size: 15px; letter-spacing: 0.1em; }

.leader { stroke: var(--gilt-dim); stroke-width: 1; opacity: 0.55; }

.body-glyph { fill: var(--gilt); font-size: 32px; font-family: var(--serif); }
.body-glyph.is-retrograde { fill: var(--signal); }
.body-degree { fill: var(--ink-faint); font-family: var(--mono); font-size: 15px; }

/* Aspect chords fade with looseness: the tight ones are what should catch
   the eye, and a chart with forty faint lines is a chart nobody reads. */
.aspect {
  stroke-width: calc(0.7px + var(--tightness, 0.5) * 1.4px);
  opacity: calc(0.2 + var(--tightness, 0.5) * 0.65);
}
.aspect-harmonious { stroke: var(--phosphor); }
.aspect-friction   { stroke: var(--signal); }
.aspect-neutral    { stroke: var(--bone); }

/* Opaque, because the aspect chords pass straight through the centre. */
.legend-disc { fill: var(--plate); stroke: var(--rule-strong); stroke-width: 1; }
.legend-body { fill: var(--gilt); font-size: 25px; font-family: var(--serif); }
.legend-sign { fill: var(--bone); font-size: 25px; font-family: var(--serif); }

.diagram-glyph { font-size: 24px; }
.diagram-caption { fill: var(--ink-faint); font-family: var(--mono); font-size: 13px; letter-spacing: 0.1em; }
.diagram-label { fill: var(--ink-dim); font-family: var(--mono); font-size: 14px; }
.diagram-node { fill: var(--gilt); }
.diagram-node.is-origin { fill: var(--bone); }

/* --- entrance ------------------------------------------------------------ */

.reveal {
  animation: rise 0.9s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 90ms);
}
@keyframes rise {
  from { opacity: 0; translate: 0 14px; }
  to   { opacity: 1; translate: 0 0; }
}

/* --- responsive ---------------------------------------------------------- */

@media (max-width: 62rem) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-ring { right: -34%; opacity: 0.22; }
  .chart-layout { grid-template-columns: 1fr; }
  .wheel-holder { position: static; }
}

@media (max-width: 40rem) {
  .masthead-inner { flex-wrap: wrap; padding-block: 0.7rem; min-height: 0; }
  .nav { width: 100%; justify-content: flex-start; }
  .passage { grid-template-columns: 1fr; gap: 0.8rem; }
  .passage-index { border-left: 0; border-top: 2px solid var(--tone, var(--rule-strong)); padding: 0.6rem 0 0; }
  .pager { flex-direction: column; }
  .pager-next { text-align: left; margin-left: 0; }
}

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