@font-face {
  font-family: 'ChalkboardFont';
  src: url('assets/chalkboard.otf?v=2') format('opentype');
}

body {
  margin: 0;
  padding: 0;
  background: black;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  font-family: Arial, sans-serif;
}

/* HERO IMAGE CONTAINER */
.hero {
  position: relative;
  /* Fit to 96% of viewport to create a small black frame */
  width: min(96vw, calc(96vh * (1672 / 941)));
  aspect-ratio: 1672 / 941;
  margin: auto;
}

.hero img,
.hero picture {
  width: 100%;
  height: 100%;
  display: block;
}

/* CLICKABLE AREAS */
.btn {
  position: absolute;
  width: 6%;
  /* Approx 100px of 1672px */
  height: 10.6%;
  /* Approx 100px of 941px */
  border-radius: 50%;
  cursor: pointer;
  border: none;
  padding: 0;
  outline: none;

  /* DEBUG MODE OFF */
  background: transparent;
}

/* POSITION THESE BY EYE - PERCENTAGES KEEP THEM IN PLACE */
.apps {
  top: 4.2%;
  right: 33.1%;
}

.labs {
  top: 4.2%;
  right: 24.5%;
}

.about {
  top: 4.2%;
  right: 15.4%;
}

.contact {
  top: 4.2%;
  right: 6.75%;
}

/* HOVER EFFECT */
.btn:hover {
  box-shadow: 0 0 45px 10px #ffd000;
  background: transparent;
}

/* MODALS (Internal Chalkboard) */
.modal {
  display: none;
  position: absolute;
  /* Positioned exactly over the "What Rules?" area */
  top: 24%;
  left: 39%;
  width: 58%;
  height: 58.5%;

  background: #1a2a1a;
  /* Chalkboard Green */
  background-image: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
  border: 6px solid #2e1d11;
  /* Dark wood frame */
  border-radius: 4px;
  box-shadow:
    inset 0 0 40px rgba(0, 0, 0, 0.8),
    0 20px 50px rgba(0, 0, 0, 0.9);

  color: rgba(245, 245, 245, 0.9);
  font-family: 'ChalkboardFont', 'Indie Flower', 'Gochi Hand', cursive;
  padding: 1% 2%;
  /* Reduced padding */
  box-sizing: border-box;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.modal h2 {
  margin-top: 5px;
  margin-bottom: 15px;
  color: #ffd000;
  font-family: 'ChalkboardFont', 'Indie Flower', 'Gochi Hand', cursive;
  font-size: 2.6vw;
  font-weight: 400;
  letter-spacing: 1px;
  display: table;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}

.modal h2::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: -5%;
  width: 135%;
  height: 15px;
  border-top: 3px solid #ffd000;
  border-radius: 50%;
  transform: rotate(-4deg);
}

.modal ul {
  font-family: 'ChalkboardFont', 'Indie Flower', 'Gochi Hand', cursive;
  font-size: 2.2vw;
  line-height: 1.15;
  margin-top: 35px;
  font-weight: 500;
  -webkit-text-stroke: 0.3px rgba(240, 240, 240, 0.6);
  color: rgba(240, 240, 240, 0.9);
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
  transform: rotate(-0.5deg);
  list-style: none;
  padding-left: 0;
}

.modal li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 4px; /* Reduced space between points */
}

/* Chalk text dash for bullet points */
.modal li::before {
  content: '-';
  font-family: 'ChalkboardFont', cursive;
  font-size: 1.2em;
  margin-right: 15px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1;
  /* Reduced the shift to center it perfectly since -0.4em overshot to the top */
  transform: translateY(-0.15em) rotate(-10deg); 
}

/* CONTACT EMAIL */
.huge-email {
  font-family: 'ChalkboardFont', 'Indie Flower', 'Gochi Hand', cursive;
  font-size: 4.8vw;
  color: rgba(245, 245, 245, 0.9);
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
  position: absolute;
  top: 65%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-5deg);
  width: 100%;
  text-align: center;
  white-space: nowrap;
  text-decoration: none;
  display: block;
}

.big-link {
  font-family: 'ChalkboardFont', 'Indie Flower', 'Gochi Hand', cursive;
  font-size: 4.2vw;
  color: rgba(245, 245, 245, 0.9);
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
  position: absolute;
  top: 78%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-3deg);
  width: 100%;
  text-align: center;
  white-space: nowrap;
  text-decoration: underline;
  display: block;
  cursor: pointer;
  transition: transform 0.2s, color 0.2s;
}

.big-link:hover {
  color: #ffd000;
}

/* CLOSE BUTTON (CHALK X) */
.close {
  position: absolute;
  top: 5px;
  right: 15px;
  cursor: pointer;
  font-size: 2.5vw;
  color: rgba(255, 255, 255, 0.4);
  background: transparent;
  border: none;
  padding: 0;
  outline: none;
  transition: color 0.2s;
}

.close:hover {
  color: #ff4444;
}

/* BRAND STYLING (SHORT CAPITAL A) */
.brand {
  font-family: 'Arial', sans-serif; /* Use clean blocky font like the logo */
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9em; /* Match flow of cursive text */
}

.short-a {
  font-size: 0.65em; /* Significantly noticeably smaller *A* */
  /* Remove transform because font-size naturally sits on baseline */
}

/* CUSTOM SCROLLBAR FOR CHALKBOARD */
.modal::-webkit-scrollbar {
  width: 6px;
}

.modal::-webkit-scrollbar-track {
  background: transparent;
}

.modal::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

#app-details {
  overflow: hidden; /* Prevent scrollbar covering logo */
}

/* APP DISPLAY & NAVIGATION */
#app-list-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  padding: 0;
  margin-top: -5px; /* Fine-tune vertical start */
}

#app-list-container ul {
  margin-top: 30px; /* Match standard modal gap */
}

.small-text li {
  font-size: 1.7vw !important; /* Smaller and neater */
  line-height: 1.1;
  letter-spacing: 0.01em;
  margin-bottom: 12px; /* Space between points */
}

.small-text a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255,208,0,0.4);
}

.small-text a:hover {
  border-bottom: 1px solid #ffd000;
}

.app-navigation {
  clear: both;
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 150px;
}

.nav-arrow {
  background: transparent;
  border: none;
  color: #ffd000;
  font-family: 'ChalkboardFont', 'Indie Flower', 'Gochi Hand', cursive;
  font-size: 5vw;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s;
  padding: 10px;
}

.nav-arrow:hover {
  opacity: 1;
  transform: scale(1.2);
}

/* PAGINATION & MODAL LINKS */
.modal a {
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.pagination {
  position: absolute;
  bottom: 15px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 30px;
  font-family: 'ChalkboardFont', 'Indie Flower', 'Gochi Hand', cursive;
  font-size: 2.2vw;
  color: #ffd000;
}

.pagination span {
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  position: relative;
  padding: 0 5px;
}

/* APP LIST BLURBS */
.app-page li {
  display: block;
  position: relative;
  padding-left: 40px;
  margin-bottom: 50px; /* Increased space between different apps */
}

.app-page li::before {
  position: absolute;
  left: 0;
  top: 0;
  margin-right: 0;
}

.app-page li strong {
  display: block;
  line-height: 1;
  margin: 0;
}

.app-page li small {
  display: block;
  font-size: 0.75em;
  opacity: 0.85;
  margin-top: 0;
  line-height: 1.1;
}

.pagination span.active {
  opacity: 1;
}

.pagination span.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: -25%;
  width: 150%;
  height: 10px;
  border-top: 2px solid #ffd000;
  border-radius: 50%;
}

/* PORTRAIT MODE OVERRIDES */
@media (max-aspect-ratio: 1/1) {
  .hero {
    width: min(96vw, calc(96vh * (941 / 1672)));
    aspect-ratio: 941 / 1672;
  }
  
  .btn {
    width: 15%;
    height: auto;
    aspect-ratio: 1/1;
    transform: translate(-50%, -50%);
  }

  .apps {
    top: 26.70%; /* center y=446.5 */
    left: 85.97%; /* center x=809 */
    right: auto;
  }

  .labs {
    top: 40.37%; /* center y=675 */
    left: 85.97%;
    right: auto;
  }

  .about {
    top: 53.40%; /* center y=893 */
    left: 85.97%;
    right: auto;
  }

  .contact {
    top: 66.83%; /* center y=1117.5 */
    left: 85.97%;
    right: auto;
  }
  
  /* Adjust the modals in portrait to cover the scientist and "WHAT RULES?" */
  .modal {
    top: 22.1%; /* Moved ~10px up */
    left: 5.9%; /* Moved ~20px left */
    width: 67.3%; /* Extended right by ~10px */
    height: 52.6%; /* Increased ~10px total */
  }
  
  .modal h2 {
    font-size: 6vw;
  }
  
  .modal ul {
    font-size: 5.5vw;
  }

  .pagination {
    font-size: 6vw;
    bottom: 25px;
    gap: 20px;
  }

  .app-page li {
    padding-left: 35px;
    margin-bottom: 35px;
  }

  .app-page li small {
    font-size: 0.8em;
    margin-top: 0;
  }

  .big-link {
    font-size: 8vw;
    top: 80%;
  }
  
  .small-text li {
    font-size: 4.5vw !important;
    margin-bottom: 15px;
  }

  .nav-arrow {
    font-size: 12vw;
  }

  .app-navigation {
    bottom: 20px;
    gap: 80px;
  }
  
  .huge-email {
    font-size: 7.5vw;
  }
  
  .close {
    font-size: 6vw;
  }
}