/* ========================
   RESET & GLOBAL STYLES
   ======================== */

/* A basic reset: remove default margins/padding on all elements */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Force a scrollbar so layout doesn't shift horizontally 
   when content length changes (particularly in Chrome/Windows). 
   Modern browsers also support: scrollbar-gutter: stable both-edges; */
html {
  overflow-y: scroll;
}

/* Body default styling */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  color: #333;
  background-color: #fff;
}

/* ========================
   HEADER & NAV
   ======================== */

header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: #fff;
  z-index: 999; /* keep it above other content */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  height: 60px;
  padding: 0 20px;
}

nav .logo {
  font-size: 1.4rem;
  font-weight: 600;
}

nav .nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

nav .nav-links li a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color 0.2s ease;
}

nav .nav-links li a:hover {
  color: #999;
}

/* ========================
   MAIN CONTENT
   ======================== */

/* The main container 
   We'll stack "slides" (sections) absolutely inside. */
main {
  margin-top: 60px; /* reserve space for the fixed header */
  position: relative;
  width: 100%;
  height: calc(100vh - 60px); /* full window height minus the header */
}

/* Each slide is absolutely positioned, 
   so they all occupy the same area. */
.fade-section {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  pointer-events: none; /* not clickable unless active */
  transition: opacity 1s ease-in-out;
}

/* When a slide is active, fade it in */
.fade-section.fade-in {
  opacity: 1;
  pointer-events: auto;
}

/* ========================
   OVERLAY & TEXT
   ======================== */

.overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4); /* semi-transparent dark overlay */
}

/* The container that holds the text */
.content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;   /* vertically center */
  justify-content: center; /* horizontally center */
  color: #fff;
  text-align: center;
}

/* The text block itself */
.text-container {
  max-width: 600px;
  margin: 0 1rem;

  /* ---- FIX TO PREVENT SHIFTING ---- */
  /* Ensure consistent height across all slides */
  min-height: 200px;  /* adjust based on your tallest text content */

  /* Keep text nicely centered within this container if you prefer: */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  background-color: rgba(0, 0, 0, 0.85); /* 51% opaque black */
  padding: 0.1rem;                         /* space around text */
  border-radius: 4px;                    /* optional rounded corners */
}

/* Normalize heading & paragraph margins */
.text-container h2 {
  margin: 0 0 1rem 0;
  line-height: 1.2;
}

.text-container p {
  margin: 0;
  line-height: 1.4;
}

/* ========================
   ARROW KEYS DIAGRAM
   ======================== */

/* Arrow key diagram container in bottom-right corner */
.arrow-diagram {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: grid;
  grid-template-columns: 40px 40px;
  grid-template-rows: 40px 40px 40px;
  gap: 5px;
}

/* Each arrow key box */
.arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ddd;
  border-radius: 4px;
  font-size: 1.2rem;
  user-select: none;
}

/* Highlight key when pressed */
.arrow.active {
  background-color: #333;
  color: #fff;
  transition: background-color 0.2s;
}

/* ========================
   RESPONSIVE (Mobile)
   ======================== */

@media (max-width: 768px) {
  nav .nav-links {
    display: none; /* or turn into a hamburger menu */
  }

  /* Keep text more compact on smaller screens */
  .text-container {
    max-width: 90%;
    min-height: 150px; /* maybe smaller if you wish */
  }

  .text-container h2 {
    font-size: 1.5rem;
  }

  .text-container p {
    font-size: 1rem;
    line-height: 1.4;
  }
}


/* The pulsing class that you apply to the down arrow */
.arrow.down.pulse {
  animation: arrowPulse 1.5s infinite alternate;
}

/* Keyframes: fade background-color between default (#ddd) and green */
@keyframes arrowPulse {
  0%   { background-color: #ddd; }
  100% { background-color: green; }
}

/* 1) Import Go Mono (Google Fonts example) */
@import url('https://fonts.googleapis.com/css2?family=Go+Mono&display=swap');

/* 2) Apply styles to h2 and p inside .text-container */
.text-container h2 {
  font-family: 'Go Mono', monospace;
  color: #00B4C3;        /* green */
  font-style: italic;
}

.text-container p {
  font-family: 'Go Mono', monospace;
  color: #EEC900;        /* gold */
}
