/* ============================================
   MYANCHOR - CIS-155 WebDev Project
   Clean, Professional CSS
   ============================================ */

/* Custom Font */
@font-face {
  font-family: 'CustomFont';
  src: url('font.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=Open+Sans:wght@400;600;700&display=swap');

/* ============================================
   VARIABLES
   ============================================ */
:root {
  --font-heading: 'CustomFont', 'Cinzel', serif;
  --font-body: 'Open Sans', sans-serif;
  
  /* Teal Header Gradient */
  --header-gradient: linear-gradient(90deg,
    #0d2a33 0%, #1a4d5c 50%, #0d2a33 100%);
  
  /* Conic Button Gradient (Pink/Burgundy) */
  --btn-gradient: conic-gradient(from 0deg,
    #5a0a20, #8b1538, #b8396b, #ff99cc, #b8396b, #8b1538, #5a0a20);
  
  /* Radial Red Gradient (Cards) */
  --card-red: radial-gradient(circle,
    #ff9999 0%, #e85d5d 50%, #a00000 100%);
  
  /* Purple Gradient (Stats) */
  --purple-gradient: linear-gradient(180deg,
    #9c27b0 0%, #6a1b9a 100%);
  
  /* Cream Card Background */
  --card-cream: linear-gradient(145deg,
    #fffaf5 0%, #f5ebe0 100%);
  
  /* Gold Colors */
  --gold: #ffd700;
  --gold-dark: #b8860b;
  
  /* Spacing */
  --gap: 1.5rem;
}

/* ============================================
   RESET
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

/* ============================================
   BODY & VIDEO BACKGROUND
   ============================================ */
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
}

.video-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  overflow: hidden;
}

.video-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Fallback & Overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #2d1410 0%, #6b2d28 50%, #8b4a45 100%);
  z-index: -3;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: -1;
}

/* ============================================
   HEADER
   ============================================ */
.header {
  background: var(--header-gradient);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  border-bottom: 3px solid #4a9eb0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #fff;
}

.logo-icon {
  font-size: 2rem;
  color: var(--gold);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-sub {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.logo-main {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

/* Navigation */
.nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-link {
  font-family: var(--font-body);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  background: var(--btn-gradient);
  border: 2px solid transparent;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-link:hover,
.nav-link.active {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

/* Mobile Menu */
.menu-btn {
  display: none;
  background: var(--btn-gradient);
  border: 2px solid #ff99cc;
  color: #fff;
  font-size: 1.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main {
  padding: 3rem 0;
  min-height: calc(100vh - 80px);
}

/* Page Header */
.page-header {
  text-align: center;
  margin-bottom: 3rem;
}

.eyebrow {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.page-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--gold);
  text-shadow: 
    0 2px 4px rgba(0,0,0,0.9),
    0 0 30px rgba(255, 215, 0, 0.4);
  margin-bottom: 1rem;
}

.page-intro {
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  line-height: 1.8;
}

/* ============================================
   HERO IMAGE
   ============================================ */
.hero-img {
  max-width: 500px;
  margin: 0 auto 3rem;
  border-radius: 20px;
  overflow: hidden;
  border: 4px solid var(--gold);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.hero-img img {
  width: 100%;
  height: auto;
  display: block;
}

/* ============================================
   STATS BANNER
   ============================================ */
.stats-banner {
  background: var(--purple-gradient);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 3rem;
  border: 3px solid var(--gold);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  border: 2px solid rgba(255, 215, 0, 0.4);
}

.stat-number {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--gold);
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.25rem;
  color: #fff;
}

/* ============================================
   CARD GRID
   ============================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin-bottom: 3rem;
}

/* ============================================
   FLIP CARDS
   ============================================ */
.flip-card {
  height: 380px;
  perspective: 1000px;
  cursor: pointer;
}

.flip-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-front,
.flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* Front - Cream */
.flip-front {
  background: var(--card-cream);
  border: 4px solid #d4a574;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.flip-front .icon {
  font-size: 3rem;
  color: #8b4513;
  margin-bottom: 1rem;
}

.flip-front h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: #5c3d2e;
  margin-bottom: 0.5rem;
}

.flip-front p {
  color: #6b4423;
  font-size: 0.9rem;
}

/* Back - Red Radial */
.flip-back {
  background: var(--card-red);
  border: 4px solid var(--gold);
  transform: rotateY(180deg);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  overflow-y: auto;
}

.flip-back h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--gold);
  margin-bottom: 1rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

.flip-back p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  margin-bottom: 0.75rem;
}

.flip-back .tip {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  font-style: italic;
  font-size: 0.85rem;
}

/* ============================================
   CONTENT CARD
   ============================================ */
.content-card {
  background: var(--card-cream);
  border-radius: 20px;
  padding: 2rem;
  border: 4px solid #d4a574;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  margin-bottom: 2rem;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.content-card:hover {
  transform: translateY(-5px);
  border-color: var(--gold);
}

.content-card h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: #5c3d2e;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.content-card h2 i {
  color: #8b4513;
}

.content-card p {
  color: #3d2914;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.content-card p:last-child {
  margin-bottom: 0;
}

.content-card strong {
  color: #8b4513;
}

/* ============================================
   RESOURCE CARDS
   ============================================ */
.resource-card {
  background: var(--card-cream);
  border-radius: 16px;
  padding: 1.5rem;
  border: 3px solid #d4a574;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.resource-card:hover {
  transform: translateY(-5px);
  border-color: var(--gold);
}

.resource-card h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: #5c3d2e;
  margin-bottom: 0.75rem;
}

.resource-card p {
  color: #3d2914;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.resource-card a {
  color: #8b1538;
  font-weight: 600;
  text-decoration: none;
}

.resource-card a:hover {
  color: #b8396b;
  text-decoration: underline;
}

/* ============================================
   AUDIO SECTION
   ============================================ */
.audio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  margin-bottom: 3rem;
}

.audio-card {
  background: var(--card-cream);
  border-radius: 16px;
  padding: 1.5rem;
  border: 3px solid #d4a574;
  text-align: center;
}

.audio-card h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: #5c3d2e;
  margin-bottom: 1rem;
}

.audio-card audio {
  width: 100%;
}

/* ============================================
   GALLERY
   ============================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 3rem;
}

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid #d4a574;
  aspect-ratio: 1;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.05);
  border-color: var(--gold);
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  pointer-events: none;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 2rem;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
}

.lightbox-close:hover {
  color: var(--gold);
}

/* ============================================
   GAME PAGE
   ============================================ */
.game-container {
  max-width: 800px;
  margin: 0 auto;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--purple-gradient);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border: 2px solid var(--gold);
  margin-bottom: 2rem;
}

.game-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--gold);
}

.game-info {
  font-family: var(--font-heading);
  color: var(--gold);
  font-size: 1rem;
}

/* Memory Grid */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.memory-card {
  aspect-ratio: 1;
  perspective: 1000px;
  cursor: pointer;
}

.memory-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

.memory-card.flipped .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-front,
.memory-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.memory-front {
  background: var(--purple-gradient);
  border: 3px solid var(--gold);
}

.memory-front i {
  font-size: 2rem;
  color: var(--gold);
}

.memory-back {
  background: #fff;
  transform: rotateY(180deg);
  overflow: hidden;
  border: 3px solid var(--gold);
}

.memory-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.memory-card.matched {
  opacity: 0.5;
  pointer-events: none;
}

/* Adventure Game */
.scene-img {
  width: 100%;
  max-height: 350px;
  object-fit: cover;
  border-radius: 16px;
  border: 4px solid var(--gold);
  margin-bottom: 1.5rem;
}

.scene-text {
  background: var(--card-red);
  padding: 1.5rem;
  border-radius: 16px;
  border: 3px solid var(--gold);
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.8;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.choice-btn {
  background: var(--btn-gradient);
  color: #fff;
  border: 3px solid #ff99cc;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
  transition: all 0.3s ease;
}

.choice-btn:hover {
  border-color: var(--gold);
  transform: translateX(10px);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.choice-btn i {
  font-size: 1.25rem;
}

/* Game Button */
.game-btn {
  background: var(--btn-gradient);
  color: #fff;
  border: 3px solid #ff99cc;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.game-btn:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

/* ============================================
   PAGE NAVIGATION
   ============================================ */
.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.page-nav-link {
  background: var(--btn-gradient);
  color: #fff;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 3px solid #ff99cc;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.page-nav-link:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center {
  text-align: center;
}

.hidden {
  display: none !important;
}

.max-width-sm {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .nav {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 1rem;
  }
  
  .nav.active {
    display: flex;
  }
  
  .menu-btn {
    display: block;
  }
  
  .header-inner {
    flex-wrap: wrap;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .audio-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .memory-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .flip-card {
    height: 350px;
  }
  
  .page-nav {
    flex-direction: column;
  }
  
  .page-nav-link {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .memory-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .flip-card {
    height: 320px;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
