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

body, html {
  width: 100%; height: 100%; overflow: hidden;
  background-color: #020205;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  cursor: none; color: #fff;
}

/* ===== LOADER ===== */
#loader {
  position: fixed; inset: 0; background: #020205;
  z-index: 10000; display: flex; align-items: center; justify-content: center;
}
.loader-content { text-align: center; }
.loader-ring { width: 100px; height: 100px; margin: 0 auto 30px; }
.loader-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,0.05); stroke-width: 2; }
.ring-progress {
  fill: none; stroke: #4488ff; stroke-width: 2;
  stroke-dasharray: 283; stroke-dashoffset: 283;
  stroke-linecap: round; transition: stroke-dashoffset 0.3s ease;
}
.loader-text { font-size: 0.7rem; letter-spacing: 6px; color: rgba(255,255,255,0.4); margin-bottom: 8px; }
.loader-percent { font-size: 2rem; font-weight: 200; letter-spacing: 2px; }

/* ===== GRAIN ===== */
#grain {
  position: fixed; top: -50%; left: -50%; width: 200%; height: 200%;
  pointer-events: none; z-index: 9000; opacity: 0.04;
  background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="n"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.7" numOctaves="4" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23n)"/%3E%3C/svg%3E');
  animation: grainShift 0.5s steps(3) infinite;
}
@keyframes grainShift {
  0%{transform:translate(0,0)} 33%{transform:translate(-2%,-1%)} 66%{transform:translate(1%,2%)} 100%{transform:translate(0,0)}
}

/* ===== TRAIL CANVAS ===== */
#trail-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 2;
}

/* ===== CANVAS ===== */
#bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; }

/* ===== CURSOR ===== */
#custom-cursor {
  position: fixed; top: 0; left: 0; width: 12px; height: 12px;
  border-radius: 50%; background: white; mix-blend-mode: difference;
  pointer-events: none; z-index: 9999; transform: translate(-50%,-50%);
  transition: width 0.3s cubic-bezier(0.25,1,0.5,1), height 0.3s cubic-bezier(0.25,1,0.5,1);
}
#cursor-follower {
  position: fixed; top: 0; left: 0; width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,0.15);
  pointer-events: none; z-index: 9998; transform: translate(-50%,-50%);
}
.cursor-hover #custom-cursor {
  width: 60px; height: 60px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.4);
}

/* ===== SOUND ===== */
#sound-toggle {
  position: fixed; top: 30px; right: 30px; z-index: 100;
  background: none; border: 1px solid rgba(255,255,255,0.12); color: white;
  width: 44px; height: 44px; border-radius: 50%; cursor: none;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.3s, box-shadow 0.3s; opacity: 0;
}
#sound-toggle:hover { border-color: rgba(255,255,255,0.4); box-shadow: 0 0 20px rgba(68,136,255,0.3); }
#sound-toggle svg { width: 18px; height: 18px; }

/* ===== FPS ===== */
#fps-counter {
  position: fixed; bottom: 30px; right: 30px; z-index: 100;
  font-size: 0.6rem; letter-spacing: 2px; color: rgba(255,255,255,0.2);
  font-variant-numeric: tabular-nums; opacity: 0;
}

/* ===== UI LAYER ===== */
#ui-layer {
  position: fixed; top: 50%; left: 8%; transform: translateY(-50%);
  z-index: 10; pointer-events: none;
  background: rgba(255,255,255,0.02); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  padding: 60px; border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.04);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6); max-width: 520px; opacity: 0;
}
.tag { font-size: 0.65rem; letter-spacing: 4px; color: #4488ff; margin-bottom: 20px; }
#ui-layer h1 {
  font-size: clamp(2.5rem,5vw,5rem); font-weight: 900; letter-spacing: -2px; margin-bottom: 16px;
  background: linear-gradient(135deg,#fff 0%,#4488ff 50%,#ff44aa 100%);
  background-size: 200% 200%; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: gradientShift 6s ease infinite; line-height: 1.05;
}
#ui-layer p {
  font-size: clamp(0.85rem,1.2vw,1.1rem); font-weight: 300; letter-spacing: 0.5px;
  color: rgba(255,255,255,0.45); max-width: 380px; line-height: 1.7;
}
.button-container { margin-top: 40px; pointer-events: auto; }
.magnetic-btn {
  padding: 16px 36px; background: transparent; border: 1px solid rgba(255,255,255,0.15);
  color: white; border-radius: 50px; font-size: 0.85rem; font-family: 'Inter',sans-serif;
  letter-spacing: 2px; cursor: none; transition: all 0.4s cubic-bezier(0.25,1,0.5,1);
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 12px;
}
.btn-icon { display: inline-block; transition: transform 0.3s ease; }
.magnetic-btn:hover .btn-icon { transform: translateX(4px); }
.magnetic-btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg,#4488ff,#ff44aa);
  z-index: -1; opacity: 0; transition: opacity 0.4s ease;
}
.magnetic-btn:hover { border-color: transparent; box-shadow: 0 10px 40px rgba(68,136,255,0.35); }
.magnetic-btn:hover::before { opacity: 1; }
@keyframes gradientShift { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }

/* ===== SCROLL CONTENT ===== */
#scroll-content {
  position: fixed; inset: 0; z-index: 10; overflow-y: auto; display: none;
  scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
}
#scroll-content::-webkit-scrollbar { width: 4px; }
#scroll-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }

.section {
  width: 100%; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 80px 60px;
}
.section-inner {
  max-width: 600px; opacity: 0; transform: translateY(60px);
  position: relative; z-index: 5;
  background: rgba(2, 2, 5, 0.75);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 50px; border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.04);
}
.section-inner.wide {
  max-width: 1000px; width: 100%;
  background: rgba(2, 2, 5, 0.75);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 50px; border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.04);
}
.section-number { font-size: 0.7rem; letter-spacing: 4px; color: #4488ff; display: block; margin-bottom: 20px; }
.section h2 {
  font-size: clamp(2.5rem,5vw,4.5rem); font-weight: 900; letter-spacing: -1px; line-height: 1.05; margin-bottom: 20px;
  background: linear-gradient(135deg,#fff,#888); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.section p { font-size: 1.1rem; font-weight: 300; color: rgba(255,255,255,0.4); line-height: 1.8; max-width: 450px; }

/* ===== PROJECT CARDS ===== */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 40px; }
.project-card {
  position: relative; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px; padding: 40px; overflow: hidden; cursor: none;
  transition: transform 0.4s cubic-bezier(0.25,1,0.5,1), border-color 0.4s;
  transform-style: preserve-3d; perspective: 1000px;
}
.project-card:hover { border-color: rgba(68,136,255,0.3); }
.card-glow {
  position: absolute; top: 50%; left: 50%; width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(68,136,255,0.15), transparent 70%);
  border-radius: 50%; transform: translate(-50%,-50%); opacity: 0;
  transition: opacity 0.4s; pointer-events: none;
}
.project-card:hover .card-glow { opacity: 1; }
.card-tag { font-size: 0.6rem; letter-spacing: 3px; color: #4488ff; display: block; margin-bottom: 16px; }
.card-content h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 10px; }
.card-content p { font-size: 0.85rem; color: rgba(255,255,255,0.35); line-height: 1.6; }
.card-year { display: block; margin-top: 20px; font-size: 0.7rem; letter-spacing: 2px; color: rgba(255,255,255,0.2); }

/* ===== STATS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; text-align: center; }
.stat-number { font-size: clamp(2.5rem,5vw,4rem); font-weight: 900; display: block; margin-bottom: 10px;
  background: linear-gradient(135deg,#4488ff,#ff44aa); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 0.65rem; letter-spacing: 3px; color: rgba(255,255,255,0.3); }

/* ===== ABOUT TAGS ===== */
.about-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.about-tag {
  padding: 8px 20px; border: 1px solid rgba(255,255,255,0.1); border-radius: 50px;
  font-size: 0.75rem; letter-spacing: 1px; color: rgba(255,255,255,0.5);
  transition: all 0.3s; cursor: none;
}
.about-tag:hover { border-color: #4488ff; color: #4488ff; box-shadow: 0 0 15px rgba(68,136,255,0.2); }

/* ===== CONTACT FORM ===== */
#contact-form { margin-top: 40px; max-width: 400px; }
.form-group { position: relative; margin-bottom: 35px; }
.form-group input, .form-group textarea {
  width: 100%; background: transparent; border: none; border-bottom: 1px solid rgba(255,255,255,0.1);
  color: white; font-family: 'Inter',sans-serif; font-size: 1rem; padding: 10px 0; outline: none;
  transition: border-color 0.3s; cursor: none; resize: none;
}
.form-group label {
  position: absolute; top: 10px; left: 0; font-size: 0.7rem; letter-spacing: 3px;
  color: rgba(255,255,255,0.3); transition: all 0.3s cubic-bezier(0.25,1,0.5,1); pointer-events: none;
}
.form-group input:focus ~ label, .form-group input:valid ~ label,
.form-group textarea:focus ~ label, .form-group textarea:valid ~ label {
  top: -18px; font-size: 0.6rem; color: #4488ff;
}
.input-line {
  position: absolute; bottom: 0; left: 0; width: 0; height: 1px; background: #4488ff;
  transition: width 0.4s cubic-bezier(0.25,1,0.5,1);
}
.form-group input:focus ~ .input-line, .form-group textarea:focus ~ .input-line { width: 100%; }
.submit-btn {
  padding: 14px 32px; background: transparent; border: 1px solid rgba(255,255,255,0.15);
  color: white; border-radius: 50px; font-size: 0.8rem; font-family: 'Inter',sans-serif;
  letter-spacing: 2px; cursor: none; transition: all 0.3s;
  display: inline-flex; align-items: center; gap: 10px;
}
.submit-btn:hover { background: #4488ff; border-color: #4488ff; box-shadow: 0 8px 30px rgba(68,136,255,0.4); }

/* ===== BOTTOM NAV ===== */
#bottom-nav {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 100;
  display: flex; align-items: center; gap: 16px;
  background: rgba(255,255,255,0.03); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
  padding: 14px 30px; border-radius: 50px; border: 1px solid rgba(255,255,255,0.06); opacity: 0;
}
.nav-link {
  color: rgba(255,255,255,0.3); text-decoration: none; font-size: 0.7rem; letter-spacing: 2px;
  transition: color 0.3s, text-shadow 0.3s; cursor: none;
}
.nav-link:hover, .nav-link.active { color: #fff; text-shadow: 0 0 20px rgba(68,136,255,0.6); }
.nav-divider { color: rgba(255,255,255,0.08); font-size: 0.7rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  body,html { cursor: auto; }
  #custom-cursor, #cursor-follower, #trail-canvas { display: none; }
  #ui-layer { left: 5%; right: 5%; padding: 35px; max-width: none; }
  #ui-layer h1 { font-size: 2.5rem; }
  .section { padding: 40px 25px; }
  .projects-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 25px; }
  #bottom-nav { padding: 10px 20px; gap: 10px; }
  .nav-link { font-size: 0.6rem; letter-spacing: 1px; }
  #sound-toggle { top: 20px; right: 20px; width: 36px; height: 36px; }
  .project-card { padding: 25px; }
}
