/* ─── Fonts ─── */
@import url("https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Sora:wght@300;400;500;600;700;800&display=swap");

/* ─── Variables ─── */
:root {
  --accent: #00acff;
  --accent-dim: rgba(0, 172, 255, 0.12);
  --accent-glow: 0 0 30px rgba(0, 172, 255, 0.28);
  --bg: #080b0f;
  --bg-card: #0e1318;
  --bg-alt: #0a0e13;
  --border: rgba(0, 172, 255, 0.12);
  --border-hover: rgba(0, 172, 255, 0.45);
  --text: #e8edf2;
  --text-muted: #7a8a9a;
  --text-dim: #3d4a57;
  --mono: "Space Mono", monospace;
  --sans: "Sora", sans-serif;
  --h: 70px;
  --radius: 10px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ─── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  font-size: 16px;
}
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}
a {
  text-decoration: none;
  color: inherit;
}
img {
  display: block;
  max-width: 100%;
}
button {
  cursor: pointer;
  font-family: var(--sans);
}

/* ─── Noise overlay ─── */
.noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.4;
}

/* ─── Container ─── */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ─── Header ─── */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--h);
  padding: 0 5%;
  background: rgba(8, 11, 15, 0.75);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
}
.logo-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.logo-brand {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
}
.logo-img {
  height: 38px;
  width: 38px;
  border-radius: 8px;
  object-fit: contain;
  transition:
    transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
.logo-img:hover {
  transform: scale(1.08);
  box-shadow: 0 0 16px rgba(0, 172, 255, 0.4);
}

nav {
  display: flex;
  gap: 2.5rem;
}
.nav-link {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  transition: color 0.2s;
  position: relative;
}
.nav-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.25s var(--ease);
}
.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--accent);
  transition: all 0.3s var(--ease);
}
.menu-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── Section base ─── */
section {
  min-height: 100vh;
  padding: 7rem 5% 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
section#home {
  padding-top: calc(var(--h) + 3rem);
}
.alt-bg {
  background: var(--bg-alt);
}

.section-header {
  margin-bottom: 3.5rem;
}
.section-label {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.5rem;
}
.section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

/* ─── Home ─── */
#home {
  position: relative;
}
.home-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5rem;
  align-items: center;
  max-width: 1180px;
  width: 100%;
}

.home-greeting {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.home-text h1 {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: 1.2rem;
}
.name-accent {
  color: var(--accent);
}

.typing-line {
  font-family: var(--mono);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 1.8rem;
  min-height: 2rem;
}
.typing-prefix {
  color: var(--text-dim);
}
#typed-text {
  color: var(--accent);
}
.cursor {
  color: var(--accent);
  animation: blink 0.7s step-end infinite;
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.home-bio {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--accent);
  color: #080b0f;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.75rem 1.8rem;
  border-radius: var(--radius);
  border: none;
  transition: all 0.25s var(--ease);
  align-self: flex-start;
}
.btn-cta:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: var(--accent-glow);
}

.social-row {
  display: flex;
  gap: 0.8rem;
}
.social-btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: all 0.25s var(--ease);
}
.social-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--accent-glow);
}

/* Profile photo */
.home-photo {
  position: relative;
}
.photo-frame {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent);
  box-shadow:
    var(--accent-glow),
    inset 0 0 40px rgba(0, 212, 255, 0.05);
  transition: all 0.35s var(--ease);
}
.photo-frame:hover {
  transform: scale(1.03);
  box-shadow: 0 0 50px rgba(0, 212, 255, 0.4);
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-tag {
  position: absolute;
  bottom: 10px;
  right: -10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  animation: float 2.5s ease-in-out infinite;
  text-decoration: none;
}
@keyframes float {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(6px);
  }
}

/* ─── Projects ─── */
#projects {
  align-items: flex-start;
  padding-top: 6rem;
}
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.3s var(--ease);
  display: grid;
  grid-template-columns: 380px 1fr;
}
.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.4),
    var(--accent-glow);
}

/* Remove the old .featured special rules — all cards are featured now */
.project-card.featured {
  grid-column: unset;
  grid-template-columns: 380px 1fr;
}

.card-img {
  position: relative;
  overflow: hidden;
  background: #0a0e13;
  height: 100%;
  min-height: 240px;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.project-card:hover .card-img img {
  transform: scale(1.06);
}

.card-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 212, 255, 0.08) 0%,
    transparent 60%
  );
}
.featured-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--accent);
  color: #080b0f;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
}

.card-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.card-body h3 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.card-body p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tags span {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(0, 172, 255, 0.2);
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.card-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: auto;
}
.card-actions a,
.card-actions button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.2s var(--ease);
  border: none;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border) !important;
  color: var(--text-muted);
}
.btn-outline:hover {
  border-color: var(--accent) !important;
  color: var(--accent);
}
.card-actions button {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(0, 172, 255, 0.2);
}
.card-actions button:hover {
  background: var(--accent);
  color: #080b0f;
  transform: translateY(-1px);
}

.more-link {
  text-align: center;
}

/* ─── Skills ─── */
#skills {
  align-items: flex-start;
  padding-top: 6rem;
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.skill-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  transition: all 0.3s var(--ease);
}
.skill-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--accent-glow);
}
.skill-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-dim);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
}
.skill-card h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  color: var(--text);
}
.skill-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.skill-card li {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.skill-card li::before {
  content: "▹";
  color: var(--accent);
  font-size: 0.7rem;
}

/* ─── Education ─── */
#education {
  align-items: flex-start;
  padding-top: 6rem;
}
.edu-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 3rem;
  max-width: 900px;
}
.edu-year {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.8rem;
}
.edu-main h3 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
  color: var(--text);
}
.edu-main h4 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.edu-main p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.edu-certs h5 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.edu-certs ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.edu-certs li {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-left: 1.2rem;
  position: relative;
}
.edu-certs li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ─── About ─── */
#about {
  align-items: flex-start;
  padding-top: 6rem;
}
.about-content {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.about-content p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.85;
}
.about-tagline {
  font-size: 1rem !important;
  color: var(--text) !important;
  font-weight: 600;
}
.about-tagline span {
  color: var(--accent);
}

/* ─── Contact ─── */
#contact {
  align-items: flex-start;
  padding-top: 6rem;
}
.contact-content {
  max-width: 600px;
}
.contact-content > p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 2.5rem;
}
.contact-links {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.contact-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1.5rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
  min-width: 130px;
  transition: all 0.25s var(--ease);
}
.contact-link i {
  font-size: 1.6rem;
  color: var(--accent);
}
.contact-link:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--accent-glow);
  color: var(--text);
}

/* ─── Footer ─── */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 2rem 5%;
  text-align: center;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.8rem;
}
footer span {
  color: var(--accent);
}

/* ─── Modal ─── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
}
.modal.open {
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-box {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: 16px;
  width: 92vw;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.5rem;
  animation: slideUp 0.3s var(--ease);
}
@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: sticky;
  float: right;
  top: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  line-height: 1;
  transition: color 0.2s;
  z-index: 2;
  margin-bottom: 0.5rem;
}
.modal-close:hover {
  color: var(--accent);
}

/* Modal details content */
#modal-details h2 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
  margin-bottom: 0.8rem;
}
#modal-details h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin: 1.5rem 0 0.6rem;
  font-family: var(--mono);
  letter-spacing: 0.05em;
}
#modal-details p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 0.8rem;
}
#modal-details ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
#modal-details li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding-left: 1.4rem;
  position: relative;
  line-height: 1.6;
}
#modal-details li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Modal gallery */
#modal-gallery {
  display: none;
  margin-bottom: 1.5rem;
}
.gallery-viewer {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #060810;
  height: 60vh;
}
.gallery-viewer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: #fff;
  padding: 1rem 0.8rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 2;
}
.gallery-nav:hover {
  background: var(--accent);
  color: #080b0f;
}
.gallery-nav.prev {
  left: 0;
  border-radius: 0 6px 6px 0;
}
.gallery-nav.next {
  right: 0;
  border-radius: 6px 0 0 6px;
}
.gallery-counter {
  text-align: center;
  margin-top: 0.8rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ─── Responsive ─── */
@media (max-width: 1100px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .home-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }
  .home-photo {
    display: flex;
    justify-content: center;
    order: -1;
  }
  .home-bio,
  .home-text h1 {
    margin-left: auto;
    margin-right: auto;
  }
  .home-actions {
    align-items: center;
  }
  .btn-cta {
    align-self: center;
  }
  .project-card,
  .project-card.featured {
    grid-template-columns: 1fr;
  }
  .card-img {
    height: 220px;
    min-height: unset;
  }
  .edu-card {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }
  nav {
    position: fixed;
    top: var(--h);
    left: 0;
    right: 0;
    background: rgba(8, 11, 15, 0.98);
    backdrop-filter: blur(14px);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    transition: transform 0.35s var(--ease);
  }
  nav.open {
    transform: translateY(0);
  }
  .nav-link {
    font-size: 1rem;
  }
  section {
    padding: 5rem 5% 4rem;
    min-height: auto;
  }
  section#home {
    min-height: 100vh;
  }
  .photo-frame {
    width: 220px;
    height: 220px;
  }
  .modal-box {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
  .contact-links {
    flex-direction: column;
  }
  .contact-link {
    flex-direction: row;
    min-width: unset;
    width: 100%;
  }
  .home-text h1 {
    font-size: 2.8rem;
  }
}
