/* ============================================================
   RESET & ROOT
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0A0F1E;
  --bg-card: #111827;
  --bg-border: #1E2D50;
  --accent: #4FC3F7;
  --accent-dim: #1A3A5C;
  --text: #F0F4FF;
  --text-muted: #8B9CC8;
  --text-dim: #4A5A80;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 8px;
  --transition: 250ms ease;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

li {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

.mono {
  font-family: var(--font-mono);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ============================================================
   SPLASH SCREEN
   ============================================================ */
.pre {
  height: 100vh;
  width: 100vw;
  position: fixed;
  background-color: var(--bg);
  display: grid;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  overflow: hidden;
  /* Step 1: sit visible, Step 2: fade out + slide up */
  animation: pre-exit 0.6s 0.8s cubic-bezier(0.7, 0, 1, 1) forwards;
}

.pre-content {
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  /* Logo: fades in, holds, then fades out — no scaling */
  animation: logo-show 0.8s 0.1s ease-in-out forwards;
}

.pre .splash-img {
  /* Large enough to be crisp and prominent, but NEVER scaled up */
  height: 42vh;
  width: auto;
  max-width: 80vw;
  object-fit: contain;
  filter: drop-shadow(0 0 40px rgba(79, 195, 247, 0.15));
}

/* Whole overlay slides up and away */
@keyframes pre-exit {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-100vh); }
}

/* Logo fades in, holds, fades out cleanly */
@keyframes logo-show {
  0%   { opacity: 0; transform: translateY(12px); }
  15%  { opacity: 1; transform: translateY(0); }
  75%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-8px); }
}

/* ============================================================
   NAVBAR
   ============================================================ */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bg-border);
  transition: transform var(--transition);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 44px;
  width: auto;
  display: block;
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.logo-text {
  font-family: 'Great Vibes', cursive;
  font-size: 2.4rem;
  color: #ffffff;
  margin-left: -6px;
  line-height: 1;
  font-weight: 400;
  transform: translateY(4px);
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.2);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  transition: color var(--transition);
}

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

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

#grid-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.35;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  padding-top: 6rem;
}

.hero-tag {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.6s 0.3s forwards ease;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 9vw, 7.5rem);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -2px;
  color: var(--text);
  opacity: 0;
  animation: fadeUp 0.6s 0.5s forwards ease;
}

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

.hero-role {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--text-muted);
  margin-top: 1.2rem;
  opacity: 0;
  animation: fadeUp 0.6s 0.7s forwards ease;
}

.typewriter {
  color: var(--accent);
}

.cursor {
  color: var(--accent);
  animation: blink 1s infinite;
}

.hero-sub {
  font-size: 1rem;
  color: var(--text-dim);
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  opacity: 0;
  animation: fadeUp 0.6s 0.9s forwards ease;
}

.hero-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.6s 1.1s forwards ease;
}

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  right: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  opacity: 0;
  animation: fadeIn 1s 1.5s forwards ease;
}

.hero-scroll span {
  font-size: 0.7rem;
  color: var(--text-dim);
  writing-mode: vertical-rl;
  letter-spacing: 0.1em;
}

.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s infinite;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-block;
  padding: 0.75rem 1.8rem;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--bg-border);
}

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

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding: 7rem 0;
}

.section-label {
  display: block;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text);
  margin-bottom: 3rem;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about {
  background: var(--bg-card);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 5rem;
  align-items: start;
}

.about-image-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.image-frame {
  position: relative;
  border: 1.5px solid var(--bg-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  aspect-ratio: 1/1;
  max-height: 420px;
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-placeholder-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  pointer-events: none;
}

.profile-photo:not([src="assets/profile.jpg"])+.image-placeholder-text {
  display: none;
}

.image-frame:not(.no-photo) .image-placeholder-text {
  display: none;
}

.image-frame.no-photo .image-placeholder-text {
  display: flex;
}

.about-badge {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.badge-text {
  font-size: 0.8rem;
  color: var(--accent);
}

.badge-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.about-text p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.2rem;
}

.about-facts {
  display: flex;
  gap: 2.5rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--bg-border);
}

.fact {
  display: flex;
  flex-direction: column;
}

.fact-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.fact-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

/* ============================================================
   SKILLS
   ============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.skill-category {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius);
  padding: 1.8rem;
  transition: border-color var(--transition);
}

.skill-category:hover {
  border-color: var(--accent);
}

.skill-cat-title {
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  font-weight: 500;
}

.skill-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.skill-item:hover {
  color: var(--text);
}

.skill-icon {
  font-size: 1rem;
}

/* ============================================================
   PROJECTS
   ============================================================ */
.projects {
  background: var(--bg-card);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--bg);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.project-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1.2rem 1.4rem 0;
}

.project-type {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-badge {
  font-size: 0.65rem;
  background: var(--accent);
  color: var(--bg);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.project-links {
  margin-left: auto;
}

.project-link {
  font-size: 0.78rem;
  color: var(--text-dim);
  transition: color var(--transition);
}

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

.project-img-wrap {
  position: relative;
  margin: 1rem 1.4rem;
  border-radius: 4px;
  overflow: hidden;
  height: 180px;
  background: var(--bg-card);
}

.project-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-img-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.project-img-wrap img[style*="display:none"]+.project-img-placeholder {
  display: flex;
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0 1.4rem;
  margin-bottom: 0.6rem;
  color: var(--text);
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0 1.4rem;
  flex: 1;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.2rem 1.4rem;
}

.tag {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  background: var(--accent-dim);
}

/* ============================================================
   EDUCATION
   ============================================================ */
.edu-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.edu-item {
  display: flex;
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--bg-border);
}

.edu-item:last-child {
  border-bottom: none;
}

.edu-line {
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--bg-border));
  border-radius: 2px;
  flex-shrink: 0;
  min-height: 80px;
}

.edu-year {
  display: block;
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.edu-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.edu-place {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.edu-note {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  background: var(--bg-card);
}

.contact-intro {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 520px;
  margin-bottom: 2.5rem;
}

.contact-email {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.contact-email:hover {
  color: #ffffff;
}

.contact-form {
  max-width: 680px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.form-row .form-group {
  margin-bottom: 0;
}

label {
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
textarea {
  background: var(--bg);
  border: 1.5px solid var(--bg-border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--transition);
  outline: none;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

.form-status {
  font-size: 0.8rem;
  margin-top: 1rem;
  color: var(--accent);
  min-height: 1.2rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--bg);
  border-top: 1px solid var(--bg-border);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-name {
  font-size: 0.85rem;
  color: var(--text);
}

.footer-copy {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  transition: color var(--transition);
}

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

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

@keyframes scrollPulse {
  0% {
    transform: scaleY(1);
    opacity: 1;
  }

  50% {
    transform: scaleY(0.6);
    opacity: 0.4;
  }

  100% {
    transform: scaleY(1);
    opacity: 1;
  }
}

/* scroll-triggered fade */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .image-frame {
    max-height: 280px;
    aspect-ratio: 1/1;
  }

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

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    gap: 1.8rem;
    border-bottom: 1px solid var(--bg-border);
  }

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

  .hamburger {
    display: flex;
  }

  .hero-name {
    letter-spacing: -1px;
  }

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

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

  .form-row {
    grid-template-columns: 1fr;
  }

  .image-frame {
    width: 250px;
    height: 300px;
    margin: 0 auto;
    aspect-ratio: auto;
  }

  .about-facts {
    flex-wrap: wrap;
    gap: 1.5rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .section {
    padding: 4rem 0;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}