@import url('https://fonts.cdnfonts.com/css/minecraftia');

body.mc-theme {
  margin: 0;
  font-family: 'Minecraftia', monospace, sans-serif;
  background: #000;
  color: white;
  text-align: center;
  position: relative;
  overflow-x: hidden;
  transition: background 0.4s, color 0.4s;
}

body.mc-theme.dark {
  background: linear-gradient(135deg, #003300, #001a00);
  color: #aaffaa;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  z-index: -1;
}

.container {
  padding: 2rem;
  max-width: 600px;
  margin: auto;
}

header, footer {
  padding: 1rem 2rem;
  background: transparent;
  color: white;
  transition: color 0.4s;
}

body.mc-theme.dark header,
body.mc-theme.dark footer {
  color: #aaffaa;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: bold;
  font-size: 1.5rem;
  user-select: none;
  color: inherit;
}

nav a {
  margin: 0 1rem;
  text-decoration: none;
  color: white;
  font-weight: 600;
  transition: color 0.3s ease;
}

body {
  margin: 0;
  font-family: 'Minecraftia', monospace, sans-serif;
  background: #000;
  color: white;
  text-align: center;
  position: relative;
  overflow-x: hidden;
  transition: background 0.4s, color 0.4s;
}

body.dark {
  background: linear-gradient(135deg, #003300, #001a00);
  color: #aaffaa;
}

body.dark header,
body.dark footer {
  color: #aaffaa;
}

/* and so on: replace all `body.mc-theme` with `body` and all `body.mc-theme.dark` with `body.dark` */


button#theme-toggle {
  background: none;
  border: 2px solid white;
  color: white;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s ease;
  font-family: 'Minecraftia', monospace;
  user-select: none;
}

body.mc-theme.dark button#theme-toggle {
  border-color: #aaffaa;
  color: #aaffaa;
}

button#theme-toggle:hover {
  background-color: #55aa55;
  border-color: #55aa55;
  color: #000;
}

body.mc-theme.dark button#theme-toggle:hover {
  background-color: #77cc77;
  border-color: #77cc77;
  color: #001a00;
}

footer p {
  font-size: 0.9rem;
  opacity: 0.6;
  margin: 0;
}

/* Link buttons inside container */
.container ul {
  list-style: none;
  padding: 0;
}

.container ul li {
  margin: 1rem 0;
}

.container ul li a {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  background-color: #2ecc71;
  color: #000;
  font-weight: bold;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.3s, color 0.3s;
  font-family: 'Minecraftia', monospace;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  user-select: none;
}

.container ul li a:hover {
  background-color: #27ae60;
  color: #fff;
}

nav a[aria-current="page"] {
  font-weight: bold;
  color: #2ecc71;
  text-decoration: underline;
}

@media (max-width: 768px) {
  nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1rem;      /* small horizontal padding so no overflow */
    box-sizing: border-box;
  }

  nav a {
    margin: 0.5rem 0;     /* vertical spacing between links */
    width: 100%;          /* full width inside nav */
    max-width: 300px;     /* optional max width so links aren't too wide */
    padding: 0.7rem 1rem; /* consistent padding */
    text-align: center;   /* center text */
    display: block;       /* block display for full width */
    box-sizing: border-box;
  }
}

@media (max-width: 768px) {
  nav {
    flex-wrap: wrap;       /* allow wrapping on small screens */
    justify-content: center; /* center the wrapped links */
    padding: 0 1rem;       /* prevent edges overflow */
  }
  
  nav a {
    flex: 1 1 auto;        /* allow links to shrink and grow */
    min-width: 120px;      /* minimum width for each link */
    margin: 0.3rem 0.5rem; /* vertical and horizontal margin */
    text-align: center;
  }
  
  /* Keep header flex direction same, but stack vertically */
  header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }

  /* Keep logo and nav spacing nice on mobile */
  .logo {
    margin-bottom: 0.5rem;
  }

  /* Theme toggle button below nav */
  button#theme-toggle {
    margin-top: 0.5rem;
  }
}

@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
  }

  nav {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 0.5rem;
  }

  nav a {
    margin: 0;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    flex: 1 1 auto;
    text-align: center;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    transition: background-color 0.3s ease;
  }

  nav a:hover {
    background-color: #27ae60;
  }

  main {
    padding: 1rem;
    margin: 0 1rem;
  }

  section {
    padding: 1rem;
    border-radius: 8px;
  }

  .card-grid, .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-list a {
    font-size: 1rem;
    gap: 8px;
  }

  #theme-toggle {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
  }

  footer {
    padding: 1rem;
    font-size: 0.8rem;
  }
}

body.dark {
  background: linear-gradient(135deg, #0a0a0a, #121f14);
  color: #b8d8b8;
}

body.dark header,
body.dark footer {
  color: #b8d8b8;
}

body.dark .overlay {
  opacity: 0.1;
}

body.dark button#theme-toggle {
  border-color: #b8d8b8;
  color: #b8d8b8;
}

body.dark button#theme-toggle:hover {
  background-color: #4a754a;
  border-color: #4a754a;
  color: #121f14;
}

.overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  z-index: -1;
  transition: opacity 0.4s ease, background-color 0.4s ease;
}

body.dark .overlay {
  opacity: 0.1;
}

body:not(.dark) .overlay {
  opacity: 0.15;
}

.container, header, footer, nav a {
  transition: color 0.4s ease, background-color 0.4s ease;
}

button#theme-toggle {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

