/* ===========================================
   Joy Music Foundation — Styles
   =========================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

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

/* --- 2. Custom Properties --- */
:root {
  --color-primary: #E84393;
  --color-primary-light: #FD79A8;
  --color-primary-dark: #C0307A;
  --color-dark: #1A1A2E;
  --color-white: #FFFFFF;
  --color-off-white: #FDF2F8;
  --color-gray-100: #F8F9FA;
  --color-gray-300: #DEE2E6;
  --color-gray-600: #6C757D;
  --color-text: #2D3436;
  --color-text-light: #636E72;
  --color-text-on-dark: #F0F0F0;

  --font-heading: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container-max: 1100px;
  --section-padding: clamp(4rem, 8vw, 7rem);
}

/* --- 3. Utility Classes --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hidden {
  position: absolute;
  overflow: hidden;
  clip: rect(0 0 0 0);
  height: 1px;
  width: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 0.5rem 1rem;
  border-radius: 0 0 8px 8px;
  z-index: 9999;
  font-weight: 600;
}

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

.section-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

/* --- 4. Buttons --- */
.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(232, 67, 147, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--color-white);
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-white);
  transform: translateY(-2px);
}

.btn-large {
  padding: 1rem 3rem;
  font-size: 1.0625rem;
}

/* --- 5. Navigation / Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 0;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

.header.scrolled {
  background-color: var(--color-white);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  padding: 0.5rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-white);
  transition: color 0.3s ease;
}

.header.scrolled .logo-link {
  color: var(--color-text);
}

.logo-icon {
  width: 32px;
  height: 38px;
  object-fit: contain;
  filter: invert(1) brightness(2);
  transition: filter 0.3s ease;
}

.header.scrolled .logo-icon {
  filter: none;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.125rem;
}

.nav-list {
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  transition: color 0.3s ease;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.header.scrolled .nav-link {
  color: var(--color-text-light);
}

.header.scrolled .nav-link:hover {
  color: var(--color-primary);
}

.nav-toggle {
  display: none;
  width: 28px;
  height: 20px;
  position: relative;
  z-index: 1001;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 28px;
  height: 2px;
  background-color: var(--color-white);
  border-radius: 2px;
  transition: all 0.3s ease;
  position: absolute;
}

.header.scrolled .hamburger,
.header.scrolled .hamburger::before,
.header.scrolled .hamburger::after {
  background-color: var(--color-text);
}

.hamburger {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger::before {
  content: '';
  top: -8px;
}

.hamburger::after {
  content: '';
  top: 8px;
}

/* Hamburger open state */
.nav-open .hamburger {
  background-color: transparent;
}

.nav-open .hamburger::before {
  top: 0;
  transform: rotate(45deg);
  background-color: var(--color-white);
}

.nav-open .hamburger::after {
  top: 0;
  transform: rotate(-45deg);
  background-color: var(--color-white);
}

/* --- 6. Hero Section --- */
.hero {
  background: linear-gradient(
    135deg,
    rgba(26, 26, 46, 0.95) 0%,
    rgba(26, 26, 46, 0.85) 40%,
    rgba(192, 48, 122, 0.7) 100%
  );
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-text-on-dark);
  padding: 6rem 1.5rem 4rem;
}

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

.hero-logo {
  width: 80px;
  height: 96px;
  margin: 0 auto 2rem;
  object-fit: contain;
  filter: invert(1) brightness(2);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.15;
  margin-bottom: 1.5rem;
  color: var(--color-white);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.1875rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2.5rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- 7. Mission Section --- */
.mission {
  padding: var(--section-padding) 0;
  text-align: center;
}

.mission .section-title {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.mission-text {
  max-width: 680px;
  margin: 0 auto 2.5rem;
}

.mission-text p {
  margin-bottom: 1.25rem;
  color: var(--color-text-light);
}

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

.mission-badges {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 2rem;
  background: var(--color-off-white);
  border-radius: 12px;
  min-width: 180px;
}

.badge-label {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.badge-text {
  font-size: 0.8125rem;
  color: var(--color-text-light);
}

/* --- 8. Programs Section --- */
.programs {
  padding: var(--section-padding) 0;
  background-color: var(--color-off-white);
  text-align: center;
}

.programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.program-card {
  background: var(--color-white);
  border-radius: 16px;
  padding: 2.5rem 1.75rem;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.program-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.program-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 1.5rem;
  color: var(--color-primary);
}

.program-icon svg {
  width: 100%;
  height: 100%;
}

.program-card h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.program-card p {
  font-size: 0.9375rem;
  color: var(--color-text-light);
  line-height: 1.65;
}

/* --- 9. Founder Section --- */
.founder {
  padding: var(--section-padding) 0;
  background-color: var(--color-dark);
  color: var(--color-text-on-dark);
}

.founder-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 768px) {
  .founder-grid {
    grid-template-columns: 2fr 3fr;
  }
}

.founder-image img {
  width: 100%;
  max-width: 400px;
  border-radius: 16px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  margin: 0 auto;
  display: block;
}

.founder-bio {
  text-align: left;
}

@media (max-width: 767px) {
  .founder-bio {
    text-align: center;
  }
}

.founder .section-label {
  color: var(--color-primary-light);
}

.founder .section-title {
  color: var(--color-white);
}

.founder-artist-name {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-primary-light);
  margin-bottom: 2rem;
  margin-top: -0.75rem;
}

.founder-text {
  margin-bottom: 2.5rem;
}

.founder-text p {
  margin-bottom: 1.25rem;
  color: rgba(240, 240, 240, 0.8);
}

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

.founder-links {
  display: flex;
  gap: 1.25rem;
}

@media (max-width: 767px) {
  .founder-links {
    justify-content: center;
  }
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-on-dark);
  transition: all 0.3s ease;
}

.social-link:hover {
  background: var(--color-primary);
  color: var(--color-white);
  transform: translateY(-2px);
}

.social-link svg {
  width: 20px;
  height: 20px;
}

/* --- 10. Donate Section --- */
.donate {
  padding: var(--section-padding) 0;
  text-align: center;
}

.donate-intro {
  max-width: 640px;
  margin: 0 auto 3rem;
  color: var(--color-text-light);
  font-size: 1.0625rem;
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  max-width: 720px;
  margin: 0 auto 3rem;
}

.impact-item {
  padding: 2rem 1.5rem;
  border-radius: 16px;
  background: var(--color-off-white);
  border: 2px solid transparent;
  transition: border-color 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}

.impact-item:hover {
  border-color: var(--color-primary-light);
}

.impact-item.selected {
  border-color: var(--color-primary);
  background-color: rgba(232, 67, 147, 0.08);
  transform: translateY(-4px);
}

.impact-amount {
  display: block;
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.impact-desc {
  font-size: 0.9375rem;
  color: var(--color-text-light);
}

.donate-cta {
  margin-top: 2rem;
}

.donate-note {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--color-gray-600);
}

/* --- 11. Contact Section --- */
.contact {
  padding: var(--section-padding) 0;
  background-color: var(--color-off-white);
  text-align: center;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-top: 3rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

@media (min-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-info p {
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

.contact-email {
  display: inline-block;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
  transition: color 0.3s ease;
}

.contact-email:hover {
  color: var(--color-primary-dark);
}

.contact-socials {
  display: flex;
  gap: 0.75rem;
}

.contact-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-white);
  color: var(--color-text-light);
  transition: all 0.3s ease;
}

.contact-socials a:hover {
  color: var(--color-primary);
  transform: translateY(-2px);
}

.contact-socials svg {
  width: 18px;
  height: 18px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.form-group input,
.form-group textarea {
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--color-gray-300);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--color-text);
  background: var(--color-white);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(232, 67, 147, 0.15);
}

.form-group textarea {
  resize: vertical;
}

.form-success {
  display: none;
  text-align: center;
  padding: 1.5rem;
  background: rgba(232, 67, 147, 0.08);
  border-radius: 12px;
  color: var(--color-primary-dark);
}

.form-success svg {
  width: 40px;
  height: 40px;
  margin: 0 auto 0.75rem;
  color: var(--color-primary);
}

.form-success p {
  font-weight: 600;
  font-size: 1rem;
}

.contact-form.submitted .form-group,
.contact-form.submitted .btn {
  display: none;
}

.contact-form.submitted .form-success {
  display: block;
}

/* --- 12. Footer --- */
.footer {
  background-color: var(--color-dark);
  color: rgba(240, 240, 240, 0.7);
  padding-top: 4rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
}

@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: 2fr 1fr 1.5fr;
  }
}

.footer-logo {
  width: 36px;
  height: 43px;
  margin-bottom: 1rem;
  object-fit: contain;
  filter: invert(1) brightness(2);
}

.footer-brand p {
  font-size: 0.875rem;
  line-height: 1.65;
  max-width: 300px;
}

.footer-links h4,
.footer-legal h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-white);
  margin-bottom: 1rem;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  font-size: 0.875rem;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--color-primary-light);
}

.footer-legal p {
  font-size: 0.8125rem;
  line-height: 1.65;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.5rem 0;
}

.footer-bottom p {
  font-size: 0.8125rem;
  text-align: center;
}

/* --- 13. Animations --- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* --- 14. Mobile Responsive --- */
@media (max-width: 767px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--color-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .nav-open .nav {
    opacity: 1;
    visibility: visible;
  }

  .nav-list {
    flex-direction: column;
    gap: 2rem;
    text-align: center;
  }

  .nav-link {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.85);
  }

  /* When mobile nav is open, hamburger should always be white */
  .nav-open .hamburger::before,
  .nav-open .hamburger::after {
    background-color: var(--color-white) !important;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }

  .hero-ctas .btn {
    width: 100%;
    max-width: 280px;
  }

  .mission-badges {
    flex-direction: column;
    align-items: center;
  }

  .badge {
    width: 100%;
    max-width: 280px;
  }

  .programs-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }

  .impact-grid {
    grid-template-columns: 1fr;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
  }
}
