@import url(https://fonts.googleapis.com/css?family=EB+Garamond|Work+Sans:700);
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  border: 0;
  outline: 0;
  -webkit-font-smoothing: antialiased;
}

/* Base nav styles */
nav {
  font-size: 10px;
  font: 2.6rem/1.55 "Adobe Garamond Pro", "EB Garamond", Garamond, Georgia, "Times New Roman", serif;
  z-index: 100;
}

/* Hamburger button - MOVED TO TOP-LEFT */
.nav-icon {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  display: inline-block;
  height: 50px;
  width: 50px;
  position: fixed;
  top: 15px;
  left: 15px; /* Changed from right: 15px */
  z-index: 101;
  /* Circle with glassmorphism */
  background: rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgb(255, 255, 255);
  transition: all 0.3s ease;
  /* CSS Anchor Positioning */
  anchor-name: --nav-icon-anchor;
}
.nav-icon:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.05);
}

/* Focus styles for accessibility */
.nav-icon:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Hamburger icon lines */
.nav-icon span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  display: block;
  height: 3px;
  width: 24px;
  transition: transform 0.5s;
}

.nav-icon span:before,
.nav-icon span:after {
  width: 100%;
  height: 3px;
  background: #fff;
  content: "";
  display: block;
  left: 0;
  position: absolute;
  transition: inherit;
}

.nav-icon span:before {
  top: -8px;
}

.nav-icon span:after {
  bottom: -8px;
}

/* Hamburger animation when popover is open */
#nav-icon:has(+ #nav-menu:popover-open) span {
  transform: translate(-50%, -50%) rotate(90deg);
}

/* Popover menu - NEW IMPLEMENTATION */
#nav-menu {
  /* Reset defaults */
  margin: 0;
  padding: 0.5em;
  list-style: none;
  /* Container styling */
  background: transparent;
  border: none;
  min-width: 250px;
  color: #fff;
  /* Fallback positioning for browsers without anchor positioning */
  position: fixed;
  top: 60px;
  left: 15px;
  /* Modern anchor positioning (overrides above in supported browsers) */
  /* Animation */
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0;
  transform: translateY(-10px);
  /* Entry animation */
}
@supports (anchor-name: --test) {
  #nav-menu {
    position: absolute;
    position-anchor: --nav-icon-anchor;
    top: anchor(bottom);
    left: anchor(left);
    margin-top: 10px;
  }
}
#nav-menu:popover-open {
  opacity: 1;
  transform: translateY(0);
}
@starting-style {
  #nav-menu:popover-open {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Backdrop (optional overlay) */
#nav-menu::backdrop {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
}

/* Menu items - HORIZONTAL LAYOUT - Each item is an independent glass box */
#nav-menu li {
  font: bolder 1.5rem "Work Sans", "Arial Black", Gadget, sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 1em 1.5em;
  font-size: 16px;
  transition: all 0.2s ease;
  /* Glassmorphism styling - From https://css.glass */
  background: rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgb(255, 255, 255);
  /* Spacing between boxes */
  margin-bottom: 0.5em;
}
#nav-menu li:last-child {
  margin-bottom: 0;
}
#nav-menu li:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateX(5px);
}

/* Menu links */
#nav-menu li a {
  display: block;
  color: inherit;
  text-decoration: none;
}

#nav-menu li a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}
