/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colors */
  --primary-color: #1a1a2e;
  --secondary-color: #16213e;
  --accent-color: #a70404;
  --dark-red: #a70404;
  --text-light: #f5f5f5;
  --text-dark: #333;
  --card-bg: rgba(22, 33, 62, 0.9);
  
  /* Spacing */
  --section-padding: 5rem 2rem;
  --container-max-width: 1200px;
  
  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --line-height: 1.6;
  
  /* Shadows */
  --shadow-sm: 0 5px 15px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.2);
  
  /* Transitions */
  --transition-default: all 0.3s ease;
}

/* Base Styles */
body {
  font-family: var(--font-family);
  line-height: var(--line-height);
  color: var(--text-dark);
  background-color: #f5f5f5;
  font-size: 1.125rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.2;
}

.section-title {
  text-align: center;
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 3rem;
}

.section-title--light {
  color: var(--text-light);
}

/* Layout Utilities */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: var(--section-padding);
}

.grid {
  display: grid;
  gap: 2rem;
}

.grid--auto-fit {
  grid-template-columns: repeat(auto-fit, minmax(var(--grid-min-width, 300px), 1fr));
}

/* Header */
.header {
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  transition: var(--transition-default);
  background: transparent;
}

.header.scrolled {
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  width: 50px;
  height: 50px;
}

.site-title {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--text-light);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Hero Section */
.home-image {
  height: 100vh;
  background: url('game-room_red.png') center/cover;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.home-title {
  font-size: 5rem;
  font-weight: 900;
  color: var(--text-light);
  text-align: center;
  text-shadow: 3px 3px 6px rgba(167, 9, 9, 0.5);
  letter-spacing: 2px;
}

.hero-logo {
  max-width: 400px;
  height: auto;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
  position: relative;
  z-index: 1;
}

/* Info Section */
.info-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  padding: var(--section-padding);
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.info-column {
  text-align: center;
  padding: 2rem;
  background: white;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-default);
}

.info-column:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.info-heading {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.info-image {
  width: 120px;
  height: 120px;
  margin: 0 auto 1.5rem;
  display: block;
}

.info-text {
  color: var(--text-dark);
  font-size: 1.25rem;
  line-height: 1.8;
}

/* Content Sections */
.content-section {
  padding: var(--section-padding);
}

/* Alternating backgrounds, starting with grey since info-row is red */
.content-section:nth-of-type(even) {
  background: #e6e6e6;
}

.content-section:nth-of-type(odd):nth-of-type(n+3) {
  background: var(--dark-red);
}

/* For dark red sections */
.content-section:nth-of-type(odd):nth-of-type(n+3) .section-title {
  color: white;
  text-shadow: 
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000,
    2px 2px 0 #000,
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}

/* Override for specific sections */
.content-section--light {
  background: #e6e6e6 !important;
}

.content-section--dark {
  background: var(--dark-red) !important;
}

.content-box {
  max-width: var(--container-max-width);
  margin: 0 auto;
  background: white;
  border-radius: 10px;
  padding: 3rem;
  box-shadow: var(--shadow-lg);
}

.content-box p {
  font-size: 1.375rem;
  color: var(--text-dark);
  line-height: 1.8;
  margin-bottom: 0.5rem;
}

.demo-section {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
  text-align: center;
}

.demo-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}


/* Lists */
.styled-list {
  list-style: none;
  color: var(--text-dark);
  font-size: 1.25rem;
  line-height: 2;
}

.styled-list li {
  padding-left: 2rem;
  position: relative;
  margin-bottom: 1rem;
}

.styled-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-size: 1.5rem;
  top: 0.25em;
  line-height: 1;
}

/* Slideshow */
.slideshow-container {
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  height: 100%; /* Ensure container can stretch with content */
}

.card-carousel {
  display: flex;
  transition: transform 0.5s ease;
  align-items: stretch; /* Ensure children (card-wrapper) stretch equally */
  height: 100%;
}

.card-wrapper {
  min-width: 100%;
  display: flex;
  justify-content: center;
  align-items: stretch; /* Stretch cards to equal height */
}

.card {
  background: white;
  padding: 3rem;
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* Even vertical spacing */
  height: 100%; /* Stretch to match tallest card */
}


.card-title {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.card-image {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.5rem;
  display: block;
}

.card-description {
  color: var(--text-dark);
  font-size: 1.25rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.card-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

.btn-round {
  background: var(--accent-color);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition-default);
}

.btn-round:hover {
  background: #d63447;
  transform: scale(1.1);
}

.card-position {
  color: var(--text-dark);
  font-size: 1rem;
}

/* Model cards */
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.model-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.5rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #fff;
  position: relative;
}

.model-card-body {
  flex-grow: 1;
}

.model-card-image {
  margin-top: 1rem;
  text-align: center;
}

.model-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.model-card.selected {
  background: linear-gradient(135deg, #fff5f5 0%, #ffebeb 100%);
  border: 3px solid var(--accent-color);
}

.selected-badge {
  position: absolute;
  top: -15px;
  right: 20px;
  background: var(--accent-color);
  color: white;
  padding: 5px 15px;
  border-radius: 15px;
  font-weight: bold;
  font-size: 0.9rem;
}

.model-card h3 {
  color: var(--primary-color);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* Clustering */
.cluster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.cluster-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
  background: #f8f8f8;
  border-radius: 10px;
  border: 2px solid var(--accent-color);
  height: 100%;
}

.cluster-item h4 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--accent-color);
  display: flex;
  justify-content: center;
  min-height: 3.6rem;
  text-align: center;
  text-wrap: balance;
}

.cluster-item p {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.4;
}

/* Key Learnings */
.learnings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.learning-card {
  background: white;
  border-radius: 10px;
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.learning-card h3 {
  color: var(--accent-color);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.learning-card p {
  font-size: 1.25rem;
  line-height: 1.8;
}

/* Furture Works */
.future-works-section {
  background-color: var(--accent-color);
  position: relative;
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.future-works-section .section-title {
  color: white;
  text-shadow: 
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000,
    2px 2px 0 #000,
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}

/* Contributions */
.contributions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.contribution-card {
  background: #f8f8f8;
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.contribution-card h3 {
  color: var(--accent-color);
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.contribution-card p {
  font-size: 1.125rem;
  line-height: 1.8;
}

/* Team Section */
.team-section {
  padding: var(--section-padding);
}

.team-section .section-title {
  color: var(--primary-color);
}

.team-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.team-member {
  text-align: center;
  background: white;
  padding: 2rem;
  border-radius: 10px;
  transition: var(--transition-default);
}

.team-member:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.team-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.5rem;
  border: 4px solid var(--accent-color);
}

.team-name {
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-weight: 600;
}

.linkedin-icon {
  width: 30px;
  height: 30px;
  transition: var(--transition-default);
}

.linkedin-icon:hover {
  transform: scale(1.2);
}

/* Footer */
footer {
  background: #0a0a0f;
  padding: 3rem 2rem;
  text-align: center;
  color: #888;
}

footer p {
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}

footer p:last-child {
  font-size: 1rem;
  margin-top: 1rem;
  color: #666;
}

/* Utilities */
.text-center {
  text-align: center;
}

.text-shadow-dark {
  text-shadow: 
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000,
    2px 2px 0 #000,
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}

/* Responsive Design */
@media (max-width: 768px) {
  :root {
    --section-padding: 3rem 1.5rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .home-title {
    font-size: 3rem;
  }
  
  .content-box {
    padding: 2rem;
  }
  
  .card {
    padding: 2rem;
  }
  
  .model-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  :root {
    --section-padding: 2rem 1rem;
  }
  
  .home-title {
    font-size: 2rem;
  }
  
  .team-container {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  .contributions-grid {
    grid-template-columns: 1fr;
  }
}

/* Responsive images */
img {
  max-width: 100%;
  height: auto;
}

.model-card img {
  width: 100%;
  max-width: 400px;
  height: auto;
  margin: 0 auto;
  display: block;
}

.content-box img {
  max-width: 100%;
  height: auto;
}

.content-box[style*="display: flex"] {
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .content-box[style*="display: flex"] {
    flex-direction: column !important;
  }
  
  .content-box[style*="display: flex"] > div {
    flex: 1 1 100% !important;
  }
  
  .content-box img {
    width: 100% !important;
    max-width: 400px;
    margin: 0 auto;
    display: block;
  }
}