/* ==========================================================================
   Base Styles & CSS Custom Properties
   ========================================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Color palette — refined, cohesive */
  --color-bg:           #fef9f0;
  --color-bg-alt:       #f5eddf;
  --color-text:         #3b2314;
  --color-text-muted:   #7a5c50;
  --color-heading:      #8c1b3d;
  --color-accent:       #8c1b3d;
  --color-accent-hover: #6b1430;
  --color-gold:         #9e7c16;
  --color-white:        #ffffff;
  --color-overlay:      rgba(46, 26, 14, 0.55);
  --color-nav-solid:    rgba(100, 18, 45, 0.95);
  --color-card-bg:      #fffdf8;
  --color-card-border:  #e2c9a5;
  --color-link:         #8c1b3d;
  --color-error:        #c0392b;
  --color-focus:        #c9a227;
  --color-hero-text:    #fff0e8;
  --color-hero-bg:      #1a0a10;

  /* Typography */
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Cormorant Garamond', Georgia, serif;
  --font-mono:    'Courier New', Courier, monospace;

  /* Spacing */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  2rem;
  --space-lg:  4rem;
  --space-xl:  6rem;

  /* Animation timing */
  --duration-fast:   200ms;
  --duration-normal: 400ms;
  --duration-slow:   700ms;
  --ease-out:        cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in-out:     cubic-bezier(0.42, 0, 0.58, 1);

  /* Layout */
  --max-width:    1100px;
  --nav-height:   64px;
  --border-radius: 8px;
}

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

/* Screen-reader only label */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
}

body {
  font-family: var(--font-body);
  font-size: 1.12rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
  background-image: url('../images/background.webp');
  background-repeat: repeat;
  background-size: 400px auto;
  background-position: top left;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--color-accent-hover);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  line-height: 1.2;
  font-weight: 600;
}

ul {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

main {
  display: block;
}

section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg) var(--space-md);
  position: relative;
  scroll-margin-top: var(--nav-height);
}

section:nth-child(even) {
  background-color: var(--color-bg-alt);
}

.section-title {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 2.5rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 0;
  letter-spacing: 0.04em;
  position: relative;
}


/* ---------- Music Toggle Button ---------- */
.music-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: transform var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
  opacity: 0;
  pointer-events: none;
}

.music-toggle.visible {
  opacity: 1;
  pointer-events: auto;
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 1.6s both;
}

.music-toggle:hover {
  transform: scale(1.1);
  background: var(--color-accent-hover);
}

.music-toggle .music-icon {
  width: 22px;
  height: 22px;
}

.music-toggle .music-icon-off {
  display: none;
}

.music-toggle.muted .music-icon-on {
  display: none;
}

.music-toggle.muted .music-icon-off {
  display: block;
}

footer {
  text-align: center;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  border-top: 1px solid var(--color-card-border);
  position: relative;
}

.mobile-break {
  display: none;
}

footer::before {
  content: '✽';
  position: absolute;
  top: -0.6em;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-bg-alt);
  padding: 0 1rem;
  color: var(--color-accent);
  font-size: 1rem;
  opacity: 0.6;
}
