:root {
  --blue-50: #f3f7ff;
  --blue-100: #e7efff;
  --blue-200: #d4e2ff;
  --blue-300: #b5cbfa;
  --blue-500: #5f86d6;
  --blue-700: #264a8a;
  --text-main: #14243a;
  --text-muted: #4a5f7d;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text-main);
  background: linear-gradient(180deg, var(--blue-50), var(--blue-100));
}

.page-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 2rem 1.5rem;
  background: var(--blue-200);
  border-right: 1px solid var(--blue-300);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.sidebar-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
}

.brand h1 {
  margin: 0;
  font-size: 1.6rem;
}

.brand p {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--blue-300);
  background: var(--white);
  color: var(--blue-700);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.lang-switch {
  display: inline-flex;
  position: fixed;
  top: 1rem;
  right: 1.2rem;
  z-index: 1100;
  border: 1px solid var(--blue-300);
  border-radius: 10px;
  overflow: hidden;
  background: var(--white);
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: none;
  background: transparent;
  color: var(--blue-700);
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.lang-flag {
  width: 1rem;
  height: 0.75rem;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--blue-300);
  display: inline-block;
}

.lang-code {
  letter-spacing: 0.02em;
}

.lang-btn.active {
  background: var(--blue-300);
}

.profile-photo-wrap {
  margin-top: 1.25rem;
}

.about-profile-photo-wrap {
  display: none;
}

.about-profile-photo {
  width: 100%;
  max-width: 170px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--blue-300);
  display: block;
}

.profile-photo {
  width: 100%;
  max-width: 170px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--blue-300);
  display: block;
}

.sidebar-contact {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.contact-icon {
  width: 1.45rem;
  height: 1.45rem;
  display: inline-block;
  flex-shrink: 0;
}

.contact-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 999px;
  border: 1px solid var(--blue-300);
  background: var(--white);
}

.contact-icon-link:hover {
  background: var(--blue-100);
}

.nav-links {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.nav-link {
  text-decoration: none;
  color: var(--blue-700);
  font-weight: 500;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  transition: background-color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  background: var(--white);
}

.content {
  padding: 2rem 2.2rem 4rem;
  max-width: 1000px;
}

.section {
  padding: 1rem 0 2rem;
  border-bottom: 1px solid var(--blue-300);
}

.section:last-child {
  border-bottom: none;
}

h2 {
  margin-top: 0;
  color: var(--blue-700);
}

/* Make entire section heading clickable but only show underline and '#' on hover */
.section-anchor {
  color: inherit;
  text-decoration: none;
  display: inline-block;
  position: relative;
}

.section-anchor::after {
  content: "#";
  opacity: 0;
  margin-left: 0.4rem;
  color: var(--text-muted);
  font-weight: 600;
  transition: opacity 120ms ease, transform 120ms ease;
  transform: translateY(-1px);
}

.section-anchor:hover {
  text-decoration: underline;
}

.section-anchor:hover::after {
  opacity: 1;
  transform: translateY(0);
}

h3 {
  margin: 0 0 0.75rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--blue-300);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.meta {
  color: var(--text-muted);
  margin: 0.2rem 0 0.6rem;
}

.project-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-card {
  margin-bottom: 0;
}

.project-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.project-title-row h3 {
  margin: 0;
}

.project-github-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--blue-300);
  background: var(--white);
  flex-shrink: 0;
}

.project-github-link:hover {
  background: var(--blue-100);
}

.project-github-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.project-site-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--blue-300);
  background: var(--white);
  flex-shrink: 0;
}

.project-site-link:hover {
  background: var(--blue-100);
}

.project-site-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.project-links {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.project-preview-btn {
  border: 0;
  background: transparent;
  padding: 0;
  float: left;
  margin: 0.1rem 0.9rem 0.55rem 0;
  cursor: pointer;
}

.project-image {
  width: min(100%, 240px);
  max-height: 150px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--blue-300);
  display: block;
}

.project-preview-btn:hover .project-image {
  border-color: var(--blue-700);
}

.project-skill-list {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-skill-list li {
  background: var(--blue-50);
  border: 1px solid var(--blue-300);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(29, 43, 59, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}

.image-lightbox[hidden] {
  display: none;
}

.image-lightbox-image {
  max-width: min(92vw, 1100px);
  max-height: 86vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--blue-300);
  background: var(--white);
}

.image-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 999px;
  border: 1px solid var(--blue-300);
  background: var(--white);
  color: var(--blue-700);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.chip-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chip-list li {
  background: var(--white);
  border: 1px solid var(--blue-300);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.92rem;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1rem max-content 1fr;
  align-items: center;
  column-gap: 0.45rem;
  row-gap: 0.4rem;
}

.contact-intro {
  margin: 0 0 0.6rem;
  color: var(--text-muted);
}

.contact-list li {
  display: contents;
}

.contact-list-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.contact-list strong {
  white-space: nowrap;
}

.contact-list a {
  min-width: 0;
  word-break: break-word;
}

a {
  color: var(--blue-700);
}

@media (max-width: 860px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    column-gap: 0.6rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: auto;
    padding: 1rem;
    border-right: none;
    border-bottom: 1px solid var(--blue-300);
  }

  .sidebar-header {
    display: contents;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
  }

  .sidebar-contact {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    justify-self: end;
    justify-content: flex-end;
    margin-top: 0;
    gap: 0.45rem;
  }

  .sidebar-controls {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
    gap: 0.45rem;
  }

  .brand h1 {
    font-size: 1.3rem;
  }

  .brand p {
    font-size: 0.92rem;
  }

  .lang-code {
    display: none;
  }

  .lang-btn {
    gap: 0;
    padding: 0.35rem 0.45rem;
  }

  .lang-switch {
    position: static;
    top: auto;
    right: auto;
    z-index: auto;
  }

  .nav-toggle {
    display: inline-flex;
    align-self: flex-end;
  }

  .profile-photo-wrap {
    display: none;
  }

  .about-profile-photo-wrap {
    display: block;
    margin: 0 0 0.9rem;
  }

  .about-profile-photo {
    display: block;
  }

  .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    display: none;
    margin-top: 1rem;
    flex-direction: column;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-link {
    width: 100%;
  }

  .content {
    padding: 6.2rem 1rem 3rem;
  }

  .section {
    padding: 0.8rem 0 1.5rem;
    scroll-margin-top: 6.8rem;
  }

  .project-preview-btn {
    float: none;
    display: block;
    margin: 0.45rem 0 0.65rem;
  }

  .project-image {
    width: 100%;
    max-height: 220px;
  }
}
