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


/* Light mode defaults */
body {
  background: #f2f2f2;
  color: #111111;
  min-height: 100vh;
}

/* toggle checkbox (hidden) */
.menu-toggle {
  position: fixed;
  top: 12px;
  left: 12px;
  width: 56px;
  height: 56px;
  opacity: 0;
  z-index: 9999;
  cursor: pointer;
}

/* button (top left corner) */
.menu-button {
  position: fixed;
  top: 12px;
  left: 12px;
  width: 56px;
  height: 56px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  display: grid;
  place-items: center;
  z-index: 9998;
}

/* tripple line container */
.menu-button .lines {
  width: 24px;
  height: 14px;
  position: relative;
}

/* tripple lines */
.menu-button .lines span {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #111111;
  border-radius: 2px;
}
.menu-button .lines span:nth-child(1) { top: 0; }
.menu-button .lines span:nth-child(2) { top: 6px; }
.menu-button .lines span:nth-child(3) { top: 12px; }

/* organising the menu UI */
.menu-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: #ffffff;
  visibility: hidden;
  opacity: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: opacity 0.26s ease, visibility 0.26s ease;
}

/* display overlay (menu) when checked */
.menu-toggle:checked ~ .menu-overlay {
  visibility: visible;
  opacity: 1;
}

/* re-arrange trio of lines into an "x" formation (when pressed) */
.menu-toggle:checked + .menu-button .lines span:nth-child(1) {
  top: 6px;
  transform: rotate(45deg);
}
.menu-toggle:checked + .menu-button .lines span:nth-child(2) {
  opacity: 0;
}
.menu-toggle:checked + .menu-button .lines span:nth-child(3) {
  top: 6px;
  transform: rotate(-45deg);
}

/* menu content */
.menu {
  width: 90%;
  max-width: 640px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* workaround : removes visual bullets for ARIA compatibility */
.menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* QR code graphic */
.main-image {
  margin-bottom: 30px;
  flex: 0 0 auto;
}
.main-image img {
  width: 50%;
  height: auto;
  max-height: 50vh;
}

/* menu navigation links */
.menu nav a {
  display: block;
  font-size: 20px;
  text-decoration: none;
  padding: 14px 8px;
  color: #111111;
  border-radius: 8px;
  margin: 6px 0;
  width: 200px;
}
.menu nav a:hover {
  background: #eeeeee;
}


/* -- Dark Mode Support -- */
@media (prefers-color-scheme: dark) {
  body {
    background: #111111;
    color: #f5f5f5;
  }
  .menu-button {
    background: #1e1e1e;
  }
  .menu-button .lines span {
    background: #f5f5f5;
  }
  .menu-overlay {
    background: #111111;
  }
  .menu nav a {
    color: #f5f5f5;
  }
  .menu nav a:hover {
    background: #222222;
  }
}

/* responsive : horizontal orientation UI re-arrangement */
@media (orientation: landscape) and (max-width: 1024px) {
  .menu-overlay {
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    padding: 20px;
  }

  .menu {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
  }

  .main-image {
    margin-bottom: 0;
    flex: 0 0 50%; /* left-hand side */
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .main-image img {
    width: 80%; /* fits nicely in left half */
    max-height: 80vh;
  }

  .menu nav {
    flex: 0 0 50%; /* right-hand side for buttons */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .menu nav a {
    width: 80%; /* fill right-hand side */
    margin: 10px 0;
    font-size: 18px;
  }
}
