/* ==================== GOOGLE FONTS ==================== */
@import url('https://fonts.googleapis.com/css2?family=Encode+Sans:wght@300;400;600;700&display=swap');

/* ==================== ROOT & VARIABLES ==================== */
:root {
  /* Color palette - soft, calm colors */
  --primary-color: #4b2e83; /* UW Purple */
  --secondary-color: #85754d; /* UW Gold */
  --accent-pink: #f8b4d9; /* Soft cherry blossom pink */
  --accent-light: #fde8f3;
  --background: #fafafa;
  --text-dark: #2c2c2c;
  --text-light: #666;
  --card-bg: #ffffff;
  --shadow: rgba(0, 0, 0, 0.1);

  /* Typography */
  font-family: 'Encode Sans', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  font-weight: 400;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3rem;
  --spacing-xl: 4rem;
}

/* ==================== GLOBAL RESET ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--background);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* ==================== NAVIGATION BAR ==================== */
.navbar {
  background-color: var(--primary-color);
  padding: var(--spacing-sm) var(--spacing-md);
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 8px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  font-size: 0.95rem;
  margin: 0 0.5rem;
}

.navbar a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.navbar a.active {
  background-color: var(--secondary-color);
  font-weight: 600;
}

/* Mobile navigation */
@media (max-width: 768px) {
  .navbar {
    padding: var(--spacing-xs) var(--spacing-sm);
    gap: var(--spacing-xs);
  }

  .navbar a {
    font-size: 0.85rem;
    padding: var(--spacing-xs);
  }
}

/* ==================== MAIN CONTAINER ==================== */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-md);
  min-height: calc(100vh - 80px);
}

/* ==================== TYPOGRAPHY ==================== */
h1 {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: var(--spacing-md);
  text-align: center;
  margin: 0.8rem 0;
}

h2 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
  text-align: center;
  margin: 0.8rem 0;
}

h3 {
  font-size: 1.5rem;
  color: var(--text-dark);
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  margin: 0.8rem 0;
}

p {
  margin-bottom: var(--spacing-sm);
  color: var(--text-light);
  line-height: 1.8;
  margin: 0.5rem 0;
  line-height: 1.4;
}

/* ==================== HOMEPAGE CANVAS ==================== */
#blossom-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.homepage-content {
  position: relative;
  z-index: 1;
  background-color: rgba(255, 255, 255, 0.9);
  padding: var(--spacing-md) var(--spacing-lg)  var(--spacing-xs) var(--spacing-lg);
  border-radius: 12px;
  box-shadow: 0 4px 16px var(--shadow);
  margin: var(--spacing-md) auto;
  max-width: 800px;
}

/* Make homepage non-scrollable on large screens */
@media (min-width: 1024px) {
  body.homepage {
    overflow: hidden;
    height: 100vh;
  }

  body.homepage main {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 60px);
    margin-bottom: 0;
    padding: var(--spacing-sm);
  }

  body.homepage .homepage-content {
    margin: 0;
    padding: var(--spacing-md) var(--spacing-lg);
    max-height: none;
    overflow-y: visible;
  }

  body.homepage .homepage-content p {
    margin-bottom: var(--spacing-sm);
  }

  body.homepage .homepage-content .mt-lg {
    margin-top: var(--spacing-md);
  }
}

/* ==================== CARDS (GENERAL) ==================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: var(--spacing-md);
  align-items: start;
}

.card {
  background-color: var(--card-bg);
  padding: var(--spacing-md);
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px var(--shadow);
}

.card h3 {
  margin-top: 0;
  color: var(--primary-color);
}

.card-meta {
  font-size: 0.9rem;
  color: var(--secondary-color);
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}

.card-description {
  color: var(--text-light);
  margin-bottom: var(--spacing-sm);
}

/* ==================== TA PHOTO ==================== */
.ta-photo-container {
  text-align: center;
  margin: 1rem auto; /* Center the container horizontally */
  max-width: 500px;
  display: block; /* Remove flexbox */
}

.ta-photo {
  width: 100%;
  max-width: 350px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 16px var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ta-photo:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow);
}

/* ==================== WEB IMPACT PHOTOS ==================== */
.wi-photos-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin: var(--spacing-md) auto var(--spacing-lg);
  align-items: center;
}

.wi-photo-wrapper {
  flex: 1;
  text-align: center;
}

.wi-photo {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 16px var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wi-photo:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow);
}

/* Desktop layout: side by side */
@media (min-width: 769px) {
  .wi-photos-container {
    flex-direction: row;
    gap: var(--spacing-lg);
    max-width: 900px;
  }
}

/* ==================== TA CARDS ==================== */
/* Make all TA cards same height */
.ta-card {
  display: flex;
  flex-direction: column;
  height: 100%; /* Let grid control the height */
  padding: 1rem;
  margin: 0.5rem;
}

/* Force equal heights on desktop */
@media (min-width: 769px) {
  .card-grid {
    grid-auto-rows: 1fr; /* All rows same height */
  }
}

.ta-card .course-link {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.ta-card .course-link:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

.ta-card .card-details {
  display: none;
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
  border-top: 2px solid var(--primary-color);
  color: var(--text-dark);
}

.ta-card.active .card-details {
  display: block;
}

.ta-card .expand-hint {
  font-size: 0.85rem;
  color: var(--primary-color);
  font-style: italic;
  margin-top: var(--spacing-xs);
}

/* Husky Mascot Card */
.husky-mascot-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  background-color: var(--card-bg); /* Same as other cards */
}

.mascot-card-image {
  max-width: 200px; /* Larger image */
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

/* Don't hide expand hint - it changes text dynamically */

/* ==================== PROJECT CARDS ==================== */
.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: var(--spacing-sm);
}

.project-link {
  display: inline-block;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  margin-top: var(--spacing-xs);
  transition: color 0.3s ease;
}

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

/* ==================== SIMPLE PROJECT GRID ==================== */
.projects-year-section {
  margin-bottom: var(--spacing-md);
}

.year-heading {
  color: var(--secondary-color);
  font-size: 1.5rem;
  font-weight: 600;
  text-align: left;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-xs);
  border-bottom: 2px solid var(--secondary-color);
}

.collapsible-heading {
  cursor: pointer;
  user-select: none;
  transition: color 0.3s ease;
}

.collapsible-heading:hover {
  color: var(--primary-color);
}

.collapse-indicator {
  display: inline-block;
  transition: transform 0.3s ease;
  font-size: 0.8em;
}

.collapsible-heading.collapsed .collapse-indicator {
  transform: rotate(-90deg);
}

.collapsible-content {
  max-height: 10000px;
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.3s ease;
}

.collapsible-content.collapsed {
  max-height: 0;
  opacity: 0;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--spacing-md);
  margin: var(--spacing-md) 0;
}

.project-card-simple {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  height: 300px;
}

.project-card-simple:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px var (--shadow);
}

.project-card-simple a {
  text-decoration: none;
  color: inherit;
  display: block;
  width: 100%;
  height: 100%;
}

.project-screenshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background-color: #f5f5f5; /* Light gray background for transparent images */
}

.project-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--spacing-md);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7));
  color: white;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.project-card-simple:hover .project-info {
  transform: translateY(0);
}

.project-info h3 {
  font-size: 1.1rem;
  margin: 0 0 var(--spacing-xs) 0;
  color: white;
}

.project-type {
  font-size: 0.875rem;
  color: var(--secondary-color);
  font-weight: 600;
  margin: 0;
}

@media (max-width: 768px) {
  .project-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-sm);
  }
}

@media (max-width: 480px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== SECTION BLOCKS ==================== */
.section-block {
  background-color: var(--card-bg);
  padding: var(--spacing-md);
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--shadow);
  margin-bottom: var(--spacing-md);
}

.mt-0 {
  margin-top: 0 !important;
}

.section-icon {
  font-size: 2rem;
  margin-right: var(--spacing-sm);
  vertical-align: middle;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
  main {
    padding: var(--spacing-sm);
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

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

  .homepage-content {
    padding: var(--spacing-md);
  }
}

/* ==================== TIMELINE ==================== */
.timeline {
  position: relative;
  max-width: 800px;
  margin: var(--spacing-lg) auto;
  padding: var(--spacing-md) 0;
}

/* Vertical line */
.timeline::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
}

.timeline-item {
  position: relative;
  padding-left: 60px;
  margin-bottom: var(--spacing-lg);
}

.timeline-dot {
  position: absolute;
  left: 11px;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--secondary-color);
  border: 3px solid var(--background);
  box-shadow: 0 0 0 3px var(--primary-color);
  z-index: 1;
}

.timeline-content {
  background-color: var(--card-bg);
  padding: var(--spacing-md);
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-date {
  color: var(--secondary-color);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: var(--spacing-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-content:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 16px var(--shadow);
}

.timeline-content h3 {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: var(--spacing-xs);
  font-size: 1.3rem;
}

.timeline-content p {
  margin-bottom: 0;
  color: var(--text-dark);
}

/* Mobile timeline */
@media (max-width: 768px) {
  .timeline::before {
    left: 15px;
  }

  .timeline-item {
    padding-left: 50px;
    padding-top: 25px;
  }

  .timeline-dot {
    left: 6px;
    top: 30px;
    width: 18px;
    height: 18px;
  }

  .timeline-date {
    left: 0;
    top: 0;
    font-size: 0.8rem;
  }

  .timeline-content {
    padding: var(--spacing-sm);
  }
}

/* ==================== CAMPUS IMAGES - LANDSCAPE FOOTER ==================== */
.campus-images {
  display: flex;
  gap: 0; /* No gap - images touch each other */
  justify-content: center;
  align-items: flex-end;
  margin-top: var(--spacing-xl);
  margin-bottom: 0;
  flex-wrap: nowrap;
  position: fixed; /* Fixed to bottom of page */
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 0; /* Behind main content */
  padding: 0;
}

.campus-images img {
  flex: 1; /* Images expand to fill space equally */
  max-width: 33.333%; /* Each takes up 1/3 of width */
  height: auto;
  opacity: 0.75;
  mix-blend-mode: multiply;
  transition: all 0.3s ease;
  object-fit: cover;
  margin: 0 -2px; /* Slight overlap to ensure no gaps */
  filter: blur(0px); /* Start with no blur */
}

/* Blur the edges where images meet */
.campus-images img:not(:last-child) {
  mask-image: linear-gradient(to right,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 85%,
    rgba(0,0,0,0.3) 95%,
    rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to right,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 85%,
    rgba(0,0,0,0.3) 95%,
    rgba(0,0,0,0) 100%);
}

.campus-images img:not(:first-child) {
  mask-image: linear-gradient(to left,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 85%,
    rgba(0,0,0,0.3) 95%,
    rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to left,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 85%,
    rgba(0,0,0,0.3) 95%,
    rgba(0,0,0,0) 100%);
}

/* Middle image gets both masks */
.campus-images img:nth-child(2) {
  mask-image: linear-gradient(to right,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.3) 5%,
    rgba(0,0,0,1) 15%,
    rgba(0,0,0,1) 85%,
    rgba(0,0,0,0.3) 95%,
    rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to right,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.3) 5%,
    rgba(0,0,0,1) 15%,
    rgba(0,0,0,1) 85%,
    rgba(0,0,0,0.3) 95%,
    rgba(0,0,0,0) 100%);
}

/* Hover effects removed */

/* ==================== HUSKY MASCOT SCROLL INDICATOR ==================== */
.husky-scroll-indicator {
  position: absolute;
  left: -10px; /* Position on the timeline line, just to the left */
  transform: translateX(-100%); /* Shift fully to the left */
  width: 100px; /* Bigger mascot */
  height: auto;
  transition: top 0.15s cubic-bezier(0.4, 0, 0.2, 1); /* Much faster animation */
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  pointer-events: none; /* Don't interfere with clicks */
}

@media (max-width: 768px) {
  .husky-scroll-indicator {
    width: 70px; /* Slightly smaller on tablet */
  }
}

@media (max-width: 480px) {
  .husky-scroll-indicator {
    width: 50px; /* Even smaller on mobile */
  }
}

/* Emphasized timeline item when husky is at it */
.timeline-item.husky-active {
  transform: scale(1.02);
  transition: transform 0.15s ease;
}

.timeline-item.husky-active .timeline-content {
  box-shadow: 0 8px 24px rgba(75, 46, 131, 0.2);
  border-color: var(--primary-color);
}

.timeline-item.husky-active .timeline-dot {
  transform: scale(1.3);
  background: var(--primary-color);
  box-shadow: 0 0 0 8px rgba(75, 46, 131, 0.1);
}

/* Ensure main content has space and appears above images */
main {
  position: relative;
  z-index: 1;
  margin-bottom: 250px; /* Space for images at bottom */
}

@media (max-width: 1024px) {
  main {
    margin-bottom: 200px;
  }
}

@media (max-width: 768px) {
  .campus-images {
    flex-wrap: nowrap;
  }
  .campus-images img {
    max-width: 33.333%;
  }
  main {
    margin-bottom: 150px;
  }
}

@media (max-width: 480px) {
  .campus-images {
    position: relative; /* Not fixed on mobile */
    flex-direction: row; /* Keep horizontal on mobile */
  }
  .campus-images img {
    max-width: 33.333%;
  }
  main {
    margin-bottom: 0;
  }
}

/* ==================== TIMELINE PAGE STYLES ==================== */
/* Timeline page uses the same .timeline class and styling as the original homepage timeline (defined above in lines 339-438) */

/* Expandable timeline items */
.timeline-expandable .timeline-content {
  cursor: pointer;
  position: relative;
}

.timeline-details {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.4s ease;
  margin-top: var(--spacing-sm);
}

.timeline-expandable.active .timeline-details {
  max-height: 1000px;
  opacity: 1;
}

.timeline-details p {
  margin-bottom: var(--spacing-sm);
}

.timeline-details p:last-child {
  margin-bottom: 0;
}

.expand-hint {
  display: block;
  color: var(--secondary-color);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: var(--spacing-sm);
  transition: color 0.3s ease;
}

.timeline-expandable:hover .expand-hint {
  color: var(--primary-color);
}

.timeline-expandable.active .expand-hint {
  color: var (--primary-color);
}

/* ==================== UTILITY CLASSES ==================== */
.text-center {
  text-align: center;
}

.mt-lg {
  margin-top: var(--spacing-lg);
}

.mb-lg {
  margin-bottom: var(--spacing-lg);
}
