/* Same palette as the wiki (lore_network/wiki/wiki_template.html). */
:root {
  --night: #211a15;
  --leather: #3a2a20;
  --parchment: #ead9b5;
  --parchment-edge: #d9c39a;
  --parchment-dark: #e2cda5;
  --ink: #33291f;
  --ink-soft: #69533c;
  --heading: #40291e;
  --gold: #b59663;
  --gold-dim: #8c7556;
  --cream: #f4e6c9;
  --link: #813b27;
  --link-hover: #a24729;

  /* Fonts (loaded from Google Fonts in index.html). Alegreya has Greek letters;
     Cinzel Decorative is Latin-only, so it is used just for the English title. */
  --font-title: "Cinzel Decorative", Georgia, serif;
  --font-heading: "Alegreya SC", Georgia, serif;
  --font-body: "Alegreya", Georgia, "Times New Roman", serif;

  /* Background picture behind the title area (see body::before below).
     Swap the file name to change it, or set it to "none" to remove it.
     Photo: Unsplash (photo-1535025075092-5a1cf795130b), Unsplash License. */
  --bg-image: url("images/misty-forest.avif");
  /* How the picture is tinted to match the site. Lower brightness = darker;
     higher sepia = warmer/browner. */
  --bg-filter: sepia(.65) saturate(.75) brightness(.48) contrast(1.08);

  font: 19px/1.65 var(--font-body);
  color: var(--ink);
  background: var(--night);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  /* Transparent so the textured layer in body::before shows through;
     the plain colour on :root is the fallback. */
  background: transparent;
  padding-inline: 16px;
}

/* Background picture: sits behind the top of the page only, tinted by
   --bg-filter, and fades out downwards into the dark brown. */
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: max(100vh, 780px);
  z-index: -1;
  background: var(--bg-image) center 35% / cover no-repeat;
  filter: var(--bg-filter);
  -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 35%, transparent 100%);
}

/* Texture over everything: candlelight, cloudy mottling, grain and a dark
   vignette. A fixed layer, so it stays put while the page scrolls. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    /* vignette: darkens the edges */
    radial-gradient(ellipse at 50% 40%, transparent 35%, #0b0806e6 100%),
    /* warm glow behind the title */
    radial-gradient(ellipse 70% 45% at 50% 0%, #b5966340, transparent 70%),
    /* fine grain */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='.5'/%3E%3C/svg%3E"),
    /* slow, cloudy mottling like old leather */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='700' height='700'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .38 0 0 0 0 .22 .7 0 0 0 -.26'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)'/%3E%3C/svg%3E") center / cover no-repeat;
}

a:focus-visible { outline: 2px solid #a84d2e; outline-offset: 3px; }
::selection { background: #9a603f; color: #fff4df; }

/* Title area */
.hero {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(3rem, 9vw, 6rem) 0 2.5rem;
  text-align: center;
  color: var(--cream);
  position: relative;
  isolation: isolate;
  text-shadow: 0 1px 3px #0b0806, 0 0 18px #0b0806cc;
}
/* Soft dark patch behind the title text so it reads over the picture. */
.hero::before {
  content: "";
  position: absolute;
  inset: 8% -6% 4%;
  z-index: -1;
  background: radial-gradient(closest-side, #0b0806b3, #0b080666 60%, transparent);
}
.eyebrow {
  margin: 0 0 1rem;
  font-family: var(--font-heading);
  font-size: .85rem;
  letter-spacing: .22em;
  color: var(--gold);
}
.hero h1 {
  margin: 0;
  font-family: var(--font-title);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.1;
  text-wrap: balance;
  text-shadow: 0 0 28px #b5966355, 0 2px 0 #0b0806;
}
.tagline {
  max-width: 38rem;
  margin: 0 auto;
  font-style: italic;
  color: #d5c5a8;
}

.rule {
  display: flex;
  align-items: center;
  gap: .9rem;
  max-width: 320px;
  margin: 1.4rem auto;
  color: var(--gold);
  font-size: .9rem;
}
.rule span { flex: 1; border-top: 3px double var(--gold-dim); }

main {
  max-width: 1000px;
  margin: 0 auto;
}

/* Newest session */
.latest {
  display: block;
  padding: clamp(1.4rem, 4vw, 2.4rem) clamp(1.4rem, 5vw, 3rem);
  background: var(--parchment);
  border: 7px solid var(--parchment-edge);
  outline: 1px solid #9d7c4f;
  box-shadow: 0 16px 44px #100c08b0;
  color: var(--ink);
  text-decoration: none;
  transition: transform .15s ease;
}
.latest:hover { transform: translateY(-2px); }
.latest .label {
  margin: 0;
  font-family: var(--font-heading);
  font-size: .85rem;
  letter-spacing: .16em;
  color: #74502d;
}
.latest h2 {
  margin: .3rem 0 .8rem;
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 500;
  line-height: 1.2;
  color: var(--heading);
  padding-bottom: .6rem;
  border-bottom: 3px double #9c8055;
}
.latest p.excerpt { margin: 0 0 1rem; max-width: 70ch; }
.latest .more { color: var(--link); text-decoration: underline; text-decoration-color: #a67d55; text-underline-offset: 3px; }
.latest:hover .more { color: var(--link-hover); }

/* Section tiles */
.section-title {
  margin: 3.2rem 0 1.2rem;
  font-family: var(--font-heading);
  font-size: .95rem;
  font-weight: normal;
  letter-spacing: .2em;
  color: var(--gold);
  text-align: center;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 1.2rem;
}
.tile {
  position: relative;
  display: block;
  padding: 1.5rem 1.4rem 1.6rem;
  background: var(--parchment-dark);
  border: 5px solid var(--parchment-edge);
  outline: 1px solid #9d7c4f;
  color: var(--ink);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
a.tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px #100c08a0;
}
a.tile:hover h3 { color: var(--link-hover); }
.tile svg {
  width: 2.4rem;
  height: 2.4rem;
  fill: none;
  stroke: #74502d;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tile h3 {
  margin: .6rem 0 .4rem;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--heading);
}
.tile p { margin: 0; font-size: .95rem; line-height: 1.5; color: var(--ink-soft); }

.tile.soon {
  background: #211a1580;
  border: 1px dashed var(--gold-dim);
  outline: none;
  margin: 4px;
}
.tile.soon svg { stroke: var(--gold-dim); }
.tile.soon h3 { color: #d5c5a8; }
.tile.soon p { color: #a8957a; }
.badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: .05rem .55rem;
  font-family: var(--font-heading);
  font-size: .8rem;
  letter-spacing: .08em;
  color: var(--night);
  background: var(--gold-dim);
}

footer {
  max-width: 1000px;
  margin: 3.5rem auto 0;
  padding-bottom: 2.5rem;
  text-align: center;
  font-size: .9rem;
  color: var(--gold-dim);
}
footer p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .latest, .tile { transition: none; }
}
