/* ============================================================
   ROOT TOKENS
   ============================================================ */
:root {
  --bg:       #0a0a0a;
  --surface:  #111111;
  --surface2: #1a1a1a;
  --border:   #222222;
  --green:    #00ff41;
  --green-dim:#00aa2b;
  --cyan:     #00b8ff;
  --orange:   #ff6b35;
  --white:    #e8e8e8;
  --muted:    #666666;
  --font:     'JetBrains Mono', monospace;
  --radius:   2px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.7;
  cursor: none;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; cursor: none; }
ul { list-style: none; }

/* ============================================================
   CUSTOM CURSOR
   ============================================================ */
#cursor-dot {
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%);
  transition: background 0.2s;
  box-shadow: 0 0 8px var(--green);
}

#cursor-ring {
  width: 28px; height: 28px;
  border: 1px solid var(--green);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, border-color 0.2s, transform 0.08s ease-out;
  opacity: 0.6;
}

body.cursor-hover #cursor-ring {
  width: 44px; height: 44px;
  border-color: var(--cyan);
  opacity: 1;
}

body.cursor-click #cursor-dot {
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

#trail-canvas {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9990;
}

/* ============================================================
   CRT / SCANLINES
   ============================================================ */
.crt-overlay {
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 65, 0.015) 2px,
    rgba(0, 255, 65, 0.015) 4px
  );
  pointer-events: none; z-index: 9980;
  animation: flicker 8s infinite;
}

.scanlines {
  position: fixed; inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(0,0,0,0.08) 50%
  );
  background-size: 100% 4px;
  pointer-events: none; z-index: 9981;
}

@keyframes flicker {
  0%,100% { opacity:1 }
  92% { opacity:1 }
  93% { opacity:0.85 }
  94% { opacity:1 }
  96% { opacity:0.9 }
  97% { opacity:1 }
}

/* ============================================================
   NAV
   ============================================================ */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 40px;
  background: rgba(10,10,10,0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.nav-logo {
  font-size: 13px;
  color: var(--muted);
}
.nav-logo .prompt { color: var(--green); }
.nav-logo .colon  { color: var(--white); }
.nav-logo .path   { color: var(--cyan); }
.cursor-blink { animation: blink 1s step-end infinite; }
@keyframes blink { 50%{opacity:0} }

.nav-links {
  display: flex; gap: 28px;
}
.nav-links a {
  font-size: 12px;
  color: var(--muted);
  transition: color 0.2s;
  letter-spacing: 0.05em;
}
.nav-links a:hover { color: var(--green); }
.nav-terminal {
  color: var(--green) !important;
  border: 1px solid var(--green-dim);
  padding: 4px 10px;
  transition: background 0.2s !important;
}
.nav-terminal:hover { background: rgba(0,255,65,0.08) !important; }

/* ============================================================
   HERO
   ============================================================ */
#hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 100px 40px 60px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,255,65,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,65,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.8) 30%, transparent 80%);
}

.hero-content {
  position: relative; z-index: 2;
  max-width: 760px;
  width: 100%;
}

/* Boot sequence */
.boot-sequence {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.9;
  margin-bottom: 20px;
}
.boot-line {
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.3s, transform 0.3s;
}
.boot-line.visible { opacity: 1; transform: none; }
.boot-line .green { color: var(--green); }

/* Hero main */
.hero-eyebrow {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}
.hero-eyebrow .green { color: var(--green); }

.hero-name {
  font-size: clamp(42px, 8vw, 80px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--white);
  line-height: 1;
  margin-bottom: 16px;
  text-shadow: 0 0 40px rgba(0,255,65,0.2);
}

/* Glitch */
.glitch {
  position: relative;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute; top: 0; left: 0;
  width: 100%;
}
.glitch::before {
  color: var(--cyan);
  clip-path: polygon(0 30%, 100% 30%, 100% 50%, 0 50%);
  animation: glitch1 4s infinite;
  opacity: 0;
}
.glitch::after {
  color: var(--orange);
  clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
  animation: glitch2 4s infinite;
  opacity: 0;
}
@keyframes glitch1 {
  0%,94%,100% { opacity:0; transform: none }
  95% { opacity:0.8; transform: translateX(-3px) }
  96% { opacity:0.8; transform: translateX(3px) }
  97% { opacity:0; transform: none }
}
@keyframes glitch2 {
  0%,94%,100% { opacity:0; transform: none }
  95% { opacity:0.6; transform: translateX(4px) }
  96% { opacity:0.6; transform: translateX(-2px) }
  97% { opacity:0; transform: none }
}

.hero-role {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 24px;
}
.hero-role .green { color: var(--green); }

.hero-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 32px;
}

.tag {
  font-size: 11px;
  color: var(--cyan);
  border: 1px solid rgba(0, 184, 255, 0.25);
  padding: 3px 8px;
  letter-spacing: 0.06em;
}

.hero-actions {
  display: flex; gap: 16px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  background: rgba(0,255,65,0.1);
  border: 1px solid var(--green);
  color: var(--green);
  font-family: var(--font); font-size: 13px;
  transition: background 0.2s, box-shadow 0.2s;
}
.btn-primary:hover {
  background: rgba(0,255,65,0.18);
  box-shadow: 0 0 18px rgba(0,255,65,0.2);
}

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border: 1px solid var(--border);
  color: var(--white);
  font-family: var(--font); font-size: 13px;
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

.hero-stats {
  display: flex; align-items: center; gap: 20px;
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num { font-size: 22px; font-weight: 700; }
.stat-label { font-size: 10px; color: var(--muted); letter-spacing: 0.1em; }
.stat-div { color: var(--border); font-size: 18px; }

.scroll-hint {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: var(--muted); letter-spacing: 0.1em;
  animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce { 0%,100%{transform:translateX(-50%) translateY(0)} 50%{transform:translateX(-50%) translateY(6px)} }

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 90px 40px;
}

.section-header {
  margin-bottom: 48px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}
.section-cmd { font-size: 13px; color: var(--muted); }

/* Reveal animations */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in-view { opacity: 1; transform: none; }
.reveal-item { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal-item.in-view { opacity: 1; transform: none; }

/* Colors */
.green  { color: var(--green) !important; }
.cyan   { color: var(--cyan) !important; }
.orange { color: var(--orange) !important; }
.white  { color: var(--white) !important; }
.comment{ color: var(--muted); }

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

.file-output p { margin-bottom: 14px; line-height: 1.8; }
.file-output .comment { font-size: 12px; }

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
}
.card-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
}
.key { color: var(--muted); }
.val { color: var(--white); }

/* ============================================================
   SKILLS
   ============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
}
.skill-group-title {
  font-size: 12px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.skill-item {
  display: grid;
  grid-template-columns: 160px 1fr 36px;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.skill-name { font-size: 12px; color: var(--muted); }
.skill-track {
  height: 3px;
  background: var(--border);
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--green-dim), var(--green));
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 6px rgba(0,255,65,0.4);
}
.skill-fill.animated { width: var(--w); }
.skill-pct { font-size: 10px; color: var(--muted); text-align: right; }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--green), var(--border), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}
.timeline-dot {
  width: 10px; height: 10px;
  background: var(--green);
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px var(--green);
  border-radius: 50%;
  position: absolute;
  left: -29px; top: 6px;
}
.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
  transition: border-color 0.2s;
}
.timeline-card:hover { border-color: var(--green-dim); }

.tl-meta {
  display: flex; gap: 16px; align-items: center;
  margin-bottom: 8px;
}
.tl-commit { font-size: 11px; color: var(--muted); font-style: italic; }
.tl-date { font-size: 11px; }
.tl-company { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.tl-role { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.tl-bullets { padding-left: 16px; margin-bottom: 16px; }
.tl-bullets li {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 6px;
  list-style: none;
  position: relative;
}
.tl-bullets li::before {
  content: '→';
  position: absolute; left: -16px;
  color: var(--green-dim);
}
.tl-tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.project-card:hover {
  border-color: var(--green-dim);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,255,65,0.08);
}

.proj-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.proj-icon { font-size: 22px; color: var(--green); }
.proj-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted);
}
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.dot.green { background: var(--green); box-shadow: 0 0 5px var(--green); }
.dot.orange { background: var(--orange); box-shadow: 0 0 5px var(--orange); }

.proj-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--white);
}
.proj-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 16px;
}
.proj-tech { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.proj-links { display: flex; gap: 16px; }
.proj-link {
  font-size: 12px;
  color: var(--muted);
  transition: color 0.2s;
}
.proj-link:hover { color: var(--white); }

/* ============================================================
   TERMINAL
   ============================================================ */
.terminal-wrapper {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 0 40px rgba(0,255,65,0.06);
  max-width: 800px;
}

.term-titlebar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.term-dots { display: flex; gap: 6px; }
.tdot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.tdot.red    { background: #ff5f57; }
.tdot.yellow { background: #febc2e; }
.tdot.tgreen { background: #28c840; }

.term-title {
  font-size: 12px;
  color: var(--muted);
  flex: 1; text-align: center;
}
.term-hint {
  font-size: 11px;
  color: var(--muted);
  opacity: 0.5;
}

.term-body {
  padding: 16px;
  min-height: 320px;
  max-height: 480px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
}

#termOutput .t-line {
  margin-bottom: 2px;
}
.t-cmd  { color: var(--white); }
.t-res  { color: var(--green); }
.t-err  { color: var(--orange); }
.t-info { color: var(--cyan); }
.t-muted{ color: var(--muted); }

.term-input-line {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px;
}
.term-prompt { font-size: 13px; white-space: nowrap; }

#termInput {
  flex: 1;
  background: transparent;
  border: none; outline: none;
  color: var(--white);
  font-family: var(--font);
  font-size: 13px;
  caret-color: transparent;
}
.term-cursor-blink {
  color: var(--green);
  animation: blink 1s step-end infinite;
  user-select: none;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.contact-intro {
  font-size: 15px;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 32px;
}
.contact-intro em { color: var(--white); font-style: normal; }

.contact-links { display: flex; flex-direction: column; gap: 12px; }
.contact-item {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.2s;
}
.contact-item:hover { border-color: var(--green-dim); }
.contact-cmd { min-width: 80px; }
.contact-val { color: var(--muted); }

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 28px;
}
.form-line {
  margin-bottom: 18px;
}
.form-line label {
  display: block;
  font-size: 11px;
  margin-bottom: 6px;
  color: var(--muted);
}
.form-line input,
.form-line textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--white);
  font-family: var(--font);
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
  border-radius: 0;
}
.form-line input:focus,
.form-line textarea:focus { border-color: var(--green-dim); }

.submit-btn {
  width: 100%;
  justify-content: center;
  font-family: var(--font);
}

.form-feedback {
  margin-top: 12px;
  font-size: 12px;
  color: var(--green);
  border: 1px solid var(--green-dim);
  padding: 8px 12px;
  background: rgba(0,255,65,0.05);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 20px 40px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.footer-right { color: var(--muted); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  #navbar { padding: 14px 20px; }
  .nav-links { display: none; }
  .section { padding: 60px 20px; }
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 14px; }
  #hero { padding: 100px 20px 60px; }
  .skill-item { grid-template-columns: 120px 1fr 36px; }
  footer { padding: 20px; }
  .footer-inner { flex-direction: column; gap: 6px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}