:root {
  --bg: #061018;
  --bg-deep: #02070d;
  --surface: rgba(12, 27, 40, 0.82);
  --surface-strong: rgba(17, 38, 55, 0.94);
  --border: rgba(88, 217, 255, 0.18);
  --border-strong: rgba(88, 217, 255, 0.34);
  --text: #e8f6ff;
  --muted: #91a9b8;
  --muted-2: #607686;
  --cyan: #58d9ff;
  --teal: #3df4c5;
  --green: #7cff9b;
  --purple: #b38cff;
  --amber: #ffd166;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(88, 217, 255, 0.14), transparent 32rem),
    radial-gradient(circle at top right, rgba(179, 140, 255, 0.12), transparent 30rem),
    linear-gradient(180deg, var(--bg), var(--bg-deep) 56%, #03111a);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

img,
svg {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3,
h4 {
  margin-top: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 999;
  background: var(--cyan);
  color: #001018;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-weight: 800;
}

.skip-link:focus {
  top: 1rem;
}

.noise-layer {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 92%);
}

.grid-glow {
  pointer-events: none;
  position: fixed;
  inset: auto 0 0 0;
  height: 18rem;
  z-index: -1;
  background: linear-gradient(to top, rgba(61, 244, 197, 0.08), transparent);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(2, 7, 13, 0.76);
  border-bottom: 1px solid rgba(88, 217, 255, 0.11);
}

.nav-shell {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-weight: 800;
  font-size: clamp(0.9rem, 2vw, 1rem);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.prompt-green {
  color: var(--green);
  text-shadow: 0 0 24px rgba(124, 255, 155, 0.28);
}

.muted {
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.55rem, 1vw, 1rem);
  font-size: 0.92rem;
  color: var(--muted);
}

.nav-links a {
  padding: 0.55rem 0.35rem;
  border-radius: 999px;
  transition: color 160ms ease, background 160ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
  background: rgba(88, 217, 255, 0.08);
  outline: none;
}

.nav-links .nav-cta {
  color: #001018;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  padding: 0.65rem 0.95rem;
  font-weight: 800;
  box-shadow: 0 12px 35px rgba(88, 217, 255, 0.16);
}

.mobile-menu {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(12, 27, 40, 0.75);
  padding: 0.7rem;
  cursor: pointer;
}

.mobile-menu span {
  display: block;
  height: 2px;
  margin: 5px 0;
  border-radius: 999px;
  background: var(--text);
}

.section-pad {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  padding: 7rem 0;
}

.narrow-section {
  padding-top: 4.5rem;
}

.hero {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding-top: 4rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.75rem;
  margin-bottom: 1.5rem;
  color: var(--teal);
  border: 1px solid rgba(61, 244, 197, 0.2);
  border-radius: 999px;
  background: rgba(61, 244, 197, 0.06);
  font-size: 0.9rem;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 7px rgba(124, 255, 155, 0.1), 0 0 22px rgba(124, 255, 155, 0.8);
}

.hero h1 {
  margin-bottom: 0.55rem;
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: -0.075em;
}

.hero h2 {
  margin-bottom: 1.4rem;
  max-width: 760px;
  font-size: clamp(1.25rem, 3vw, 2.2rem);
  line-height: 1.15;
  color: var(--cyan);
  letter-spacing: -0.035em;
}

.hero-copy {
  max-width: 740px;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.7vw, 1.25rem);
}

.hero-actions,
.contact-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 800;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.btn.primary {
  color: #001018;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  box-shadow: 0 18px 45px rgba(88, 217, 255, 0.2);
}

.btn.secondary {
  color: var(--text);
  border-color: rgba(88, 217, 255, 0.28);
  background: rgba(88, 217, 255, 0.08);
}

.btn.ghost {
  color: var(--muted);
  border-color: rgba(145, 169, 184, 0.24);
  background: rgba(255, 255, 255, 0.03);
}

.btn.ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 2rem;
}

.hero-meta span {
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(145, 169, 184, 0.16);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(12, 27, 40, 0.6);
  font-size: 0.88rem;
}

.terminal-card {
  position: relative;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(12, 27, 40, 0.96), rgba(4, 15, 24, 0.88));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  overflow: hidden;
}

.terminal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(88, 217, 255, 0.11), transparent 42%, rgba(124, 255, 155, 0.08));
  opacity: 0.78;
}

.terminal-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.48rem;
  min-height: 48px;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(88, 217, 255, 0.14);
  background: rgba(2, 7, 13, 0.44);
}

.terminal-top span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted-2);
}

.terminal-top span:nth-child(1) { background: #ff657a; }
.terminal-top span:nth-child(2) { background: var(--amber); }
.terminal-top span:nth-child(3) { background: var(--green); }

.terminal-top p {
  margin: 0 0 0 0.35rem;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.86rem;
}

pre {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 1.35rem;
  color: var(--text);
  white-space: pre-wrap;
  overflow-x: auto;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.92rem;
}

.cmd {
  color: var(--green);
}

.hero-terminal {
  transform: rotate(1.2deg);
}

.section-heading {
  max-width: 820px;
  margin-bottom: 2.25rem;
}

.section-heading p,
.card-kicker,
.date {
  color: var(--green);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.91rem;
  margin-bottom: 0.6rem;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4.6vw, 4rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.section-heading.compact {
  margin-bottom: 1rem;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  gap: 2rem;
  align-items: start;
}

.about-copy {
  padding: clamp(1.3rem, 3vw, 2.3rem);
  border: 1px solid rgba(145, 169, 184, 0.12);
  border-radius: var(--radius-lg);
  background: rgba(12, 27, 40, 0.46);
}

.about-copy p {
  color: var(--muted);
  font-size: 1.05rem;
}

.signal-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.signal-row span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.32rem 0.58rem;
  border: 1px solid rgba(88, 217, 255, 0.18);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(88, 217, 255, 0.06);
  font-size: 0.82rem;
}

.json-card pre {
  min-height: 335px;
}

.focus-grid,
.project-grid,
.skills-grid,
.education-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.focus-card,
.project-card,
.research-card,
.education-card,
.timeline-content,
.contact-card {
  border: 1px solid rgba(145, 169, 184, 0.14);
  border-radius: var(--radius-lg);
  background: rgba(12, 27, 40, 0.55);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
}

.focus-card,
.project-card,
.research-card,
.education-card {
  padding: 1.35rem;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.focus-card:hover,
.project-card:hover,
.research-card:hover,
.education-card:hover,
.skill-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
  background: rgba(17, 38, 55, 0.68);
}

.icon-chip {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 1rem;
  border-radius: 15px;
  color: #001018;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-weight: 900;
}

.focus-card h3,
.project-card h3,
.research-card h3,
.education-card h3,
.timeline-content h3,
.skill-card h3 {
  margin-bottom: 0.55rem;
  font-size: 1.17rem;
  line-height: 1.22;
}

.focus-card p,
.project-card p,
.research-card p,
.education-card p,
.timeline-content p,
.timeline-content li,
.project-card li {
  color: var(--muted);
}

.focus-card > span {
  display: block;
  margin-top: 1rem;
  color: var(--teal);
  font-size: 0.86rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.surface-section {
  position: relative;
}

.surface-section::before {
  content: "";
  position: absolute;
  inset: 3rem 50% 3rem 50%;
  width: 100vw;
  transform: translateX(-50%);
  border-block: 1px solid rgba(88, 217, 255, 0.08);
  background: linear-gradient(90deg, rgba(88, 217, 255, 0.045), rgba(124, 255, 155, 0.035), rgba(179, 140, 255, 0.045));
  z-index: -1;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.research-card pre {
  margin-top: 1.2rem;
  padding: 1rem;
  border: 1px solid rgba(88, 217, 255, 0.14);
  border-radius: var(--radius-md);
  background: rgba(2, 7, 13, 0.46);
}

.research-card code {
  font-size: 0.78rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  border: 1px solid rgba(145, 169, 184, 0.2);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(12, 27, 40, 0.66);
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  font-weight: 800;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.filter-btn:hover,
.filter-btn:focus-visible,
.filter-btn.active {
  color: #001018;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  border-color: transparent;
  transform: translateY(-1px);
  outline: none;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.project-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--green);
  font-size: 0.8rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.project-card ul,
.timeline-content ul,
.education-card ul {
  padding-left: 1.15rem;
  margin: 0.9rem 0 0;
}

.project-card[hidden] {
  display: none;
}

.timeline {
  position: relative;
  display: grid;
  gap: 1rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(var(--cyan), var(--green), transparent);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 1rem;
}

.timeline-marker {
  width: 33px;
  height: 33px;
  border: 1px solid rgba(88, 217, 255, 0.34);
  border-radius: 50%;
  background: radial-gradient(circle, var(--green) 0 28%, rgba(12, 27, 40, 1) 31% 100%);
  box-shadow: 0 0 24px rgba(124, 255, 155, 0.22);
}

.timeline-content {
  padding: 1.35rem;
}

.timeline-content h4,
.education-card h4 {
  color: var(--cyan);
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.skills-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.skill-card {
  padding: 1.2rem;
  border-radius: var(--radius-md);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.skill-card h3 {
  color: var(--green);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 1rem;
}

.skill-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.education-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.certs li {
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.contact-section {
  padding-bottom: 4rem;
}

.contact-card {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.contact-card::before {
  content: "";
  position: absolute;
  right: -8rem;
  top: -8rem;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(88, 217, 255, 0.18), transparent 68%);
}

.contact-card > * {
  position: relative;
  z-index: 1;
}

.contact-card > p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.1rem;
}

.mini-terminal {
  margin-top: 2rem;
  max-width: 650px;
  border-radius: var(--radius-md);
}

.footer {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted-2);
  border-top: 1px solid rgba(88, 217, 255, 0.08);
  font-size: 0.9rem;
}

.footer p {
  margin: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 650ms ease, transform 650ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .hero,
  .about-grid,
  .research-grid,
  .focus-grid,
  .project-grid,
  .education-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-terminal {
    transform: none;
  }

  .focus-grid,
  .project-grid,
  .education-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .research-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .mobile-menu {
    display: inline-block;
  }

  .nav-links {
    position: fixed;
    inset: 74px 1rem auto 1rem;
    display: grid;
    gap: 0.25rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(2, 7, 13, 0.96);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity 180ms ease, transform 180ms ease;
  }

  .nav-links.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-links a {
    padding: 0.85rem 1rem;
  }

  .section-pad {
    padding: 4.5rem 0;
  }

  .hero {
    padding-top: 3rem;
  }

  .focus-grid,
  .project-grid,
  .skills-grid,
  .education-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .contact-actions {
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  pre {
    padding: 1rem;
  }

  code {
    font-size: 0.82rem;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ==============================
   Custom Hollow Green Cursor
================================= */

@media (pointer: fine) {
  body {
    cursor: none;
  }

  a,
  button,
  .btn,
  .filter-btn,
  .project-card,
  .focus-card,
  .research-card,
  .terminal-card {
    cursor: none;
  }

  .custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 28px;
    height: 28px;
    border: 2px solid #22c55e;
    border-radius: 50%;
    background: transparent;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition:
      width 0.18s ease,
      height 0.18s ease,
      border-color 0.18s ease,
      opacity 0.18s ease;
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.45);
  }

  .custom-cursor.cursor-hover {
    width: 42px;
    height: 42px;
    border-color: #00f5a0;
    box-shadow: 0 0 24px rgba(0, 245, 160, 0.65);
  }

  .custom-cursor.cursor-hidden {
    opacity: 0;
  }
}

/* Disable custom cursor on touch/mobile devices */
@media (pointer: coarse) {
  .custom-cursor {
    display: none;
  }
}
