/* Apparent Gods. Shared stylesheet, v1. */
:root {
  --panel: #fffdf8;
  --ink: #221c26;
  --ink-soft: #4a4050;
  --link: #5b2d82;
  --gold: #c39a3e;
  --gold-deep: #9a7426;
  --gold-leaf: linear-gradient(90deg, rgba(167, 125, 44, 0) 0%, #c4973a 12%, #f1d27e 50%, #c4973a 88%, rgba(167, 125, 44, 0) 100%);
  --label: #a3241b;
  --accent: #b1261c;
  --hdr-text: #221c26;
  --hdr-muted: #4a4050;
  --hdr-bar: rgba(255, 253, 248, .78);
  --ftr-text: #2e2438;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --wordmark: "Cinzel", "Trajan Pro", Georgia, serif;
  --decor: "UnifrakturMaguntia", "Old English Text MT", serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 .6em; font-weight: 700; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); margin: 0 0 .5em; }
h3 { font-size: 1.25rem; margin: 1.4em 0 .4em; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; border-radius: 2px; }

/* ---------- Themes: page backgrounds only ---------- */
body.theme-bright {
  background:
    radial-gradient(ellipse at 18% 8%, rgba(255, 214, 236, .95) 0, rgba(255, 214, 236, 0) 42%),
    radial-gradient(ellipse at 86% 16%, rgba(201, 245, 226, .95) 0, rgba(201, 245, 226, 0) 40%),
    radial-gradient(ellipse at 50% 40%, rgba(255, 249, 220, .9) 0, rgba(255, 249, 220, 0) 38%),
    radial-gradient(ellipse at 12% 78%, rgba(198, 230, 255, .95) 0, rgba(198, 230, 255, 0) 45%),
    radial-gradient(ellipse at 88% 88%, rgba(255, 216, 194, .95) 0, rgba(255, 216, 194, 0) 45%),
    linear-gradient(180deg, #e6dcff 0%, #fde3ea 35%, #fff0dc 60%, #dcefff 100%);
  background-attachment: fixed;
}

body.theme-ideologies {
  --accent: #9b3a35;
  --label: #8a2b26;
  --hdr-text: #f3eee8;
  --hdr-muted: #cfc6be;
  --hdr-bar: rgba(0, 0, 0, 0);
  --ftr-text: #ddd5cd;
  background: linear-gradient(180deg, #1a191c 0%, #211d1f 55%, #26201f 100%);
  background-attachment: fixed;
}

body.theme-philosophy {
  --accent: #b8933e;
  --label: #765714;
  --hdr-text: #eeeaf7;
  --hdr-muted: #c9c4e0;
  --hdr-bar: rgba(0, 0, 0, 0);
  --ftr-text: #d6d1ea;
  background: linear-gradient(180deg, #12163a 0%, #171b45 55%, #1c2150 100%);
  background-attachment: fixed;
}

/* ---------- Bright sky: sun, rays, sparkles ---------- */
.sky, .ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.rays {
  position: absolute;
  left: 50%;
  top: 34%;
  width: 260vmax;
  height: 260vmax;
  margin: -130vmax 0 0 -130vmax;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .55) 0deg 5deg, rgba(255, 255, 255, 0) 5deg 15deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, .55) 18%, rgba(0, 0, 0, 0) 46%);
          mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, .55) 18%, rgba(0, 0, 0, 0) 46%);
  animation: turn 300s linear infinite;
}
.sun {
  position: absolute;
  left: 50%;
  top: 34%;
  width: 70vmin;
  height: 70vmin;
  margin: -35vmin 0 0 -35vmin;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 252, 235, .95) 0, rgba(255, 240, 200, .55) 30%, rgba(255, 220, 240, 0) 70%);
}
.spark {
  position: absolute;
  width: var(--s, 14px);
  height: var(--s, 14px);
  background: var(--c, #fff);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, .9));
  animation: twinkle var(--d, 3.6s) ease-in-out infinite;
  animation-delay: var(--w, 0s);
  opacity: .9;
}
@keyframes turn { to { transform: rotate(360deg); } }
@keyframes twinkle {
  0%, 100% { transform: scale(.35) rotate(0deg); opacity: .35; }
  50% { transform: scale(1) rotate(45deg); opacity: 1; }
}

/* ---------- Dark ambient: dim drifting light, faint slow rays. No sparkles. ---------- */
.ambient .glow {
  position: absolute;
  width: 80vmax;
  height: 80vmax;
  border-radius: 50%;
  animation: drift 90s ease-in-out infinite alternate;
}
.ambient .g1 { left: -20vmax; top: -30vmax; }
.ambient .g2 { right: -25vmax; bottom: -35vmax; animation-duration: 120s; animation-delay: -40s; }
.theme-ideologies .ambient .g1 { background: radial-gradient(circle, rgba(150, 48, 44, .28) 0, rgba(150, 48, 44, 0) 62%); }
.theme-ideologies .ambient .g2 { background: radial-gradient(circle, rgba(120, 70, 60, .22) 0, rgba(120, 70, 60, 0) 62%); }
.theme-philosophy .ambient .g1 { background: radial-gradient(circle, rgba(184, 147, 62, .16) 0, rgba(184, 147, 62, 0) 62%); }
.theme-philosophy .ambient .g2 { background: radial-gradient(circle, rgba(96, 106, 190, .24) 0, rgba(96, 106, 190, 0) 62%); }
.ambient .field {
  position: absolute;
  left: 50%;
  top: 20%;
  width: 240vmax;
  height: 240vmax;
  margin: -120vmax 0 0 -120vmax;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .035) 0deg 4deg, rgba(255, 255, 255, 0) 4deg 16deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, 0) 45%);
          mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, 0) 45%);
  animation: turn 600s linear infinite;
}
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(14vmax, 10vmax) scale(1.12); }
}

/* ---------- Header ---------- */
.site-header {
  position: relative;
  z-index: 2;
  background: var(--hdr-bar);
  border-bottom: 1px solid rgba(195, 154, 62, .55);
}
.site-header .bar {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  flex-wrap: wrap;
}
.brand { text-decoration: none; }
.wordmark {
  display: inline-block;
  font-family: var(--wordmark);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1.1;
  letter-spacing: .04em;
  color: var(--hdr-text);
}
.motto { margin: 4px 0 0; line-height: 1.3; color: var(--hdr-muted); }
.motto .la {
  font-family: var(--decor);
  font-size: 1rem;
  margin-right: .5em;
}
.motto .en {
  font-family: var(--sans);
  font-size: .875rem;
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
}
.site-nav a {
  display: inline-block;
  padding: 8px 0 6px;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  color: var(--hdr-text);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: rgba(195, 154, 62, .8); }
.site-nav a[aria-current="page"] {
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* ---------- Main and reading panels ---------- */
main {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 36px 24px 48px;
}
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid rgba(195, 154, 62, .45);
  border-radius: 4px;
  box-shadow: 0 18px 50px rgba(20, 15, 35, .16);
  padding: 36px 44px;
}
.panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--gold-leaf);
  border-radius: 4px 4px 0 0;
}
.reading { max-width: 820px; margin-left: auto; margin-right: auto; }
.label {
  font-family: var(--sans);
  font-size: .875rem;
  font-weight: 600;
  color: var(--label);
  margin: 0 0 6px;
}
.lede { font-size: 1.2rem; }

.dropcap::first-letter {
  float: left;
  font-family: var(--decor);
  font-size: 3.6em;
  line-height: .8;
  padding: 8px 10px 0 0;
  color: var(--label);
}

/* ---------- Home hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 40px;
  align-items: center;
}
figure.icon { margin: 0; text-align: center; }
figure.icon svg { width: 100%; max-width: 440px; height: auto; display: block; margin: 0 auto; }
figure.icon .spin { transform-origin: 200px 200px; animation: turn 160s linear infinite; }
figure.icon figcaption {
  font-family: var(--sans);
  font-size: .9375rem;
  color: var(--ink-soft);
  margin-top: 10px;
}

/* ---------- Home cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 28px;
}
.card { padding: 28px 28px 24px; display: flex; flex-direction: column; }
.card h2 { margin-bottom: .35em; }
.card p { flex: 1 0 auto; }
.card .go {
  flex: 0 0 auto;
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
}
.card .mark { width: 26px; height: 26px; color: var(--label); display: block; margin-bottom: 10px; }

/* ---------- Eight-sign strip ---------- */
.signs {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin-top: 28px;
  padding: 18px 8px 14px;
  border-top: 1px solid rgba(154, 116, 38, .5);
  border-bottom: 1px solid rgba(154, 116, 38, .5);
  background: rgba(255, 253, 248, .6);
}
.signs figure { margin: 0; text-align: center; }
.signs .sig {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel);
  box-shadow: 0 0 0 1.5px var(--gold);
}
.signs .sig svg { width: 26px; height: 26px; }
.signs figcaption {
  font-family: var(--sans);
  font-size: .875rem;
  margin-top: 6px;
  color: var(--ink-soft);
}

/* ---------- Tab pages ---------- */
.stubs { margin-top: 24px; }
.stub {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 18px;
  flex-wrap: wrap;
  padding: 14px 0;
  border-top: 1px solid rgba(195, 154, 62, .45);
}
.stub:last-child { border-bottom: 1px solid rgba(195, 154, 62, .45); }
.stub h2 { margin: 0; font-size: 1.3rem; font-weight: 600; }
.stub .status {
  margin: 0;
  font-family: var(--sans);
  font-size: .875rem;
  font-weight: 600;
  color: var(--label);
}

/* ---------- Article layout (defined for later use; no page uses it yet) ---------- */
.article { max-width: 760px; margin: 0 auto; }
.article .article-title { font-size: clamp(2rem, 4.4vw, 2.8rem); margin: 0 0 .35em; }
.article .byline {
  font-family: var(--sans);
  font-size: .9375rem;
  color: var(--ink-soft);
  margin: 0 0 1.6em;
  padding-bottom: 1em;
  border-bottom: 1px solid rgba(195, 154, 62, .5);
}
.article .byline .models { display: block; margin-top: 2px; }
.article .article-body p { margin: 0 0 1.1em; }
.article .article-body h2 { margin: 1.8em 0 .5em; }
.article .article-body h3 { margin: 1.4em 0 .4em; }
.article blockquote {
  margin: 1.4em 0;
  padding: .2em 0 .2em 1.2em;
  border-left: 3px solid var(--gold);
  color: var(--ink-soft);
}
.article blockquote p:last-child { margin-bottom: 0; }
.article .directory { list-style: none; padding: 0; margin: 0 0 1.4em; }
.article .directory li { padding: 10px 0; border-bottom: 1px solid rgba(195, 154, 62, .35); }
.article .directory li a { font-weight: 600; }
.article .references-title {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--label);
  margin: 2.4em 0 .6em;
}
.article .references { font-size: 1rem; padding-left: 1.6em; margin: 0; }
.article .references li { margin-bottom: .6em; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 26px 24px 40px;
  border-top: 1px solid rgba(195, 154, 62, .55);
  color: var(--ftr-text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
}
.site-footer p { margin: 0; }
.site-footer .mark { width: 22px; height: 22px; display: block; margin: 0 auto 10px; color: var(--accent); }

/* ---------- 404 ---------- */
.lost { text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  figure.icon svg { max-width: 340px; }
  .cards { grid-template-columns: 1fr; }
  .signs { grid-template-columns: repeat(4, 1fr); row-gap: 14px; }
}
@media (max-width: 560px) {
  .site-header .bar { padding: 12px 16px; flex-direction: column; align-items: flex-start; }
  .wordmark { font-size: 1.5rem; }
  .site-nav { width: 100%; }
  .site-nav ul { gap: 2px 0; flex-wrap: nowrap; justify-content: space-between; }
  .site-nav a { font-size: .9rem; }
  .motto .en { display: block; margin-top: 2px; }
  main { padding: 20px 12px 36px; }
  .panel { padding: 24px 18px; }
  .card { padding: 22px 18px 20px; }
  .signs .sig { width: 46px; height: 46px; }
  .signs .sig svg { width: 22px; height: 22px; }
}

/* ---------- Reduced motion: stop every animation ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
