/* =====================
   Beast of Brantford — FULL STYLESHEET (STRUCTURALLY CLEANED)
====================== */
:root {
  --bg: #0b0b0d;             /* near-black */
  --bg-elev: #121216;        /* panels */
  --text: #e7e7ea;           /* body text */
  --muted: #b6b6c2;          /* subtle text */
  --accent: #c63b3b;         /* blood red */
  --link: #ff7800;           /* cool link */
  --border: #272c33;         /* visible borders on dark bg */
  --shadow: 0 10px 30px rgb(0 0 0 / .6);
  --radius: 16px;
  --maxw: 1120px;

  /* Site Menu accent */
  --menu-accent: #ff7800;    /* orange */
  --menu-hover-text: #000;   /* black */
}

/* Engria / headings */
.engria {
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
}
h1.engria {
  color: #fff;
  text-shadow:
    1px 1px 1px rgba(0, 0, 0, 0.9),              /* dark lower-right shadow */
   -1px -1px 1px rgba(255, 255, 255, 0.25),      /* light upper-left highlight */
    0 0 8px rgba(0, 0, 0, 0.8);                  /* soft outer glow */
}
h1.engriaTitles {
  color: #fff;
  margin-top: 0;
  text-shadow:
    1px 1px 1px rgba(0, 0, 0, 0.9),
   -1px -1px 1px rgba(255, 255, 255, 0.25),
    0 0 8px rgba(0, 0, 0, 0.8);
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  font-family: "engria", sans-serif; /* Engria for body */
  font-weight: 300;
  background: radial-gradient(1200px 600px at 50% -200px, #15171b 0%, var(--bg) 55%) fixed;
  color: var(--text);
  line-height: 1.6;
}
a {
  color: var(--link);
  text-decoration-thickness: .08em;
  text-underline-offset: 2px;
  font-family: "engria", sans-serif;
}
img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
::selection { background: #2c2f38; }

/* Headings */
h1 {
  font-family: "cc-near-myth-fables", sans-serif;
  font-weight: 400;
  font-style: normal;
}
.section-title,
.kicker {
  font-family: "engria", sans-serif;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: .5rem .75rem;
  background: #1b1d22;
  border-radius: .5rem;
  outline: 2px solid var(--accent);
}

/* ===== Header ===== */
header {
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: #000000;
  background-image: url("/images/background.png");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: auto; /* keeps the image’s original width and height */
}
.masthead {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1rem, 2.4vw, 2rem) 1rem;
}
.brand {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: end;
}

/* (Removed .banner + .titleblock h1/p: unused in this HTML) */

/* Reduce vertical gap between title and subtitle */
.brand h1 { margin-bottom: 0.1rem; }
.brand p  { margin-top: 0; }

/* Main title (non-animated) positioning + strong glow */
.brand h1.engria.no-animate {
  margin-bottom: 0.1rem;
  position: relative;
  top: 9px;
  text-shadow:
    0 0 6px #000,
    0 0 12px #000,
    0 0 20px rgba(0, 0, 0, 0.9),
    2px 2px 6px rgba(0, 0, 0, 0.8);
}

/* ===== Layout ===== */
main {
  max-width: var(--maxw);
  margin: clamp(1rem, 2.5vw, 2rem) auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 1.2fr 3fr;
  gap: clamp(1rem, 2.4vw, 2rem);
}
@media (max-width: 1024px) {
  main { grid-template-columns: 1fr; }
}

/* Card */
.card {
  background: linear-gradient(180deg, #121318, #0f1014);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: clip;
}
.card > * {
  padding: clamp(1rem, 2.8vw, 1.25rem);
}

/* (Removed .hero, .hero-visual img, .caption: unused) */

/* Text sections */
.lead {
  font-size: clamp(1rem, 1.3vw, 1.1rem);
}
.section-title {
  font-size: 1.15rem;
  letter-spacing: .2px;
  margin: 0 0 .25rem;
}
.kicker {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .8rem;
}

/* ===== Sidebar ===== */
aside {
  display: grid;
  gap: 1rem;
  align-self: start;
  position: sticky;
  top: 12px;
}
.list {
  list-style: none;
  padding: 0;
  margin: .25rem 0 0;
  display: grid;
  gap: .25rem;
}

/* ===== SITE MENU ===== */
aside .list a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .65rem;
  border-radius: .5rem;
  border: 1px solid var(--border);
  background: rgb(0 0 0 / .20);
  color: var(--menu-accent);                /* orange text */
  font-family: "engria", sans-serif;
  font-weight: 700;                         /* bold */
  text-decoration: none;                    /* no underline */
  transition:
    background-color .28s ease,
    color .28s ease,
    box-shadow .28s ease,
    border-color .28s ease,
    transform .28s ease;
  /* overlay prep */
  position: relative;
  overflow: hidden;
  isolation: isolate;
  z-index: 0;
}

/* Keep visited links orange too */
aside .list a:visited { color: var(--menu-accent); }

/* White icons base */
aside .list a::before {
  content: "";
  width: 1.1em;
  height: 1.1em;
  flex: 0 0 1.1em;
  background: #fff;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  transition: transform .28s ease, background-color .28s ease;
}

/* Icon assignments (optional) */
aside .list li:nth-child(1)  > a::before { mask-image: url("/images/icons/legend.svg"); }
aside .list li:nth-child(2)  > a::before { mask-image: url("/images/icons/beast.svg"); }
aside .list li:nth-child(3)  > a::before { mask-image: url("/images/icons/children.svg"); }
aside .list li:nth-child(4)  > a::before { mask-image: url("/images/icons/halloween.svg"); }
aside .list li:nth-child(5)  > a::before { mask-image: url("/images/icons/diary.svg"); }
aside .list li:nth-child(6)  > a::before { mask-image: url("/images/icons/eyewitness.svg"); }
aside .list li:nth-child(7)  > a::before { mask-image: url("/images/icons/gallery.svg"); }
aside .list li:nth-child(8)  > a::before { mask-image: url("/images/icons/team.svg"); }
aside .list li:nth-child(9)  > a::before { mask-image: url("/images/icons/contact.svg"); }
aside .list li:nth-child(10) > a::before { mask-image: url("/images/icons/youtube.svg"); }

/* External Links — individual icons (keep, but share base styles above) */
aside .list.externals li:nth-child(1) > a::before { mask-image: url("/images/icons/youtube.svg"); }
aside .list.externals li:nth-child(2) > a::before { mask-image: url("/images/icons/paranormal.svg"); }
aside .list.externals li:nth-child(3) > a::before { mask-image: url("/images/icons/department.svg"); }

aside .list.externals a:hover::before,
aside .list.externals a:focus-visible::before {
  transform: scale(1.10);
  background: #000;
}

/* External links in content cards keep default link weight/color */
.card ul.list a {
  font-weight: 400;
  color: var(--link);
}

/* Hover: fade in image + stronger smoke and adjust colors */
aside .list a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1; /* image + smoke below text/icon */
  background:
    radial-gradient(60% 120% at 20% 50%, rgba(255,255,255,0.20), transparent 65%),
    radial-gradient(50% 100% at 80% 40%, rgba(255,255,255,0.16), transparent 65%),
    url("/images/buttBK.png") center top / cover no-repeat;
  background-blend-mode: normal;
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}

aside .list a:hover::after,
aside .list a:focus-visible::after {
  opacity: 1;
  animation: smoke 6s linear infinite;
}

/* Hover styling */
aside .list a:hover,
aside .list a:focus-visible {
  background: transparent;
  color: #000 !important;
  text-shadow:
    0 1px 3px rgba(255,255,255,0.7),
    0 0 12px rgba(255,255,255,0.5);
  border-color: #000;
  box-shadow: inset 0 0 0 1px #000, inset 0 0 14px rgba(0,0,0,.55);
}

aside .list a:hover::before,
aside .list a:focus-visible::before {
  transform: scale(1.10);
  background: #000;
}

/* Ensure text & icons above overlay */
aside .list a::before,
aside .list a > * {
  position: relative;
  z-index: 2;
}

/* Gentle drifting smoke animation */
@keyframes smoke {
  0%   { background-position: 0 0,         100% 0,        center top; }
  50%  { background-position: 24px -12px,   76% -20px,    center top; }
  100% { background-position: 0 0,         100% 0,        center top; }
}

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  background: #0e0f12;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.75rem 1rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ===== Mobile hamburger ===== */
.menu-toggle { display: none; }
@media (max-width: 1024px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: 0 1rem .75rem;
    padding: .6rem .9rem;
    border-radius: .6rem;
    border: 1px solid var(--border);
    background: rgb(0 0 0 /.25);
    cursor: pointer;
  }
  aside { position: static; }
  #sidebar {
    display: none;
    position: relative;
    top: 0;
  }
  #sidebar.open { display: block; }
}

/* ===== Staggered fade-in + slide-up animation ===== */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Desktop/regular view: animate on page load when #sidebar has .animate */
#sidebar.animate .list li {
  opacity: 0;
  transform: translateY(8px);
  animation: fadeSlideUp .45s ease-out forwards;
}
#sidebar.animate .list li:nth-child(1) { animation-delay: 40ms; }
#sidebar.animate .list li:nth-child(2) { animation-delay: 80ms; }
#sidebar.animate .list li:nth-child(3) { animation-delay: 120ms; }
#sidebar.animate .list li:nth-child(4) { animation-delay: 160ms; }
#sidebar.animate .list li:nth-child(5) { animation-delay: 200ms; }
#sidebar.animate .list li:nth-child(6) { animation-delay: 240ms; }
#sidebar.animate .list li:nth-child(7) { animation-delay: 280ms; }
#sidebar.animate .list li:nth-child(8) { animation-delay: 320ms; }
#sidebar.animate .list li:nth-child(9) { animation-delay: 360ms; }

/* Mobile: animate when hamburger opens */
@media (max-width: 1024px) {
  #sidebar.animate.open .list li {
    opacity: 0;
    transform: translateY(8px);
    animation: fadeSlideUp .45s ease-out forwards;
  }
}

/* ===== Motion preferences ===== */
@media (prefers-reduced-motion: reduce) {
  #sidebar.animate .list li,
  #sidebar.animate.open .list li {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .reveal,
  .reveal--visible {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  * {
    animation: none !important;
    transition: none !important;
  }
}


/* Shared hover treatment for sigil and title */
.sigil-link img,
.home-link h1 {
  transition: transform 0.3s ease, filter 0.3s ease, color 0.3s ease;
}
.sigil-link:hover img,
.home-link:hover h1 {
  transform: scale(1.05);
  filter: brightness(1.2);
  cursor: pointer;
}
.home-link {
  text-decoration: none;
  color: inherit;
}

/* ===== Global H1 Letter-by-Letter Fade Animation ===== */

h1 span {
  opacity: 0;
  display: inline-block;
  transform: translateY(10px);
  animation: fadeInLetter 0.6s forwards;
}

/* Ensure spaces between animated letters look like real word gaps */
h1 span.space {
  display: inline-block;
  width: 0.5em;  /* adjust wider/narrower if you like */
}

/* Fade + rise motion */
@keyframes fadeInLetter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Basic wrapper behavior for animated titles */
h1 {
  display: inline-block;
  overflow: hidden;
}

/* Sequential animation delays (up to 30 chars for long titles) */
h1 span:nth-child(1)  { animation-delay: 0.05s; }
h1 span:nth-child(2)  { animation-delay: 0.10s; }
h1 span:nth-child(3)  { animation-delay: 0.15s; }
h1 span:nth-child(4)  { animation-delay: 0.20s; }
h1 span:nth-child(5)  { animation-delay: 0.25s; }
h1 span:nth-child(6)  { animation-delay: 0.30s; }
h1 span:nth-child(7)  { animation-delay: 0.35s; }
h1 span:nth-child(8)  { animation-delay: 0.40s; }
h1 span:nth-child(9)  { animation-delay: 0.45s; }
h1 span:nth-child(10) { animation-delay: 0.50s; }
h1 span:nth-child(11) { animation-delay: 0.55s; }
h1 span:nth-child(12) { animation-delay: 0.60s; }
h1 span:nth-child(13) { animation-delay: 0.65s; }
h1 span:nth-child(14) { animation-delay: 0.70s; }
h1 span:nth-child(15) { animation-delay: 0.75s; }
h1 span:nth-child(16) { animation-delay: 0.80s; }
h1 span:nth-child(17) { animation-delay: 0.85s; }
h1 span:nth-child(18) { animation-delay: 0.90s; }
h1 span:nth-child(19) { animation-delay: 0.95s; }
h1 span:nth-child(20) { animation-delay: 1.00s; }
h1 span:nth-child(21) { animation-delay: 1.05s; }
h1 span:nth-child(22) { animation-delay: 1.10s; }
h1 span:nth-child(23) { animation-delay: 1.15s; }
h1 span:nth-child(24) { animation-delay: 1.20s; }
h1 span:nth-child(25) { animation-delay: 1.25s; }
h1 span:nth-child(26) { animation-delay: 1.30s; }
h1 span:nth-child(27) { animation-delay: 1.35s; }
h1 span:nth-child(28) { animation-delay: 1.40s; }
h1 span:nth-child(29) { animation-delay: 1.45s; }
h1 span:nth-child(30) { animation-delay: 1.50s; }

/* H1 color fade (dark orange -> white) after letters appear)
   Applies to all H1s except the main header, which has .no-animate */
h1:not(.no-animate) {
  color: #b94e00; /* start dark orange */
  animation: h1ColorFade 0.8s ease-out forwards;
  animation-delay: 1.8s; /* wait for letter animation to finish */
}

@keyframes h1ColorFade {
  to { color: #ffffff; }
}

/* ===== Content reveal sequence (after H1 finishes) ===== */

.reveal {
  opacity: 0;
  transform: translateY(8px);
}

.reveal--visible {
  animation: revealFadeUp 0.5s ease-out forwards;
}

@keyframes revealFadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
