/* Portals of the Fae — site styles
   Palette: dark brown ground, gold type, light blue (from the logo) for links and accents. */

:root {
  --bark: #2b1a0f;        /* page background */
  --bark-deep: #1c1009;   /* header, footer, banner frame */
  --bark-raised: #3a2415; /* panels */
  --line: #5b3d22;        /* rules and borders */
  --gold: #e2b24a;        /* headings, nav */
  --gold-soft: #ecdcb2;   /* body text */
  --blue: #8fcfe0;        /* links, accents (logo blue, lightened for small text) */
  --blue-deep: #78c0d0;   /* logo blue */

  --display: "IM Fell English SC", "IM Fell English", Georgia, "Times New Roman", serif;
  --text: "Alegreya", Georgia, "Times New Roman", serif;
  --measure: 68ch;
}

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

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

body {
  margin: 0;
  background-color: var(--bark);
  background-image: radial-gradient(120% 60% at 50% 0%, #3a2414 0%, var(--bark) 60%);
  background-repeat: no-repeat;
  color: var(--gold-soft);
  font-family: var(--text);
  font-size: 1.1875rem;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: #fff; }
a:focus-visible, .button:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  color: var(--gold);
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); margin: 0 0 0.6em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); margin: 2.2em 0 0.5em; }
h3 { font-size: 1.35rem; margin: 1.6em 0 0.3em; color: var(--blue); letter-spacing: 0.03em; }

p, ul, ol, dl { margin: 0 0 1.1em; }
li { margin-bottom: 0.35em; }
strong { color: var(--gold); font-weight: 700; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--gold); color: var(--bark-deep); padding: 0.5em 1em; z-index: 10;
}
.skip:focus { left: 0; }

/* ---------- Header ---------- */

.site-header {
  background: var(--bark-deep);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 16px 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px 28px;
}
.logo { justify-self: center; }
.logo img { width: 305px; }

.nav { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.nav-left { justify-content: flex-end; }
.nav-right { justify-content: flex-start; }
.nav a {
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--gold);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav a:hover { color: var(--blue); }
.nav a[aria-current="page"] { color: var(--blue); border-bottom-color: var(--blue-deep); }

/* ---------- Layout ---------- */

main { display: block; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.prose { max-width: var(--measure); }
.page { padding-top: 48px; padding-bottom: 72px; }
.lede { font-size: 1.3rem; line-height: 1.55; color: #f4e7c4; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 48px;
  align-items: start;
}
.split > aside { position: sticky; top: 24px; }

figure { margin: 0 0 1.4em; }
figure img { border: 1px solid var(--line); }
figcaption { font-size: 0.95rem; font-style: italic; color: #cdb98a; margin-top: 0.5em; }

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

/* ---------- Rotating banner (CSS only) ---------- */

.banner {
  position: relative;
  max-width: 1120px;
  margin: 28px auto 0;
  aspect-ratio: 974 / 350;
  background: var(--bark-deep);
  border: 1px solid var(--line);
  overflow: hidden;
}
.slide {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  animation: rotate-banner 30s infinite;
}
.slide:nth-child(1) { animation-delay: 0s; }
.slide:nth-child(2) { animation-delay: 6s; }
.slide:nth-child(3) { animation-delay: 12s; }
.slide:nth-child(4) { animation-delay: 18s; }
.slide:nth-child(5) { animation-delay: 24s; }
.banner:hover .slide, .banner:focus-within .slide { animation-play-state: paused; }

@keyframes rotate-banner {
  0%   { opacity: 0; visibility: visible; }
  4%   { opacity: 1; visibility: visible; }
  20%  { opacity: 1; visibility: visible; }
  24%  { opacity: 0; visibility: visible; }
  24.01%, 100% { opacity: 0; visibility: hidden; }
}

.slide img { width: 100%; height: 100%; object-fit: cover; border: 0; }
.slide .caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 24px 16px;
  background: rgba(28, 16, 9, 0.78);
  border-top: 1px solid rgba(226, 178, 74, 0.45);
}
.caption .title {
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--gold);
  margin: 0;
  letter-spacing: 0.03em;
  line-height: 1.2;
}
.caption .sub { margin: 2px 0 0; font-size: 1.05rem; line-height: 1.4; }

@media (prefers-reduced-motion: reduce) {
  .slide { animation: none; }
  .slide:nth-child(1) { opacity: 1; visibility: visible; }
}

/* ---------- Home ---------- */

.gathering {
  margin: 28px auto 0;
  max-width: 1120px;
  padding: 22px 24px;
  background: var(--bark-raised);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 14px 32px;
}
.gathering h2 { margin: 0 0 0.15em; font-size: 1.6rem; }
.gathering p { margin: 0; }

.button {
  display: inline-block;
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--bark-deep);
  background: var(--gold);
  padding: 0.55em 1.2em;
  border: 1px solid var(--gold);
}
.button:hover { background: var(--blue); border-color: var(--blue); color: var(--bark-deep); }
.button.ghost { background: transparent; color: var(--gold); }
.button.ghost:hover { background: transparent; color: var(--blue); border-color: var(--blue); }

.worlds {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 1.2em 0 2em;
}
.worlds > div { padding: 22px 26px 12px; border-left: 1px solid var(--line); }
.worlds > div:first-child { border-left: 0; padding-left: 0; }
.worlds h3 { margin-top: 0; font-size: 1.5rem; }
.worlds .era { font-style: italic; color: var(--gold); margin-bottom: 0.5em; }

/* ---------- Lists and panels ---------- */

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 0.6em 3.2rem;
  margin-bottom: 1em;
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0.1em;
  width: 2.2rem; height: 2.2rem;
  border: 1px solid var(--gold); border-radius: 50%;
  font-family: var(--display); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.steps h3 { margin: 0 0 0.2em; }

.panel {
  background: var(--bark-raised);
  border: 1px solid var(--line);
  padding: 22px 24px 8px;
  margin: 0 0 1.4em;
}
.panel h2, .panel h3 { margin-top: 0; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.5em 1.4em; }
dl.facts dt { font-family: var(--display); color: var(--gold); letter-spacing: 0.03em; }
dl.facts dd { margin: 0; }

.classes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.classes h3 { margin-top: 0.8em; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--bark-deep);
  border-top: 1px solid var(--line);
  padding: 28px 0 36px;
  font-size: 1rem;
  color: #cdb98a;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 32px; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }

/* ---------- Small screens ---------- */

@media (max-width: 960px) {
  .site-header .inner { grid-template-columns: 1fr; padding: 18px 16px 14px; }
  .logo { order: -1; }
  .logo img { width: 240px; }
  .nav-left, .nav-right { justify-content: center; }
  .split { grid-template-columns: 1fr; gap: 24px; }
  .split > aside { position: static; max-width: 420px; }
}

@media (max-width: 720px) {
  body { font-size: 1.125rem; }
  .banner { margin-top: 0; aspect-ratio: 4 / 3; border-left: 0; border-right: 0; }
  .slide .caption { padding: 10px 16px 12px; }
  .caption .title { font-size: 1.15rem; }
  .caption .sub { font-size: 0.98rem; }
  .gathering { margin: 20px 16px 0; padding: 18px; }
  .worlds { grid-template-columns: 1fr; }
  .worlds > div { border-left: 0; border-top: 1px solid var(--line); padding: 18px 0 6px; }
  .worlds > div:first-child { border-top: 0; }
  .classes { grid-template-columns: 1fr; }
  .page { padding-top: 32px; padding-bottom: 56px; }
  dl.facts { grid-template-columns: 1fr; gap: 0; }
  dl.facts dd { margin-bottom: 0.8em; }
}
