:root {
  --bg: #ffffff;
  --panel: #f8f9fa;
  --text: #212529;
  --muted: #6c757d;
  --accent: #17a2b8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  scroll-behavior: smooth;
}

.navbar {
  background: var(--panel);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #dee2e6;
}

.nav-container {
  max-width: 1100px;
  margin: auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-link:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.bar {
  width: 25px;
  height: 3px;
  background: var(--text);
  margin: 3px 0;
  transition: 0.3s;
}

.nav-menu {
  display: flex;
  gap: 2rem;
}

.nav-menu.active {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--panel);
  padding: 1rem 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.hero {
  background: linear-gradient(to bottom, #f8f9fa, var(--bg));
  padding: 4rem 1.5rem;
  text-align: center;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin-bottom: 1rem;
  border: 2px solid var(--accent);
}

.subtitle {
  color: var(--muted);
}

.hero-links a {
  margin: 0 0.75rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease, transform 0.2s ease;
}

.hero-links a:hover {
  color: #138496;
  transform: translateY(-2px);
}

.hero-links a:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

main {
  max-width: 1100px;
  margin: auto;
  padding: 2rem 1.5rem;
}

.section {
  margin-bottom: 4rem;
}

.section h2 {
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.project {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  background: var(--panel);
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.project-info h3 {
  margin-top: 0;
}

.tags {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tags li {
  background: #e9ecef;
  color: var(--text);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.project-links a {
  color: var(--accent);
  margin-right: 1rem;
  text-decoration: none;
  transition: color 0.3s ease;
}

.project-links a:hover {
  color: #7dd3fc;
}

.project-links a:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.project-images img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  cursor: zoom-in;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-images img:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.project-images img:focus {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* License Carousel */
.license-carousel {
  position: relative;
  background: var(--panel);
  border-radius: 12px;
  padding: 1rem 2.5rem;
  margin-bottom: 2rem;
}

.license-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;          /* Firefox */
  padding: 0.5rem 0;
}

.license-track::-webkit-scrollbar {
  display: none;                  /* Chrome/Safari */
}

.license-track > div,
.license-track > iframe {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, opacity 0.3s ease;
}

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

.carousel-btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.carousel-btn[disabled] {
  opacity: 0.25;
  cursor: default;
}

.carousel-prev {
  left: 0.3rem;
}

.carousel-next {
  right: 0.3rem;
}

.image-viewer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.image-viewer.is-open {
  display: block;
}

.image-viewer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 25, 41, 0.84);
}

.image-viewer-content {
  position: relative;
  z-index: 1;
  margin: 4vh auto;
  width: min(92vw, 1100px);
  background: #0f172a;
  border-radius: 14px;
  padding: 3rem 3.5rem 2rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

#viewer-image {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 10px;
}

.image-viewer-caption {
  color: #f1f5f9;
  margin: 1rem 0 0;
  text-align: center;
}

.image-viewer-close,
.image-viewer-nav {
  position: absolute;
  border: none;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.7);
  cursor: pointer;
}

.image-viewer-close {
  top: 0.8rem;
  right: 0.8rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
}

.image-viewer-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 1.5rem;
}

.image-viewer-prev {
  left: 0.8rem;
}

.image-viewer-next {
  right: 0.8rem;
}

.image-viewer-close:hover,
.image-viewer-nav:hover {
  background: rgba(23, 162, 184, 0.9);
}

.image-viewer-close:focus,
.image-viewer-nav:focus {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  border-top: 1px solid var(--muted);
}

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

@media (max-width: 600px) {
  .hamburger {
    display: flex;
    margin-left: auto;
  }

  .nav-menu {
    display: none;
  }

  .nav-container {
    position: relative;
  }

  .nav-link {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #dee2e6;
  }

  .hero {
    padding: 2rem 1rem;
  }

  .avatar {
    width: 100px;
    height: 100px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .hero-links a {
    margin: 0 0.5rem;
    font-size: 0.9rem;
  }

  main {
    padding: 1rem;
  }

  .section {
    margin-bottom: 2rem;
  }

  .project {
    padding: 1rem;
    gap: 1rem;
  }

  .image-viewer-content {
    margin: 6vh auto;
    width: 94vw;
    padding: 2.8rem 2.6rem 1.5rem;
  }

  .image-viewer-nav {
    width: 2.2rem;
    height: 2.2rem;
    font-size: 1.2rem;
  }
}

/* Language Switcher */
.lang-switch {
  background: var(--accent);
  color: #ffffff !important;
  padding: 0.2rem 0.7rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: background 0.3s ease;
}

.lang-switch:hover {
  background: #138496;
  color: #ffffff !important;
}
