/* I'll start with the previous CSS, add styles for cursor, modal, buttons, new grid boxes, and reveal animation */
:root {
  --bg: #050505;
  --surface: rgba(20, 20, 20, 0.6);
  --surface-hover: rgba(30, 30, 30, 0.8);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.2);
  --text-main: #f5f5f5;
  --text-muted: #888888;
  --accent: #ffffff;
  --accent-1: #a855f7;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: none; /* Hide default cursor for custom cursor */
}

/* Fallback cursor for elements that need pointer */
a, button, input, textarea { cursor: none; }

/* Custom Cursor */
.cursor-dot {
  width: 8px; height: 8px;
  background-color: #fff;
  border-radius: 50%;
  position: fixed;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
  transition: width 0.2s, height 0.2s, background-color 0.2s;
}
.cursor-outline {
  width: 40px; height: 40px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  position: fixed;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9998;
  transition: transform 0.1s ease-out, width 0.2s, height 0.2s, border-color 0.2s;
}

/* When hovering over clickable elements */
.cursor-hover .cursor-dot {
  width: 12px; height: 12px;
  background-color: var(--accent-1);
}
.cursor-hover .cursor-outline {
  width: 60px; height: 60px;
  border-color: var(--accent-1);
  background-color: rgba(168, 85, 247, 0.1);
}

.noise-overlay {
  position: fixed; inset: 0;
  background-image: url('data:image/svg+xml,%3Csvg viewBox=%220 0 200 200%22 xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cfilter id=%22noiseFilter%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%220.65%22 numOctaves=%223%22 stitchTiles=%22stitch%22/%3E%3C/filter%3E%3Crect width=%22100%25%22 height=%22100%25%22 filter=%22url(%23noiseFilter)%22 opacity=%220.05%22/%3E%3C/svg%3E');
  pointer-events: none; z-index: 999;
}

.mesh-glow {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 80vw; height: 80vh;
  background: radial-gradient(circle at 30% 30%, rgba(56, 189, 248, 0.15), transparent 50%),
              radial-gradient(circle at 70% 70%, rgba(192, 132, 252, 0.15), transparent 50%);
  filter: blur(80px); z-index: -1; pointer-events: none;
}

.serif-italic {
  font-family: 'Instrument Serif', serif;
  font-style: italic; font-weight: 400; color: #999;
}

/* Intersection Observer Reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Bento Grid System */
.bento-container {
  max-width: 1200px; margin: 4rem auto; padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  grid-auto-rows: minmax(100px, auto);
}

.bento-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  padding: 2rem;
  transition: border-color 0.3s, background 0.3s;
  overflow: hidden; position: relative;
}
.bento-box:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

/* Hero Box */
.bento-hero {
  grid-column: span 2; grid-row: span 2;
  display: flex; flex-direction: column; justify-content: space-between;
}
.hero-top {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem;
}
.logo { display: flex; align-items: center; gap: 0.5rem; font-size: 1.2rem; font-weight: 500; letter-spacing: -0.5px; }
.logo i { color: var(--accent-1); }

.btn-contact {
  display: flex; align-items: center; gap: 0.5rem;
  background: #fff; color: #000;
  padding: 0.6rem 1.2rem; border-radius: 99px; font-size: 0.9rem; font-weight: 600;
  border: none; outline: none; transition: opacity 0.2s;
}
.btn-contact:hover { opacity: 0.8; }

.hero-main h1 {
  font-size: clamp(2.5rem, 5vw, 4.2rem); font-weight: 500; letter-spacing: -2px; line-height: 1.1; margin-bottom: 1.2rem;
}
.hero-main p {
  color: var(--text-muted); font-size: clamp(1rem, 2vw, 1.1rem); max-width: 600px; margin-bottom: 2rem;
}
.hero-actions { display: flex; gap: 1rem; }
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  text-decoration: none; padding: 0.7rem 1.4rem; border-radius: 12px; font-weight: 500; font-size: 0.9rem;
  transition: transform 0.2s, background 0.2s; border: 1px solid var(--border);
}
.btn-primary { background: rgba(255,255,255,0.1); color: #fff; }
.btn-primary:hover { background: rgba(255,255,255,0.2); transform: translateY(-2px); }
.btn-secondary { background: transparent; color: var(--text-muted); }
.btn-secondary:hover { color: #fff; border-color: rgba(255,255,255,0.3); transform: translateY(-2px); }

/* Socials */
.bento-socials {
  grid-column: span 1; grid-row: span 1;
  display: flex; justify-content: space-around; align-items: center;
}
.social-link { color: var(--text-muted); font-size: clamp(1.5rem, 3vw, 2rem); transition: color 0.2s, transform 0.2s; }
.social-link:hover { color: var(--accent); transform: translateY(-3px); }

/* Skills */
.bento-skills {
  grid-column: span 1; grid-row: span 1;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.bento-skills h3 { font-family: 'Instrument Serif', serif; font-size: 2rem; font-weight: 400; margin-bottom: 1rem; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill-tags span {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  padding: 0.4rem 0.8rem; border-radius: 8px; font-size: 0.85rem; color: var(--text-muted);
}

/* Stats (GitHub) */
.bento-stats {
  grid-column: span 2; grid-row: span 1;
  display: flex; align-items: center; justify-content: space-around; padding: 2rem;
}
.stat-item {
  display: flex; align-items: center; gap: 1rem;
}
.stat-icon {
  width: 50px; height: 50px; border-radius: 12px; background: rgba(168, 85, 247, 0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: var(--accent-1);
}
.stat-info h4 { font-size: 1.8rem; font-weight: 600; line-height: 1; margin-bottom: 0.3rem; font-family: 'Instrument Serif', serif; letter-spacing: 1px; }
.stat-info p { color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; }

/* Location */
.bento-location {
  grid-column: span 1; grid-row: span 1;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 0.5rem; text-align: center;
}
.bento-location i { font-size: 2.5rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.bento-location h4 { font-family: 'Instrument Serif', serif; font-size: 1.5rem; font-weight: 400; color: #fff; }
.bento-location p { font-size: 0.9rem; color: var(--text-muted); }

/* Title Boxes */
.bento-title {
  grid-column: span 3; grid-row: span 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.5rem 2rem; background: transparent; border: none; backdrop-filter: none;
}
.bento-title:hover { background: transparent; border: none; }
.bento-title h2 { font-family: 'Instrument Serif', serif; font-size: clamp(2rem, 4vw, 2.5rem); font-weight: 400; letter-spacing: 1px; }

/* Projects */
.bento-project {
  grid-column: span 1; grid-row: span 2;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 0; min-height: 350px;
}
.project-info { padding: 2rem; position: absolute; top: 0; left: 0; right: 0; z-index: 2; }
.project-info h3 { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.5px; margin-bottom: 0.5rem; }
.project-info p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1rem; }
.project-info a {
  display: inline-flex; align-items: center; gap: 0.3rem; color: var(--accent);
  text-decoration: none; font-size: 0.9rem; font-weight: 500;
  opacity: 0; transform: translateY(10px); transition: all 0.3s ease;
}
.bento-project:hover .project-info a { opacity: 1; transform: translateY(0); }

.project-visual {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); z-index: 1;
}
.bento-project:hover .project-visual { transform: scale(1.05); }
.project-visual::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.9) 100%);
}
.visual-1 { background-image: url('https://images.unsplash.com/photo-1639762681485-074b7f4ec851?w=800&q=80'); }
.visual-2 { background-image: url('https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?w=800&q=80'); }
.visual-3 { background-image: url('https://images.unsplash.com/photo-1516321497487-e288fb19713f?w=800&q=80'); }

/* Archive */
.search-wrap { position: relative; width: 300px; }
.search-wrap i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-wrap input {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 99px;
  padding: 0.6rem 1rem 0.6rem 2.5rem; color: #fff; font-family: inherit; font-size: 0.9rem; outline: none; transition: border-color 0.3s;
}
.search-wrap input:focus { border-color: var(--accent-1); }

.bento-archive { grid-column: span 3; padding: 1.5rem; }
.repo-list-bento { list-style: none; max-height: 450px; overflow-y: auto; padding-right: 0.8rem; }
.repo-list-bento::-webkit-scrollbar { width: 6px; }
.repo-list-bento::-webkit-scrollbar-track { background: transparent; }
.repo-list-bento::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }

.repo-list-bento li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 1rem; border-bottom: 1px solid var(--border); transition: background 0.2s; border-radius: 12px;
}
.repo-list-bento li:hover { background: rgba(255,255,255,0.02); }
.repo-list-bento li:last-child { border-bottom: none; }
.repo-bento-title { font-size: 1.1rem; font-weight: 500; color: #fff; text-decoration: none; display: flex; align-items: center; gap: 0.8rem; }
.repo-bento-title i { color: var(--text-muted); }
.repo-bento-title:hover { text-decoration: underline; }
.repo-bento-desc { color: var(--text-muted); font-size: 0.9rem; width: 40%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.repo-bento-meta { display: flex; gap: 1.5rem; font-size: 0.85rem; color: var(--text-muted); }
.repo-bento-meta span { display: flex; align-items: center; gap: 0.4rem; }

.bento-footer { text-align: center; padding: 4rem 0 2rem; color: var(--text-muted); font-size: 0.9rem; }

/* Contact Modal */
.modal {
  border: none; background: transparent; margin: auto; padding: 0; outline: none;
}
.modal::backdrop { background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); }
.modal-content {
  background: #111; border: 1px solid var(--border); border-radius: 24px;
  padding: 2.5rem; width: 90vw; max-width: 500px; position: relative; color: #fff;
}
.btn-close {
  position: absolute; top: 1.5rem; right: 1.5rem; background: transparent; border: none; color: var(--text-muted); font-size: 1.5rem; transition: color 0.2s;
}
.btn-close:hover { color: #fff; }
.modal-content h2 { font-family: 'Instrument Serif', serif; font-size: 2.5rem; margin-bottom: 0.5rem; font-weight: 400; }
.modal-content p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem; }
.input-group { margin-bottom: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.input-group label { font-size: 0.85rem; font-weight: 500; color: #ccc; }
.input-group input, .input-group textarea {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: 12px;
  padding: 0.8rem 1rem; color: #fff; font-family: inherit; outline: none; transition: border-color 0.3s;
}
.input-group input:focus, .input-group textarea:focus { border-color: var(--accent-1); }
.btn-submit {
  width: 100%; padding: 1rem; background: #fff; color: #000; border: none; border-radius: 12px;
  font-family: inherit; font-weight: 600; font-size: 1rem; transition: opacity 0.2s;
}
.btn-submit:hover { opacity: 0.8; }

/* Mobile & Tablet Responsiveness */
@media (max-width: 1024px) {
  .bento-container { grid-template-columns: repeat(2, 1fr); }
  .bento-hero { grid-column: span 2; grid-row: auto; }
  .bento-socials { grid-column: span 1; }
  .bento-skills { grid-column: span 1; grid-row: auto; }
  .bento-stats { grid-column: span 2; }
  .bento-location { grid-column: span 1; }
  .bento-title { grid-column: span 2; }
  .bento-project { grid-column: span 1; grid-row: auto; }
  .bento-project:nth-of-type(3) { grid-column: span 2; }
  .bento-archive { grid-column: span 2; }
  .repo-bento-desc { width: 30%; }
}

@media (max-width: 768px) {
  .bento-container { grid-template-columns: 1fr; padding: 0 1rem; margin: 2rem auto; }
  .bento-hero, .bento-socials, .bento-skills, .bento-stats, .bento-location, .bento-title, .bento-project, .bento-project:nth-of-type(3), .bento-archive {
    grid-column: span 1; grid-row: auto;
  }
  .cursor-dot, .cursor-outline { display: none; } /* Disable custom cursor on mobile */
  body { cursor: auto; }
  a, button, input, textarea { cursor: pointer; }
  
  .bento-box { padding: 1.5rem; border-radius: 20px; }
  .hero-top { flex-direction: column; align-items: flex-start; gap: 1.5rem; margin-bottom: 2rem; }
  .btn-contact { width: 100%; justify-content: center; }
  
  .bento-title { flex-direction: column; align-items: flex-start; gap: 1.2rem; padding: 1rem 0; }
  .search-wrap { width: 100%; }
  
  .bento-stats { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
  
  .bento-project { min-height: 280px; }
  .project-info { padding: 1.5rem; }
  .project-info a { opacity: 1; transform: none; background: rgba(255,255,255,0.1); padding: 0.4rem 0.8rem; border-radius: 8px; margin-top: 0.5rem; display: inline-flex; }
  
  .repo-list-bento li { flex-direction: column; align-items: flex-start; gap: 0.8rem; padding: 1.2rem; }
  .repo-bento-desc {
    width: 100%; white-space: normal;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .repo-bento-meta { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
}
