/* CSS VARIABLES */
:root {
  --main-bg: #ffffff;
  --main-text: #000000;
  --main-accent: #555555;
  --main-highlight: #f5f5f5;
  --main-shadow: rgba(0, 0, 0, 0.1);
}

/* Dark mode overrides */
[data-theme="dark"] {
  --main-bg: #121212;
  --main-text: #f0f0f0;
  --main-accent: #bbbbbb;
  --main-highlight: #1e1e1e;
  --main-shadow: rgba(255, 255, 255, 0.05);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  font-size: 1.6rem;
  line-height: 1.6;
  background-color: var(--main-bg);
  color: var(--main-text);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1,
h2 {
  font-family: "Raleway", sans-serif;
  font-weight: 700;
  text-align: center;
  color: var(--main-text);
}

h1 {
  font-size: 5.6rem;
}

h2 {
  font-size: 3.6rem;
}

a {
  text-decoration: none;
  color: var(--main-text);
}

ul {
  list-style: none;
}

img {
  display: block;
  width: 100%;
}

/* NAVBAR */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--main-highlight);
  box-shadow: 0 2px 4px var(--main-shadow);
  z-index: 10;
}

.nav-list {
  display: flex;
  gap: 1rem;
}

.nav-list a {
  display: block;
  font-size: 1.8rem;
  padding: 2rem;
}

.nav-list a:hover {
  background: var(--main-accent);
  color: var(--main-bg);
}

/* THEME TOGGLE BUTTON IN NAV */
/*
.theme-toggle {
  background: var(--main-highlight);
  border: 1px solid var(--main-accent);
  padding: 0.8rem 1.2rem;
  font-size: 1.4rem;
  border-radius: 4px;
  cursor: pointer;
  color: var(--main-text);
  transition: background 0.3s ease, color 0.3s ease;
}

.theme-toggle:hover {
  background: var(--main-accent);
  color: var(--main-bg);
}
*/

/* Toggle Switch Styles */
.toggle-wrapper {
  margin-right: 2rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 30px;
  transition: background-color 0.3s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 24px;
  width: 24px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

/* Icon styles inside slider */
.slider .icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  pointer-events: none;
}

.sun {
  left: 8px;
  color: #f39c12;
}

.moon {
  right: 8px;
  color: #f1c40f;
  opacity: 0;
  transition: opacity 0.3s;
}

/* When checked, move slider and show moon */
.switch input:checked + .slider::before {
  transform: translateX(30px);
}

.switch input:checked + .slider {
  background-color: #666;
}

.switch input:checked + .slider .moon {
  opacity: 1;
}

.switch input:checked + .slider .sun {
  opacity: 0;
}

/* WELCOME SECTION */
.welcome-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: var(--main-highlight);
  text-align: center;
  padding: 2rem;
  margin-top: 7rem; /* To avoid overlap with fixed nav */
}

.welcome-section h1 {
  margin-bottom: 2rem;
}

.welcome-section p {
  font-size: 2.4rem;
  font-style: italic;
  color: var(--main-accent);
}

/* PROJECTS SECTION */
.projects-section {
  padding: 10rem 2rem;
  background: var(--main-bg);
  text-align: center;
}

.projects-section-header {
  font-size: 3.2rem;
  margin-bottom: 6rem;
  border-bottom: 2px solid var(--main-accent);
  display: inline-block;
  padding-bottom: 1rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.project {
  background-color: var(--main-highlight);
  border: 1px solid var(--main-accent);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 6px var(--main-shadow);
}

.project:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px var(--main-shadow);
}

.project-tile {
  width: 100%;
  height: 200px;
  object-fit: cover;
  filter: grayscale(100%);
}

.project-tile:hover {
  filter: grayscale(0%);
}

.project-title {
  font-size: 2rem;
  padding: 1.5rem;
  background-color: var(--main-bg);
  color: var(--main-text);
}

.code {
  font-weight: bold;
  color: var(--main-accent);
}

/* CONTACT SECTION */
.contact-section {
  background: var(--main-highlight);
  padding: 8rem 2rem;
  text-align: center;
}

.contact-section-header > h2 {
  font-size: 4rem;
  margin-bottom: 2rem;
}

.contact-section-header > p {
  font-style: italic;
  color: var(--main-accent);
}

.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 3rem;
}

.contact-details {
  font-size: 2rem;
  padding: 1rem 2rem;
  background: var(--main-bg);
  border: 1px solid var(--main-accent);
  border-radius: 4px;
  text-shadow: none;
  transition: 0.3s ease, transform 0.3s ease;
}

.contact-details:hover {
  transform: translateY(-4px);
  background: var(--main-accent);
  color: var(--main-bg);
}

/* FOOTER */
footer {
  padding: 2rem;
  background: var(--main-highlight);
  border-top: 2px solid var(--main-accent);
  text-align: center;
  font-size: 1.4rem;
  color: var(--main-text);
}

.socials {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
  font-size: 2rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  html {
    font-size: 56%;
  }

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

  .nav {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .nav-list {
    flex-direction: column;
    width: 100%;
  }

  .nav-list a {
    padding: 1.2rem 2rem;
  }

  .theme-toggle {
    align-self: flex-end;
    margin: 0 2rem 1rem 0;
  }

  footer {
    flex-direction: column;
    gap: 1rem;
  }
}
