:root {
  /* Rustic Color Palette */
  --bg: #2d332a;            /* Deep forest charcoal */
  --panel: #3a4237;         /* Mossy dark green */
  --fg: #f4f1ea;            /* Warm linen cream */
  --muted: #c2beaf;          /* Muted beige-grey */
  --accent: #8a9a86;         /* Sage green */
  --accent-hover: #a3b39f;   /* Light sage */
  --warm-accent: #c88a58;    /* Terracotta accent */
  --border: rgba(244, 241, 234, 0.18);
  --glow: rgba(138, 154, 134, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  /* Earthy radial gradient background */
  background: radial-gradient(1200px 600px at 50% -10%, #3f473b 0%, var(--bg) 60%);
  color: var(--fg);
  font-family: Georgia, serif, Arial, sans-serif; /* Shifted toward classic/rustic serif body */
  line-height: 1.6;
}

/* Layout */
.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 3.5rem; /* Increased top padding so content doesn't overlap the pinned home button */
  text-align: center;
  position: relative; /* Keeps the positioned home button contained within the wrap layout */
}

/* Typography & Decorative Headings */
h1 { 
  margin: 0.5rem 0 0.25rem; 
  font-size: clamp(2.2rem, 5vw, 3rem); 
  letter-spacing: 0.08em;
  color: #fcfaf7;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

h2 { 
  margin: 2.5rem 0 1rem; 
  font-size: 1.4rem; 
  letter-spacing: 0.06em;
  color: #f4f1ea;
  position: relative;
  display: inline-block;
}

/* Underline accent for H2 */
h2::after {
  content: '';
  display: block;
  width: 60%;
  height: 2px;
  background: var(--warm-accent);
  margin: 0.4rem auto 0;
  border-radius: 2px;
  transition: width 0.3s ease;
}

h2:hover::after {
  width: 100%;
}

h3 { 
  margin: 2rem 0 0.75rem; 
  font-size: 1.05rem; 
  letter-spacing: 0.05em; 
  color: var(--muted);
}

p { margin: 0.75rem 0; }

/* Links */
a { 
  color: var(--warm-accent); 
  text-decoration: none; 
  transition: color 0.2s ease, text-decoration 0.2s ease;
}
a:hover { 
  color: #e09f6c; 
  text-decoration: underline; 
}

/* Navigation */
nav { 
  margin-top: 1.75rem; 
  display: flex; 
  gap: 0.75rem; 
  justify-content: center; 
  flex-wrap: wrap; 
}

nav a {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(244, 241, 234, 0.04);
  color: var(--fg);
  font-size: 0.95rem;
  transition: all 0.25s ease;
  backdrop-filter: blur(4px);
}

nav a:hover { 
  background: var(--accent); 
  color: #1e241c;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Panels / Sections */
section, .panel {
  margin-top: 2.5rem;
  padding: 1.5rem 1.5rem 1.75rem;
  background: linear-gradient(180deg, rgba(244, 241, 234, 0.06), rgba(244, 241, 234, 0.02));
  border: 1px solid var(--border);
  border-radius: 12px; /* Softened rustic corners */
  text-align: left;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

section:hover, .panel:hover {
  border-color: rgba(244, 241, 234, 0.3);
  transform: translateY(-3px);
}

/* Interactive Buttons */
.button, button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.65rem 1.35rem;
  border-radius: 8px;
  background: var(--accent);
  color: #1a2118;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.button:hover, button:hover {
  background: var(--accent-hover);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 18px var(--glow), 0 2px 4px rgba(0, 0, 0, 0.3);
}

.button:active, button:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Decorative Images & Video Embeds */
img {
  display: block;            /* Needed for auto-margins to work */
  width: 100%;               /* Spans full width of container */
  max-width: 100%;           /* Prevents overflowing bounds */
  height: auto;              /* Preserves natural aspect ratio */
  margin: 1.5rem auto;       /* Spacers on top/bottom, auto centers horizontally */
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #1c211a;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: 0.75rem 0 1.5rem;
  background: #1c211a;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Hover effect for pictures and media */
img:hover, iframe:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: var(--accent);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 15px var(--glow);
}

/* Specific aspect ratio for video embeds */
iframe {
  aspect-ratio: 16 / 9;
  border: none;
}

/* Hover effect for pictures and media */
img:hover, iframe:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: var(--accent);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 15px var(--glow);
}

/* Back / Home link pinned to top-left */
.wrap > a:first-child {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: transform 0.2s ease, color 0.2s ease;
}

.wrap > a:first-child:hover {
  color: var(--fg);
  transform: translateX(-3px);
  text-decoration: none;
}

.wrap > a:first-child:hover {
  color: var(--fg);
  transform: translateX(-4px);
  text-decoration: none;
}

/* Small screens */
@media (max-width: 520px) {
  .wrap {
    padding-top: 4rem !important; /* Pushes the title down so the home button doesn't cover it */
    position: relative !important;
  }
  
  .wrap > a:first-child {
    position: absolute !important;
    top: 1rem !important;
    left: 1rem !important;
    margin: 0 !important;
    display: inline-block !important;
    width: auto !important; /* Prevents mobile button rules from stretching it full-width */
    text-align: left !important;
  }

  h1 { 
    letter-spacing: 0.06em; 
  }

  section { 
    padding: 1.25rem; 
  }

  img {
    display: block !important;
    width: 90% !important;
    max-width: 90% !important;
    height: auto !important;
    margin: 1.5rem auto !important;
  }

  /* Nav links mobile fix */
  nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  nav a {
    text-align: center;
    padding: 0.75rem 1rem;
  }

  /* Action buttons mobile fix (excluding the back link) */
  .button, button {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    text-align: center;
  }
}
/* --- Interactive Floating & Falling Instruments --- */

.falling-instrument, 
.mouse-instrument {
  position: fixed;
  pointer-events: none; /* Allows user to click through instruments */
  user-select: none;
  z-index: 9999;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

/* Falling Animation */
.falling-instrument {
  top: -50px;
  opacity: 0.85;
  animation: fall linear forwards;
}

@keyframes fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.85;
  }
  90% {
    opacity: 0.85;
  }
  100% {
    transform: translateY(105vh) rotate(360deg);
    opacity: 0;
  }
}

/* Mouse Follow / Drift Animation */
.mouse-instrument {
  font-size: 1.4rem;
  animation: floatUp 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.6) rotate(-10deg);
  }
  50% {
    opacity: 0.8;
    transform: translate(-50%, -80px) scale(1.1) rotate(15deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -120px) scale(0.8) rotate(30deg);
  }
}