/* ============================================
   FOR MEGAN ♡ — Design System
   A warm, handcrafted, green-toned aesthetic
   ============================================ */

/* --- Google Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&display=swap');

/* --- CSS Variables --- */
:root {
  /* Greens */
  --green-deep: #3d5c3d;
  --green-primary: #5a7d5a;
  --green-soft: #8fbc8f;
  --green-pale: #b5d5b5;
  --green-whisper: #d4e8d4;
  --green-tint: #eaf3ea;

  /* Warm Neutrals */
  --cream: #f8f4ed;
  --cream-dark: #efe8dc;
  --brown-warm: #8a7560;
  --brown-light: #c4b49a;

  /* Accents */
  --rose: #c4786e;
  --rose-soft: #e8a89e;
  --gold: #c9a84c;
  --gold-soft: #e8d49e;

  /* Text */
  --text-primary: #2c3e2c;
  --text-secondary: #5a6e5a;
  --text-light: #8a9a8a;
  --text-on-dark: #f0ede6;

  /* Shadows & Effects */
  --shadow-soft: 0 2px 12px rgba(61, 92, 61, 0.08);
  --shadow-medium: 0 4px 20px rgba(61, 92, 61, 0.12);
  --shadow-lift: 0 8px 30px rgba(61, 92, 61, 0.15);
  --shadow-photo: 3px 4px 14px rgba(61, 92, 61, 0.18);

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

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-round: 50%;

  /* Transitions */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 0.2s var(--ease-out);
  --transition-medium: 0.4s var(--ease-out);
  --transition-slow: 0.7s var(--ease-out);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Times New Roman', 'Playfair Display', Georgia, serif;
  background-color: var(--cream);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Selection Style --- */
::selection {
  background: var(--green-pale);
  color: var(--green-deep);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--cream);
}
::-webkit-scrollbar-thumb {
  background: var(--green-soft);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--green-primary);
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(248, 244, 237, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--green-whisper);
  padding: 0 var(--space-xl);
  transition: box-shadow var(--transition-medium);
}

.navbar.scrolled {
  box-shadow: var(--shadow-soft);
}

.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--green-deep);
  text-decoration: none;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-logo .heart {
  color: var(--rose);
  font-size: 1.1rem;
  animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.15); }
  30% { transform: scale(1); }
  45% { transform: scale(1.1); }
}

.nav-links {
  display: flex;
  gap: var(--space-xs);
  list-style: none;
}

.nav-link {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
  cursor: pointer;
}

.nav-link:hover {
  color: var(--green-deep);
  background: var(--green-tint);
}

.nav-link.active {
  color: var(--green-deep);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--green-primary);
  border-radius: 2px;
}

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--space-sm);
  background: none;
  border: none;
}

.nav-hamburger span {
  width: 22px;
  height: 2px;
  background: var(--green-deep);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

@media (max-width: 640px) {
  .nav-hamburger {
    display: flex;
  }
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(248, 244, 237, 0.97);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: var(--space-md);
    border-bottom: 1px solid var(--green-whisper);
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-fast);
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-content {
  margin-top: 64px;
  min-height: calc(100vh - 64px);
}

.tab-content {
  display: none;
  animation: fadeIn 0.5s var(--ease-out);
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   HOME PAGE — HERO
   ============================================ */
.hero {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl) var(--space-2xl);
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--green-whisper) 0%, transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}

.hero-greeting {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 700;
  color: var(--green-deep);
  margin-bottom: var(--space-md);
  opacity: 0;
  animation: slideUp 0.8s var(--ease-out) 0.2s forwards;
}

.hero-subtext {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  font-style: italic;
  max-width: 500px;
  margin: 0 auto;
  opacity: 0;
  animation: slideUp 0.8s var(--ease-out) 0.5s forwards;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Decorative leaf flourish */
.flourish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin: var(--space-xl) auto;
  opacity: 0;
  animation: slideUp 0.8s var(--ease-out) 0.8s forwards;
}

.flourish-line {
  width: 60px;
  height: 1px;
  background: var(--green-soft);
}

.flourish-icon {
  color: var(--green-soft);
  font-size: 1.2rem;
}

/* ============================================
   PHOTO GALLERY
   ============================================ */
.gallery-section {
  padding: var(--space-xl) var(--space-xl) var(--space-2xl);
  max-width: 900px;
  margin: 0 auto;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--green-deep);
  text-align: center;
  margin-bottom: var(--space-xl);
  font-weight: 600;
}

.gallery-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.gallery-track {
  display: flex;
  transition: transform 0.6s var(--ease-out);
}

.gallery-slide {
  min-width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.photo-frame {
  background: white;
  padding: 10px 10px 40px 10px;
  box-shadow: var(--shadow-photo);
  border-radius: 2px;
  transform: rotate(-1deg);
  transition: transform var(--transition-medium);
  max-width: 480px;
  width: 100%;
}

.photo-frame:hover {
  transform: rotate(0deg) scale(1.02);
}

.photo-frame img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  display: block;
}

.photo-frame .photo-caption {
  text-align: center;
  padding-top: 12px;
  font-size: 0.85rem;
  color: var(--text-light);
  font-style: italic;
}

/* Alternating tilt */
.gallery-slide:nth-child(even) .photo-frame {
  transform: rotate(1.5deg);
}
.gallery-slide:nth-child(even) .photo-frame:hover {
  transform: rotate(0deg) scale(1.02);
}
.gallery-slide:nth-child(3n) .photo-frame {
  transform: rotate(-0.5deg);
}

/* Gallery controls */
.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.gallery-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-round);
  border: 1.5px solid var(--green-soft);
  background: white;
  color: var(--green-primary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.gallery-btn:hover {
  background: var(--green-tint);
  border-color: var(--green-primary);
  transform: scale(1.08);
}

.gallery-dots {
  display: flex;
  gap: 8px;
}

.gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-round);
  background: var(--green-pale);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.gallery-dot.active {
  background: var(--green-primary);
  width: 22px;
  border-radius: 4px;
}

/* ============================================
   SPOTIFY SECTION
   ============================================ */
.spotify-section {
  padding: var(--space-2xl) var(--space-xl);
  max-width: 650px;
  margin: 0 auto;
}

.spotify-card {
  background: linear-gradient(135deg, var(--green-tint) 0%, white 100%);
  border: 1px solid var(--green-whisper);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: all var(--transition-medium);
}

.spotify-card:hover {
  box-shadow: var(--shadow-medium);
  transform: translateY(-2px);
}

.spotify-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.spotify-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--green-deep);
  margin-bottom: var(--space-sm);
}

.spotify-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: var(--space-lg);
  font-style: italic;
}

.spotify-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--green-primary);
  color: var(--text-on-dark);
  text-decoration: none;
  border-radius: 30px;
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(90, 125, 90, 0.3);
}

.spotify-link:hover {
  background: var(--green-deep);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(90, 125, 90, 0.4);
}

/* ============================================
   GAMES TAB
   ============================================ */
.games-page {
  padding: var(--space-3xl) var(--space-xl) var(--space-2xl);
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.games-header {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: var(--green-deep);
  margin-bottom: var(--space-md);
}

.games-subtitle {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 1.1rem;
  margin-bottom: var(--space-2xl);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.game-card {
  background: white;
  border: 1px solid var(--green-whisper);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
  transition: all var(--transition-medium);
  cursor: pointer;
}

.game-card:hover {
  box-shadow: var(--shadow-medium);
  transform: translateY(-4px);
  border-color: var(--green-soft);
}

.game-card-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.game-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--green-deep);
  margin-bottom: var(--space-sm);
}

.game-card-desc {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* Empty state */
.games-empty {
  padding: var(--space-2xl);
  border: 2px dashed var(--green-pale);
  border-radius: var(--radius-lg);
  color: var(--text-light);
}

.games-empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.6;
}

.games-empty-text {
  font-size: 1.1rem;
  font-style: italic;
}

/* ============================================
   WHITEBOARD TAB
   ============================================ */
.whiteboard-page {
  padding: 80px var(--space-md) var(--space-md);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.whiteboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
  border: 1px solid var(--green-whisper);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.toolbar-label {
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.toolbar-divider {
  width: 1px;
  height: 28px;
  background: var(--green-whisper);
}

.color-picker-wrapper {
  position: relative;
}

.color-picker-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-round);
  border: 2px solid var(--green-soft);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.color-picker-btn:hover {
  transform: scale(1.1);
  border-color: var(--green-primary);
}

input[type="color"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  opacity: 0;
  cursor: pointer;
}

.brush-size {
  width: 100px;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--green-pale);
  border-radius: 2px;
  outline: none;
}

.brush-size::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-round);
  background: var(--green-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.brush-size::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: var(--green-deep);
}

.toolbar-btn {
  padding: var(--space-xs) var(--space-md);
  border: 1.5px solid var(--green-soft);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--green-primary);
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toolbar-btn:hover {
  background: var(--green-tint);
  border-color: var(--green-primary);
}

.toolbar-btn.active {
  background: var(--green-primary);
  color: white;
  border-color: var(--green-primary);
}

.toolbar-btn.danger {
  border-color: var(--rose-soft);
  color: var(--rose);
}

.toolbar-btn.danger:hover {
  background: #fdf0ee;
  border-color: var(--rose);
}

.canvas-container {
  flex: 1;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--green-whisper);
  overflow: hidden;
  position: relative;
  cursor: crosshair;
}

.canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.whiteboard-status {
  text-align: center;
  padding: var(--space-sm);
  font-size: 0.8rem;
  color: var(--text-light);
  font-style: italic;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-round);
  margin-right: var(--space-xs);
  vertical-align: middle;
}

.status-dot.connected {
  background: var(--green-soft);
}

.status-dot.disconnected {
  background: var(--rose-soft);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  text-align: center;
  padding: var(--space-2xl) var(--space-xl);
  color: var(--text-light);
  font-style: italic;
  font-size: 0.9rem;
  border-top: 1px solid var(--green-whisper);
}

.site-footer .footer-heart {
  color: var(--rose);
  font-size: 1rem;
  animation: heartbeat 2s ease-in-out infinite;
}

/* ============================================
   UTILITIES
   ============================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Prevent layout jank during load */
.page-loader {
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}

.page-loader.loaded {
  opacity: 1;
}
