/* =========================
   Design Tokens (Reusable Palette)
   ========================= */
:root {
  /* Core colors */
  --primary: #22c55e;    
  

    --secondary: #1e3a8a;       /* Titles & headers ONLY (dark, strong) */

  --accent: #e5e7eb;
  --bg: #f9fafb;

  /* Text */
  --text-dark: #0f172a;
  --text-muted: #64748b;     
  /* Navbar */
  --navbar-bg: #020617;

  /* Buttons (CTA only) */
  --btn-blue: #2563eb;
  --btn-blue-hover: #1d4ed8;

  --btn-orange: #f97316;
  --btn-orange-deep: #ea580c;

  --btn-shadow: rgba(2, 6, 23, 0.12);
}


/* =========================
   Global Reset
   ========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =========================
   Layout
   ========================= */
.page-wrapper {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  flex: 1 0 auto;
}

.section {
  margin-top: 48px;
}

.section:first-child {
  margin-top: 0;
}

/* =========================
   Titles
   ========================= */
.section-title {
  font-weight: 700;
  color: var(--secondary);
  display: inline-block;
  position: relative;
  margin-bottom: 24px;
  font-size: 1.3rem;
}

h1.section-title {
  margin-bottom: 14px;
}

h3.section-title {
  margin-top: 30px;
  margin-bottom: 14px;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 60px;
  height: 3px;
  border-radius: 999px;
  background: var(--primary);
}

/* Utility */
.text-muted {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Paragraph formatting */
.hero-desc,
.about-text p:first-child,
.section-intro,
.contact-intro,
.resume-intro {
  text-indent: 1em;
}

.hero-desc::first-letter,
.about-text p:first-child::first-letter,
.section-intro::first-letter,
.contact-intro::first-letter,
.resume-intro::first-letter {
  font-weight: 700;
  color: var(--primary);
}

/* =========================
   Navbar
   ========================= */
header {
  margin-bottom: 16px;
}

.nav-shell {
  max-width: 1120px;
  margin: 20px auto 0;
  background: var(--navbar-bg);
  border-radius: 999px;
  padding: 10px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #ffffff;
  position: relative;
  overflow: visible;
}

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

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

.nav-center-circle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #111111;
}

.nav-center-text {
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
  text-transform: uppercase;
}

.nav-link {
  position: relative;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 999px;
  color: #f5f5f5;
  text-decoration: none;
  background: transparent;
  transition: background 0.18s ease, color 0.18s ease, transform 0.08s ease;
}

.nav-link:hover {
  background: rgba(14, 165, 164, 0.22);
  color: #ffffff;
  transform: translateY(-1px);
}

.nav-active {
  background: var(--primary);
  color: #111111;
  font-weight: 600;
}

/* Hamburger menu for small screens (hidden on desktop) */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.mobile-menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: #ffffff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* =========================
   Buttons (Unified System)
   ========================= */
.btn,
.social-btn,
.project-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  outline: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

/* Hero buttons container */
.hero-buttons {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
}

.hero-buttons a {
  min-width: 80px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* BLUE Filled (default for hero + socials + project links) */
.btn-primary,
.btn-ghost,
.social-btn,
.project-link-icon {
  background: var(--btn-blue);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.25);
}

.btn-primary:hover,
.btn-ghost:hover,
.social-btn:hover,
.project-link-icon:hover {
  background: var(--btn-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(29, 78, 216, 0.32);
}

/* Social icon inside */
.social-btn i {
  font-size: 1.1rem;
  color: #ffffff;
}

/* Watch Demo (orange) */
.btn-watch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #ffffff;
  background: var(--btn-orange-deep);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.25);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-watch:hover {
  background: var(--btn-orange);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(234, 88, 12, 0.35);
}

/* =========================
   Chips
   ========================= */
.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
  margin-top: 20px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  width: 160px;
  height: 44px;
  padding: 10px 18px;
  border-radius: 999px;

  background: #ffffff;
  border: 1.5px solid rgba(14, 165, 164, 0.35);
  color: var(--text-dark);

  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.06);

  line-height: 1.2;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip span {
  font-weight: 500;
  font-size: 0.96rem;
  white-space: nowrap;
}

.chip-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.chip-compact {
  gap: 6px;
}

.chip-compact .chip-icon {
  width: 16px;
  height: 16px;
}

.chip-compact span {
  font-size: 0.85rem;
}

.chip-neutral {
  padding: 10px 18px;
}

/* =========================
   Home / Hero
   ========================= */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  margin-top: 15px;
}

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

.hero-kicker {
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.9rem;
  margin-bottom: 10px;
  color: var(--text-muted);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.hero-title {
  font-size: 2.8rem;
  margin-bottom: 4px;
  font-weight: 700;
  color: var(--text-dark);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.5s forwards;
}

/* Hero photo */
.hero-photo-wrapper {
  position: relative;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 6px solid #e6e6e6;
  margin-left: 180px;
  overflow: hidden;
  flex-shrink: 0;
}

.hero-photo-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-desc {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 26px;
}

/* =========================
   Wave Animation for palm emoji
   ========================= */
.animate-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.animate-kicker::after {
  content: "👋";
  display: inline-block;
  transform-origin: 70% 70%;
  animation: wave 0.9s ease-in-out 1;
  animation-delay: 0.25s;
}

@keyframes wave {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(12deg); }
  50% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
  100% { transform: rotate(0deg); }
}

/* =========================
   Typewriter (INDEX + ABOUT)
   ========================= */
.hero-subtitle {
  overflow: hidden;
  white-space: nowrap;
  display: inline-block;
  max-width: 0;
  border-right: 2px solid var(--secondary);
  font-size: 1.1rem;
  color: var(--secondary);
  margin-bottom: 20px;

  --type-width: 42ch;
  --type-delay: 1.3s;
  --type-dur: 3.6s;
  --blink-dur: 0.45s;
  --blink-count: 2;
  --cursor-off: calc(var(--type-delay) + var(--type-dur) + 0.10s);

  animation:
    typeReveal var(--type-dur) linear var(--type-delay) forwards,
    cursorBlink var(--blink-dur) step-end var(--blink-count) var(--type-delay),
    cursorOff 0s var(--cursor-off) forwards;
}

.about-text h3.section-title {
  display: block;
  overflow: visible;
  margin-top: 30px;
  margin-bottom: 35px;
  color: var(--secondary);
  font-size: 1.3rem;
}

@keyframes typeReveal {
  from { max-width: 0; }
  to   { max-width: var(--type-width); }
}

@keyframes cursorBlink {
  0%, 100% { border-right-color: var(--secondary); }
  50%      { border-right-color: transparent; }
}

@keyframes cursorOff {
  to { border-right: 0; }
}

/* =========================
   About / Projects / Contact / Career Overview
   ========================= */
.about-layout {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  margin-top: 32px;
}

.about-photo-frame {
  width: 260px;
  height: 260px;
  border-radius: 24px;
  border: 6px solid #e6e6e6;
  overflow: hidden;
  flex-shrink: 0;
}

.about-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-text {
  flex: 1;
  font-size: 0.98rem;
  color: var(--text-muted);
}

.about-text p + p {
  margin-top: 16px;
}

.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 28px;
}

.project-card {
  display: flex;
  gap: 24px;
  background: #ffffff;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 14px 45px rgba(2, 6, 23, 0.06);
}

.project-images-wrapper {
  margin-top: 30px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: none;
  background: transparent;
}

.project-media {
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
}

.project-media img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.project-media img:hover {
  transform: scale(1.05);
}

.project-thumbs {
  display: flex;
  gap: 12px;
  width: 100%;
}

.project-thumbs img {
  flex: 1;
  min-width: 0;
  height: 150px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid #e6e6e6;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.project-thumbs img:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.12);
}

.project-body {
  flex: 1.3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project-index {
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 6px;
}

.project-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 10px;
  line-height: 1.3;
}

.project-desc {
  font-size: 0.98rem;
  color: #475569;
  line-height: 1.65;
  margin-bottom: 30px;
}

.tech-stack-label {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dark);
  margin-top: 24px;
  margin-bottom: 10px;
}

.project-footer {
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 16px;
  margin-top: 18px;
}

.project-links {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  justify-content: center;
}

/* Contact */
section#contact {
  margin-top: 5px;
}

.contact-intro {
  max-width: 620px;
  margin-top: 16px;
  color: var(--text-muted);
}

.contact-form-wrapper {
  margin-top: 26px;
  max-width: 620px;
  background: #ffffff;
  border-radius: 20px;
  padding: 24px 24px 28px;
  box-shadow: 0 12px 40px rgba(2, 6, 23, 0.06);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-row label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
}

.form-row input,
.form-row textarea {
  border-radius: 10px;
  border: 1px solid #cbd5e0;
  padding: 9px 11px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 1px rgba(30, 58, 138, 0.22);
}

.form-row textarea {
  resize: vertical;
  min-height: 140px;
}

/* If you already have .form-actions in HTML, this aligns submit nicely */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}

/* Fallback: if there's NO .form-actions, try to right-align the submit without :has() */
.contact-form-wrapper form button[type="submit"],
.contact-form-wrapper form input[type="submit"] {
  display: inline-flex;
  margin-left: auto;
}

/* Career */
.resume-intro {
  margin-top: 16px;
  color: var(--text-muted);
}

.resume-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Footer */
footer {
  margin-top: 40px;
  padding: 18px 16px;
  background: #020617;
  color: #93a4b8;
  text-align: center;
  font-size: 0.8rem;
}

/* =========================
   Lightbox Modal
   ========================= */
.lightbox-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: fadeIn 0.2s ease;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-modal img {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: zoomIn 0.3s ease;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 3rem;
  color: #ffffff;
  font-weight: 300;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.lightbox-close:hover {
  transform: scale(1.1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* =========================
   Page Loader
   ========================= */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.page-loader.active {
  opacity: 1;
}

.loader-spinner {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Page transitions */
.page-fade-out {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.page-fade-in {
  animation: pageSlideIn 0.3s ease forwards;
}

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

/* Error page */
.error-page {
  text-align: center;
  padding: 80px 20px;
}

.error-page h1 {
  font-size: 5rem;
  color: var(--primary);
  margin-bottom: 10px;
}

.error-page p {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 30px;
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 900px) {
  .hero {
    flex-direction: column-reverse;
    align-items: flex-start;
  }

  .hero-photo-wrapper {
    align-self: center;
    margin-left: 0;
  }

  .about-layout {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-card {
    flex-direction: column;
  }

  .project-body {
    flex: 1;
  }

  .project-images-wrapper {
    margin-top: 20px;
  }

  .hero-buttons {
    flex-wrap: wrap;
  }

  .nav-shell {
    padding: 8px 18px;
    gap: 16px;
  }

  .nav-link {
    padding: 6px 12px;
    font-size: 0.82rem;
  }

  .nav-center-text {
    display: none;
  }
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-shell {
    flex-wrap: wrap;
    padding: 12px 16px;
    border-radius: 24px;
  }

  .nav-center-logo {
    order: 1;
    flex: 1;
    justify-content: center;
  }

  .mobile-menu-toggle {
    order: 0;
  }

  .nav-links {
    order: 3;
    width: 100%;
    flex-direction: column;
    gap: 8px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
  }

  .nav-shell.mobile-menu-open .nav-links {
    opacity: 1;
    margin-top: 14px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-link {
    width: 100%;
    text-align: center;
    padding: 12px 18px;
  }

  .chip {
    width: 170px;
    height: 44px;
  }

  .hero {
    flex-direction: column;
    gap: 30px;
  }

  .hero-photo-wrapper {
    order: -1;
    max-width: 280px;
  }

  .hero-buttons {
    flex-wrap: wrap;
    justify-content: center;
  }

  .project-thumbs {
    flex-wrap: wrap;
  }

  .project-thumbs img {
    min-width: calc(50% - 6px);
    height: 120px;
  }

  .project-title {
    font-size: 1.1rem;
  }

  .project-desc {
    font-size: 0.9rem;
    margin-bottom: 20px;
  }

  .project-footer {
    flex-wrap: wrap;
  }

  .project-links {
    justify-content: flex-start;
  }

  .about-photo-frame {
    align-self: center;
  }
}

@media (max-width: 480px) {
  .project-card {
    padding: 16px;
  }

  .project-media img {
    border-radius: 12px;
  }

  .project-thumbs {
    gap: 8px;
  }

  .project-thumbs img {
    min-width: 100%;
    height: 100px;
  }

  .project-title {
    font-size: 1rem;
  }

  .project-index {
    font-size: 0.8rem;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .chip {
    width: 100%;
    max-width: 200px;
  }

  .chips-row {
    gap: 10px;
  }
}

/* =========================
   Focus styles
   ========================= */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible,
.project-link-icon:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.mobile-menu-toggle:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
}

/* =========================
   Animations
   ========================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================
   Video Modal
   ========================= */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.video-modal.is-open {
  display: block;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.video-modal-dialog {
  position: relative;
  width: min(920px, calc(100% - 32px));
  margin: 60px auto;
  background: #0f172a;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.video-modal-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-modal-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.video-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.video-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.video-modal-title {
  padding: 12px 16px 16px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

/* Prevent background scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

@media (max-width: 520px) {
  .video-modal-dialog {
    margin: 24px auto;
  }
}
