/* ============================================
   Global Base Styles
   ============================================ */

body {
  font-family: var(--font-body);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* ---- Typography ---- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.3;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }

.text-handwriting {
  font-family: var(--font-handwriting);
}

.text-display {
  font-family: var(--font-display);
}

.text-secondary {
  color: var(--text-secondary);
}

/* ---- Letter text sizing ---- */
.letter-text {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  line-height: 1.8;
  max-width: var(--content-max);
  margin: 0 auto;
}

/* ---- Section layout ---- */
.section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--section-padding) var(--gap-lg);
  position: relative;
}

/* ---- Emphasis glow ---- */
.emphasis-gold {
  color: var(--gold-bright);
  text-shadow: 0 0 20px var(--glow-bright);
}

.emphasis-purple {
  color: var(--purple-soft);
  text-shadow: 0 0 20px var(--glow-purple);
}

/* ---- Breathing background (§3.1) ---- */
@keyframes breathe {
  0%, 100% { background-color: var(--bg-from); }
  50%      { background-color: var(--bg-to); }
}

.breathing-bg {
  animation: breathe 8s ease-in-out infinite;
}

/* ---- Buttons ---- */
.btn {
  font-family: var(--font-body);
  font-weight: 500;
  padding: 0.75rem 2rem;
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-primary);
  transition: all var(--duration-normal) var(--ease-default);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.btn:hover {
  background: rgba(160, 120, 72, 0.1);
  box-shadow: 0 0 20px var(--glow-purple);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--gold);
  color: #FFFFFF;
  border-color: var(--gold);
}

.btn-primary:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
}

/* ---- Focus states (accessibility) ---- */
:focus-visible {
  outline: 2px solid var(--purple-soft);
  outline-offset: 3px;
}

/* ---- Skip Buttons ---- */
.skip-btn {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  background: transparent;
  border: 1px solid var(--text-secondary);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.8rem;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity var(--duration-normal), background var(--duration-normal);
}

.skip-btn:hover {
  opacity: 1;
  background: rgba(160, 120, 72, 0.1);
}

/* ---- Utility: hidden for state toggling ---- */
.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
/* ============================================
   Theme Toggle
   ============================================ */
#theme-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast), color var(--duration-fast);
}

#theme-toggle:hover {
  background: var(--glow);
  color: var(--gold);
}

#theme-toggle svg {
  width: 24px;
  height: 24px;
  transition: transform 0.5s var(--ease-bounce);
}

#theme-toggle:hover svg {
  transform: rotate(15deg) scale(1.1);
}

/* Light Mode: Show Moon */
#theme-toggle .sun-icon { display: none; }
#theme-toggle .moon-icon { display: block; }

/* Dark Mode: Show Sun */
[data-theme="dark"] #theme-toggle .sun-icon { display: block; }
[data-theme="dark"] #theme-toggle .moon-icon { display: none; }
