/* ========================================
   CSS CUSTOM PROPERTIES
   ======================================== */
:root {
  --bg-primary: #541A1A;
  --bg-secondary: #541d1d;
  --bg-card: #4B2E2B;
  --bg-card-hover: #23211a;
  --bg-elevated: #F1E2D1;
  --text-primary: #f0ece4;
  --text-secondary: #a8a295;
  --text-muted: #706b61;
  --accent: #c9a96e;
  --accent-light: #dfc596;
  --accent-dim: #8a7548;
  --border: rgba(201, 169, 110, 0.12);
  --border-strong: rgba(201, 169, 110, 0.25);
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--bg-primary);
}

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

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

/* ========================================
   NAVIGATION
   ======================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
  background: rgba(255, 255, 255, 0.04); 
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
  
  transition: background 0.5s ease, box-shadow 0.5s ease, padding 0.4s ease;
}

.nav.scrolled {
  background: rgba(75, 46, 43, 0.7); 
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); 
  border-bottom: 1px solid rgba(255, 255, 255, 0.08); 
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  transition: color 0.3s;
}

.nav-logo span {
  color: var(--accent);
}

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

.nav-links a {
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.3s, letter-spacing 0.4s var(--ease-out);
  position: relative;
  padding: 0.3rem 0;
}

.nav-links a::before,
.nav-links a::after {
  position: absolute;
  font-family: var(--font-display);
  font-size: 1.1em;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.3s, transform 0.4s var(--ease-out);
}

.nav-links a::before {
  content: '[';
  left: -0.6em;
  transform: translateX(4px);
}

.nav-links a::after {
  content: ']';
  right: -0.6em;
  transform: translateX(-4px);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  letter-spacing: 0.16em;
}

.nav-links a:hover::before,
.nav-links a:hover::after,
.nav-links a.active::before,
.nav-links a.active::after {
  opacity: 1;
  transform: translateX(0);
}

.nav-cta {
  font-size: 0.82rem !important;
  letter-spacing: 0.12em !important;
  padding: 0.75rem 1.8rem !important;
  border: 1px solid var(--accent-dim);
  color: var(--accent) !important;
  transition: all 0.3s var(--ease-smooth) !important;
}

.nav-cta::before,
.nav-cta::after { display: none !important; }

.nav-cta:hover {
  background: var(--accent);
  color: var(--bg-primary) !important;
  border-color: var(--accent);
  letter-spacing: 0.12em !important;
}

/* Mobile menu */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px;
}

.nav-toggle span {
  width: 24px;
  height: 1.5px;
  background: var(--text-primary);
  transition: all 0.3s var(--ease-smooth);
  transform-origin: center;
}

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

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

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

/* ========================================
   HERO — SPLIT LAYOUT
   ======================================== */
.hero {
  min-height: 100vh;
  display: flex;
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(6rem, 10vh, 8rem) clamp(2rem, 6vw, 5rem);
  position: relative;
  z-index: 2;
}

.hero-label {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  opacity: 0;
  animation: fadeSlideUp 0.8s var(--ease-out) 0.2s forwards;
}

.hero-label::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--accent);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 5.5vw, 5rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeSlideUp 0.8s var(--ease-out) 0.4s forwards;
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-tagline {
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 440px;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeSlideUp 0.8s var(--ease-out) 0.6s forwards;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  opacity: 0;
  animation: fadeSlideUp 0.8s var(--ease-out) 0.8s forwards;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.2rem;
  background: var(--accent);
  color: var(--bg-primary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: all 0.4s var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(201, 169, 110, 0.2);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s var(--ease-out);
}

.btn-primary:hover svg {
  transform: translateX(3px);
}

.btn-ghost {
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

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

/* Hero visual side */
.hero-visual {
  position: relative;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(201, 169, 110, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse at 80% 20%, rgba(201, 169, 110, 0.04) 0%, transparent 60%);
}

.hero-code-block {
  position: relative;
  width: 80%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4);
  opacity: 0;
  animation: fadeScale 1s var(--ease-out) 0.5s forwards;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.4;
}

.code-dot:nth-child(1) { background: #e06c60; opacity: 0.7; }
.code-dot:nth-child(2) { background: #e5bf4e; opacity: 0.7; }
.code-dot:nth-child(3) { background: #61c354; opacity: 0.7; }

.code-title {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.code-body {
  padding: 24px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.82rem;
  line-height: 1.9;
  color: var(--text-secondary);
}

.code-body .kw { color: #c792ea; }
.code-body .fn { color: #82aaff; }
.code-body .str { color: #c3e88d; }
.code-body .cm { color: var(--text-muted); font-style: italic; }
.code-body .num { color: #f78c6c; }
.code-body .op { color: #89ddff; }
.code-body .pr { color: var(--accent); }
.code-body .typ { color: #ffcb6b; }

/* Floating decorative elements */
.hero-float {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--border);
  animation: float 6s ease-in-out infinite;
}

.hero-float-1 {
  width: 120px;
  height: 120px;
  top: 15%;
  right: 10%;
  animation-delay: 0s;
}

.hero-float-2 {
  width: 60px;
  height: 60px;
  bottom: 25%;
  left: 8%;
  animation-delay: -2s;
}

.hero-float-3 {
  width: 180px;
  height: 180px;
  bottom: 10%;
  right: 20%;
  opacity: 0.4;
  animation-delay: -4s;
}

/* ========================================
   SECTIONS — SHARED
   ======================================== */
.section {
  padding: clamp(5rem, 10vh, 8rem) clamp(1.5rem, 4vw, 3rem);
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-label::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent-dim);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 500;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.8;
  margin-bottom: 3.5rem;
}

.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  max-width: 1100px;
  margin: 0 auto;
}

/* Scroll animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

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

/* ========================================
   ABOUT
   ======================================== */
.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 4rem;
  align-items: start;
}

.about-photo {
  aspect-ratio: 4/5;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.about-text h3 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-weight: 300;
  font-size: 1.02rem;
  line-height: 1.9;
}

/* ========================================
   PROJECTS
   ======================================== */
/* --- GRID UTAMA --- */
    .projects-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 1.8rem;
    }

    /* --- PROJECT CARD --- */
    .project-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 10px;
      overflow: hidden;
      transition: all 0.4s var(--ease-smooth);
      display: flex;
      flex-direction: column;
      height: 100%;
    }

    .project-card:hover {
      border-color: var(--border-strong);
      transform: translateY(-4px);
      box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    }

    /* --- THUMBNAIL (GAMBAR) --- */
    .project-thumb {
      aspect-ratio: 16/10;
      width: 100%;
      background: var(--bg-secondary);
      position: relative;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    /* Tambahan kursor pointer untuk gambar */
    .project-thumb img {
      cursor: pointer;
      transition: opacity 0.3s ease;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .project-thumb img:hover {
      opacity: 0.8;
    }

    /* --- KONTEN TEKS --- */
    .project-info {
      padding: 1.5rem;
      flex: 1;
      display: flex;
      flex-direction: column;
    }

    .project-name {
      font-family: var(--font-display);
      font-size: 1.5rem;
      font-weight: 500;
      color: var(--text-primary);
      margin-bottom: 0.6rem;
      margin-top: 0;
    }

    .project-desc {
      font-size: 0.95rem;
      color: var(--text-secondary);
      line-height: 1.7;
      margin-bottom: 1.2rem;
      font-weight: 300;
    }

    .project-link {
      font-size: 0.85rem;
      font-weight: 500;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--accent);
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      transition: gap 0.3s var(--ease-out);
      margin-top: auto;
      text-decoration: none;
    }

    .project-link:hover {
      gap: 0.8rem;
    }

    .project-link svg {
      width: 14px;
      height: 14px;
    }

    /* --- WADAH STATISTIK (Khusus Card 1) --- */
    .stats-container {
      display: none; /* Disembunyikan secara default */
      margin-top: 1rem;
      padding-top: 1rem;
      border-top: 1px dashed var(--border);
      animation: fadeIn 0.5s ease;
    }
    
    .stats-container h4 {
      margin: 0 0 10px 0;
      font-size: 0.9rem;
      color: var(--text-primary);
    }

    /* --- DESAIN MODAL / POPUP --- */
    .modal-overlay {
      display: none;
      position: fixed;
      z-index: 9999;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.85);
      backdrop-filter: blur(5px);
      flex-direction: column;
      justify-content: center;
      align-items: center;
    }

    .modal-content {
      max-width: 90%;
      max-height: 85vh;
      object-fit: contain;
      border-radius: 8px;
      box-shadow: 0 5px 15px rgba(0,0,0,0.5);
      animation: zoomIn 0.3s ease;
    }

    .close-modal {
      position: absolute;
      top: 20px;
      right: 40px;
      color: #f1f1f1;
      font-size: 40px;
      font-weight: bold;
      cursor: pointer;
      transition: 0.3s;
    }

    .close-modal:hover { color: #bbb; }

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

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

    /* --- RESPONSIVE --- */
    @media (max-width: 1024px) {
      .projects-grid { grid-template-columns: repeat(2, 1fr); }
    }
    @media (max-width: 768px) {
      .projects-grid { grid-template-columns: 1fr; }
      .close-modal { top: 10px; right: 20px; font-size: 35px; }
    }

/* ========================================
   EXPERIENCE
   ======================================== */
.experience-section {
  background: var(--bg-secondary);
}

.experience-section .section-label {
  justify-content: center;
}

.experience-section .section-title {
  text-align: center;
}

.experience-section .section-subtitle {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.timeline {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent-dim), var(--border), transparent);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  padding-bottom: 3.5rem;
  width: 46%;
}

.timeline-item:nth-child(odd) {
  margin-left: 0;
  text-align: right;
  padding-right: 2.5rem;
}

.timeline-item:nth-child(even) {
  margin-left: 54%;
  text-align: left;
  padding-left: 2.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  top: 8px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--accent);
}

.timeline-item:nth-child(odd) .timeline-dot {
  right: -6px;
}

.timeline-item:nth-child(even) .timeline-dot {
  left: -6px;
}

.timeline-date {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.timeline-role {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.timeline-email {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.8rem;
}
.timeline-company {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
}
.timeline-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.8;
  font-weight: 300;
}
.timeline-image1 {
  width: 80px;
  height: 80px;
  margin-bottom: 1rem;
}
.timeline-image1 {
  width: 80px;
  height: 80px;
  margin-bottom: 1rem;
}

.timeline-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  display: block;
}

/* ========================================
   CONTACT
   ======================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contact-text h3 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.contact-text p {
  color: var(--text-secondary);
  font-weight: 300;
  font-size: 1.02rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.contact-email {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  transition: color 0.3s;
  margin-bottom: 2rem;
}

.contact-email:hover {
  color: var(--accent-light);
}

.contact-email svg {
  width: 20px;
  height: 20px;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.3s var(--ease-smooth);
}

.social-link:hover {
  color: var(--accent);
  border-color: var(--border-strong);
  background: rgba(201, 169, 110, 0.05);
  transform: translateY(-2px);
}

.social-link svg {
  width: 18px;
  height: 18px;
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 300;
  transition: border-color 0.3s;
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-dim);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.btn-submit {
  align-self: flex-start;
  padding: 0.9rem 2rem;
  background: var(--accent);
  color: var(--bg-primary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth);
}

.btn-submit:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  padding: 2.5rem clamp(1.5rem, 4vw, 3rem);
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer p {
  font-size: 0.88rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.footer p + p {
  margin-top: 0.4rem;
}

.footer a {
  color: var(--accent);
  transition: color 0.3s;
}

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

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-content {
    padding: 8rem 2rem 4rem;
    order: 1;
  }

  .hero-visual {
    order: 2;
    min-height: 50vh;
    padding: 3rem 2rem;
  }

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

  .about-grid {
    grid-template-columns: 200px 1fr;
    gap: 2.5rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .project-card:nth-child(2),
  .project-card:nth-child(3) {
    flex-direction: column;
  }

  .project-card:nth-child(2) .project-thumb,
  .project-card:nth-child(3) .project-thumb {
    min-width: 100%;
    max-width: 100%;
    aspect-ratio: 16/10;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-elevated);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 120px 2rem 80px;
    border-left: 1px solid var(--border);
    transition: right 0.4s var(--ease-smooth);
    overflow-y: auto;
  }

  .nav-links.open {
    right: 0;
  }

  .nav-toggle {
    display: flex;
    z-index: 1001;
  }

  .hero-content {
    padding: 7rem 1.5rem 3rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-photo {
    max-width: 220px;
  }


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

  .project-card:first-child {
    grid-row: auto;
  }

  .project-card:nth-child(2),
  .project-card:nth-child(3),
  .project-card:nth-child(4) {
    flex-direction: column;
  }

  .project-card:nth-child(2) .project-thumb,
  .project-card:nth-child(3) .project-thumb,
  .project-card:nth-child(4) .project-thumb {
    min-width: 100%;
    max-width: 100%;
    aspect-ratio: 16/10;
  }

  .project-card:nth-child(4) {
    grid-column: auto;
  }

  /* Timeline collapse to single column */
  .timeline::before {
    left: 0;
    transform: none;
  }

  .timeline-item {
    width: 100%;
    text-align: left !important;
    padding-left: 2rem !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
  }

  .timeline-dot {
    left: -6px !important;
    right: auto !important;
  }

  .contrib-grid {
    grid-template-columns: repeat(26, 1fr);
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.4rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .stat-number {
    font-size: 1.6rem;
  }
}