/* =============================================================
   Neural Interface — Personal Site Stylesheet
   Theme: Dark technical + scientific/data-viz
   Palette: #0d0f14 bg · #f97316 accent · #e2e8f0 text
   ============================================================= */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:           #0d0f14;
  --surface:      #161b22;
  --surface-2:    #1a2030;
  --border:       #1f2937;
  --border-bright:#2d3a4a;
  --text:         #e2e8f0;
  --text-muted:   #8b9ab0;
  --accent:       #f97316;
  --accent-dim:   rgba(249, 115, 22, 0.12);
  --accent-glow:  rgba(249, 115, 22, 0.25);
  --mono:         'JetBrains Mono', 'Courier New', monospace;
  --sans:         'Inter', system-ui, sans-serif;
  --nav-h:        60px;
  --radius:       4px;
  --transition:   0.2s ease;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--transition);
}
a:hover { opacity: 0.8; }

img { max-width: 100%; display: block; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

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

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar             { width: 6px; }
::-webkit-scrollbar-track       { background: var(--bg); }
::-webkit-scrollbar-thumb       { background: var(--border-bright); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* =============================================================
   NAVIGATION
   ============================================================= */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(13, 15, 20, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: border-color var(--transition), background var(--transition);
}

.top-nav.scrolled {
  border-bottom-color: var(--border-bright);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
}
.nav-brand:hover { opacity: 1; }
.nav-brand .accent { color: var(--accent); }

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  opacity: 1;
}

.nav-cv-btn {
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent) !important;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  transition: background var(--transition), color var(--transition) !important;
}
.nav-cv-btn:hover {
  background: var(--accent);
  color: var(--bg) !important;
  opacity: 1 !important;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =============================================================
  TOP 
   ============================================================= */
.top {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: var(--nav-h);
}

#network-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.top-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
}

.top-pre {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.top-name {
  font-family: var(--mono);
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.top-title {
  font-family: var(--sans);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
}

.top-sub {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 2.5rem;
  opacity: 0.7;
}

.top-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
              box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  display: inline-block;
}
.btn:hover { transform: translateY(-2px); opacity: 1; }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: #fb923c;
  box-shadow: 0 0 18px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline:hover {
  background: var(--accent-dim);
  box-shadow: 0 0 14px var(--accent-glow);
}

.top-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  animation: scrollBounce 2s ease-in-out infinite;
  z-index: 1;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.5; }
  50%       { transform: translateX(-50%) translateY(6px); opacity: 1; }
}

/* =============================================================
   SECTIONS — shared
   ============================================================= */
.section {
  padding: 6rem 0 4rem;
  position: relative;
}
.section-alt {
  background: var(--surface);
}

.section-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.section-heading {
  font-family: var(--mono);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
}
.section-heading::after {
  content: '';
  display: block;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
  margin-top: 0.4rem;
}

/* Waveform divider */
.waveform-divider {
  width: 100%;
  height: 60px;
  margin-top: 3rem;
  overflow: hidden;
}
.waveform-svg {
  width: 100%;
  height: 100%;
}

/* =============================================================
   ABOUT
   ============================================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.8;
  margin-bottom: 1.2rem;
}
.about-text p:last-child { margin-bottom: 0; }

.meta-block {
  margin-bottom: 1.6rem;
}
.meta-block:last-child { margin-bottom: 0; }

.meta-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  margin-bottom: 0.3rem;
  opacity: 0.8;
}
.meta-block p { font-size: 0.95rem; color: var(--text); }
.meta-block .muted { font-size: 0.88rem; }

/* =============================================================
   SKILLS
   ============================================================= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.skills-col-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
  opacity: 0.85;
}

.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 2px;
  padding: 0.25rem 0.6rem;
  letter-spacing: 0.04em;
  transition: background var(--transition), border-color var(--transition);
}
.tag:hover {
  background: rgba(249, 115, 22, 0.2);
  border-color: rgba(249, 115, 22, 0.45);
}

.tag-sm {
  font-size: 0.68rem;
  padding: 0.18rem 0.5rem;
}

/* =============================================================
   PROJECTS — Cards
   ============================================================= */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  /* Chamfered top-right corner */
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
  transition: border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
}
/* The clip-path cuts the border at the corner, so we fake the corner notch line */
.card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 18px; height: 18px;
  border-bottom: 1px solid var(--border);
  border-left: 0;
  transform-origin: top right;
  transform: rotate(0deg);
  pointer-events: none;
  z-index: 1;
  /* diagonal line via gradient */
  background: linear-gradient(
    225deg,
    transparent 49%,
    var(--border) 49%,
    var(--border) 51%,
    transparent 51%
  );
}
.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-3px);
}
.card:hover::before {
  background: linear-gradient(
    225deg,
    transparent 49%,
    var(--accent) 49%,
    var(--accent) 51%,
    transparent 51%
  );
  border-bottom-color: var(--accent);
}

.card-inner {
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 0.9rem;
}

.card-header { display: flex; flex-direction: column; gap: 0.4rem; }

.card-domain-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
}

.card-title {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.card-links {
  display: flex;
  gap: 1rem;
  padding-top: 0.2rem;
  border-top: 1px solid var(--border);
}

.card-link {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  transition: opacity var(--transition);
}
.card-link:hover { opacity: 0.7; }

/* =============================================================
   PUBLICATIONS
   ============================================================= */
.pub-group {
  margin-bottom: 3rem;
}
.pub-group:last-child { margin-bottom: 0; }

.pub-group-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
  opacity: 0.85;
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pub-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-bright);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  transition: border-left-color var(--transition), box-shadow var(--transition);
}
.pub-card:hover {
  border-left-color: var(--accent);
  box-shadow: -2px 0 12px var(--accent-glow);
}

.pub-badges {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.pub-badge {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 0.15rem 0.55rem;
  border-radius: 2px;
  text-transform: uppercase;
}

.pub-badge-journal  { background: rgba(99, 179, 237, 0.15); color: #63b3ed; border: 1px solid rgba(99, 179, 237, 0.3); }
.pub-badge-preprint { background: rgba(159, 122, 234, 0.15); color: #9f7aea; border: 1px solid rgba(159, 122, 234, 0.3); }
.pub-badge-thesis   { background: rgba(72, 187, 120, 0.15); color: #48bb78; border: 1px solid rgba(72, 187, 120, 0.3); }
.pub-badge-poster   { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(249, 115, 22, 0.3); }
.pub-badge-oral     { background: rgba(246, 173, 85, 0.15); color: #f6ad55; border: 1px solid rgba(246, 173, 85, 0.3); }

.pub-citation {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 0.6rem;
}
.pub-citation strong { color: var(--text); }

.pub-links { display: flex; gap: 1rem; }

.pub-link {
  font-family: var(--mono);
  font-size: 0.73rem;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.pub-link:hover { opacity: 0.7; }

.pub-placeholder {
  font-family: var(--mono);
  font-size: 0.78rem;
  opacity: 0.45;
  padding: 0.5rem 0;
}

/* =============================================================
   FOOTER
   ============================================================= */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  position: relative;
}

/* Circuit trace decorative line */
.footer-circuit-line {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--border-bright) 20%,
    var(--accent) 40%,
    var(--accent) 60%,
    var(--border-bright) 80%,
    transparent 100%
  );
  opacity: 0.4;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color var(--transition);
}
.footer-link:hover { color: var(--accent); opacity: 1; }

.footer-copy {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  opacity: 0.5;
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(13, 15, 20, 0.97);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 1rem 2rem 1.5rem;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 0.6rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-links li:last-child a { border-bottom: none; }
  .nav-toggle { display: flex; }

  .top-name { font-size: clamp(2.5rem, 12vw, 4rem); }

  .section { padding: 4rem 0 3rem; }
}

@media (max-width: 480px) {
  .cards-grid { gap: 1rem; }
  .top-ctas { gap: 0.7rem; }
  .btn { padding: 0.55rem 1.1rem; font-size: 0.75rem; }
}
