:root {
  --bg: #000;
  --green: #00ff41;
  --green-dim: #00b32d;
  --green-faint: rgba(0, 255, 65, 0.15);
  --text: #e6ffe9;
  --muted: #8fbf98;
  --panel: rgba(0, 10, 2, 0.78);
  --border: rgba(0, 255, 65, 0.25);
  --surface: #000;               /* solid boxes: picker, toast, timeline dots */
  --overlay: rgba(0, 0, 0, 0.7); /* behind the email picker */
  --ghost-bg: rgba(0, 0, 0, 0.6);
  --on-green: #000;              /* text on green buttons */
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Space Grotesk", system-ui, sans-serif;
}


* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ---------- Matrix canvas ---------- */
#matrix {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
  opacity: 0.85;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.container { width: min(1100px, 92%); margin: 0 auto; }
section { padding: 90px 0; }
.accent { color: var(--green); }
.muted { color: var(--muted); }
.center { text-align: center; margin-top: 40px; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 40px;
  padding-top: 70px;
}
.hero-text { display: flex; flex-direction: column; align-items: center; }
.hero-photo { order: -1; }
.eyebrow { font-family: var(--mono); color: var(--green); margin-bottom: 12px; }
.cursor { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

h1 {
  font-size: clamp(2rem, 9vw, 5.2rem);
  line-height: 1.02;
  font-weight: 700;
  margin-bottom: 24px;
}
.name { white-space: nowrap; }
.glow { color: var(--green); text-shadow: 0 0 18px rgba(0, 255, 65, 0.6); }

/* ---------- Hero entrance (staggered, under 1s) ---------- */
.hero-in {
  opacity: 0;
  animation: hero-in 0.5s ease forwards;
  animation-delay: var(--d, 0s);
}
.d-0 { --d: 0s; }
.d-1 { --d: 0.05s; }
.d-2 { --d: 0.35s; }
.d-3 { --d: 0.5s; }
.d-4 { --d: 0.65s; }
@keyframes hero-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-in { opacity: 1; animation: none; }
}


.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  font-family: var(--mono);
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.dot, .status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  display: inline-block;
}
.tagline { color: var(--muted); margin-bottom: 28px; max-width: 46ch; }

.hero-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  border: 1px solid var(--green);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 20px rgba(0, 255, 65, 0.4); }
.btn-primary { background: var(--green); color: var(--on-green); font-weight: 700; }
.btn-ghost { background: var(--ghost-bg); color: var(--green); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; margin-top: 8px; }

.socials { display: flex; justify-content: center; gap: 20px; font-family: var(--mono); font-size: 0.9rem; }
.socials a { color: var(--muted); border-bottom: 1px dashed transparent; }
.socials a:hover { color: var(--green); border-color: var(--green); }

.hero-photo { display: flex; justify-content: center; }
.photo-frame {
  width: 200px;
  aspect-ratio: 1;
  border: 1px solid var(--green);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 255, 65, 0.25);
  background: var(--panel);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  color: var(--muted);
}

.stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.stat .num {
  display: block;
  font-family: var(--mono);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--green);
}
.stat .num::after { content: "+"; font-size: 1.2rem; opacity: 0.7; }
.stat .label { color: var(--muted); font-size: 0.85rem; }

/* ---------- Sections / panels ---------- */
.section-title {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  font-weight: 700;
  margin-bottom: 36px;
}
.section-title .accent { text-shadow: 0 0 10px rgba(0, 255, 65, 0.5); }
.section-title .prompt { color: var(--green-dim); }
.block-cursor {
  display: inline-block;
  width: 0.55em;
  height: 0.95em;
  margin-left: 6px;
  vertical-align: -0.1em;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: blink 1s steps(1) infinite;
}
@media (prefers-reduced-motion: reduce) { .block-cursor { animation: none; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  backdrop-filter: blur(3px);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.panel:hover { border-color: var(--green); box-shadow: 0 0 24px rgba(0, 255, 65, 0.15); }
.panel h3 { font-size: 1.25rem; margin-bottom: 6px; }
.panel p + p { margin-top: 8px; }
.meta { font-family: var(--mono); color: var(--green); font-size: 0.85rem; margin-bottom: 6px; }

.edu-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: stretch; }
.edu-grid .label-sm { margin-top: 18px; }
.edu-grid .checks li { color: var(--muted); }
.edu-progress { margin-top: 18px; }
.edu-progress-bar {
  height: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 255, 65, 0.05);
}
.edu-progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  transition: width 1.4s ease;
}
.edu-progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}
#edu-progress-pct { color: var(--green); }

.about-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.stack-title { margin-bottom: 18px !important; }
.about-side { display: grid; gap: 20px; }
.greeting { font-size: 1.6rem; font-weight: 700; margin-bottom: 12px; }
#greet { color: var(--green); font-family: var(--mono); transition: opacity 0.3s; }
.label-sm { font-family: var(--mono); font-size: 0.85rem; color: var(--green); margin: 20px 0 10px; }

.stack-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack-cmd { font-family: var(--mono); font-size: 0.8rem; font-weight: 400; color: var(--muted); }
.stack {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 28px;
}
.stack-label {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--green);
  padding-bottom: 8px;
  margin-bottom: 10px !important;
  border-bottom: 1px solid var(--border);
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
}
.stack-group ul { display: grid; gap: 6px; }
.stack-group li {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text);
  transition: color 0.15s, text-shadow 0.15s, transform 0.15s;
}
.stack-group li::before { content: "> "; color: var(--green-dim); }
.stack-group li:hover {
  color: var(--green);
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.6);
  transform: translateX(3px);
}
@media (max-width: 900px) { .stack { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .stack { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .stack { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.8rem;
  background: var(--green-faint);
}
.chips-sm li { font-size: 0.72rem; padding: 3px 10px; }
.link { color: var(--green); font-family: var(--mono); font-size: 0.9rem; }
.link:hover { text-decoration: underline; }

/* ---------- Projects ---------- */
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.project { display: flex; flex-direction: column; gap: 12px; }
.project:hover { transform: translateY(-4px); }
.project-img {
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  border: 1px dashed var(--border);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  color: var(--muted);
  background: rgba(0, 255, 65, 0.04);
  overflow: hidden;
}
.project-img img { width: 100%; height: 100%; object-fit: cover; }
.project p { color: var(--muted); font-size: 0.95rem; }
.project-links { display: flex; gap: 18px; margin-top: auto; }

/* ---------- Experience ---------- */
.exp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.exp-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--green);
  color: var(--green);
  font-family: var(--mono);
  font-weight: 700;
  margin-bottom: 14px;
}
.exp-grid p { color: var(--muted); }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 34px; }
/* Connector line, drawn per item so it always meets the vertically centred dots:
   first item: dot -> bottom, middle items: gap above -> bottom, last item: gap above -> dot */
.timeline > li::after {
  content: "";
  position: absolute;
  left: -24px; /* dot is 18px wide incl. border, starting at -32px: center = -23px */
  top: -24px;   /* reach up through the 22px gap to the previous item */
  bottom: -1px;
  width: 2px;
  background: var(--green);
  box-shadow: 0 0 6px rgba(0, 255, 65, 0.5);
  z-index: 0;
}
.timeline > li:first-child::after { top: 50%; }
.timeline > li:last-child::after { bottom: 50%; }
.timeline > li:only-child::after { display: none; }
.timeline > li {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 22px;
}
.timeline > li::before {
  content: "";
  position: absolute;
  left: -32px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--green);
  box-shadow: 0 0 10px var(--green);
  z-index: 1;
}
.timeline p { color: var(--muted); }
.checks li { color: var(--muted); }
.checks li { position: relative; padding-left: 20px; }
.checks li + li { margin-top: 6px; }
.checks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.timeline > li:last-child { margin-bottom: 0; }

/* ---------- Contact / footer ---------- */
#journey { padding-bottom: 40px; }
#contact { padding-top: 40px; }
.contact { text-align: center; padding: 60px 30px; }
.contact h2 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 12px; }
.contact p { color: var(--muted); margin-bottom: 28px; }

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 0 40px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  padding: 12px 20px;
  background: var(--surface);
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 0.9rem;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Email picker ---------- */
.email-picker {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  padding: 20px;
}
.email-picker[hidden] { display: none; }
.email-picker-box {
  position: relative;
  width: max-content;
  min-width: min(420px, 100%);
  max-width: 100%;
  padding: 32px;
  background: var(--surface);
  border-color: var(--green);
  box-shadow: 0 0 40px rgba(0, 255, 65, 0.25);
}
.email-picker-box h3 { margin-bottom: 16px; }
.email-picker-box .meta { white-space: nowrap; padding-right: 48px; }
@media (max-width: 480px) { .email-picker-box .meta { white-space: normal; word-break: break-all; } }
.email-picker-list { display: grid; gap: 8px; }
.email-option {
  text-align: left;
  padding: 11px 14px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.email-option:hover,
.email-option:focus-visible {
  outline: none;
  color: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 14px rgba(0, 255, 65, 0.25);
}
.email-picker-close {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 1rem;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--mono);
  cursor: pointer;
}
.email-picker-close:hover { color: var(--green); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .photo-frame { width: 160px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .edu-grid, .about-grid, .exp-grid, .project-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .footer { flex-direction: column; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .cursor { animation: none; }
}
