:root {
  /* Default theme: Brewers */
  --primary-color: #12284b;
  --secondary-color: #0a1929;
  --theme-color-1: #12284b;
  --theme-color-2: #1e5ba8;
  --theme-color-3: #FFC52F;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --bg-color: #ffffff;
  --bg-gray: #f9fafb;
  --border-color: #e5e7eb;
}

/* Brewers Theme */
[data-theme="brewers"] {
  --primary-color: #12284b;
  --secondary-color: #0a1929;
  --theme-color-1: #12284b;
  --theme-color-2: #1e5ba8;
  --theme-color-3: #FFC52F;
}

/* Badgers Theme */
[data-theme="badgers"] {
  --primary-color: #c5050c;
  --secondary-color: #9b0000;
  --theme-color-1: #c5050c;
  --theme-color-2: #a30000;
  --theme-color-3: #ffffff;
}

/* Packers Theme */
[data-theme="packers"] {
  --primary-color: #203731;
  --secondary-color: #14231e;
  --theme-color-1: #203731;
  --theme-color-2: #2d5a4a;
  --theme-color-3: #FFB612;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  width: 100%;
  min-height: 100vh;
  padding: 0;
  margin: 0;
  background: linear-gradient(135deg, var(--theme-color-1) 0%, var(--theme-color-2) 50%, var(--theme-color-3) 100%);
  background-attachment: fixed;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  color: var(--text-color);
  line-height: 1.6;
}

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

div.main_page {
  width: 100%;
  min-height: calc(100vh - 100px);
  background-color: var(--bg-color);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  margin: 2rem auto;
  max-width: 900px;
  padding: 3rem 2rem;
}

header h1 {
  font-size: 3rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: var(--text-color);
  background: linear-gradient(135deg, var(--theme-color-1) 0%, var(--theme-color-2) 50%, var(--theme-color-3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

header h3 {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-light);
  margin: 0 0 2rem 0;
}

section h2 {
  font-size: 2rem;
  font-weight: 600;
  margin: 2.5rem 0 1.5rem 0;
  color: var(--text-color);
  position: relative;
  display: inline-block;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--theme-color-1) 0%, var(--theme-color-3) 100%);
  border-radius: 2px;
}

.profile {
  border-radius: 50%;
  width: 160px;
  height: 160px;
  overflow: hidden;
  margin: 2rem auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border: 4px solid white;
}

.profile-pic {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-text {
  font-size: 1.1rem;
  color: var(--text-color);
  max-width: 700px;
  margin: 1.5rem auto;
  line-height: 1.8;
}

.about-text a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.about-text a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.project-card {
  background: var(--bg-gray);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: left;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.project-card h3 {
  font-size: 1.5rem;
  margin: 0 0 0.75rem 0;
  color: var(--text-color);
}

.project-card p {
  color: var(--text-light);
  margin: 0 0 1rem 0;
  font-size: 0.95rem;
}

.project-card a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.project-card a:hover {
  color: var(--secondary-color);
}

.support-section {
  background: linear-gradient(135deg, var(--theme-color-1) 0%, var(--theme-color-2) 50%, var(--theme-color-3) 100%);
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
  color: white;
  text-align: center;
}

.support-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1.75rem;
}

.support-section p {
  margin: 0 0 1.5rem 0;
  font-size: 1.05rem;
  opacity: 0.95;
}

.coffee-btn {
  display: inline-block;
  background: white;
  color: var(--primary-color);
  padding: 0.875rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.coffee-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.social-icons {
  width: 100%;
  text-align: center;
  margin: 2rem 0;
  padding: 1.5rem 0 0 0;
  border-top: 1px solid var(--border-color);
}

.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 0.5rem;
  border-radius: 50%;
  background: var(--bg-gray);
  color: var(--text-color);
  font-size: 1.25rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.social-icons a:hover {
  background: linear-gradient(135deg, var(--theme-color-1) 0%, var(--theme-color-3) 100%);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.footer-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem 2rem 1rem;
}

footer {
  color: white;
  text-align: center;
  font-size: 0.9rem;
}

/* Theme Switcher */
.theme-switcher {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 0.75rem;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  padding: 10px 15px;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.theme-btn {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  border: 3px solid white;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  position: relative;
}

.theme-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border-width: 4px;
}

.theme-btn.active {
  border-color: var(--theme-color-3);
  box-shadow: 0 0 0 3px var(--theme-color-1), 0 8px 24px rgba(0, 0, 0, 0.4);
  transform: scale(1.1);
  border-width: 4px;
}

.theme-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Individual logo adjustments */
.theme-btn-brewers img {
  transform: scale(0.95);
}

.theme-btn-badgers img {
  transform: scale(0.90);
}

.theme-btn-packers img {
  transform: scale(0.83);
  object-fit: contain;
}

/* Chant Animations */
.chant-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2000;
  overflow: hidden;
}

.chant-drop {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 5rem;
  font-weight: 900;
  text-shadow: 4px 4px 8px rgba(0,0,0,0.5);
  animation: dropDown 2s ease-out forwards;
  white-space: nowrap;
}

@keyframes dropDown {
  0% { top: -200px; opacity: 0; }
  30% { top: 50%; transform: translate(-50%, -50%); opacity: 1; }
  70% { top: 50%; transform: translate(-50%, -50%); opacity: 1; }
  100% { top: 150%; opacity: 0; }
}

.chant-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 5rem;
  font-weight: 900;
  text-shadow: 4px 4px 8px rgba(0,0,0,0.5);
  animation: pulse 2s ease-in-out forwards;
  white-space: nowrap;
}

@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
  10% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  20% { transform: translate(-50%, -50%) scale(1); }
  30% { transform: translate(-50%, -50%) scale(1.2); }
  40% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
  80% { opacity: 1; }
}

@media (max-width: 768px) {
  header h1 {
    font-size: 2.25rem;
  }

  div.main_page {
    padding: 2rem 1.25rem;
    margin: 1rem;
    border-radius: 16px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .theme-switcher {
    top: 10px;
    right: 10px;
    gap: 0.5rem;
  }

  .theme-btn {
    width: 45px;
    height: 45px;
    border-width: 2px;
  }

  .theme-btn:hover {
    border-width: 3px;
  }

  .theme-btn.active {
    border-width: 3px;
  }

  .chant-drop, .chant-pulse {
    font-size: 3rem;
  }
}
