/* ==========================================================
   zodiac.css — design system
   shared by signos / signs / los-signos
   ========================================================== */

/* ---------- tokens ---------- */
:root {
  --font-display: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --maxw: 1120px;
  --gap: clamp(1rem, 2vw, 1.5rem);
  --ease: cubic-bezier(.2, .7, .3, 1);

  --fire: #ff6b57;
  --earth: #5ecb8a;
  --air: #67d3e6;
  --water: #6f8dff;

  --step--1: clamp(.8rem, .76rem + .2vw, .9rem);
  --step-0: clamp(1rem, .96rem + .3vw, 1.1rem);
  --step-1: clamp(1.25rem, 1.1rem + .7vw, 1.5rem);
  --step-2: clamp(1.6rem, 1.3rem + 1.4vw, 2.2rem);
  --step-3: clamp(2rem, 1.5rem + 2.6vw, 3.2rem);

  --stars: none;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg-0: #0b0f1f;
  --bg-1: #1a1440;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .08);
  --border: rgba(255, 255, 255, .13);
  --text: #e9ecf5;
  --muted: #9aa3b8;
  --gold: #e8c26a;
  --gold-ink: #12162a;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
  --fire: #ff6b57;
  --earth: #5ecb8a;
  --air: #67d3e6;
  --water: #6f8dff;
  --stars:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255, 255, 255, .55), transparent 60%),
    radial-gradient(1px 1px at 68% 12%, rgba(255, 255, 255, .45), transparent 60%),
    radial-gradient(1.5px 1.5px at 34% 68%, rgba(255, 255, 255, .40), transparent 60%),
    radial-gradient(1px 1px at 86% 58%, rgba(255, 255, 255, .50), transparent 60%),
    radial-gradient(1px 1px at 50% 88%, rgba(255, 255, 255, .35), transparent 60%),
    radial-gradient(1.5px 1.5px at 6% 76%, rgba(255, 255, 255, .35), transparent 60%),
    radial-gradient(1px 1px at 92% 30%, rgba(255, 255, 255, .35), transparent 60%);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg-0: #f7f5ef;
  --bg-1: #ece9dc;
  --surface: #ffffff;
  --surface-2: #faf8f2;
  --border: rgba(20, 24, 36, .14);
  --text: #141824;
  --muted: #5b6274;
  --gold: #87590e;
  --gold-ink: #ffffff;
  --shadow: 0 14px 30px rgba(20, 24, 36, .10);
  --fire: #b03318;
  --earth: #146e45;
  --air: #0d6a7c;
  --water: #3649bd;
}

[data-element="fire"] { --el: var(--fire); }
[data-element="earth"] { --el: var(--earth); }
[data-element="air"] { --el: var(--air); }
[data-element="water"] { --el: var(--water); }

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg-0);
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

/* fixed sky: gradients and stars stay in the viewport */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1100px 700px at 85% -10%, color-mix(in srgb, var(--bg-1) 90%, transparent), transparent 70%),
    radial-gradient(900px 600px at -10% 110%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 70%),
    var(--stars);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--gold); }

img, svg { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  padding: .6rem 1rem;
  background: var(--gold);
  color: var(--gold-ink);
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 600;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 1rem; }

section[id] { scroll-margin-top: 5rem; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg-0) 82%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-display);
  font-size: 1.12rem;
  color: var(--text);
  text-decoration: none;
}
.brand__mark { color: var(--gold); }

.header-tools {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.lang {
  display: flex;
  gap: .25rem;
  padding: .2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
}
.lang a {
  display: block;
  padding: .25rem .6rem;
  border-radius: var(--radius-pill);
  color: var(--muted);
  text-decoration: none;
  font-size: var(--step--1);
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.lang a:hover { color: var(--text); }
.lang a[aria-current="true"] {
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 600;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.icon-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-1px);
}
.icon-btn svg { width: 1.1rem; height: 1.1rem; }

html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(2rem, 6vw, 4rem) 0 clamp(1.5rem, 4vw, 3rem);
}

.eyebrow {
  margin: 0 0 .8rem;
  font-size: var(--step--1);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero h1 { font-size: var(--step-3); }

.lede {
  margin: .5rem 0 0;
  font-size: var(--step-1);
  font-family: var(--font-display);
  font-style: italic;
  color: var(--muted);
}

.hero-note {
  max-width: 46ch;
  margin: 1.1rem 0 1.7rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.3rem;
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: var(--gold-ink);
  text-decoration: none;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }

.hero-art {
  justify-self: center;
  width: min(100%, 340px);
}

/* zodiac wheel */
.wheel { width: 100%; height: auto; }
.wheel .ring {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
}
.wheel .ring--core {
  stroke: color-mix(in srgb, var(--gold) 55%, transparent);
}
.wheel .spoke {
  stroke: var(--border);
  stroke-width: 1;
}
.wheel .glyph {
  fill: var(--muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-variant-emoji: text;
  text-anchor: middle;
  dominant-baseline: central;
}
.wheel .core {
  fill: var(--gold);
  font-size: 16px;
  text-anchor: middle;
  dominant-baseline: central;
}
.wheel__spin {
  transform-origin: 100px 100px;
  animation: spin 140s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- sections ---------- */
.section { padding: clamp(1.5rem, 4vw, 3rem) 0; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.section-head h1, .section-head h2 { font-size: var(--step-2); }
.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: var(--step--1);
}

/* ---------- sign cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--gap);
}

.sign-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .2rem;
  padding: 1.2rem 1.1rem 1.3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.sign-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--el, var(--gold));
}
.sign-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--el, var(--gold)) 60%, var(--border));
  box-shadow: 0 16px 34px color-mix(in srgb, var(--el, var(--gold)) 22%, transparent);
}

.sign-glyph {
  font-size: 2rem;
  line-height: 1;
  color: var(--el, var(--gold));
  font-variant-emoji: text;
}

.sign-name {
  margin: .35rem 0 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.sign-dates {
  margin: 0;
  color: var(--muted);
  font-size: var(--step--1);
}

.sign-card .chip { margin-top: auto; }

.sign-card--sm { padding: .95rem .9rem 1.05rem; }
.sign-card--sm .sign-glyph { font-size: 1.6rem; }
.sign-card--sm .sign-name { font-size: 1rem; }

.sign-card[aria-current="page"] {
  border-color: color-mix(in srgb, var(--el) 65%, transparent);
  background: color-mix(in srgb, var(--el) 8%, var(--surface));
}

/* ---------- chips ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .65rem;
  border: 1px solid color-mix(in srgb, var(--el, var(--muted)) 45%, transparent);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--el, var(--muted)) 12%, transparent);
  color: var(--el, var(--muted));
  font-size: .74rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip--neutral {
  --el: var(--muted);
  background: var(--surface-2);
}
.chip--gold { --el: var(--gold); }

/* ---------- ads ---------- */
.ad-slot {
  display: grid;
  place-items: center;
  gap: .35rem;
  min-height: 250px;
  width: min(100%, 300px);
  max-width: 100%;
  margin-inline: auto;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  /* ad frames keep a fixed width and must never widen the page */
  overflow: hidden;
}
.ad-slot__label {
  display: none;
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}
/* the placeholder shows only while the slot renders no content (see theme.js) */
.ad-slot.is-empty > .ad-slot__label { display: block; }
.ad-slot--wide {
  width: 100%;
  min-height: 96px;
}

/* ---------- breadcrumb ---------- */
.breadcrumb { padding: 1.4rem 0 0; }
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--step--1);
  color: var(--muted);
}
.breadcrumb li { display: flex; gap: .35rem; }
.breadcrumb li + li::before { content: "/"; opacity: .55; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb [aria-current="page"] { color: var(--text); }

/* ---------- sign hero ---------- */
.sign-hero {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  padding: clamp(1.25rem, 3vw, 2rem) 0;
  border-bottom: 1px solid var(--border);
}

.glyph-badge {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: clamp(76px, 12vw, 112px);
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--el) 55%, transparent);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%,
    color-mix(in srgb, var(--el) 32%, transparent),
    color-mix(in srgb, var(--el) 8%, transparent));
  box-shadow: 0 0 46px color-mix(in srgb, var(--el) 26%, transparent);
  color: var(--el);
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-variant-emoji: text;
}

.sign-hero h1 { font-size: var(--step-3); }

.sign-hero .dates {
  margin: .4rem 0 1rem;
  color: var(--muted);
  font-size: var(--step-1);
  font-family: var(--font-display);
  font-style: italic;
}

/* ---------- page layout ---------- */
.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  padding: clamp(1.5rem, 3vw, 2.5rem) 0;
}

.aside {
  display: grid;
  gap: var(--gap);
  align-content: start;
  position: sticky;
  top: 5rem;
}

.card {
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card h2 {
  margin-bottom: .8rem;
  font-size: var(--step-1);
}
.card h2 + p { color: var(--muted); font-size: var(--step--1); }

/* ---------- prose ---------- */
.prose { max-width: 66ch; }
.prose h2 { margin-bottom: .6rem; font-size: var(--step-2); }

.prose .data {
  display: inline-block;
  margin: 0 0 1.2rem;
  padding: .32rem .85rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  color: var(--gold);
  font-size: var(--step--1);
  letter-spacing: .04em;
}

.prose blockquote {
  margin: 0;
  padding: .1rem 0 .1rem 1.15rem;
  border-left: 3px solid var(--gold);
  color: var(--text);
}
.prose blockquote.justify { text-align: justify; }
.prose blockquote p { margin-bottom: 1rem; }

/* ---------- facts ---------- */
.facts { margin: 0; }

.facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem 0;
  border-bottom: 1px dashed var(--border);
}
.facts > div:last-child { border-bottom: 0; padding-bottom: 0; }

.facts dt {
  color: var(--muted);
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.facts dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}

.compat {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .4rem;
}
.compat a {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid color-mix(in srgb, var(--el, var(--gold)) 50%, transparent);
  border-radius: 50%;
  color: var(--el, var(--gold));
  text-decoration: none;
  font-size: 1.1rem;
  font-variant-emoji: text;
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.compat a:hover {
  background: color-mix(in srgb, var(--el, var(--gold)) 16%, transparent);
  transform: translateY(-2px);
}

/* ---------- pager ---------- */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}
.pager a {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.pager a:hover { transform: translateY(-3px); border-color: var(--gold); }
.pager a:last-child { text-align: right; align-items: flex-end; }
.pager .dir {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.pager .who { font-family: var(--font-display); font-size: 1.05rem; }

/* ---------- info cards ---------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap);
}
.info-grid .card p { color: var(--muted); font-size: var(--step--1); }
.info-grid h3 { margin-bottom: .5rem; font-size: var(--step-1); }

/* ---------- footer ---------- */
.site-footer {
  margin-top: clamp(2rem, 6vw, 4rem);
  padding: 1.6rem 0 2.6rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--step--1);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--gold); }

.note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: .78rem;
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .page-grid { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; }
}

@media (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-art { order: -1; width: min(70%, 280px); }
}

@media (max-width: 560px) {
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager a:last-child { text-align: left; align-items: flex-start; }
  .brand { font-size: .98rem; }
  .lang a { padding: .25rem .45rem; }
}

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