*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #0d1117;
  color: #e6edf3;
  font-family: 'Segoe UI', sans-serif;
  overflow-y: hidden;
  overflow-x: hidden;
  animation: allowScroll 1s forwards 1s;
}

#home {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  margin: 0;
  font-size: 1.5rem;
}

#about {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  margin: 0;
  font-size: 1.5rem;
}

#projects {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  margin: 0;
}

h2 {
  font-size: 2rem;
  margin: 20px 0 5px;
}

.typed-line {
  font-size: 1.5rem;
  margin: 0 0 10px;
}

#navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #161b22;
    width: 100%;
    height: 70px;
    margin:auto;
    color: #fff;
    text-align: center;
    font-size: 2.2rem;
    font-family: 'Fredoka One';
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-bottom: 2px solid #30363d;
}

#navbar a {
    color: #fff;
    text-decoration: none;
    margin: 0 20px;
    padding: 10px 15px;
}

#navbar a:hover {
    color: aqua;
    background-color: #555;
    border-radius: 5px;
}

#navbar a:active {
    color: #fff;
    background-color: rgba(0, 255, 255, 0.137);
    border-radius: 5px;
}

#navbar img {
    height: 50px;
    vertical-align: middle;
    margin-right: 10px;
    border-radius: 100%;
}

#title {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    padding: 5px;
    color: rgb(255,255,255);
}

#title hr {
    width: 50%;
    margin: 20px auto;
    border: 2px solid #555;
}

#content {
    display: block;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: rgb(200,200,200);
}

#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 8%;
  height: 100vh;
  background-color: #161b22;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 2px 0 10px rgba(0,0,0,0.25);
  transition: width 0.3s ease, transform .25s ease;
  z-index: 999;
  border-right: 1px solid #30363d;
  will-change: width, transform;
}

#sidebarToggle img {
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: block;
}

#sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

#sidebar li {
  width: 100%;
}

#sidebar a {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  color: #e6edf3;
  text-decoration: none;
  transition: background 0.2s ease, color .2s ease;
}

#sidebar a:hover {
  background: #21262d;
  color: #58a6ff;
}

.sidebar-img {
  width: 24px;
  height: 24px;
  margin-right: 12px;
}

.sidebar-text {
  transition: opacity 0.3s;
}

#sidebar.collapsed {
  width: 60px;
}

#sidebar.collapsed .sidebar-text {
  opacity: 0;
  pointer-events: none;
}

#sidebarBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 998;
}

body.menu-open {
  overflow: hidden;
}

body.menu-open #sidebarBackdrop {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    top: 12px;
    left: 12px;
    width: auto;
    height: auto;
    padding: 0;
    background-color: transparent !important;
    box-shadow: none !important;
    border-right: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform .25s ease, background-color .25s ease, width .25s ease, height .25s ease;
    z-index: 999;
  }

  #sidebar #sidebarToggle {
    display: block;
  }

  #sidebar .sidebar-text,
  #sidebar ul {
    display: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
  }

  #sidebar.open {
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    padding-top: 20px;
    background-color: #161b22 !important;
    box-shadow: 2px 0 10px rgba(0,0,0,.25) !important;
    border-right: 1px solid #30363d !important;
  }

  #sidebar.open .sidebar-text,
  #sidebar.open ul {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  #sidebar.collapsed {
    width: auto;
    height: auto;
    background-color: transparent !important;
    box-shadow: none !important;
    border-right: 0 !important;
  }

  #sidebar.collapsed .sidebar-text,
  #sidebar.collapsed ul {
    display: none;
    opacity: 0;
    pointer-events: none;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
}

@keyframes fadeSlideUp {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes allowScroll {
  to {
    overflow-y: auto;
  }
}

#footer {
  background: #161b22;
  text-align: center;
  font-size: 0.95rem;
  color: #8b949e;
  border-top: 1px solid #30363d;

  animation: fadeSlideUp 0.8s ease-out 0.3s both;
}
