/* === Base Styles === */
html,
body {
  font-size: 20px;
  line-height: 1.4;
  margin: 0;
  padding: 0;
  background-color: rgb(10, 10, 10);
  color: white;
  font-family: Arial, Helvetica, sans-serif;
  scroll-behavior: smooth;
  overflow-x: hidden;
  overscroll-behavior: none;
  max-width: 100vw;
}

.container {
  width: calc(90% - 20px);
  margin: auto;
  border-radius: 8px;
  z-index: 2;

  padding: 10px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background-color: rgba(27, 27, 27, 0.5);
  border: 1px solid rgba(54, 54, 54, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.container:hover {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* === Light Mode Styles === */
.container,
section,
footer {
  position: relative;
  z-index: 1;
}

#portfolio {
  scroll-margin-top: 70px;
}

#resume {
  scroll-margin-top: 180px;
}

.nav-links {
  z-index: 10;
}

html.light-mode,
body.light-mode {
  font-size: 20px;
  line-height: 1.4;
  margin: 0;
  background-color: rgb(214, 214, 214);
  color: white;
  font-family: Arial, Helvetica, sans-serif;
}

.light-mode .container,
.light-mode .nav-links,
.light-mode .portfolio-card,
.light-mode .resume-controls button {
  background-color: rgba(245, 245, 245, 0.7);
  color: #111;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.light-mode header {
  background-color: rgba(245, 245, 245, 0.7);
}

.light-mode .nav-buttons {
  filter: invert(100%);
}

.light-mode p {
  color: #272727;
}

.light-mode h1,
.light-mode h2,
body.light-mode h3 {
  color: #000000;
}

.light-mode .container:hover,
.light-mode .resume-controls button:hover {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.light-mode hr {
  border-color: #000000;
}

.light-mode #shader-container {
  background-color: transparent;
}

.light-mode .file-icons {
  filter: invert(90%);
}

.light-mode .nav-links li a {
  color: #000000;
}

.light-mode .card-title a img,
.light-mode footer ul li img,
.light-mode .resume-controls a button img {
  filter: invert(0%);
}

.light-mode .portfolio-card ul li img {
  filter: invert(0%);
}

.resume-controls button:hover {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.light-mode .footer {
  background: linear-gradient(to bottom, transparent, rgb(255, 255, 255));
}

.light-mode #footer-bottom {
  background-color: rgb(255, 255, 255);
}

/*--------common---------*/

a {
  text-decoration: none;
  color: white;
}

a:hover {
  filter: invert(50%);
  transition: filter 0.3s ease;
}

h1,
h2,
h3 {
  margin: 0;
  padding: 0;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.6rem;
}

h3 {
  font-size: 1.3rem;
}

p {
  width: 88%;
  color: rgb(210, 210, 210);
}

hr {
  width: 100%;
  opacity: 0.2;
}

/* === Shader Section === */
canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  max-height: 100vh;
  overflow: hidden;
}

/* === Header === */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background-color: rgba(27,27,27,0.5);
  border-bottom: 1px solid rgba(54,54,54,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-sizing: border-box;
}

.nav-buttons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-buttons button {
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-buttons button img {
  width: 40px;
  object-fit: contain;
  filter: invert(100%);
}

.light-toggle {
  font-size: 1.5rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

.hamburger {
  display: block;
  font-size: 1.8rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

.nav-links {
  display: none;
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  max-width: calc(90% - 20px);
  width: 800px;
  list-style: none;
  margin: 30px auto;
  border-radius: 8px;
  padding: 10px;
}

.nav-links:hover {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.nav-links.open {
  display: flex !important;
}

.nav-links li {
  margin: auto;
  padding: 10px 0 10px 0;
}

/* === About Section === */
#about {
  max-width: calc(90% - 20px);
  width: 800px;
  margin: 100px auto;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#about p {
  width: 100%;
  margin-top: 0;
}

#about hr {
  width: 85%;
  opacity: 0.2;
}

/* === Portfolio Section === */
section h2 {
  width: 90%;
  max-width: 822px;
  display: block;
  padding-bottom: 10px;
  margin: auto;
}

.portfolio {
  width: 90%;
  max-width: 822px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  box-sizing: border-box;
  gap: 2rem;
}

.portfolio-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  width: 100%;
  top: 0;
}

.portfolio-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.portfolio-card img {
  object-fit: cover;
  border-radius: 7px;
  margin-bottom: 10px;
}

.card-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
  gap: 0.5rem;
}

.card-title h3 {
  margin: 0;
  font-size: 1.5rem;
  color: white;
  line-height: 1.2;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: break-word;
}

.card-title a {
  width: 36px;
  height: 36px;
  align-self: flex-end;
}

.card-title a img {
  width: 36px;
  height: 36px;
  margin: 0;
  filter: invert(100%);
  object-fit: contain;
}

.portfolio-card p {
  width: 100%;
  margin: 0;
}

.file-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.file {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: white;
}

.file img {
  width: 24px;
  height: 24px;
  margin: 0;
  object-fit: contain;
  filter: invert(100%);
}

/* === CV === */
.resume-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  max-width: 822px;
  margin: auto;
  padding-bottom: 10px;
}

.resume-header h2 {
  padding-bottom: 0;
}

.resume-controls {
  display: flex;
  gap: 0.5rem;
}

.resume-controls a:hover {
  filter: invert(10%);
}

.resume-controls button {
  width: 40px;
  height: 40px;
  padding: 2px;
  cursor: pointer;
  border-radius: 8px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background-color: rgba(27, 27, 27, 0.5);
  border: 1px solid rgba(54, 54, 54, 0.5);
}

.resume-controls button:hover {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.resume-controls button img {
  width: 30px;
  height: 30px;
  filter: invert(100%);
}

.resume {
  height: fit-content;
  width: calc(90% - 20px);
  max-width: 800px;
}

#resume-image {
  width: 100%;
  object-fit: cover;
  border-radius: 7px;
  display: block;
}

/* === Footer === */
.footer {
  background: linear-gradient(to bottom, transparent, rgb(8, 8, 8));
  text-align: center;
  margin-top: 30px;
}

#footer-top {
  padding: 1rem;
}

#footer-bottom {
  height: 40px;
  background-color: rgb(2, 2, 2);
  color: rgb(160, 160, 160);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(255, 255, 255, 0.04);
}

#footer-bottom p {
  margin: 0;
  padding-bottom: 5px;
}

footer ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 0;
  margin: 0;
}

footer ul li {
  margin: auto;
  padding: 10px;
}

footer ul li img {
  width: 40px;
  filter: invert(100%);
}

.footer h2 {
  font-size: 28px;
  margin-bottom: 15px;
}

.footer p {
  font-size: 18px;
  padding-bottom: 20px;
  margin: auto;
}