/* ============================================================
   CSS CUSTOM PROPERTIES & RESETS
   ============================================================ */
:root {
  --bg: #000c02;
  --bg2: #010f03;
  --bg3: #0a140c;
  --green: #00ff41;
  --green2: #33ff66;
  --green3: #88ff88;
  --green-dim: #0d4f1a;
  --green-glow: rgba(0,255,65,0.15);
  --green-glow2: rgba(0,255,65,0.08);
  --text: #c8ffd4;
  --text2: #7abf8a;
  --text3: #4a7a58;
  --border: rgba(0,255,65,0.18);
  --border2: rgba(0,255,65,0.35);
  --card-bg: rgba(0,20,5,0.85);
  --card-border: rgba(0,255,65,0.2);
  --font-mono: 'Share Tech Mono', 'Courier New', monospace;
  --font-sans: 'Space Grotesk', sans-serif;
  --nav-h: 70px;
  --radius: 4px;
  --radius-lg: 8px;
  --transition: all 0.3s ease;
}

body.light-mode {
  --bg: #f0f7f1;
  --bg2: #e4f0e6;
  --bg3: #d8eadb;
  --green: #006b1a;
  --green2: #008a22;
  --green3: #33a64d;
  --green-dim: #c3e8ca;
  --green-glow: rgba(0,107,26,0.12);
  --green-glow2: rgba(0,107,26,0.06);
  --text: #0a2d12;
  --text2: #2a6b3a;
  --text3: #5a9868;
  --border: rgba(0,107,26,0.2);
  --border2: rgba(0,107,26,0.4);
  --card-bg: rgba(240,247,241,0.92);
  --card-border: rgba(0,107,26,0.22);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.4s, color 0.4s;
}

/* ============================================================
   CANVAS
   ============================================================ */
#matrixCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
  transition: opacity 0.5s;
}
body.light-mode #matrixCanvas { opacity: 0.12; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--green-dim); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--green2); }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1,h2,h3,h4 { font-family: var(--font-mono); line-height: 1.2; }
a { color: var(--green2); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--green); }

/* ============================================================
   LAYOUT
   ============================================================ */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
section { position: relative; z-index: 1; padding: 6rem 0; }

/* ============================================================
   NAV
   ============================================================ */
nav {
  position: fixed; top: 0; left: 0; width: 100%;
  height: var(--nav-h);
  background: rgba(0,8,1,0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: background 0.4s, border-color 0.4s;
}
body.light-mode nav { background: rgba(240,247,241,0.9); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--green);
  letter-spacing: 0.04em;
  position: relative;
}
.logo::before { content: '>'; margin-right: 6px; opacity: 0.5; }
.logo span { color: var(--green2); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 2px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--green);
  transition: width 0.3s;
}
.nav-links a:hover { color: var(--green); }
.nav-links a:hover::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 12px; }

#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  width: 36px; height: 36px;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
}
#theme-toggle:hover { border-color: var(--green); color: var(--green); background: var(--green-glow); }

.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  width: 36px; height: 36px;
  border-radius: var(--radius);
  cursor: pointer;
  align-items: center; justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
}
.hamburger:hover { border-color: var(--green); color: var(--green); }

/* ============================================================
   HERO
   ============================================================ */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0;
  padding-top: var(--nav-h);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4rem;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text3);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.hero-label span { color: var(--green); }

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  color: var(--green);
  text-shadow: 0 0 40px rgba(0,255,65,0.3);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--text2);
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
}
.hero-subtitle .typing { color: var(--green2); }

.hero-bio {
  max-width: 520px;
  color: var(--text2);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 2.5rem;
  border-left: 2px solid var(--green-dim);
  padding-left: 1rem;
}

.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid;
}
.btn-primary {
  background: var(--green);
  color: #000;
  border-color: var(--green);
  font-weight: 600;
}
.btn-primary:hover {
  background: transparent;
  color: var(--green);
  box-shadow: 0 0 20px var(--green-glow);
}
.btn-outline {
  background: transparent;
  color: var(--green2);
  border-color: var(--border2);
}
.btn-outline:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-glow);
}

.hero-socials {
  display: flex;
  gap: 12px;
  margin-top: 2rem;
}
.social-link {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text3);
  font-size: 1rem;
  transition: var(--transition);
}
.social-link:hover { border-color: var(--green); color: var(--green); background: var(--green-glow); }

.hero-image {
  flex-shrink: 0;
  position: relative;
}
.hero-image::before {
  content: '';
  position: absolute;
  inset: -8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transform: rotate(3deg);
}
.hero-image::after {
  content: '';
  position: absolute;
  inset: -16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transform: rotate(-2deg);
  opacity: 0.5;
}
.hero-image img {
  width: 280px;
  height: 280px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 2px solid var(--green-dim);
  display: block;
  position: relative;
  z-index: 1;
  filter: grayscale(20%);
  transition: filter 0.4s;
}
.hero-image:hover img { filter: grayscale(0); }

/* scroll indicator */
.scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text3);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  animation: scrollBounce 2s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ============================================================
   SECTION TITLES
   ============================================================ */
.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--green2);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.section-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--text);
}
.section-title span { color: var(--green); }
.section-divider {
  width: 60px; height: 2px;
  background: var(--green-dim);
  margin: 1.2rem auto 0;
  position: relative;
}
.section-divider::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 8px; height: 8px;
  border: 2px solid var(--green);
  border-radius: 50%;
}

/* ============================================================
   ABOUT
   ============================================================ */
#about { background: var(--bg2); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}
.about-text p { color: var(--text2); margin-bottom: 1rem; line-height: 1.9; }
.about-text strong { color: var(--green2); }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  text-align: center;
}
.stat-card .num {
  display: block;
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--green);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card .label { font-size: 0.78rem; color: var(--text3); letter-spacing: 0.05em; }

.skills-block h3 {
  font-family: var(--font-mono);
  color: var(--green2);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.skills-group { margin-bottom: 2rem; }

.skill-bar-wrap { margin-bottom: 12px; }
.skill-bar-head {
  display: flex; justify-content: space-between;
  margin-bottom: 4px;
  font-size: 0.85rem;
  color: var(--text2);
  font-family: var(--font-mono);
}
.skill-bar-track {
  height: 4px;
  background: var(--green-dim);
  border-radius: 2px;
  overflow: hidden;
}
.skill-bar-fill {
  height: 100%;
  background: var(--green2);
  border-radius: 2px;
  width: 0;
  transition: width 1.4s cubic-bezier(0.4,0,0.2,1);
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text3);
  transition: var(--transition);
}
.tag:hover { border-color: var(--green2); color: var(--green2); background: var(--green-glow2); }

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  cursor: default;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--green2), transparent);
  transform: scaleX(0);
  transition: transform 0.4s;
}
.project-card:hover {
  border-color: var(--green-dim);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--green-glow2);
}
.project-card:hover::before { transform: scaleX(1); }

.project-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--green-glow);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--green);
  font-size: 1.4rem;
  margin-bottom: 1.2rem;
}

.project-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1.5rem; }
.project-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 3px 8px;
  border: 1px solid var(--green-dim);
  border-radius: 3px;
  color: var(--green2);
  background: var(--green-glow2);
}

.project-links { display: flex; gap: 12px; }
.project-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text3);
  letter-spacing: 0.05em;
  display: flex; align-items: center; gap: 4px;
  transition: var(--transition);
}
.project-link:hover { color: var(--green); }

/* ============================================================
   TIMELINE (Education/Experience)
   ============================================================ */
#timeline { background: var(--bg2); }
.timeline { position: relative; max-width: 750px; margin: 0 auto; }
.timeline::before {
  content: '';
  position: absolute;
  left: 24px; top: 0; bottom: 0;
  width: 1px;
  background: var(--green-dim);
}
.timeline-item {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  position: relative;
}
.timeline-dot {
  width: 48px; height: 48px;
  flex-shrink: 0;
  border: 2px solid var(--green-dim);
  border-radius: 50%;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--green);
  font-size: 1rem;
  z-index: 1;
  transition: var(--transition);
}
.timeline-item:hover .timeline-dot {
  border-color: var(--green);
  background: var(--green-glow);
}
.timeline-content {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.5rem;
  flex: 1;
  transition: var(--transition);
}
.timeline-item:hover .timeline-content { border-color: var(--green-dim); }
.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--green2);
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.timeline-title {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 4px;
}
.timeline-org {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text3);
  margin-bottom: 8px;
}
.timeline-desc { font-size: 0.88rem; color: var(--text2); line-height: 1.7; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4rem;
  align-items: start;
}
.contact-info h3 {
  font-family: var(--font-mono);
  color: var(--green2);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 1.2rem;
}
.contact-icon {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--green2);
  flex-shrink: 0;
  font-size: 0.9rem;
}
.contact-item-text label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.contact-item-text span {
  font-size: 0.9rem;
  color: var(--text2);
}

/* Form */
.form-group { margin-bottom: 1.2rem; }
.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  resize: vertical;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text3); }
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--green2);
  box-shadow: 0 0 0 3px var(--green-glow2);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-success {
  background: var(--green-glow);
  border: 1px solid var(--green-dim);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  color: var(--green2);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-top: 1rem;
}
.form-error {
  background: rgba(255,30,30,0.08);
  border: 1px solid rgba(255,60,60,0.3);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  color: #ff6060;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  position: relative; z-index: 1;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
}
.footer-logo {
  font-family: var(--font-mono);
  color: var(--green);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.footer-links a:hover { color: var(--green); }
.footer-copy {
  font-size: 0.8rem;
  color: var(--text3);
  font-family: var(--font-mono);
}

/* ============================================================
   GLITCH EFFECT
   ============================================================ */
.glitch {
  position: relative;
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}
.glitch::before {
  color: #0ff;
  animation: glitch1 3.5s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}
.glitch::after {
  color: #f0f;
  animation: glitch2 3.5s infinite;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}
@keyframes glitch1 {
  0%,94%,100% { transform: none; opacity: 0; }
  95% { transform: translate(-2px, 1px); opacity: 0.7; }
  97% { transform: translate(2px, -1px); opacity: 0.7; }
}
@keyframes glitch2 {
  0%,94%,100% { transform: none; opacity: 0; }
  96% { transform: translate(2px, 2px); opacity: 0.7; }
  98% { transform: translate(-2px, -2px); opacity: 0.7; }
}

/* ============================================================
   CURSOR
   ============================================================ */
.cursor-dot, .cursor-ring {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.3s;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--green);
  transform: translate(-50%, -50%);
  top: 0; left: 0;
}
.cursor-ring {
  width: 30px; height: 30px;
  border: 1px solid var(--green);
  opacity: 0.4;
  transform: translate(-50%, -50%);
  top: 0; left: 0;
  transition: width 0.2s, height 0.2s, opacity 0.3s;
}
.cursor-ring.hover { width: 50px; height: 50px; opacity: 0.2; }

/* ============================================================
   PROGRESS BAR (page scroll)
   ============================================================ */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--green);
  z-index: 9998;
  width: 0;
  transition: width 0.1s;
  box-shadow: 0 0 8px var(--green);
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
#back-to-top {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 40px; height: 40px;
  background: var(--card-bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--green2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  z-index: 100;
  opacity: 0;
  transform: translateY(10px);
  transition: var(--transition);
}
#back-to-top.visible { opacity: 1; transform: translateY(0); }
#back-to-top:hover { border-color: var(--green); color: var(--green); background: var(--green-glow); }

/* ============================================================
   MOBILE MENU
   ============================================================ */
@media (max-width: 768px) {
  .hamburger { display: flex; }

  .nav-links {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    background: rgba(0,8,1,0.97);
    backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    transform: translateY(-110%);
    transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
    border-bottom: 1px solid var(--border);
  }
  body.light-mode .nav-links { background: rgba(240,247,241,0.97); }
  .nav-links.active { transform: translateY(0); }

  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-image { display: none; }
  .hero-bio { margin: 0 auto 2.5rem; }
  .hero-ctas { justify-content: center; }
  .hero-socials { justify-content: center; }

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

  .cursor-dot, .cursor-ring { display: none; }
}
