:root {
  --bg-color: #12100e;
  --text-color: #ece6dc;
  --accent-color: #e8a838;
  --accent-soft: rgba(232, 168, 56, 0.15);
  --muted-text: #a89f92;
  --font-text: 'Lora', serif;
  --font-heading: 'Outfit', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-text);
  line-height: 1.8;
  font-size: 1.15rem;
  overflow-x: hidden;
}

h1, h2, h3, h4, .character {
  font-family: var(--font-heading);
}

#part-one,
#part-two,
#gallery,
#festival {
  scroll-margin-top: 4.5rem;
}

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.75rem;
  padding: 0.65rem 1rem;
  background: rgba(18, 16, 14, 0.94);
  border-bottom: 1px solid rgba(232, 168, 56, 0.2);
}

.site-nav a {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-text);
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--bg-color);
  background: var(--accent-color);
  outline: none;
}

.hero-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  max-width: 36rem;
  margin-top: 2.5rem;
  padding: 0 1.5rem;
  z-index: 2;
}

.hero-nav a {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-color);
  text-decoration: none;
  padding: 0.65rem 1.1rem;
  border: 1px solid rgba(232, 168, 56, 0.45);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  transition: background 0.2s, border-color 0.2s;
}

.hero-nav a:hover,
.hero-nav a:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent-color);
  outline: none;
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding-top: 3.5rem;
  background: radial-gradient(ellipse 120% 80% at 50% 20%, #2a2218 0%, var(--bg-color) 55%);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: url('data:image/svg+xml,%3Csvg opacity="0.05" width="200" height="200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 5rem);
  letter-spacing: 2px;
  color: var(--accent-color);
  text-transform: uppercase;
  margin: 0;
  text-shadow: 0 4px 30px rgba(247, 183, 49, 0.3);
  z-index: 2;
}

.hero p {
  font-style: italic;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  color: var(--muted-text);
  margin-top: 1rem;
  z-index: 2;
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
  opacity: 0.7;
  z-index: 2;
}

.scroll-indicator svg {
  width: 30px;
  height: 30px;
  fill: var(--accent-color);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
  40% { transform: translateY(-15px) translateX(-50%); }
  60% { transform: translateY(-7px) translateX(-50%); }
}

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

.part-divider {
  text-align: center;
  margin: 6rem 0;
  position: relative;
}

.part-divider h2 {
  font-size: 2.5rem;
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.part-divider::after {
  content: '';
  display: block;
  width: 100px;
  height: 2px;
  background: var(--accent-color);
  margin: 0 auto;
  border-radius: 2px;
}

.part-subtitle {
  color: var(--muted-text);
  font-style: italic;
  margin: 0.5rem 0 0;
  font-size: 1.05rem;
}

.prose p {
  margin: 0 0 1.75rem;
  text-indent: 1.5rem;
}

.prose p:first-of-type {
  text-indent: 0;
  font-size: 1.2rem;
  color: #fff;
}

.part-two-flow {
  max-width: 960px;
}

.story-block-wide {
  margin-top: 2.5rem;
}

.fable-title {
  font-family: var(--font-heading);
  color: var(--accent-color);
  font-size: 1.35rem;
  margin: 2.5rem 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--accent-soft);
  border-radius: 8px;
}

.story-end {
  text-align: center;
  font-family: var(--font-heading);
  letter-spacing: 0.35em;
  color: var(--accent-color);
  margin: 4rem 0 2rem;
}

.gallery-section {
  padding-bottom: 2rem;
}

.gallery-grid {
  max-width: 1100px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.gallery-item {
  margin: 0;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

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

@media (min-width: 960px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.scene-title {
  font-size: 1.8rem;
  color: #fff;
  margin: 4rem 0 2rem;
  border-left: 4px solid var(--accent-color);
  padding-left: 1rem;
}

.dialogue-line {
  margin-bottom: 1.2rem;
}

.character {
  color: var(--accent-color);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.95em;
  margin-right: 0.5rem;
}

.stage-direction {
  font-style: italic;
  color: var(--muted-text);
}

.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.festival-footer {
  background: #0a0908;
  text-align: center;
  padding: 5rem 2rem;
  margin-top: 6rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.chiostro-logo {
  display: inline-block;
  background: #f7f4ee;
  padding: 1.35rem 2.25rem;
  border-radius: 14px;
  margin-bottom: 2rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.chiostro-logo img {
  display: block;
  max-width: min(280px, 85vw);
  height: auto;
  margin: 0 auto;
}

.festival-footer h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.festival-footer p {
  color: var(--muted-text);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.festival-footer a.btn {
  display: inline-block;
  padding: 1rem 2rem;
  background: var(--accent-color);
  color: #0c121e;
  text-decoration: none;
  font-weight: 700;
  font-family: var(--font-heading);
  border-radius: 30px;
  transition: background 0.3s, transform 0.3s;
}

.festival-footer a.btn:hover {
  background: #fff;
  transform: translateY(-2px);
}
