@import url('https://fonts.googleapis.com/css2?family=IM+Fell+English:ital@0;1&family=IM+Fell+English+SC&family=Cinzel:wght@400;700&display=swap');

:root {
  --ink: #0a0a0a;
  --stone-dark: #111111;
  --stone-mid: #1c1c1c;
  --stone-light: #2a2a2a;
  --parchment-dim: #a89e92;
  --parchment-mid: #c8bfb4;
  --parchment-bright: #d4cfc6;
  --silver: #ddd8d0;
  --fog: #7a7268;
  --accent-white: #f0ece4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--ink);
  background-image: url("Images/HC.png");
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  color: var(--parchment-mid);
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}

/* pages/ subfolder needs to look one level up for the image */
body.subpage {
  background-image: url("../Images/HC.png");
}

#bg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 3, 3, 0.72);
  pointer-events: none;
  z-index: 1;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.07'/%3E%3C/svg%3E");
  background-size: 150px 150px;
  pointer-events: none;
  z-index: 101;
  opacity: 0.5;
}

#wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 0 60px;
  position: relative;
  z-index: 2;
}

#header {
  text-align: center;
  padding: 64px 0 52px;
  border-bottom: 1px solid #2a2a2a;
}

.site-title {
  font-family: 'Cinzel', 'IM Fell English SC', serif;
  font-size: clamp(2.8rem, 8vw, 5rem);
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--accent-white);
  text-shadow: 0 0 40px rgba(0,0,0,1), 0 2px 8px rgba(0,0,0,1);
  margin-bottom: 10px;
  text-decoration: none;
  display: block;
}

.site-sub {
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--fog);
  font-style: normal;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}

#flex {
  display: flex;
  align-items: flex-start;
}

aside {
  width: 210px;
  flex-shrink: 0;
  padding: 24px 18px;
  border-right: 1px solid #2a2a2a;
  min-height: 600px;
}

aside h3 {
  font-family: 'IM Fell English SC', serif;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fog);
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid #2a2a2a;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}

aside ul {
  list-style: none;
  margin-bottom: 28px;
}

aside ul li { margin-bottom: 4px; }

aside ul li a {
  color: var(--parchment-dim);
  text-decoration: none;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
  text-shadow: 0 1px 6px rgba(0,0,0,1);
}

aside ul li a::before {
  content: '⸻';
  font-size: 0.55rem;
  color: var(--stone-light);
  flex-shrink: 0;
}

aside ul li a:hover { color: var(--silver); }
aside ul li a.active { color: var(--accent-white); }

.divider {
  height: 1px;
  background: linear-gradient(to right, #2a2a2a, transparent);
  margin: 20px 0;
}

.sidebar-note {
  font-size: 0.78rem;
  color: var(--fog);
  font-style: italic;
  line-height: 1.6;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}

main {
  flex: 1;
  padding: 30px 28px;
}

.page { animation: pageFade 0.4s ease; }
@keyframes pageFade { from { opacity: 0; } to { opacity: 1; } }

/* ── Welcome / info blocks ── */
.welcome-block {
  border: 1px solid #2a2a2a;
  padding: 22px 24px;
  margin-bottom: 28px;
  background: rgba(0,0,0,0.35);
  position: relative;
}

.welcome-block::before {
  content: '✦';
  position: absolute;
  top: -8px;
  left: 24px;
  background: transparent;
  padding: 0 6px;
  font-size: 0.65rem;
  color: var(--fog);
}

.welcome-block p {
  color: var(--parchment-mid);
  font-style: italic;
  font-size: 0.95rem;
  text-shadow: 0 1px 6px rgba(0,0,0,1);
  margin-bottom: 0;
}

.welcome-block p + p { margin-top: 12px; }

h2 {
  font-family: 'IM Fell English SC', serif;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fog);
  margin: 28px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid #2a2a2a;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}

/* ── LORE GRID ── */
.lore-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}

.lore-card {
  border: 1px solid #2a2a2a;
  padding: 16px;
  background: rgba(0,0,0,0.35);
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
  display: block;
  text-decoration: none;
}

.lore-card:hover {
  border-color: #4a4a4a;
  background: rgba(0,0,0,0.5);
}

.lore-card-title {
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  color: var(--silver);
  letter-spacing: 0.08em;
  text-shadow: 0 1px 6px rgba(0,0,0,1);
}

/* ── DISCOVERY MODAL ── */
#discoveryModal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(4,3,3,0.85);
  align-items: center;
  justify-content: center;
}

#discoveryModal.open { display: flex; }

.modal-box {
  max-width: 420px;
  width: 90%;
  border: 1px solid #4a4540;
  background: #0e0d0c;
  padding: 32px 28px;
  position: relative;
}

.modal-box::before {
  content: '✦';
  position: absolute;
  top: -8px;
  left: 24px;
  font-size: 0.65rem;
  color: var(--fog);
  padding: 0 6px;
  background: #0e0d0c;
}

.modal-box::after {
  content: '✦';
  position: absolute;
  bottom: -8px;
  right: 24px;
  font-size: 0.65rem;
  color: var(--fog);
  padding: 0 6px;
  background: #0e0d0c;
}

#modalTitle {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: var(--accent-white);
  margin-bottom: 16px;
  text-shadow: 0 1px 6px rgba(0,0,0,1);
}

#modalBody {
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 0.92rem;
  color: var(--parchment-mid);
  line-height: 1.8;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
}

.modal-close {
  margin-top: 22px;
  background: none;
  border: 1px solid #2a2a2a;
  color: var(--fog);
  font-family: 'IM Fell English SC', serif;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 6px 18px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  display: block;
  margin-left: auto;
}

.modal-close:hover { border-color: #4a4a4a; color: var(--parchment-dim); }

/* ── Words of the Well ── */
.depths-wrap {
  text-align: center;
  padding: 10px 0 4px;
}

.depths-rule {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.depths-rule::before, .depths-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, #3a3832, transparent);
}

.depths-glyph {
  font-family: 'IM Fell English SC', serif;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fog);
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  white-space: nowrap;
}

.depths-quote {
  font-style: italic;
  font-size: 0.98rem;
  color: var(--parchment-mid);
  line-height: 1.8;
  max-width: 480px;
  margin: 0 auto 10px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.9);
}

.depths-attr {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fog);
  font-style: normal;
  margin-bottom: 24px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}

.depths-bottom-rule {
  display: flex;
  align-items: center;
  gap: 14px;
}

.depths-bottom-rule::before, .depths-bottom-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, #3a3832, transparent);
}

.depths-bottom-glyph { color: #3a3832; font-size: 0.55rem; letter-spacing: 0.3em; }

.depths-btn {
  margin-top: 18px;
  background: none;
  border: 1px solid #2a2a2a;
  color: var(--fog);
  font-family: 'IM Fell English SC', serif;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 7px 20px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}

.depths-btn:hover { border-color: #4a4a4a; color: var(--parchment-dim); }

/* ── SISTER MOONS ── */
.mw-wrap {
  font-family: 'IM Fell English', Georgia, serif;
  color: var(--parchment-mid);
  margin-top: 32px;
}

.mw-rule {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.mw-rule::before, .mw-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, #3a3832, transparent);
}

.mw-rule-label {
  font-family: 'IM Fell English SC', serif;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fog);
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}

.mw-grid {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.mw-moon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px 14px;
  border: 1px solid #4a4540;
  background: rgba(0,0,0,0.5);
  position: relative;
  width: 110px;
}

.mw-moon::before {
  content: '✦';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--fog);
  padding: 0 4px;
}

.mw-glyph { width: 44px; height: 44px; }

.mw-name {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent-white);
  text-align: center;
  line-height: 1.3;
  text-shadow: 0 1px 6px rgba(0,0,0,1);
}

.mw-phase-label {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fog);
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}

.mw-info { text-align: center; padding: 6px 0 4px; }

.mw-goddess-name {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--accent-white);
  margin-bottom: 6px;
  text-shadow: 0 1px 6px rgba(0,0,0,1);
}

.mw-omen {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--parchment-mid);
  line-height: 1.75;
  max-width: 380px;
  margin: 0 auto;
  text-shadow: 0 1px 8px rgba(0,0,0,0.9);
}

.mw-bottom-rule {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

.mw-bottom-rule::before, .mw-bottom-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, #3a3832, transparent);
}

.mw-bottom-glyph { color: #3a3832; font-size: 0.55rem; letter-spacing: 0.3em; }

/* ── Links page ── */
.link-entry {
  border: 1px solid #2a2a2a;
  padding: 16px 20px;
  margin-bottom: 12px;
  background: rgba(0,0,0,0.35);
  transition: border-color 0.25s, background 0.25s;
}

.link-entry:hover { border-color: #4a4a4a; background: rgba(0,0,0,0.5); }

.link-entry a {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--silver);
  letter-spacing: 0.08em;
  text-decoration: none;
  text-shadow: 0 1px 6px rgba(0,0,0,1);
}

.link-entry a:hover { color: var(--accent-white); }

.link-desc {
  font-size: 0.85rem;
  color: var(--parchment-dim);
  font-style: italic;
  margin-top: 5px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}

/* ── World / creatures entries ── */
.lore-entry {
  border: 1px solid #2a2a2a;
  padding: 18px 20px;
  margin-bottom: 14px;
  background: rgba(0,0,0,0.35);
  position: relative;
}

.lore-entry::before {
  content: '✦';
  position: absolute;
  top: -8px;
  left: 20px;
  font-size: 0.6rem;
  color: var(--fog);
  padding: 0 5px;
}

.lore-entry-title {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  color: var(--silver);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  text-shadow: 0 1px 6px rgba(0,0,0,1);
}

.lore-entry-body {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--parchment-mid);
  line-height: 1.8;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
}

footer {
  border-top: 1px solid #2a2a2a;
  text-align: center;
  padding: 18px;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--fog);
  font-family: 'IM Fell English SC', serif;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: #2a2a2a; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

@media (max-width: 640px) {
  #flex { flex-direction: column; }
  aside { width: 100%; border-right: none; border-bottom: 1px solid #2a2a2a; min-height: unset; }
  .lore-grid { grid-template-columns: 1fr; }
}
