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

/* Set system UI as the default font */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: #fff;
  color: #000;
  line-height: 1.5;
  letter-spacing: -0.3px;
  font-size: 1rem;
}

/* Page wrapper for centering */
.page-wrapper {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 120px 40px;
}

/* Container for nav + content */
.container {
  display: flex;
  gap: 100px;
  align-items: flex-start;
}

/* Navigation */
nav {
  flex-shrink: 0;
  width: 70px;
  position: sticky;
  top: 120px;
  align-self: flex-start;
}

nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

nav ul li {
  position: relative;
  line-height: 1.5;
}

/* Desktop nav links - text only */
nav ul li a.nav-text {
  text-decoration: none;
  color: #000;
  font-size: 1rem;
  position: relative;
  display: inline-block;
}

/* Underline effect using pseudo-element */
nav ul li a.nav-text::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: #000;
  transition: width 0.3s ease;
}

/* Hover state - underline expands from left to right */
nav ul li a.nav-text:hover::after {
  width: 100%;
}

/* Active state - underline always visible */
nav ul li a.nav-text.active::after {
  width: 100%;
}

/* Hide mobile icons on desktop */
nav ul li a.nav-icon {
  display: none;
}

/* Main content area */
main {
  width: 600px;
}

/* All text is body-sized, no hierarchy */
main p {
  margin-bottom: 1rem;
}

main p:last-child {
  margin-bottom: 0;
}

/* Links in content */
main a {
  color: #000;
  text-decoration: none;
  border-bottom: 1px solid #000;
}

main a:hover {
  border-bottom-color: #000;
}

/* Mobile styles */
@media (max-width: 768px) {
  body {
    font-size: 1rem;
  }

  .page-wrapper {
    padding: 2rem 3rem;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    min-height: 100vh;
    position: relative;
  }

  /* Fade effect at bottom */
  .page-wrapper::after {
    content: '';
    position: fixed;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    height: 24px;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
    pointer-events: none;
    z-index: 9;
    transition: opacity 0.3s ease;
  }

  .page-wrapper.fade-hidden::after {
    opacity: 0;
  }

  .container {
    flex-direction: column;
    gap: 0;
  }

  nav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 16px 24px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 10;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  nav.nav-hidden {
    opacity: 0;
    pointer-events: none;
  }

  nav ul {
    flex-direction: row;
    justify-content: center;
    gap: 24px;
    height: 24px;
    align-items: center;
  }

  nav ul li {
    height: 24px;
    line-height: 24px;
  }

  /* Hide text links on mobile */
  nav ul li a.nav-text {
    display: none;
  }

  /* Show icon links on mobile */
  nav ul li a.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
  }

  nav ul li a.nav-icon svg {
    width: 24px;
    height: 24px;
  }

  /* Non-active icons are grayed out */
  nav ul li a.nav-icon {
    opacity: 0.35;
  }

  /* Active icon is full black */
  nav ul li a.nav-icon.active {
    opacity: 1;
  }

  main {
    width: 100%;
  }

  nav {
    width: 100%;
  }
}

/* Smaller mobile */
@media (max-width: 480px) {
  .page-wrapper {
    padding: 2rem 1.5rem;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  nav {
    padding: 16px 20px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  nav ul {
    gap: 20px;
  }
}
