:root {
  --bg-main: #121212;
  --bg-surface: #1a1a1a;
  --bg-card: #242424;
  --text-primary: #eee;
  --text-secondary: #bbb;
  --accent1: #ff8c42;
  --accent2: #ff5e62;

  --light-bg-main: #fff4ee;
  --light-bg-surface: #f9e7dcff;
  --light-bg-card: #ffffff;
  --light-text-primary: #2b2b2b;
  --light-text-secondary: #555555;
}

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

html,
body {
  overflow-x: hidden;
}

body {
  font-family: "Roboto", sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background 0.4s ease, color 0.4s ease;
}

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

header {
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  padding: 12px 30px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: background 0.4s ease, color 0.4s ease;
}

.theme-switch {
  margin-left: 20px;
  all: unset;
}

nav ul {
  display: flex;
  gap: 24px;
  list-style: none;
  align-items: center;
  flex-wrap: wrap;
}

nav a {
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  transition: 0.3s;
}

nav a:hover {
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  color: #fff;
}

#hero {
  text-align: center;
  padding: 50px 20px;
  background: linear-gradient(
    135deg,
    var(--bg-surface) 0%,
    var(--bg-card) 100%
  );
  transition: background 0.4s ease;
  background-size: cover;
  background-position: center;
}

#hero h1 {
  font-size: 48px;
  font-weight: 900;
  margin-bottom: 16px;
  color: var(--accent1);
}

#hero p {
  font-size: 20px;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
}

button,
.button,
.cert-btn {
  cursor: pointer;
  border: none;
  border-radius: 24px;
  padding: 10px 24px;
  font-weight: 600;
  transition: 0.3s;
  font-size: 16px;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

button:hover,
.button:hover,
.cert-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

#about {
  padding: 60px 20px;
  max-width: 1000px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: background 0.4s ease;
}

.about-container {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
}

.about-img {
  flex: 1 1 300px;
  max-width: 300px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transform: translateY(-4px);
}

.about-img img {
  width: 100%;
  height: auto;
  border-radius: inherit;
  display: block;
}

.about-img:hover {
  transform: translateY(-8px);
  box-shadow: 0 6px 20px rgba(255, 140, 66, 0.3);
}

.about-text {
  flex: 2 1 500px;
  flex: 1 1 300px;
}

.about-text h2 {
  color: var(--accent1);
  font-size: 32px;
  margin-bottom: 16px;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 24px;
}

.cert-list {
  display: none;
  margin-top: 24px;
}

.cert-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 24px;
}

.cert-card {
  padding: 16px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s, box-shadow 0.3s;
  line-height: 1.4;
  min-height: 60px;
}

.cert-card.web {
  background: linear-gradient(135deg, var(--bg-card), var(--accent1));
  color: #fff;
}

.cert-card.data {
  background: linear-gradient(135deg, var(--bg-card), var(--accent2));
  color: #fff;
}

.cert-card.other {
  background: linear-gradient(135deg, var(--bg-card), #999);
  color: #fff;
}

.cert-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(255, 140, 66, 0.3);
}

#projectsSection {
  padding: 60px 20px;
  max-width: 1000px;
  margin: 0 auto 40px;
  border-radius: 16px;
  background: var(--bg-card);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s, background 0.4s ease;
  display: none;
}

#projectsSection h2 {
  text-align: center;
  font-size: 32px;
  margin-bottom: 40px;
  color: var(--accent1);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--bg-surface);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: 0.3s;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(255, 140, 66, 0.3);
}

.project-card h3 {
  color: var(--accent1);
  margin-bottom: 12px;
}

.project-card p {
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.project-card a {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 16px;
  border: 2px solid var(--accent2);
  border-radius: 8px;
  color: var(--accent2);
  font-weight: 600;
  transition: all 0.3s ease;
}

.project-card a:hover {
  background: var(--accent2);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 94, 98, 0.4);
}

#contact {
  text-align: center;
  padding: 20px 20px;
  background: var(--bg-card);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

#contact h2 {
  font-size: 32px;
  margin-bottom: 16px;
  color: var(--accent1);
}

#contact a {
  display: inline-block;
  margin: 0 auto;
  padding: 8px 8px;
  border-radius: 16px;
  font-weight: 600;
  color: var(--accent2);
  transition: 0.3s;
}

#contact a:hover {
  background: var(--accent2);
  color: #fff;
}

footer {
  text-align: center;
  padding: 8px 16px;
  background: var(--bg-surface);
  color: #bbb;
  font-size: 14px;
}

footer a :hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(255, 140, 66, 0.3);
  background: var(--accent2);
  color: #fff;
  border-radius: 3px;
}

body.light-mode {
  background: var(--light-bg-main);
  color: var(--light-text-primary);
}

body.light-mode #hero {
  background: linear-gradient(135deg, #fff8f4 0%, #ffe8dc 100%);
}

body.light-mode #hero h1 {
  color: var(--accent1);
}

body.light-mode #hero p {
  color: var(--light-text-secondary);
}

body.light-mode #about,
body.light-mode #projectsSection,
body.light-mode #contact {
  background: var(--light-bg-card);
  color: var(--light-text-primary);
}

body.light-mode .about-text h2,
body.light-mode #projectsSection h2,
body.light-mode #contact h2 {
  color: var(--accent1);
}

body.light-mode .about-text p,
body.light-mode .project-card p,
body.light-mode #contact p {
  color: var(--light-text-secondary);
}

body.light-mode .project-card {
  background: var(--light-bg-card);
  color: var(--light-text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.light-mode .project-card a {
  color: var(--accent1);
}

body.light-mode .project-card a:hover {
  color: #fff;
}

body.light-mode .cert-card.web {
  background: linear-gradient(135deg, #ffe2c9, #fff0e0);
  color: var(--light-text-primary);
}

body.light-mode .cert-card.data {
  background: linear-gradient(135deg, #ffd6d6, #ffe6e9);
  color: var(--light-text-primary);
}

body.light-mode .cert-card.other {
  background: linear-gradient(135deg, #e8e8e8, #f7f7f7);
  color: var(--light-text-primary);
}

body.light-mode a {
  color: var(--accent2);
}

body.light-mode a:hover {
  color: #000;
}

body.light-mode footer {
  background: var(--light-bg-surface);
  color: #555;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

body.light-mode header {
  background: var(--light-bg-surface);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

body.light-mode nav a:hover {
  background: linear-gradient(90deg, #ffa25a, #ff7a7a);
  color: #fff;
}

body.light-mode .project-card a {
  border: 2px solid var(--accent1);
  color: var(--accent1);
}

body.light-mode .project-card a:hover {
  background: var(--accent1);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 140, 66, 0.3);
}

@media (max-width: 700px) {
  header {
    padding: 10px 16px;
    font-size: 14px;
  }

  nav ul {
    gap: 12px;
  }

  nav a {
    padding: 6px 10px;
    font-size: 14px;
  }

  .theme-switch {
    margin-left: 8px;
    transform: scale(0.85);
  }
}

@media (max-width: 1000px) {
  .cert-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 800px) {
  .about-img {
    max-width: 300px;
    width: 100%;
  }

  .about-img img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }

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

  .about-text {
    flex: 1 1 100%;
  }
}

@media (max-width: 650px) {
  .cert-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  #hero h1 {
    font-size: 32px;
  }
  #projectsSection h2,
  #contact h2 {
    font-size: 24px;
  }
  button,
  .button,
  .cert-btn {
    padding: 8px 16px;
    font-size: 14px;
  }
}

.typewriter {
  font-family: "Quicksand", sans-serif;
  font-weight: 800;
  text-align: center;
  color: var(--text-color, #fff);
  white-space: normal;
  overflow: hidden;
  width: fit-content;
  margin: 0 auto;
  font-size: clamp(1.5rem, 5vw, 4rem);
}

@keyframes blink {
  0%,
  100% {
    border-color: transparent;
  }
  50% {
    border-color: currentColor;
  }
}
