:root {
  --bg: #3776c4;
  --accent: #fcb900;
  --radius: 12px;
  --max: 1200px;
  --container-pad: 6%;
  --mono:
    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: var(--mono);
  background: #000000;
  color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  font-size: 16px;
}

/* container */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px var(--container-pad);
}

/* top header */
.top {
  position: fixed;
  top: 0;
  width: 100%;
  height: 0;
  display: flex;
  justify-content: center;
  z-index: 100;
}

/* semicircle nav */
.nav-menu {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 90px;
  background: rgba(15, 15, 18, 0.3);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom-left-radius: 200px;
  border-bottom-right-radius: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
  backdrop-filter: blur(10px);
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.nav-menu a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}
.nav-menu a:hover {
  opacity: 0.7;
}
.nav-hidden {
  transform: translate(-50%, -120%);
  opacity: 0;
}

/* hero */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.hero svg {
  width: 100%;
  height: auto;
  display: block;
  margin-top: 200px;
  margin-bottom: -3px;
  position: relative;
  z-index: 1;
}
.hero-inner {
  background: rgba(0, 0, 0, 0.6);
  border-radius: 30px;
  position: relative;
  z-index: 2;
  padding: 60px 40px;
  max-width: 1200px;
  margin-top: 200px;
  display: grid;
  grid-template-columns: 1fr 350px;
  align-items: center;
  gap: 40px;
  backdrop-filter: blur(10px);
}
.hero-content {
  display: flex;
  flex-direction: column;
}
.name {
  font-size: 60px;
}
.subtitle {
  font-size: 24px;
  margin-top: -25px;
}
.biography {
  max-width: 500px;
  color: #cfd8df;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.hero-socials {
  display: flex;
  gap: 16px;
}
.social-btn {
  display: inline-flex;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.social-btn img {
  width: 60%;
  height: 60%;
  object-fit: contain;
}
.social-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 15px rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.2);
}
.contact-hint {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pointer img {
  width: 40px;
  height: auto;
  rotate: 270deg;
  animation: bounce 0.75s ease-in-out infinite alternate;
}
@keyframes bounce {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(6px);
  }
}
.contact-text {
  margin-top: -5px;
  font-weight: 600;
  font-size: 18px;
  color: var(--accent);
}
.hero-avatar {
  width: 350px;
  height: 350px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.3);
  object-fit: cover;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

/* section basics */
.section {
  min-height: 100vh;
  align-items: center;
  background: linear-gradient(180deg, #000000 0%, var(--bg) 80%);
  display: flex;
  flex-direction: column;
}
.section svg {
  width: 100%;
  height: auto;
  display: block;
  margin-top: auto;
  margin-bottom: -3px;
}
.section-title {
  margin-top: 0px;
  font-size: 36px;
  align-self: center;
  text-align: center;
}

/* projects grid */
.grid {
  display: grid;
  gap: 18px;
}
.projects-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}
@media (min-width: 980px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* If there's an orphan card, place it in the center column */
  .card:last-child:nth-child(3n + 1) {
    grid-column: 2;
  }
  
  .card:last-child:nth-child(3n + 2) {
    grid-column: 2 / 3;
  }
}

/* Project subsection styling */
.project-subsection-title {
  font-size: 28px;
  margin-top: 60px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 600;
}

/* First subsection shouldn't have top margin */
.project-subsection-title:first-of-type {
  margin-top: 40px;
}

/* Control gap between subsections */
.professional-projects {
  margin-bottom: 80px; /* Gap between Professional and Educational */
}

.educational-projects {
  margin-bottom: 40px; /* Gap below Educational projects */
}

/* card */
.card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.01)
  );
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 6px 30px rgba(2, 6, 23, 0.6);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    outline 0.25s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  width: 100%;
  max-width: 400px;
}
@media (min-width: 980px) {
  .card {
    max-width: none;
  }
}
.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 14px 60px rgba(2, 6, 23, 0.7);
  outline: 1px solid rgba(252, 185, 0, 0.4);
}

/* card media */
.media {
  height: 170px;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.media video.thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1);
  transition: transform 0.35s ease;
}

/* card content */
.card-body {
  padding: 12px;
  flex: 1;
  flex-direction: column;
  display: flex;
}
.card-title {
  font-size: 18px;
}
.card-subtitle {
  margin-top: -15px;
  font-size: 12px;
  color: #999da0;
  font-weight: 500;
}
.card-desc {
  margin-top: -5px;
  font-size: 14px;
}

/* education */
.edu-card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.01)
  );
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 6px 30px rgba(2, 6, 23, 0.6);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
  border-radius: 50px;
  padding: 20px;
  flex: 1;
  flex-direction: column;
  display: flex;
}
.edu-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 60px rgba(2, 6, 23, 0.7);
}
.edu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.edu-header-text {
  display: flex;
  flex-direction: column;
}
.edu-logo {
  width: 150px;
  height: 150px;
  margin-bottom: 50px;
  object-fit: contain;
  flex-shrink: 0;
}
.edu-title {
  font-size: 30px;
}
.edu-school {
  font-size: 24px;
  margin-top: -15px;
  color: #999da0;
}
.edu-year {
  font-size: 20px;
  margin-top: -30px;
  color: #999da0;
}
.edu-desc {
  margin-top: -40px;
  padding: 0;
}
.edu-item {
  align-content: center;
  list-style-type: none;
  font-size: 15px;
  margin-top: 40px;
  text-align: center;
}

/* chips */
.project-skills {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.project-chip {
  font-size: 10px;
  background: rgba(19, 19, 19, 0.6);
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 600;
}

/* skills section */
.skills {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.skills-title {
  margin-top: 75px;
  font-size: 36px;
  align-self: center;
  text-align: center;
}
.skills-chip {
  font-size: 16px;
  background: rgba(19, 19, 19, 0.6);
  padding: 12px;
  border-radius: 999px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.chip-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}
.skills-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 30px rgba(2, 6, 23, 0.7);
}

/* footer */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.02);
  padding: 10px 0;
  text-align: center;
  font-size: 14px;
}

/* reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: all 0.7s ease;
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Modal backdrop & panel ─────────────────────────────────────────── */
#project-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
#project-modal.open {
  pointer-events: all;
  opacity: 1;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
}
.modal-panel {
  position: relative;
  z-index: 1;
  background: #0d0d0d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  width: min(96vw, 1300px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
  transform: translateY(30px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
#project-modal.open .modal-panel {
  transform: translateY(0) scale(1);
}
.modal-close {
  position: sticky;
  top: 16px;
  float: right;
  margin: 16px 16px 0 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 10;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ─── Modal inner layout ─────────────────────────────────────────────── */
.modal-inner {
  display: grid;
  grid-template-columns: 1fr;
}

/* ─── Modal video ────────────────────────────────────────────────────── */
.modal-media {
  position: relative;
  width: 105%;
  max-height: 480px;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
  background: #111;
}
#modal-video {
  width: 100%;
  height: 480px;
  object-fit: cover;
  display: block;
}

/* ─── Modal content ──────────────────────────────────────────────────── */
.modal-content {
  padding: 32px 28px;
  max-width: 90%;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  gap: 4px;
  text-align: center;
}
.modal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
  justify-content: center;
}
.modal-chips .project-chip {
  font-size: 12px;
  padding: 6px 12px;
  background: rgba(46, 46, 46, 0.6);
}
.modal-title {
  font-size: 30px;
  margin: 30px 0 4px 0;
  line-height: 1.2;
}
.modal-company {
  font-size: 16px;
  color: #999da0;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.team-size {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: #999da0;
}
.team-size svg {
  vertical-align: middle;
  opacity: 0.8;
}
.modal-tagline {
  font-size: 16px;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 12px 0;
}
.modal-section-label {
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
  margin: 30px 0 6px 0;
}
.modal-overview {
  font-size: 14px;
  color: #cfd8df;
  line-height: 1.65;
  white-space: pre-line;
  margin: 0;
}
.modal-contributions {
  margin: 0 auto;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.modal-contributions li {
  font-size: 14px;
  color: #cfd8df;
  line-height: 1.5;
}
.modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  justify-content: center;
}
.modal-link-btn {
  display: inline-block;
  padding: 9px 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}
.modal-link-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
}

/* responsive */
@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-avatar {
    order: 4;
    width: 200px;
    height: 200px;
    margin: auto;
  }
  .hero-actions {
    order: 5;
    justify-content: center;
  }
  .name {
    order: 1;
  }
  .subtitle {
    order: 2;
  }
  .biography {
    order: 3;
  }
}
