/* =============================================
   MOSSBEARD THE WANDERER
   ============================================= */

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --crimson:        #8b1a1a;
  --crimson-light:  #b02020;
  --gold:           #c9a447;
  --gold-light:     #e8c56a;
  --parchment:      #f5e6c8;
  --parchment-mid:  #ead5a8;
  --dark:           #141410;
  --dark-mid:       #1e1e14;
  --dark-card:      #1a1a10;
  --bark:           #3d2b1f;
  --bark-light:     #5a3f2d;
  --moss:           #3a5c2e;
  --text-on-dark:   #e0cfa0;
  --text-on-light:  #2a1c10;
  --nav-height:     54px;
}

html {
  scroll-behavior: smooth;
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  background: var(--gold);
  color: var(--bark);
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.6rem 1.25rem;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  transition: top 0.15s;
}

.skip-link:focus {
  top: 0;
}

body {
  font-family: 'IM Fell English', Georgia, serif;
  background: var(--dark);
  color: var(--text-on-dark);
  line-height: 1.85;
  font-size: 1.05rem;
}

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

a {
  color: inherit;
}


/* =============================================
   HERO
   ============================================= */

#hero {
  height: 100vh;
  min-height: 560px;
  background-image: url('../photos/Facebook Image.jpg');
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 10, 5, 0.25) 0%,
    rgba(10, 10, 5, 0.55) 55%,
    rgba(10, 10, 5, 0.92) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.hero-content {
  max-width: 800px;
}

.hero-content h1 {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(3.2rem, 9vw, 7.5rem);
  color: var(--gold);
  text-shadow:
    0 0 60px rgba(201, 164, 71, 0.35),
    2px 3px 6px rgba(0, 0, 0, 0.9);
  line-height: 1;
  letter-spacing: 0.03em;
}

.hero-subtitle {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.1rem, 3vw, 2rem);
  color: var(--parchment);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  margin-top: 0.6rem;
  font-style: normal;
}

.hero-tagline {
  font-family: 'IM Fell English', serif;
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  color: var(--parchment);
  opacity: 0.85;
  max-width: 36em;
  margin: 1.4rem auto 0;
  line-height: 1.7;
  font-style: normal;
}

.scroll-hint {
  display: inline-block;
  margin-top: 3rem;
  color: var(--gold);
  font-size: 1.8rem;
  text-decoration: none;
  opacity: 0.65;
  animation: bob 2.2s ease-in-out infinite;
  transition: opacity 0.2s;
}

.scroll-hint:hover {
  opacity: 1;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(9px); }
}


/* =============================================
   STICKY NAV
   ============================================= */

#main-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(14, 14, 8, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(201, 164, 71, 0.25);
}

/* Desktop: single centred row */
.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  height: var(--nav-height);
}

.nav-links a {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--parchment-mid);
  text-decoration: none;
  padding: 0.9rem 1.1rem;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
  background: rgba(201, 164, 71, 0.07);
}

/* Hamburger button — hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 1rem 1.25rem;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s, width 0.25s;
}

.nav-toggle-bar:nth-child(1) { width: 22px; }
.nav-toggle-bar:nth-child(2) { width: 16px; }
.nav-toggle-bar:nth-child(3) { width: 22px; }

/* Animated X when open */
#main-nav.nav-open .nav-toggle-bar:nth-child(1) {
  width: 22px;
  transform: translateY(7px) rotate(45deg);
}
#main-nav.nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
  width: 0;
}
#main-nav.nav-open .nav-toggle-bar:nth-child(3) {
  width: 22px;
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile: collapse to dropdown */
@media (max-width: 680px) {
  #main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: var(--nav-height);
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    height: auto;
    background: rgba(14, 14, 8, 0.98);
    border-bottom: 1px solid rgba(201, 164, 71, 0.25);
    padding: 0.5rem 0 1rem;
  }

  #main-nav.nav-open .nav-links {
    display: flex;
  }

  .nav-links a {
    padding: 0.85rem 1.75rem;
    font-size: 0.78rem;
    letter-spacing: 0.15em;
    border-bottom: 1px solid rgba(201, 164, 71, 0.08);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }
}


/* =============================================
   SECTION SHELLS
   ============================================= */

.section-dark      { background: var(--dark); }
.section-parchment { background: var(--parchment); color: var(--text-on-light); }
.section-connect   { background: var(--bark); }

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 5.5rem 2rem;
}

.container--centered {
  text-align: center;
}

/* ---- Shared headings ---- */
h2 {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  text-align: center;
  letter-spacing: 0.04em;
  color: var(--gold);
}

.section-parchment h2 { color: var(--crimson); }
.section-connect   h2 { color: var(--gold); }

h3 {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.06em;
}

/* ---- Dividers ---- */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  color: var(--gold);
  font-size: 1.15rem;
  margin: 1.1rem 0 1.2rem;
  opacity: 0.55;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  max-width: 100px;
  height: 1px;
  background: currentColor;
}

.divider-crimson {
  color: var(--crimson);
}

.section-intro {
  text-align: center;
  font-size: 1.2rem;
  line-height: 1.75;
  color: var(--parchment);
  max-width: 58ch;
  margin: 0 auto 3rem;
}

.section-parchment .section-intro {
  color: var(--text-on-light);
  margin-bottom: 1.5rem;
}


/* =============================================
   THE WANDERER SECTION
   ============================================= */

.lore-intro {
  text-align: center;
  padding: 0 1rem 2.8rem;
  position: relative;
}

.lore-intro::before,
.lore-intro::after {
  content: '✦';
  display: block;
  color: var(--gold);
  font-size: 0.85rem;
  opacity: 0.5;
  letter-spacing: 0.5em;
  margin-bottom: 1.25rem;
}

.lore-intro::after {
  margin-top: 1.25rem;
  margin-bottom: 0;
}

.lore-intro p {
  font-size: 1.2rem;
  font-style: normal;
  color: var(--parchment);
  line-height: 1.85;
  max-width: 58ch;
  margin: 0 auto;
}

.lore-text p {
  margin-bottom: 1.5rem;
  color: var(--text-on-dark);
  font-size: 1.15rem;
  max-width: 72ch;
  margin-left: auto;
  margin-right: auto;
}

.lore-text p:first-of-type::first-letter,
.scroll-container > p:first-of-type::first-letter {
  font-family: 'Cinzel Decorative', serif;
  font-size: 4.2rem;
  line-height: 0.82;
  float: left;
  margin-right: 0.08em;
  margin-top: 0.12em;
  color: var(--gold);
}

.scroll-container > p:first-of-type::first-letter {
  color: var(--crimson);
}

.lore-text p:last-child {
  margin-bottom: 0;
}


/* =============================================
   FORGOTTEN WORDS SECTION
   ============================================= */

.scroll-container {
  background: var(--parchment-mid);
  border: 1px solid rgba(61, 43, 31, 0.45);
  border-radius: 3px;
  padding: 3rem 3.5rem;
  box-shadow:
    inset 0 0 40px rgba(61, 43, 31, 0.15),
    0 6px 24px rgba(0, 0, 0, 0.12);
  position: relative;
}


/* Paragraphs rendered by markdownify inside the scroll container */
.scroll-container > p {
  margin-bottom: 1.4rem;
  font-size: 1.15rem;
  color: var(--text-on-light);
  max-width: 68ch;
  margin-left: auto;
  margin-right: auto;
}

/* Blockquote rendered by markdownify (the > mission line in forgotten-words.md) */
.scroll-container blockquote {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-style: normal;
  color: var(--bark);
  text-align: center;
  border: none;
  padding: 1.25rem 2rem;
  margin: 1.75rem auto;
  letter-spacing: 0.04em;
  border-top: 1px solid rgba(61, 43, 31, 0.25);
  border-bottom: 1px solid rgba(61, 43, 31, 0.25);
  max-width: 56ch;
}

/* Reset the <p> that markdownify wraps inside the blockquote */
.scroll-container blockquote p {
  margin: 0;
  font-size: inherit;
  max-width: none;
}

.incantation {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(0.95rem, 2.5vw, 1.2rem);
  color: var(--crimson);
  text-align: center;
  margin-top: 1.5rem;
  letter-spacing: 0.06em;
}


/* =============================================
   RELICS SECTION
   ============================================= */

.relics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.relic-card {
  background: var(--dark-card);
  border: 1px solid rgba(201, 164, 71, 0.15);
  border-radius: 3px;
  padding: 2rem 1.75rem;
  transition: border-color 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.relic-card > p:not(.relic-warning) {
  padding-bottom: 1.5rem;
}

.relic-card .relic-warning {
  margin-top: auto;
}

.relic-card:hover {
  border-color: rgba(201, 164, 71, 0.5);
}

@keyframes relic-stir {
  0%   { transform: rotate(0deg) scale(1); }
  20%  { transform: rotate(-9deg) scale(1.12); }
  50%  { transform: rotate(7deg) scale(1.08); }
  75%  { transform: rotate(-4deg) scale(1.04); }
  100% { transform: rotate(0deg) scale(1); }
}

.relic-card:hover .relic-icon-svg {
  animation: relic-stir 0.45s ease-in-out forwards;
  opacity: 1;
}

.relic-icon-svg {
  width: 2.8rem;
  height: 2.8rem;
  margin-bottom: 0.9rem;
  opacity: 0.75;
  display: block;
}

.relic-card h3 {
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 0.65rem;
}

.relic-card p {
  font-size: 0.95rem;
  color: var(--text-on-dark);
  opacity: 0.8;
  line-height: 1.7;
}

.relic-warning {
  margin-top: 1rem;
  padding: 0.55rem 0.85rem;
  background: rgba(139, 26, 26, 0.18);
  border-left: 2px solid var(--crimson-light);
  border-radius: 0 2px 2px 0;
  font-size: 0.82rem;
  color: #c97070;
  opacity: 1;
  line-height: 1.55;
}

.relic-warning-icon {
  width: 1.6rem;
  height: 1.6rem;
  margin-right: 0.45em;
  vertical-align: middle;
  position: relative;
  top: -1px;
  filter: invert(59%) sepia(23%) saturate(624%) hue-rotate(310deg) brightness(100%) contrast(88%);
}

/* photo variant */
.relic-card--photo {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.relic-card--photo:hover {
  transform: translateY(-4px);
}

.relic-photo {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center 20%;
}

.relic-card-body {
  padding: 1.5rem 1.75rem;
}

.relic-card--photo h3 {
  color: var(--gold);
  font-size: 1rem;
  margin-bottom: 0.65rem;
}

.relic-card--photo p {
  font-size: 0.95rem;
  color: var(--text-on-dark);
  opacity: 0.8;
  line-height: 1.7;
}

.relic-card--photo .relic-warning {
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-top: 1px solid rgba(139, 26, 26, 0.4);
  padding: 0.65rem 1.75rem;
}


/* =============================================
   FIND MOSSBEARD SECTION
   ============================================= */

.appearances {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.appearance-card {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  padding: 1.75rem 2rem;
  border: 1px solid rgba(61, 43, 31, 0.35);
  border-radius: 3px;
  background: rgba(61, 43, 31, 0.06);
}

.appearance-card--upcoming {
  border-color: var(--crimson-light);
  background: rgba(139, 26, 26, 0.06);
}

.appearance-when {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  min-width: 110px;
  padding-top: 0.15rem;
}

.appearance-badge {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: var(--crimson);
  color: var(--parchment);
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  white-space: nowrap;
}

.appearance-date {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--crimson-light);
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
}

.appearance-card--upcoming .appearance-date {
  color: var(--crimson);
}

.appearance-details h3 {
  font-size: 1.05rem;
  color: var(--text-on-light);
  margin-bottom: 0.2rem;
}

.appearance-location {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--bark-light);
  margin-bottom: 0.6rem;
}

.appearance-details p:not(.appearance-location) {
  font-size: 0.95rem;
  color: var(--text-on-light);
  opacity: 0.78;
  margin-bottom: 0.75rem;
}

.faire-link {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--crimson);
  text-decoration: none;
  border-bottom: 1px solid var(--crimson);
  padding-bottom: 1px;
  transition: opacity 0.2s;
}

.faire-link:hover {
  opacity: 0.65;
}

.faire-link:focus-visible {
  outline: 2px solid var(--crimson);
  outline-offset: 3px;
  border-bottom-color: transparent;
}

.appearances-footer {
  text-align: center;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-on-light);
  opacity: 0.72;
}

.appearances-footer a {
  color: var(--crimson);
  text-decoration: none;
  border-bottom: 1px solid rgba(139, 26, 26, 0.4);
}

.appearances-footer a:hover {
  opacity: 0.7;
}


/* =============================================
   GALLERY SECTION
   ============================================= */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.gallery-item {
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease, filter 0.45s ease;
  filter: brightness(0.88) saturate(0.85);
}

.gallery-item:hover img,
.gallery-item:focus img {
  transform: scale(1.06);
  filter: brightness(1) saturate(1);
}

.gallery-item:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}


/* =============================================
   LIGHTBOX
   ============================================= */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(8, 8, 4, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none;
}

#lightbox-img {
  max-width: 88vw;
  max-height: 88vh;
  object-fit: contain;
  border: 1px solid rgba(201, 164, 71, 0.25);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.7);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: 1px solid rgba(201, 164, 71, 0.3);
  color: var(--gold);
  font-size: 1.2rem;
  cursor: pointer;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  opacity: 0.65;
  transition: opacity 0.2s, border-color 0.2s;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
  border-color: var(--gold);
}

.lightbox-close { top: 1.5rem;  right: 1.5rem; }
.lightbox-prev  { left: 1.5rem; top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 1.5rem; top: 50%; transform: translateY(-50%); }


/* =============================================
   CONNECT SECTION
   ============================================= */

.section-connect .container p {
  font-size: 1.2rem;
  color: var(--parchment);
  max-width: 560px;
  margin: 0 auto 2.75rem;
  line-height: 1.8;
}

.cta-btn {
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 1rem 2.75rem;
  text-decoration: none;
  transition: background 0.3s, color 0.3s;
}

.cta-btn:hover {
  background: var(--gold);
  color: var(--bark);
}

.cta-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}


/* =============================================
   FOOTER
   ============================================= */

footer {
  background: #0a0a06;
  text-align: center;
  padding: 2rem;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: rgba(201, 164, 71, 0.35);
}


/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 760px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .relics-grid {
    grid-template-columns: 1fr;
  }

  .appearance-card {
    flex-direction: column;
    gap: 0.9rem;
  }

  .appearance-when {
    flex-direction: row;
    min-width: unset;
    align-items: center;
  }

  .scroll-container {
    padding: 2rem 1.5rem;
  }

}

/* background-attachment: fixed causes jank on iOS/iPadOS (all sizes).
   Restrict it to pointer: fine devices (mouse-driven desktops) only. */
@media (pointer: coarse) {
  #hero {
    background-attachment: scroll;
  }
}

/* =============================================
   SCROLL REVEAL
   ============================================= */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================
   REDUCED MOTION
   ============================================= */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scroll-hint {
    animation: none;
  }

  .gallery-item img,
  .relic-card,
  .skip-link,
  .reveal {
    transition: none;
  }

  .relic-card:hover .relic-icon-svg {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 440px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }

  .container {
    padding: 4rem 1.25rem;
  }
}
