/* STRICT GRAYSCALE PALETTE */
:root {
  --black: #000000;
  --gray-900: #1a1a1a;
  --gray-800: #2a2a2a;
  --gray-700: #3a3a3a;
  --gray-500: #555555;
  --gray-400: #888888;
  --gray-300: #cccccc;
  --gray-100: #f5f5f5;
  --white: #ffffff;

  --bg-body: var(--white);
  --text-main: var(--gray-900);
  --text-muted: var(--gray-500);
  --border-light: var(--gray-300);
  --border-dark: var(--gray-700);
  --header-bg: var(--gray-900);
  --header-text: var(--white);
}

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

body {
  font-family: 'Inter', 'Roboto', sans-serif;
  color: var(--text-main);
  background-color: var(--bg-body);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease, border-bottom 0.2s ease;
}

a:hover {
  opacity: 0.7;
}

ul {
  list-style: none;
}

/* LAYOUT UTILITIES */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  /* Slight increase in padding for wider layout */
}

/* Main content expands to push footer down */
main.container {
  flex: 1;
  width: 100%;
  /* Ensure it spans width */
}

.flex {
  display: flex;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.justify-between {
  justify-content: space-between;
}

.align-center {
  align-items: center;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-4 {
  margin-top: 2rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-4 {
  margin-bottom: 2rem;
}

/* HEADER */
header {
  background-color: var(--header-bg);
  color: var(--header-text);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--gray-700);
}

.site-logo {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
}

.nav-links a {
  margin-left: 20px;
  font-size: 0.9rem;
  color: var(--gray-300);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
  border-bottom: 1px solid var(--white);
}

.social-icons a {
  margin-left: 15px;
  color: var(--gray-300);
  font-size: 1.1rem;
}

/* NAVIGATION (Sub-header) */
.main-nav {
  background-color: var(--white);
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 0;
}

.main-nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
}

.main-nav a {
  color: var(--gray-700);
  font-weight: 500;
}

.main-nav a:hover {
  color: var(--black);
}

/* FOOTER */
footer {
  background-color: var(--gray-900);
  color: var(--gray-400);
  padding: 3rem 0;
  margin-top: auto;
  /* Pushes to bottom if flex container has space */
  font-size: 0.9rem;
}

footer .footer-inner {
  width: 100%;
}

footer .social-links {
  display: flex;
  gap: 20px;
}

footer .social-links a {
  margin: 0;
  color: var(--gray-300);
}

footer .copyright {
  margin: 0;
}

@media (max-width: 768px) {
  footer .footer-inner {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
}

/* COMPONENTS: ACCORDIONS */
.accordion-item {
  border-bottom: 1px solid var(--border-light);
}

.accordion-header {
  padding: 1.5rem 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--gray-800);
  transition: color 0.3s ease;
}

.accordion-header:hover {
  color: var(--black);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, opacity 0.4s ease;
  opacity: 0;
}

.accordion-content.active {
  padding-bottom: 1.5rem;
  opacity: 1;
}

.accordion-icon {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.active .accordion-icon {
  transform: rotate(180deg);
}

/* TYPOGRAPHY COMPONENTS */
h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 1.5rem;
  margin-top: 3rem;
  border-left: 4px solid var(--gray-300);
  padding-left: 1rem;
}

p {
  color: var(--gray-500);
  margin-bottom: 1rem;
  max-width: 100%;
}

/* BUTTONS (Text based mostly) */
.btn-text {
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--gray-300);
  padding-bottom: 2px;
  color: var(--gray-700);
  display: inline-block;
  margin-top: 1rem;
}

.btn-text:hover {
  color: var(--black);
  border-color: var(--black);
}

/* TIMELINE COMPONENT */
/* TIMELINE COMPONENT */
.timeline-scroll-wrapper {
  max-height: 600px;
  overflow-y: auto;
  position: relative;
  /* Scrollbar Styling */
  scrollbar-width: thin;
  scrollbar-color: var(--gray-400) var(--gray-100);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 2rem 0;
}

.timeline-scroll-wrapper::-webkit-scrollbar {
  width: 6px;
}

.timeline-scroll-wrapper::-webkit-scrollbar-track {
  background: var(--gray-100);
}

.timeline-scroll-wrapper::-webkit-scrollbar-thumb {
  background-color: var(--gray-400);
  border-radius: 10px;
}

.timeline-section {
  position: relative;
  max-width: 100%;
  margin: 0;
  padding-left: 140px;
  /* Space for year label */
}

/* The Vertical Line */
.timeline-section::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 120px;
  /* Line position */
  width: 2px;
  background: var(--border-light);
}

.timeline-entry {
  position: relative;
  margin-bottom: 4rem;
}

/* The Dot */
.timeline-entry::before {
  content: '';
  position: absolute;
  /*
       Container padding-left: 140px.
       Line left: 120px.
       Difference: -20px relative to entry content start.
       Dot width: 12px -> center at 6px.
       Left: -20px - 6px = -26px.
    */
  left: -26px;
  top: 5px;
  width: 12px;
  height: 12px;
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: 50%;
  z-index: 1;
}

/* The Year Label - Moved to left */
.timeline-year-label {
  position: absolute;
  left: -140px;
  /* Move into the padding area */
  width: 110px;
  /* Width up to near the line */
  text-align: right;
  top: 0px;
  font-weight: 700;
  color: var(--black);
  font-size: 1rem;
  line-height: 1.2;
  padding-right: 15px;
}

.timeline-role {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.25rem;
  margin-top: -5px;
  /* Alignment fix with dot */
}

.timeline-location {
  font-size: 0.95rem;
  color: var(--gray-500);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-body {
  color: var(--gray-500);
  max-width: 100%;
  text-align: justify;
}

@media (max-width: 768px) {
  .timeline-section {
    padding-left: 40px;
  }

  .timeline-section::before {
    left: 20px;
  }

  .timeline-entry::before {
    left: -26px;
    /* 20 (line) - 40 (padding) - 6 (half dot) = -26 */
  }

  .timeline-year-label {
    position: relative;
    left: 0;
    text-align: left;
    margin-bottom: 0.5rem;
    width: auto;
    padding-right: 0;
    color: var(--gray-500);
  }
}

/* HEXAGONAL CLUSTER */
.hex-cluster {
  position: relative;
  width: 100%;
  height: 600px;
  /* Reduced min-height */
  max-width: 1000px;
  margin: 1rem auto;
  /* Reduced margin */
  /* Removed flex properties as we are doing absolute positioning */
}

.hex-tile {
  width: 160px;
  /* Reduced from 200px */
  height: 184px;
  /* Reduced from 230px */
  background-color: var(--gray-100);
  position: absolute;
  /* Changed (was relative/flex item) */
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  /* Centered by default */
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  /* Smoother pop-in */
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0.5rem;
  /* Reduced padding */
  opacity: 0;
  /* Hide initially until JS places them */
}

.hex-tile.placed {
  opacity: 1;
}

.hex-tile:hover {
  /* transform: scale(1.05); REMOVED per user request */
  background-color: var(--gray-300);
  z-index: 10;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.hex-tile h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--gray-900);
}

.hex-tile p {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin: 0;
}

/* MODAL STYLES */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--white);
  padding: 2rem;
  width: 90%;
  max-width: 900px;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 8px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-500);
}

.modal-close-btn:hover {
  color: var(--black);
}

/* Modal Content Typography Override */
.modal-content h2 {
  text-align: center;
  border-left: none;
  padding-left: 0;
  margin-top: 0;
}

.modal-content p {
  text-align: justify;
}

.modal-content ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--gray-500);
}

.modal-content li {
  margin-bottom: 0.5rem;
  text-align: justify;
}

/* EXPLORATION PAGE STYLES */
@import url('https://fonts.googleapis.com/css2?family=Patrick+Hand&display=swap');

.sketch-font {
  font-family: 'Patrick Hand', cursive;
}

.view-container {
  position: relative;
  width: 100%;
  height: calc(100vh - 450px);
  min-height: 400px;
  /* Fixed height container for the "app" feel */
  overflow: hidden;
  border: 2px solid var(--black);
  border-radius: 4px;
  /* Rough corner could use SVG border image later */
  background: var(--white);
  margin-top: 2rem;
}

/* Make views transparent so they inherit container background or texture */
.view-section {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  /* Slight opacity to see texture if applied to container, or just white */
  transition: transform 0.5s ease-in-out;
  display: flex;
  flex-direction: column;
  padding: 2rem;
  overflow-y: auto;
}

/* Match buttons: Black circle with white text for topics */
.topic-marker {
  width: 80px;
  height: 80px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: 'Patrick Hand', cursive;
  text-align: center;
  font-size: 0.9rem;
  padding: 5px;
}

.topic-marker:hover {
  transform: scale(1.1);
  box-shadow: 2px 2px 0px var(--gray-500);
}

/* Slide Logic */
.view-section.active {
  transform: translateX(0);
  z-index: 10;
}

.view-section.next {
  transform: translateX(100%);
  z-index: 20;
}

.view-section.prev {
  transform: translateX(-100%);
  z-index: 5;
}


/* Specific view overrides */
#view-map {
  overflow: hidden;
}

#landscape-title {
  color: var(--white);
  background-color: var(--black);
  padding: 0.5rem 1.5rem;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  border: 2px solid var(--white);
  width: fit-content;
  margin: 2rem auto;
  border-left: none;
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
}

/* Sketch Components */
.sketch-btn {
  font-family: 'Patrick Hand', cursive;
  font-size: 1.5rem;
  padding: 1rem 2rem;
  border: 2px solid var(--white);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  /* Sketchy border radius */
  background: var(--black);
  color: var(--white);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin: 1rem;
}

.sketch-btn:hover {
  transform: rotate(-2deg) scale(1.05);
  box-shadow: 2px 2px 0px var(--gray-500);
  z-index: 100;
  /* Bring to front on hover */
}

/* Tooltip */
.sketch-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%) scale(0);
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--black);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
  font-family: 'Patrick Hand', cursive;
  z-index: 101;
}

.sketch-btn:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.back-arrow {
  position: absolute;
  top: 1rem;
  left: 1rem;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 100;
  font-family: 'Patrick Hand', cursive;
  display: none;
  background-color: var(--black);
  color: var(--white);
  padding: 0.5rem 1rem;
  border: 2px solid var(--white);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.back-arrow:hover {
  transform: scale(1.05);
  box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.2);
}

/* Map specific */
.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  height: 100%;
  align-content: center;
  justify-items: center;
}

.landscape-canvas {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px dashed var(--gray-300);
  margin-top: 2rem;
  position: relative;
}

/* Old topic-marker removed, handled above */