/* RESET */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* THEME VARIABLES */
:root{
  --bg: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  --surface: rgba(255,255,255,0.95);
  --text: #111;
  --text-inverse: #fff;
  --muted: #555;
  --shadow: 0 2px 10px rgba(0,0,0,0.05);
  --border: rgba(0,0,0,0.08);
  --card-bg: #fff;
  --tag-bg: #f0f0f0;
  --accent-last: #007aff;
}

:root[data-theme="dark"]{
  --bg: linear-gradient(135deg, #0b1220 0%, #0b1220 100%);
  --surface: rgba(17,17,17,0.85);
  --text: #e5e7eb;
  --text-inverse: #111;
  --muted: rgba(229,231,235,0.72);
  --shadow: 0 2px 16px rgba(0,0,0,0.35);
  --border: rgba(255,255,255,0.12);
  --card-bg: rgba(255,255,255,0.06);
  --tag-bg: rgba(255,255,255,0.10);
  --accent-last: #60a5fa;
}

/* BASE */
body{
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  scroll-behavior: smooth;
}

/* NAVBAR */
.navbar{
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 1.2rem 2.2rem;
  background: var(--surface);
  backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: var(--shadow);
  border-bottom: 1px solid var(--border);
}

.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.brand-logo{
  height: 34px;
  width: auto;
  opacity: 0;
  transform: translateY(2px);
  animation: logoFade 0.6s ease forwards;
}

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

.brand-name{
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

#last-name{
  color: var(--accent-last);
  font-weight: 800;
}

/* Cursor */
.cursor{
  margin-left: 2px;
  color: var(--text);
  animation: blink 1s infinite;
}

@keyframes blink{
  0%,50%{ opacity: 1; }
  51%,100%{ opacity: 0; }
}

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

.nav-links a{
  position: relative;
  margin-left: 2rem;
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--muted);
  padding-bottom: 4px;
  transition: color 0.25s ease;
}

.nav-links a::after{
  content:"";
  position: absolute;
  left: 0; bottom: 0;
  width: 0%;
  height: 2px;
  background: var(--text);
  transition: width 0.25s ease;
}

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

.nav-links a:hover::after{
  width: 100%;
}

/* Theme toggle */
.theme-toggle{
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.20);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
  white-space: nowrap;
  font-size: 0.85rem;
}
:root[data-theme="dark"] .theme-toggle{
  background: rgba(255,255,255,0.08);
}
.theme-toggle:hover{ transform: translateY(-1px); }
.theme-toggle:active{ transform: translateY(0); }

/* SCROLL INDICATOR */
.scroll-indicator{
  position: fixed;
  right: 2.2rem;
  bottom: 1.6rem;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.25s ease;
}
.scroll-indicator .arrow{
  font-size: 1.1rem;
  animation: bounce 1.5s infinite;
}
@keyframes bounce{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(6px); }
}

/* HERO */
.hero{
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem 2rem 4rem;
  text-align: center;
}

.hero-text{ max-width: 760px; }

.role-badges{
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.badge{
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-block;
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}

.badge-orange{ background: #ff9500; color: #fff; animation-delay: 0.2s; }
.badge-blue{ background: #007aff; color: #fff; animation-delay: 0.4s; }

@keyframes fadeInUp{
  from{ opacity: 0; transform: translateY(20px); }
  to{ opacity: 1; transform: translateY(0); }
}

.hero-text h1{
  font-size: 3.4rem;
  font-weight: 800;
  margin-bottom: 1.3rem;
  line-height: 1.1;
  animation: fadeIn 1s ease forwards;
  animation-delay: 0.6s;
  opacity: 0;
}

.hero-text p{
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto 2.2rem;
  color: var(--muted);
  animation: fadeIn 1s ease forwards;
  animation-delay: 0.8s;
  opacity: 0;
}

.cta-button{
  display: inline-block;
  padding: 1rem 2.5rem;
  background: var(--text);
  color: var(--text-inverse);
  text-decoration: none;
  border-radius: 999px;
  font-weight: 650;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  animation: fadeIn 1s ease forwards;
  animation-delay: 1s;
  opacity: 0;
}
.cta-button:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
  opacity: 0.95;
}

@keyframes fadeIn{
  from{ opacity: 0; transform: translateY(10px); }
  to{ opacity: 1; transform: translateY(0); }
}

/* SECTIONS */
section{
  padding: 5rem 2rem;
}
section h2{
  font-size: 2.5rem;
  margin-bottom: 3rem;
  text-align: center;
  font-weight: 800;
}

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

.projects-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1150px;
  margin: 0 auto;
}

.project-card{
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  opacity: 0;
  transform: translateY(60px);
}

:root[data-theme="dark"] .project-card{
  box-shadow: 0 10px 30px rgba(0,0,0,0.30);
}

.project-card.in-view{
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover{
  transform: translateY(-8px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.14);
}

.project-image{
  height: 200px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.project-placeholder{
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  opacity: 0.95;
}

.project-card h3{
  font-size: 1.25rem;
  margin: 1.4rem 1.4rem 0.5rem;
}

.project-card p{
  margin: 0 1.4rem 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.tags{
  display: flex;
  gap: 0.5rem;
  margin: 0 1.4rem 1rem;
  flex-wrap: wrap;
}

.tags span{
  padding: 0.3rem 0.8rem;
  background: var(--tag-bg);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  border: 1px solid var(--border);
}

.links{
  display: flex;
  gap: 1rem;
  margin: 0 1.4rem 1.4rem;
}

.links a{
  padding: 0.5rem 1.2rem;
  text-decoration: none;
  color: var(--text);
  border: 2px solid var(--text);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  transition: background 0.25s ease, color 0.25s ease;
}

.links a:hover{
  background: var(--text);
  color: var(--text-inverse);
}

/* ABOUT */
.about-section{
  background: rgba(255,255,255,0.35);
}
:root[data-theme="dark"] .about-section{
  background: rgba(255,255,255,0.04);
}

.about-content{
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.about-content p{
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 1.4rem;
}

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

.contact-intro{
  text-align: center;
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 3rem;
}

.contact-links{
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto;
}

.contact-link{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.4rem 1.8rem;
  background: rgba(255,255,255,0.45);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
  min-width: 150px;
}
:root[data-theme="dark"] .contact-link{
  background: rgba(255,255,255,0.06);
}

.contact-link:hover{
  transform: translateY(-4px);
  background: var(--text);
  color: var(--text-inverse);
}

.contact-link span:first-child{
  font-size: 2rem;
}

/* FOOTER */
.footer{
  text-align: center;
  padding: 2rem;
  background: rgba(0,0,0,0.85);
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
}

/* REVEAL */
.reveal{
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s ease;
}
.reveal.active{
  opacity: 1;
  transform: translateY(0);
}

/* MOBILE */
@media (max-width: 768px){
  .navbar{
    padding: 1rem 1.2rem;
    flex-wrap: wrap;
  }

  .brand{
    min-width: auto;
  }

  .brand-logo{
    height: 26px;
  }

  .brand-name{
    font-size: 0.9rem;
  }

  .nav-links{
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 10px;
  }

  .nav-links a{
    margin-left: 1.1rem;
    margin-right: 1.1rem;
    font-size: 0.85rem;
  }

  .scroll-indicator{ display: none; }

  .hero{
    padding: 7rem 1.2rem 3rem;
    min-height: 90vh;
  }

  .hero-text h1{
    font-size: 2.25rem;
  }

  .hero-text p{
    font-size: 1rem;
  }

  section{
    padding: 3.2rem 1.2rem;
  }

  section h2{
    font-size: 2rem;
  }

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

  .contact-links{
    flex-direction: column;
  }

  .contact-link{
    flex-direction: row;
    justify-content: center;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}