/* ================= RESET & VARIABLES ================= */
:root {
  --bg: #080808;
  --bg-alt: #111111;
  --surface: #151515;
  --border: #2a2a2a;
  --text: #ffffff;
  --text-muted: #a1a1aa;
  --accent: #00C9A7;
  --accent-hover: #00F5D4;
  --accent-dim: #008f76;
  --crimson: #8B1538;
  --crimson-dark: #650D20;
  --font-main: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none; /* For custom cursor */
}
a { color: inherit; text-decoration: none; }
li { list-style: none; }
img { max-width: 100%; display: block; }

/* ================= PRELOADER ================= */
.preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-inner { text-align: center; z-index: 2; }
.preloader-logo {
  font-family: var(--font-mono); font-size: 3rem; font-weight: 700;
  margin-bottom: 2rem;
}
.pl-bracket { color: var(--accent); }
.preloader-terminal {
  text-align: left; font-family: var(--font-mono); font-size: 0.9rem;
  color: var(--text-muted); margin-bottom: 2rem; min-height: 120px;
}
.pl-line { margin-bottom: 0.5rem; opacity: 0; animation: fadeIn 0.5s forwards; }
.pl-line[data-line="1"] { animation-delay: 0.2s; }
.pl-line[data-line="2"] { animation-delay: 0.6s; }
.pl-line[data-line="3"] { animation-delay: 1.0s; }
.pl-line[data-line="4"] { animation-delay: 1.4s; }
.pl-line[data-line="5"] { animation-delay: 1.8s; color: var(--accent); }
.pl-prompt { color: var(--accent); }
.pl-ok { color: #39d353; }
.preloader-bar-wrap {
  width: 250px; height: 4px; background: var(--surface);
  border-radius: 4px; overflow: hidden; margin: 0 auto;
}
.preloader-bar {
  width: 0%; height: 100%; background: var(--accent);
  transition: width 0.3s ease;
}
.preloader-counter {
  font-family: var(--font-mono); font-size: 1.2rem; color: var(--accent);
  margin-top: 1rem;
}
.preloader-hint {
  position: absolute; bottom: 2rem; font-family: var(--font-mono);
  font-size: 0.8rem; color: #555;
}

/* ================= OVERLAYS (MODAL & SUCCESS) ================= */
#blackout {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8);
  backdrop-filter: blur(5px); z-index: 900; opacity: 0; visibility: hidden;
  transition: var(--transition);
}
#blackout.active { opacity: 1; visibility: visible; }

.success-screen, .project-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: var(--transition);
}
.success-screen.active, .project-modal.active { opacity: 1; visibility: visible; }
.success-inner {
  background: var(--surface); padding: 3rem; border-radius: 12px;
  border: 1px solid var(--accent-dim); text-align: center; max-width: 400px;
}
.success-title { font-size: 2rem; font-weight: 800; margin-bottom: 1rem; }
.success-title .gradient-text {
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.success-bar { width: 100%; height: 4px; background: var(--border); margin: 1.5rem 0; border-radius: 4px; }
.success-bar i { display: block; height: 100%; background: var(--accent); width: 100%; animation: progress 4s linear forwards; }
@keyframes progress { from { width: 100%; } to { width: 0%; } }

/* Modal Details */
.modal-content {
  background: var(--bg-alt); width: 90%; max-width: 900px;
  border-radius: 12px; border: 1px solid var(--border);
  display: flex; overflow: hidden; position: relative; z-index: 1001;
}
.modal-hologram {
  flex: 1; background: #000; display: flex; align-items: center; justify-content: center;
  position: relative; border-right: 1px solid var(--border); min-height: 400px;
}
.modal-info { flex: 1.2; padding: 3rem; }
.modal-close {
  position: absolute; top: 1rem; right: 1rem; background: none; border: none;
  width: 30px; height: 30px; cursor: pointer; z-index: 1002;
}
.modal-close span {
  display: block; width: 100%; height: 2px; background: var(--text);
  position: absolute; top: 50%; left: 0;
}
.modal-close span:first-child { transform: rotate(45deg); }
.modal-close span:last-child { transform: rotate(-45deg); }
.modal-title { font-size: 2rem; margin-bottom: 1rem; font-family: var(--font-mono); }
.modal-desc { color: var(--text-muted); margin-bottom: 2rem; }
.modal-section h4 { font-family: var(--font-mono); color: var(--accent); margin-bottom: 1rem; }
.modal-features { list-style: square; padding-left: 1.2rem; color: var(--text-muted); margin-bottom: 2rem; }

/* ================= NAVBAR ================= */
header { position: fixed; top: 0; width: 100%; z-index: 100; background: rgba(8,8,8,0.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.nav { display: flex; justify-content: space-between; align-items: center; padding: 1rem 5%; max-width: 1200px; margin: 0 auto; }
.nav-logo { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; }
.logo-bracket { color: var(--accent); }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-link { font-size: 0.9rem; font-family: var(--font-mono); transition: var(--transition); }
.nav-link:hover, .nav-link.active { color: var(--accent); }
.nav-cta { background: var(--accent); color: #000; padding: 0.5rem 1rem; border-radius: 4px; font-weight: 600; font-size: 0.9rem; transition: var(--transition); }
.nav-cta:hover { background: var(--accent-hover); transform: translateY(-2px); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; }
.nav-toggle span { width: 25px; height: 2px; background: var(--text); }

/* ================= HERO ================= */
.hero { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 0 5%; position: relative; text-align: center; }
.hero-content { max-width: 800px; z-index: 2; }
.hero-eyebrow { font-family: var(--font-mono); color: var(--accent); margin-bottom: 1.5rem; display: flex; align-items: center; justify-content: center; gap: 8px; }
.pulse-dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0, 201, 167, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(0, 201, 167, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 201, 167, 0); } }
.hero-title { font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 900; line-height: 1.1; margin-bottom: 1.5rem; }
.hero-title .line { display: block; }
.gradient-text { background: linear-gradient(90deg, var(--accent), var(--crimson)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { font-family: var(--font-mono); font-size: 1.1rem; color: var(--accent); margin-bottom: 1.5rem; }
.hero-desc { color: var(--text-muted); max-width: 600px; margin: 0 auto 2.5rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; margin-bottom: 3rem; }
.btn { padding: 0.8rem 1.8rem; border-radius: 4px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; transition: var(--transition); font-family: var(--font-mono); }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); }
.btn-ghost { border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.hero-stats { display: flex; justify-content: center; gap: 3rem; border-top: 1px solid var(--border); padding-top: 2rem; }
.stat b { display: block; font-size: 2rem; font-weight: 800; font-family: var(--font-mono); color: var(--accent); }
.stat span { font-size: 0.9rem; color: var(--text-muted); }

/* ================= MARQUEE ================= */
.marquee { background: var(--crimson-dark); padding: 1rem 0; overflow: hidden; white-space: nowrap; border-top: 1px solid var(--crimson); border-bottom: 1px solid var(--crimson); }
.marquee-track { display: inline-block; animation: scroll 30s linear infinite; }
.marquee-track span { font-family: var(--font-mono); font-size: 0.9rem; font-weight: 700; color: #fff; margin: 0 1.5rem; }
@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ================= SECTIONS ================= */
.section { padding: 6rem 5%; }
.section-alt { background: var(--bg-alt); }
.container { max-width: 1100px; margin: 0 auto; }
.section-head { margin-bottom: 4rem; }
.section-index { font-family: var(--font-mono); color: var(--accent); font-size: 0.9rem; display: block; margin-bottom: 0.5rem; }
.section-title { font-size: 2.5rem; font-weight: 800; margin-bottom: 0.5rem; }
.section-kicker { font-family: var(--font-mono); color: var(--text-muted); }

/* ================= ABOUT ================= */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.about-text p { margin-bottom: 1.5rem; color: var(--text-muted); }
.about-text strong, code { color: var(--accent); font-family: var(--font-mono); }
.about-tags { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.about-tags span { font-family: var(--font-mono); font-size: 0.8rem; padding: 0.4rem 0.8rem; border: 1px solid var(--border); border-radius: 4px; color: var(--accent); }
.about-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.info-card { background: var(--surface); padding: 1.5rem; border-radius: 8px; border: 1px solid var(--border); transition: var(--transition); }
.info-card:hover { border-color: var(--accent-dim); transform: translateY(-5px); }
.info-icon { font-size: 1.5rem; margin-bottom: 1rem; }
.info-card h3 { font-family: var(--font-mono); font-size: 1rem; margin-bottom: 0.5rem; }
.info-card p { font-size: 0.9rem; color: var(--text-muted); }

/* ================= SKILLS ================= */
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.skill-group h3 { font-family: var(--font-mono); color: var(--accent); margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.skill-bar { margin-bottom: 1.2rem; }
.skill-bar span { display: block; font-size: 0.9rem; margin-bottom: 0.4rem; font-family: var(--font-mono); }
.skill-bar .bar { width: 100%; height: 6px; background: var(--surface); border-radius: 3px; overflow: hidden; }
.skill-bar .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-dim), var(--accent)); width: 0%; transition: width 1.5s ease-out; }
.tech-pills { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.tech-pills span { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); padding: 0.5rem 1rem; background: var(--surface); border-radius: 20px; border: 1px solid var(--border); }

/* ================= PROJECTS ================= */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; }
.project-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; transition: var(--transition); cursor: pointer; display: flex; flex-direction: column; }
.project-card:hover { border-color: var(--accent); transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0, 201, 167, 0.1); }
.project-card.featured { grid-column: 1 / -1; display: flex; flex-direction: row; justify-content: space-between; align-items: center; }
.project-card.featured > div:first-child { max-width: 600px; }
.project-top { display: flex; justify-content: space-between; margin-bottom: 1rem; }
.project-badge { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); background: rgba(0, 201, 167, 0.1); padding: 0.2rem 0.6rem; border-radius: 4px; }
.project-year { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }
.project-card h3 { font-size: 1.4rem; margin-bottom: 0.8rem; }
.project-card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; flex-grow: 1; }
.project-tech { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.project-tech span { font-family: var(--font-mono); font-size: 0.75rem; color: #aaa; border: 1px solid var(--border); padding: 0.2rem 0.5rem; border-radius: 4px; }
.project-links { display: flex; gap: 1rem; }
.project-links a { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent); }
.project-links a:hover { text-decoration: underline; }

/* ================= CONTACT ================= */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.contact-card { background: var(--surface); border: 1px solid var(--border); padding: 2rem; text-align: center; border-radius: 8px; transition: var(--transition); }
.contact-card:hover { border-color: var(--accent); transform: translateY(-5px); }
.contact-icon { font-size: 2rem; display: block; margin-bottom: 1rem; }
.contact-card h3 { font-family: var(--font-mono); font-size: 1.1rem; margin-bottom: 0.5rem; }
.contact-card p { color: var(--text-muted); font-size: 0.9rem; }

/* ================= FOOTER ================= */
.footer { padding: 3rem 5%; border-top: 1px solid var(--border); text-align: center; }
.footer-brand { font-family: var(--font-mono); font-weight: 700; margin-bottom: 0.5rem; }
.footer-note { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.9rem; margin-bottom: 1rem; }
.footer-copy { color: #555; font-size: 0.8rem; }

/* ================= CURSOR & MISC ================= */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999; border-radius: 50%; transform: translate(-50%, -50%); transition: opacity 0.3s; }
.cursor-dot { width: 8px; height: 8px; background: var(--accent); }
.cursor-ring { width: 30px; height: 30px; border: 1px solid var(--accent); transition: transform 0.15s, width 0.3s, height 0.3s, opacity 0.3s; }
.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); width: 0%; z-index: 999; }

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
  .about-grid, .skills-grid { grid-template-columns: 1fr; }
  .project-card.featured { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
  .hero-title { font-size: 2.5rem; }
  .hero-stats { gap: 1.5rem; flex-direction: column; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: var(--bg); flex-direction: column; padding: 1rem; border-bottom: 1px solid var(--border); }
  .nav-links.active { display: flex; }
  .nav-toggle { display: flex; }
  .modal-content { flex-direction: column; }
  .modal-hologram { min-height: 200px; }
  .modal-info { padding: 1.5rem; }
  .cursor-dot, .cursor-ring { display: none; }
  body { cursor: auto; }
  }
