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

body {
  font-family: 'Segoe UI', sans-serif;
  line-height: 1.6;
  background: var(--background);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main,
section {
  flex: 1;
}

a {
  pointer-events: auto !important;
  position: relative;
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--card-border);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  gap: 22px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 22px;
}

.logo {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.3px;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav-links a {
  font-weight: 500;
  font-size: 15px;
  color: var(--nav-link);
  padding-bottom: 6px;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--surface);
  cursor: pointer;
  padding: 10px;
  transition: 0.2s ease;
}

.nav-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background: var(--text-primary);
  border-radius: 12px;
  transition: 0.25s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-select {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--surface);
  color: var(--text-primary);
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

/* ---- Toggle Switch ---- */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

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

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

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(18px);
}

/* ---- Section Projects ---- */
.projects-page {
  padding: 36px 0 72px;
  flex: 1;
}

.section-title {
  font-size: 28px;
  margin-bottom: 6px;
}

.section-subtitle {
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  height: 320px;
  padding: 18px;
  color: #fff;
  display: flex;
  align-items: flex-end;
  border: 1px solid var(--card-border);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}

.project-card .project-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  font-size: 22px;
}

.project-content {
  width: 100%;
  height: 200px;
  background: var(--card-surface);
  color: var(--text-primary);
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.project-content h3 {
  font-size: 17px;
  line-height: 1.35;
  margin: 0;
  flex-shrink: 0;
}

.project-content p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tag-text);
  background: var(--tag-bg);
  border: 1px solid var(--card-border);
}

.project-link {
  font-weight: 700;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-top: auto;
}

.project-link:hover {
  opacity: 0.9;
}

.gradient-monitoring {
  background: linear-gradient(145deg, #6a11cb, #2575fc);
}

.gradient-mobile {
  background: linear-gradient(145deg, #3d86ff, #2465d7);
}

.gradient-auth {
  background: linear-gradient(145deg, #9b2ffb, #6c3cff);
}

.gradient-cloud {
  background: linear-gradient(145deg, #2e5bff, #4f90ff);
}

.gradient-db {
  background: linear-gradient(145deg, #c67fff, #7b47ff);
}

.gradient-ci {
  background: linear-gradient(145deg, #2d7dfb, #1c5bff);
}

.gradient-analytics {
  background: linear-gradient(145deg, #7c5dff, #5aa9ff);
}

.gradient-ml {
  background: linear-gradient(145deg, #ff7eb6, #7c3aed);
}

.gradient-secops {
  background: linear-gradient(145deg, #2bb7da, #2563eb);
}

.gradient-frontend {
  background: linear-gradient(145deg, #ff8ccf, #8a5dff);
}

.cta-wrapper {
  text-align: center;
  margin-top: 28px;
}

body.no-scroll {
  overflow: hidden;
}

.project-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.project-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.project-modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 10, 27, 0.55);
  backdrop-filter: blur(6px);
}

.modal-shell {
  position: relative;
  width: min(1040px, 92vw);
  height: 94vh;
  max-height: 94vh;
  background: var(--surface);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--card-border);
  transform: translateY(12px);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.project-modal.open .modal-shell {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  transition: 0.2s ease;
  z-index: 1;
}

.modal-close:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.modal-hero {
  position: relative;
  height: 340px;
  min-height: 220px;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.modal-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 25%, rgba(12, 10, 27, 0.55) 100%);
}

.modal-hero-content {
  position: relative;
  z-index: 1;
  padding: 28px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-kicker {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
  color: #e8e4ff;
  font-weight: 700;
}

.modal-hero-content h2 {
  font-size: 32px;
  line-height: 1.2;
}

.modal-subtitle {
  color: #e8e4ff;
  opacity: 0.92;
}

.modal-body {
  padding: 24px 28px 28px;
  display: flex;
  gap: 22px;
  align-items: flex-start;
  flex-wrap: wrap;
  overflow-y: auto;
  flex: 1;
}

.modal-copy {
  flex: 1;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-copy h3 {
  font-size: 20px;
  margin: 0;
}

.modal-copy p {
  margin: 0;
  color: var(--text-secondary);
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  box-shadow: none;
}

.ghost-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font-weight: 700;
  border-radius: 12px;
  font-size: 15px;
  cursor: pointer;
  transition: 0.25s ease;
  border: 0;
  text-decoration: none;
}

.disabled {
  pointer-events: none;
  opacity: 0.5;
  cursor: not-allowed;
}

.disabled:hover {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary-btn {
  background: linear-gradient(120deg, #6a8dff, #9c5dff);
  color: #fff;
  box-shadow: 0 12px 24px rgba(124, 104, 255, 0.28);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(124, 104, 255, 0.35);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 20px 0 8px;
}

.page-btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s ease;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-status {
  font-weight: 700;
  color: var(--text-primary);
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--card-border);
  padding: 18px 0 22px;
  background: var(--background);
  color: var(--footer-text);
  margin-top: auto;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.footer-links {
  display: flex;
  gap: 14px;
}

.footer-links a {
  color: var(--footer-text);
}

.footer-links a:hover {
  color: var(--accent);
}

/* ---- Home Page ---- */
.hero-section {
  padding: 60px 0 80px;
  display: flex;
  align-items: center;
  flex: 1;
}

.hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-greeting {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.hero-name {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.hero-name .first-name {
  color: var(--accent);
}

.hero-name .last-name {
  color: var(--accent);
}

.hero-title {
  font-size: 24px;
  color: var(--text-primary);
  font-weight: 500;
  margin: 8px 0;
}

.hero-description {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 540px;
  margin: 12px 0 24px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.btn-contact {
  background: linear-gradient(135deg, #6a8dff, #9c5dff);
  color: #fff;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-contact:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(106, 141, 255, 0.4);
}

.btn-cv {
  border: 2px solid var(--accent);
  color: var(--accent);
  background: transparent;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-cv:hover {
  background: var(--accent);
  color: #fff;
}

.hero-illustration {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 500px;
}

.illustration-circle {
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4c6ef5 0%, #9f5fff 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 60px rgba(124, 104, 255, 0.3);
  overflow: hidden;
  padding: 20px;
}

.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.illustration-diamonds {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.diamond {
  position: absolute;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, rgba(124, 104, 255, 0.2), rgba(159, 93, 255, 0.2));
  transform: rotate(45deg);
  border-radius: 8px;
}

.diamond-1 {
  top: 10%;
  right: 10%;
  animation: float 6s ease-in-out infinite;
}

.diamond-2 {
  bottom: 15%;
  left: 5%;
  animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% {
    transform: rotate(45deg) translateY(0);
  }
  50% {
    transform: rotate(45deg) translateY(-20px);
  }
}

/* ---- Technologies Section ---- */
.tech-section {
  padding: 80px 0;
  position: relative;
}

.social-icons {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
}

.social-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: color 0.2s ease, transform 0.2s ease;
}

.social-icon:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.tech-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 16px;
}

.tech-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.tech-card {
  background: var(--card-surface);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.tech-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(124, 104, 255, 0.3), rgba(159, 93, 255, 0.3));
  border-radius: 0 0 16px 16px;
  opacity: 0.6;
}

.tech-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.tech-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: inline-block;
}

.tech-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* ---- Responsiveness ---- */
@media (max-width: 900px) {
  .nav-links {
    gap: 16px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .nav-bar {
    flex-wrap: wrap;
    row-gap: 12px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-menu {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 12px;
  }

  .nav-links a {
    width: 100%;
  }

  .nav-actions {
    width: 100%;
    justify-content: flex-start;
  }

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

  .footer-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-name {
    font-size: 42px;
  }

  .hero-illustration {
    height: 350px;
  }

  .illustration-circle {
    width: 300px;
    height: 300px;
  }

  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .hero-name {
    font-size: 32px;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .btn-contact,
  .btn-cv {
    width: 100%;
    text-align: center;
  }

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

/* ---- Legal Pages (Privacy & Terms) ---- */
.legal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.legal-content {
  flex: 1;
  padding: 48px 0 72px;
}

.legal-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.legal-date {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 40px;
}

.legal-section {
  margin-bottom: 36px;
}

.legal-section h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.legal-section p {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 15px;
  margin: 0;
}

.legal-contact {
  margin-top: 48px;
  padding: 32px;
  background: var(--card-surface);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  text-align: center;
}

.legal-contact p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 15px;
}

@media (max-width: 768px) {
  .legal-content {
    padding: 32px 0 48px;
  }

  .legal-title {
    font-size: 28px;
  }

  .legal-section h2 {
    font-size: 20px;
  }

  .legal-contact {
    padding: 24px;
  }
}
