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

/* Honorable Mentions */
#honorable-mentions {
  padding: 3rem 1.5rem 4rem;
  margin-top: 1.5rem;
  background: white;
}

.honorable-header {
  text-align: center;
  margin-bottom: 2.2rem;
}

.honorable-subtitle {
  font-size: 1.18rem;
  line-height: 1.7;
  color: #000;
  margin: 0;
  font-weight: 400;
}

.honorable-carousel {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
}

.hm-frame {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 1.4rem;
  box-shadow: none;
}

.hm-slide {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1.25rem;
  align-items: center;
}

.hm-image {
  width: 100%;
  aspect-ratio: 3 / 4;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 0;
  box-shadow: none;
}

.hm-copy {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.hm-title {
  font-size: 1.4rem;
  font-weight: 400;
  margin: 0;
  color: #fff;
  background: #0000FF;
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  align-self: flex-start;
}

.hm-text {
  margin: 0;
  font-size: 1.05rem;
  color: #222;
  line-height: 1.6;
}

.hm-nav {
  background: #000;
  color: #fff;
  border: none;
  border-radius: 999px;
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.hm-nav:hover {
  background: #0000FF;
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .honorable-carousel {
    grid-template-columns: 1fr;
  }
  
  .hm-nav {
    width: 100%;
  }
  
  .hm-frame {
    order: 1;
  }
  
  .hm-slide {
    grid-template-columns: 1fr;
  }
  
  .hm-copy {
    text-align: left;
  }
}

#about-project {
  background: white;
  padding: 3.5rem 1.5rem 4.5rem;
  border-top: 1px solid #e5e5e5;
}

.about-container {
  max-width: 980px;
  margin: 0 auto;
}

.about-container h2 {
  margin: 0 0 0.6rem;
  font-size: 1.9rem;
  font-weight: 700;
  font-family: 'Boldonse', Arial, sans-serif;
}

.about-container p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.7;
  color: #111;
}

.about-container a {
  color: #0000FF;
  text-decoration: underline;
  font-weight: 400;
}

.about-container a:hover {
  text-decoration: none;
}

body {
  font-family: 'Cabin', Arial, sans-serif;
  background: white;
  color: black;
  overflow-x: hidden;
}

/* Landing Section */
#landing {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  background: white;
}

#landing h1 {
  font-family: 'Boldonse', Arial, sans-serif;
  font-size: 8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

/* Individual letter styling for animation */
.letter {
  display: inline-block;
  position: relative;
  transition: all 0.3s ease;
}

.letter.image-mode {
  overflow: hidden;
  vertical-align: baseline;
  position: relative;
  box-sizing: border-box;
}

.letter.image-mode img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#landing .subtitle {
  font-size: 1.65rem;
  margin-bottom: 0.5rem;
  font-weight: 400;
}

#landing .credit {
  font-size: 1.18rem;
  opacity: 0.7;
  margin-bottom: 0;
}

.scroll-indicator {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  opacity: 0.8;
}

.scroll-arrow {
  font-size: 1.5rem;
  color: #0000FF;
  opacity: 1;
  font-weight: 600;
  border-radius: 50%;
  padding: 0.2rem;
  transition: opacity 0.3s ease;
  animation: scrollPulse 1.4s ease-in-out infinite;
}

@keyframes scrollPulse {
  0% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(6px); opacity: 1; }
  100% { transform: translateY(0); opacity: 0.7; }
}

/* Add subtle gradient fade at bottom of landing */
#landing::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.8));
  pointer-events: none;
}

/* Intro Section */
#intro {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem 5rem;
  background: white;
}

.intro-text {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
  font-family: 'Cabin', Arial, sans-serif;
}

.intro-text p {
  font-size: 1.3rem;
  line-height: 1.7;
  font-weight: 400;
  margin-bottom: 1.25rem;
  opacity: 0;
}

.intro-text.visible p {
  opacity: 1;
}

.intro-text p:last-child {
  margin-bottom: 0;
}

.transition-arrow {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 0 0.5rem;
  position: relative;
  z-index: 5;
}

.transition-arrow .scroll-arrow {
  font-size: 1.5rem;
  color: #0000FF;
  border: none;
  width: auto;
  height: auto;
  padding: 0.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  animation: scrollPulse 1.4s ease-in-out infinite;
}

/* Timeline Section */
#timeline-section {
  position: relative;
  min-height: 100vh;
  padding: 1.5rem 1.5rem 4rem;
  background: white;
}

.timeline-layout {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  text-align: left;
  position: relative;
  z-index: 2;
}

#chart-fixed {
  position: relative;
  width: 100%;
  max-width: 1400px;
  height: 160vh;
  margin-top: -200px;
  background: white;
  z-index: 1;
  display: block;
  overflow: visible;
  padding: 0;
}

#viz {
  width: 100%;
  height: 100%;
}

.timeline-prompt {
  position: absolute;
  top: 80px;
  left: 100px;
  z-index: 10;
  font-size: 1.5rem;
  margin: 0;
}

/* Highlighted text */
.highlight {
  background-color: #0000FF; /* Accent blue */
  color: white; /* White text */
  padding: 0.2rem 0.4rem;
  border-radius: 0.2rem;
}

/* Highlight Gilbert Stuart */
.gilbert-stuart {
  background-color: #0000FF; /* Accent blue */
  color: white; /* White text */
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

/* Filter Section Layout */
.filter-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3rem;
  max-width: 1200px;
  width: 100%;
  padding: 0;
  margin: 0 auto;
}

.filter-left {
  flex-shrink: 0;
  pointer-events: all;
  margin-right: auto;
}

.filter-explanations {
  position: absolute;
  top: 80px;
  right: 40px;
  max-width: 380px;
  width: auto;
  pointer-events: none;
  z-index: 10;
  padding-bottom: 0;
}

.filter-explanation {
  display: none;
  opacity: 0;
  pointer-events: none;
  position: relative;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.95);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  border-left: 3px solid #0000FF;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.filter-explanation.visible {
  display: block;
  opacity: 1;
  pointer-events: none;
  animation: fadeInUp 0.4s ease-out;
}

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

.filter-explanation p {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #333;
  margin: 0;
}

/* Explore Button */
.explore-button {
  font-size: 1.2rem;
  padding: 1rem 2.5rem;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.explore-button:hover {
  background: #333;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.explore-button:active {
  transform: translateY(0);
}

/* Filter Dropdown */
.filter-prompt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  margin: 0;
  line-height: 1.2;
  font-size: 1.38rem;
}

#d3-dropdown-container {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  overflow: visible;
  position: relative;
  z-index: 5;
}

.filter-container-inline {
  position: relative;
  display: inline-block;
  pointer-events: all;
}

/* Category Labels */
.category-label {
  font-size: 0.85rem;
  fill: #999;
  font-weight: 500;
}

/* Accent blue text */
.accent-blue {
  color: #0000FF;
}

/* Memory Game Section */
/* Post-chart transition arrow - pulls up into chart area */
.transition-arrow-post-chart {
  margin-top: -30vh;
  position: relative;
  z-index: 5;
}

.transition-arrow-post-game {
  margin-top: 2rem;
}

.transition-arrow-post-about {
  margin-top: 2.5rem;
  margin-bottom: 2rem;
}

/* Post-chart explanatory text */
#post-chart-text {
  background: white;
  padding: 3rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 5;
}

#memory-game-section {
  min-height: 100vh;
  background: white;
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.memory-intro {
  max-width: 700px;
  text-align: center;
  margin-bottom: 3rem;
}

.memory-intro h2 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #000;
}

.memory-intro p {
  font-size: 1.18rem;
  line-height: 1.7;
  color: #000;
}

.memory-game-container {
  width: 100%;
  max-width: 800px;
  position: relative;
}

.game-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  background: white;
  padding: 15px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 8px;
  margin-bottom: 20px;
}

#buttons {
  display: flex;
  gap: 10px;
}

#hint, #playAgain {
  padding: 10px 20px;
  background: #0000FF;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-family: 'Cabin', Arial, sans-serif;
  font-weight: 600;
  transition: background 0.2s;
}

#hint:hover, #playAgain:hover {
  background: #0000CC;
}

#hint:disabled {
  background: #999;
  cursor: not-allowed;
}

#stats {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  gap: 15px;
}

#hintMessage {
  margin: 10px 0 20px 0;
  font-size: 16px;
  font-weight: 600;
  color: #0000FF;
  display: none;
  padding: 15px 20px;
  background: rgba(0, 0, 255, 0.05);
  border-radius: 8px;
  border-left: 4px solid #0000FF;
}

#message {
  margin: 10px 0 20px 0;
  font-size: 20px;
  font-weight: 700;
  color: green;
  display: none;
  padding: 15px 20px;
  background: rgba(0, 255, 0, 0.05);
  border-radius: 8px;
  text-align: center;
}

#loading {
  margin: 20px 0;
  font-size: 18px;
  color: #666;
  text-align: center;
}

#app {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 15px;
  padding: 0;
  width: 100%;
  margin: 0 auto;
}

.card {
  width: 100%;
  aspect-ratio: 1;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background-color: #f0f0f0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border: 3px solid #ddd;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.card.selected {
  border-color: #0000FF;
  box-shadow: 0 0 0 3px rgba(0, 0, 255, 0.2);
}

.card.correct {
  border-color: green;
  box-shadow: 0 0 0 3px rgba(0, 255, 0, 0.2);
}

.card.incorrect {
  border-color: red;
  box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.2);
}

.card.blurred {
  opacity: 0.3;
  filter: blur(2px);
  pointer-events: none;
}

.card .front {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  justify-content: flex-end;
}

.card .title {
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 8px;
  font-size: 13px;
  text-align: center;
  font-family: "Gill Sans", "Gill Sans MT", sans-serif;
  font-weight: 500;
}

/* Game Intro Box Styling */
.game-intro-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0;
  margin: 0;
  gap: 2rem;
}

.game-intro-text {
  font-size: 1.3rem;
  line-height: 1.7;
  max-width: 860px;
  margin: 0;
  color: #000;
  font-family: 'Cabin', Arial, sans-serif;
  font-weight: 400;
}

.game-intro-box .game-button {
  padding: 0.75rem 1.7rem;
  font-size: 1.32rem;
  background: #000;
  color: white;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: 'Cabin', Arial, sans-serif;
  font-weight: 600;
  transition: background 0.2s ease;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.game-intro-box .game-button:hover {
  background: #0000FF;
}

.game-intro-box .game-button:active {
  background: #000;
}

#game-board {
  display: none;
}

#game-board.visible {
  display: block;
}

#game-shell.game-active .game-intro-box {
  display: none;
}

.game-intro-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.98);
  z-index: 9999;
  backdrop-filter: blur(0px);
}

.game-intro-overlay.hidden {
  display: none;
}

@media (max-width: 768px) {
  #landing h1 {
    font-size: 6rem;
  }
  
  #intro {
    padding: 2rem 1rem 3rem;
  }
  
  .intro-text {
    max-width: 100%;
  }
  
  .intro-text p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
  }
  
  #landing .subtitle {
    font-size: 1.3rem;
  }
  
  #landing .credit {
    font-size: 0.95rem;
  }
  
  .text-box p {
    font-size: 1.1rem;
  }
  
  .filter-explanations {
    top: auto;
    right: auto;
    position: relative;
    max-width: 100%;
    margin: 1rem auto;
    padding: 0 1rem;
  }
  
  .filter-explanation {
    padding: 1rem;
  }
  
  .filter-explanation p {
    font-size: 1rem;
  }
  
  .filter-prompt {
    font-size: 1.1rem;
  }
  
  #memory-game-section {
    padding: 2rem 1rem;
  }
  
  .memory-intro h2 {
    font-size: 2rem;
  }
  
  .memory-intro p {
    font-size: 1rem;
  }
  
  .timeline-layout {
    grid-template-columns: 1fr;
  }
  
  .filter-column {
    position: relative;
    top: auto;
  }
  
  #chart-fixed {
    height: 65vh;
  }
  
  #app {
    gap: 10px;
  }
  
  .card .title {
    font-size: 11px;
    padding: 6px;
  }
  
  .game-header {
    flex-direction: column;
    gap: 10px;
  }
}
