/**
 * custom.css — Guanchen Du's Personal Site Enhancement
 * Modern tech/research aesthetic inspired by GitHub profile
 */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@300;400;600;700;800&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --bg:         #090b14;
  --bg2:        #0d1117;
  --bg3:        #161b27;
  --primary:    #00d4ff;
  --secondary:  #6366f1;
  --accent:     #22d3ee;
  --green:      #06ffa5;
  --text:       #e2e8f0;
  --muted:      #8892b0;
  --border:     rgba(255,255,255,0.07);
  --glow-c:     rgba(0, 212, 255, 0.45);
  --glow-p:     rgba(99, 102, 241, 0.45);
}

/* ============================================================
   GLOBAL OVERRIDES
   ============================================================ */
html, body {
  background: var(--bg) !important;
}

body {
  font-family: 'Inter', 'lora-regular', serif !important;
  color: var(--text) !important;
}

/* ============================================================
   HEADER
   ============================================================ */
header {
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  background: rgba(9, 11, 20, 0.85) !important;
  border-bottom: 1px solid rgba(0, 212, 255, 0.08);
}

header .top-bar {
  background: transparent !important;
}

/* Logo text */
header .logo a {
  font: normal 1.5rem/1 'JetBrains Mono', monospace !important;
  text-shadow: none !important;
  color: var(--primary) !important;
  background: none !important;
  width: auto !important;
  height: auto !important;
  letter-spacing: 0.05rem;
  text-decoration: none;
}

/* Nav dropdown */
.main-navigation {
  background: rgba(9, 11, 20, 0.97) !important;
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 212, 255, 0.1);
}

.main-navigation li a {
  color: var(--muted) !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 1.3rem !important;
  letter-spacing: 0.1rem;
}

.main-navigation li a:hover,
.main-navigation li.current > a {
  color: var(--primary) !important;
  padding-left: 0.5rem !important;
}

/* ============================================================
   HERO / INTRO SECTION
   ============================================================ */
#intro {
  background: var(--bg) !important;
  position: relative;
  overflow: hidden;
}

#canvas-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.intro-overlay {
  background: linear-gradient(
    135deg,
    rgba(9, 11, 20, 0.6) 0%,
    rgba(13, 17, 23, 0.55) 100%
  ) !important;
  opacity: 1 !important;
}

.intro-content {
  position: relative;
  z-index: 2;
}

/* Terminal greeting badge */
.intro-greeting {
  display: inline-block;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.25);
  color: var(--primary);
  padding: 0.5rem 1.8rem;
  border-radius: 50px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.3rem;
  margin-bottom: 2.5rem;
  letter-spacing: 0.15rem;
}

/* Hide original h5 */
.intro-content h5 {
  display: none !important;
}

/* Name — gradient text */
.intro-content h1 {
  background: linear-gradient(135deg, #ffffff 0%, #00d4ff 45%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none !important;
  font-family: 'Inter', sans-serif !important;
  font-weight: 800 !important;
  font-size: 8rem !important;
  letter-spacing: -0.3rem !important;
  line-height: 1.05 !important;
  margin-bottom: 1.5rem !important;
}

/* Typing animation wrapper */
.typing-container {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.9rem;
  color: var(--green);
  margin-bottom: 2.5rem;
  min-height: 3rem;
  line-height: 1;
}

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

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.6rem;
  background: var(--primary);
  margin-left: 3px;
  vertical-align: middle;
  animation: blink 0.9s infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Hide original position spans */
.intro-position {
  display: none !important;
}

/* Research tag chips */
.intro-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3.5rem;
}

.intro-tag {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  padding: 0.5rem 1.4rem;
  border-radius: 50px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  letter-spacing: 0.03rem;
  transition: all 0.3s ease;
  cursor: default;
}

.intro-tag:hover {
  background: rgba(99, 102, 241, 0.25);
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.6);
}

/* Buttons */
.intro-content .button {
  background: transparent !important;
  border: 1px solid rgba(0, 212, 255, 0.4) !important;
  color: var(--primary) !important;
  border-radius: 6px !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 1.2rem !important;
  letter-spacing: 0.1rem !important;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease !important;
}

.intro-content .button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,212,255,0.08), rgba(99,102,241,0.08));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.intro-content .button:hover::before {
  opacity: 1;
}

.intro-content .button:hover {
  border-color: var(--primary) !important;
  box-shadow: 0 0 22px var(--glow-c) !important;
  transform: translateY(-2px);
}

/* Remove the fontawesome down arrow */
.intro-content .button::after {
  display: none !important;
}

/* Social icons */
.intro-social li a {
  transition: all 0.3s ease !important;
}

.intro-social li a:hover {
  color: var(--primary) !important;
  text-shadow: 0 0 12px var(--primary);
}

/* Scroll chevron indicator */
.scroll-down {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.scroll-down span {
  display: block;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(45deg);
  opacity: 0;
  animation: scrollAnim 1.8s infinite;
}

.scroll-down span:nth-child(2) { animation-delay: 0.2s; }
.scroll-down span:nth-child(3) { animation-delay: 0.4s; }

@keyframes scrollAnim {
  0%   { opacity: 0; transform: rotate(45deg) translate(-4px, -4px); }
  50%  { opacity: 0.8; }
  100% { opacity: 0; transform: rotate(45deg) translate(4px, 4px); }
}

/* ============================================================
   ABOUT SECTION
   ============================================================ */
#about {
  background: var(--bg2) !important;
  padding-top: 10rem !important;
  padding-bottom: 10rem !important;
  position: relative;
  overflow: hidden;
}

/* Radial glow decoration */
#about::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
  pointer-events: none;
}

#about .section-intro h5 {
  color: var(--primary) !important;
  font-family: 'JetBrains Mono', monospace !important;
}

#about .section-intro h1 {
  color: var(--text) !important;
}

/* GitHub-style code card */
.profile-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(0, 212, 255, 0.12);
  border-radius: 12px;
  padding: 3rem;
  max-width: 680px;
  margin: 0 auto 5rem;
  position: relative;
  backdrop-filter: blur(8px);
}

/* Top gradient line */
.profile-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

/* macOS window dots */
.code-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.code-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.code-dot.red    { background: #ff5f57; }
.code-dot.yellow { background: #febc2e; }
.code-dot.green  { background: #28c840; }

.code-filename {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  color: var(--muted);
  margin-left: 0.8rem;
}

/* Syntax-highlighted YAML */
.code-block {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  line-height: 2.4rem;
  color: var(--text);
  text-align: left;
}

.code-key   { color: #7dd3fc; }
.code-value { color: #86efac; }
.code-string { color: #fca5a5; }
.code-comment { color: var(--muted); }

.code-list-item {
  padding-left: 2rem;
  color: #c4b5fd;
}

.code-list-item::before {
  content: '  - ';
  color: var(--muted);
}

/* Stats row */
.about-stats {
  display: flex;
  justify-content: center;
  gap: 5rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.stat-item {
  text-align: center;
  position: relative;
}

.stat-item + .stat-item::before {
  content: '';
  position: absolute;
  left: -2.5rem;
  top: 50%;
  transform: translateY(-50%);
  height: 40px;
  width: 1px;
  background: var(--border);
}

.stat-number {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 3.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.6rem;
}

.stat-label {
  font-size: 1.15rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.15rem;
  font-family: 'JetBrains Mono', monospace;
}

/* ============================================================
   RESEARCH SECTION
   ============================================================ */
#research {
  background: var(--bg) !important;
  padding: 10rem 0;
  position: relative;
}

#research::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -10%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,255,0.04) 0%, transparent 70%);
  pointer-events: none;
}

#research .section-intro h5 {
  color: var(--green) !important;
  font-family: 'JetBrains Mono', monospace !important;
}

#research .section-intro h1 {
  color: var(--text) !important;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.research-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.8rem 2.5rem;
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
}

.research-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity 0.35s ease;
}

.research-card:hover {
  border-color: rgba(0, 212, 255, 0.25);
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0, 212, 255, 0.08);
  background: rgba(0, 212, 255, 0.03);
}

.research-card:hover::before {
  opacity: 1;
}

.research-icon {
  font-size: 3.2rem;
  display: block;
  margin-bottom: 1.5rem;
}

.research-card h3 {
  font-family: 'Inter', sans-serif !important;
  font-size: 1.8rem !important;
  font-weight: 600 !important;
  color: var(--text) !important;
  margin-bottom: 1rem !important;
}

.research-card p {
  font-size: 1.35rem !important;
  color: var(--muted) !important;
  line-height: 1.8 !important;
  margin-bottom: 0 !important;
  font-family: 'Inter', sans-serif !important;
}

/* ============================================================
   PORTFOLIO SECTION
   ============================================================ */
#portfolio {
  background: var(--bg2) !important;
}

#portfolio .section-intro h5 {
  color: var(--primary) !important;
  font-family: 'JetBrains Mono', monospace !important;
}

#portfolio .section-intro h1 {
  color: var(--text) !important;
}

#portfolio .folio-item:hover .overlay {
  background: rgba(9,11,20,0.88) !important;
}

#portfolio .folio-title {
  color: #fff !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 2rem !important;
  font-weight: 600 !important;
}

#portfolio .folio-types {
  color: var(--primary) !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 1.1rem !important;
}

/* ============================================================
   EDUCATION TIMELINE  (reference-style, dark tech)
   ============================================================ */

/* Outer wrapper */
.education-timeline {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Vertical glowing line */
.edu-tl-line {
  position: absolute;
  left: 50%;
  top: 40px;
  bottom: 40px;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg,
    rgba(0,212,255,0.8) 0%,
    rgba(99,102,241,0.8) 50%,
    rgba(0,212,255,0.3) 100%);
  box-shadow: 0 0 12px rgba(0,212,255,0.4);
  z-index: 0;
}

/* Each entry row */
.edu-tl-entry {
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  align-items: center;
  gap: 0 2rem;
  padding: 3.5rem 0;
  position: relative;
  z-index: 1;
}

/* Right-aligned date column */
.edu-tl-date {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.edu-tl-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.35rem;
  color: var(--muted);
  letter-spacing: 0.05rem;
}

.edu-tl-dash {
  color: rgba(0,212,255,0.3);
  font-size: 1rem;
}

.edu-tl-now {
  color: var(--green);
  text-shadow: 0 0 8px rgba(6,255,165,0.5);
}

/* Center node column */
.edu-tl-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
}

/* University logo circle */
.edu-tl-logo {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid rgba(99,102,241,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.0rem;
  font-weight: 700;
  color: #a5b4fc;
  letter-spacing: 0.03rem;
  transition: all 0.35s ease;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1), 0 0 20px rgba(99,102,241,0.15);
}

.edu-tl-logo--active {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0,212,255,0.12), 0 0 25px rgba(0,212,255,0.3);
}

/* Pulse ring on active node */
.edu-tl-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  animation: pulseRing 2.2s ease-out infinite;
  z-index: 1;
}

@keyframes pulseRing {
  0%   { transform: translate(-50%, -50%) scale(1);   opacity: 0.7; }
  100% { transform: translate(-50%, -50%) scale(1.9); opacity: 0; }
}

/* Card column */
.edu-tl-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.35s ease;
  position: relative;
}

/* Top accent line */
.edu-tl-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--secondary), transparent);
  opacity: 0.6;
}

.edu-tl-card:hover {
  border-color: rgba(99,102,241,0.3);
  transform: translateX(6px);
  box-shadow: 0 8px 32px rgba(99,102,241,0.1);
}

/* Active card */
.edu-tl-card--active {
  border-color: rgba(0,212,255,0.2);
  background: rgba(0,212,255,0.03);
}

.edu-tl-card--active::before {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0.8;
}

.edu-tl-card--active:hover {
  border-color: rgba(0,212,255,0.4);
  box-shadow: 0 8px 32px rgba(0,212,255,0.1);
}

.edu-tl-card-inner {
  padding: 2.4rem 2.8rem;
}

/* Badge pill */
.edu-tl-badge {
  display: inline-block;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.3);
  color: #a5b4fc;
  padding: 0.3rem 1.1rem;
  border-radius: 50px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  letter-spacing: 0.04rem;
  margin-bottom: 1.2rem;
}

.edu-tl-badge--active {
  background: rgba(0,212,255,0.1);
  border-color: rgba(0,212,255,0.35);
  color: var(--primary);
}

/* Degree title */
.edu-tl-degree {
  font-family: 'Inter', sans-serif !important;
  font-size: 2rem !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  margin-bottom: 0.5rem !important;
  line-height: 1.2 !important;
}

/* University name */
.edu-tl-university {
  font-family: 'Inter', sans-serif !important;
  font-size: 1.4rem !important;
  color: var(--muted) !important;
  margin-bottom: 1.5rem !important;
}

/* Info list */
.edu-tl-info {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.edu-tl-info li {
  font-family: 'Inter', sans-serif;
  font-size: 1.35rem;
  color: var(--muted);
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0 !important;
}

.edu-tl-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  color: var(--primary);
  min-width: 5.5rem;
  flex-shrink: 0;
  opacity: 0.8;
}

.edu-tl-info a,
.edu-tl-info a:visited {
  color: var(--muted);
  text-decoration: none;
}

.edu-tl-info a:hover,
.edu-tl-info a:focus {
  color: var(--primary);
  text-decoration: underline;
}


/* Left-side entry: date on right, card on left */
.edu-tl-entry:nth-child(odd) .edu-tl-date {
  order: 1;
}
.edu-tl-entry:nth-child(odd) .edu-tl-node {
  order: 2;
}
.edu-tl-entry:nth-child(odd) .edu-tl-card {
  order: 3;
}

/* Right-side entry: card on left, date on right */
.edu-tl-entry:nth-child(even) {
  grid-template-columns: 1fr 80px 1fr;
}
.edu-tl-entry:nth-child(even) .edu-tl-card {
  order: 1;
  text-align: right;
}
.edu-tl-entry:nth-child(even) .edu-tl-card::before {
  background: linear-gradient(270deg, var(--primary), var(--secondary));
}
.edu-tl-entry:nth-child(even) .edu-tl-card:hover {
  transform: translateX(-6px);
}
.edu-tl-entry:nth-child(even) .edu-tl-card-inner {
  text-align: right;
}
.edu-tl-entry:nth-child(even) .edu-tl-info li {
  flex-direction: row-reverse;
}
.edu-tl-entry:nth-child(even) .edu-tl-node {
  order: 2;
}
.edu-tl-entry:nth-child(even) .edu-tl-date {
  order: 3;
  text-align: left;
  align-items: flex-start;
}

/* ── Responsive ── */
@media only screen and (max-width: 768px) {
  .edu-tl-entry,
  .edu-tl-entry:nth-child(even) {
    grid-template-columns: 50px 1fr;
    grid-template-rows: auto auto;
    gap: 0 1.5rem;
  }

  .edu-tl-line {
    left: 25px;
  }

  .edu-tl-entry .edu-tl-date,
  .edu-tl-entry:nth-child(even) .edu-tl-date {
    order: 1;
    grid-column: 2;
    text-align: left;
    align-items: flex-start;
    flex-direction: row;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
  }

  .edu-tl-entry .edu-tl-node,
  .edu-tl-entry:nth-child(even) .edu-tl-node {
    order: 2;
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: flex-start;
    margin-top: 0.5rem;
  }

  .edu-tl-logo { width: 46px; height: 46px; font-size: 0.85rem; }
  .edu-tl-pulse { width: 46px; height: 46px; }

  .edu-tl-entry .edu-tl-card,
  .edu-tl-entry:nth-child(even) .edu-tl-card {
    order: 3;
    grid-column: 2;
    transform: none !important;
    text-align: left !important;
  }

  .edu-tl-entry:nth-child(even) .edu-tl-info li {
    flex-direction: row;
  }

  .edu-tl-card-inner { padding: 1.8rem; }
  .edu-tl-degree { font-size: 1.7rem !important; }
}

/* ============================================================
   PROJECTS SECTION — horizontal carousel
   ============================================================ */
#projects {
  background: var(--bg) !important;
  padding: 9rem 0 8rem !important;
  position: relative;
  overflow: hidden;
}

#projects::before {
  content: '';
  position: absolute;
  top: 20%;
  right: -8%;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6,255,165,0.05) 0%, transparent 70%);
  pointer-events: none;
}

#projects .section-intro h5 {
  color: var(--green) !important;
  font-family: 'JetBrains Mono', monospace !important;
}

#projects .section-intro h1 {
  color: var(--text) !important;
}

/* Viewport wrapper */
.projects-viewport {
  position: relative;
  max-width: 1200px;
  margin: 2rem auto 0;
  padding: 0 6rem;
}

/* Track: horizontal scroll container */
.projects-track {
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  padding: 1rem 0 2rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.projects-track::-webkit-scrollbar { display: none; }

.projects-track.is-grabbing {
  cursor: grabbing;
  scroll-behavior: auto;
  scroll-snap-type: none;
}
.projects-track.is-grabbing .project-card { pointer-events: none; }

/* Individual card */
.project-card {
  flex: 0 0 auto;
  width: min(520px, 85vw);
  min-height: 440px;
  background: linear-gradient(145deg, rgba(255,255,255,0.035) 0%, rgba(255,255,255,0.015) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 0;
  scroll-snap-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  display: flex;
  flex-direction: column;
}

/* Top gradient accent */
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--green));
  opacity: 0.75;
}

/* Decorative grid pattern */
.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  opacity: 0.6;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 55%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 55%);
}

.project-card:hover {
  border-color: rgba(0,212,255,0.25);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,212,255,0.08);
}

/* Image / placeholder header */
.project-cover {
  position: relative;
  width: 100%;
  height: 160px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(135deg, rgba(0,212,255,0.08) 0%, rgba(99,102,241,0.12) 100%);
}

.project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.project-card:hover .project-cover img { transform: scale(1.04); }

.project-cover-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 5rem;
  color: rgba(0,212,255,0.35);
  background-image:
    radial-gradient(circle at 30% 40%, rgba(0,212,255,0.15) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(99,102,241,0.18) 0%, transparent 50%);
}

.project-cover-badge {
  position: absolute;
  top: 1.2rem;
  left: 1.2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  color: var(--primary);
  background: rgba(9,11,20,0.75);
  border: 1px solid rgba(0,212,255,0.3);
  padding: 0.3rem 0.9rem;
  border-radius: 50px;
  backdrop-filter: blur(6px);
  letter-spacing: 0.05rem;
  z-index: 2;
}

/* Body */
.project-body {
  padding: 2rem 2.2rem 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  position: relative;
  z-index: 1;
}

.project-title {
  font-family: 'Inter', sans-serif !important;
  font-size: 1.85rem !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  line-height: 1.3 !important;
  margin: 0 !important;
}

.project-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  color: var(--primary);
  letter-spacing: 0.03rem;
  margin: 0;
}

.project-desc {
  font-family: 'Inter', sans-serif !important;
  font-size: 1.3rem !important;
  color: var(--muted) !important;
  line-height: 1.7 !important;
  margin: 0 !important;
}

.project-highlight {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.6rem 1.1rem;
  background: rgba(6,255,165,0.06);
  border: 1px solid rgba(6,255,165,0.25);
  border-radius: 8px;
  align-self: flex-start;
}

.project-highlight-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--green);
}

.project-highlight-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  color: var(--muted);
  letter-spacing: 0.04rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.project-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  color: #a5b4fc;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.25);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  letter-spacing: 0.03rem;
}

.project-links {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.4rem;
}

.project-link,
.project-link:link,
.project-link:visited {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ff6b6b;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255,107,107,0.35);
  border-radius: 6px;
  background: rgba(255,107,107,0.06);
  transition: all 0.25s ease;
}

.project-link:hover,
.project-link:focus {
  background: rgba(255,107,107,0.14);
  border-color: rgba(255,107,107,0.6);
  box-shadow: 0 0 14px rgba(255,107,107,0.35);
  color: #ff8787 !important;
  text-decoration: none;
}

.project-link i { font-size: 1.3rem; }

/* Prev / Next buttons */
.proj-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(13,17,23,0.7);
  border: 1px solid rgba(0,212,255,0.3);
  color: var(--primary);
  font-size: 1.6rem;
  cursor: pointer;
  z-index: 5;
  backdrop-filter: blur(6px);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.proj-nav:hover {
  background: rgba(0,212,255,0.15);
  box-shadow: 0 0 16px rgba(0,212,255,0.35);
  transform: translateY(-50%) scale(1.08);
}

.proj-nav:disabled,
.proj-nav.is-disabled {
  opacity: 0.25;
  cursor: not-allowed;
  box-shadow: none;
  transform: translateY(-50%);
}

.proj-nav-prev { left: 0.8rem; }
.proj-nav-next { right: 0.8rem; }

/* Scroll hint */
.projects-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  color: var(--muted);
  letter-spacing: 0.25rem;
  opacity: 0.85;
  animation: hintPulse 2.6s ease-in-out infinite;
}

.hint-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

.hint-arrow {
  color: var(--primary);
  font-size: 1.3rem;
  animation: hintSlide 2s ease-in-out infinite;
}
.hint-arrow:last-child { animation-delay: 1s; }

@keyframes hintSlide {
  0%, 100% { transform: translateX(0); opacity: 0.4; }
  50%      { transform: translateX(-4px); opacity: 1; }
}
.hint-arrow:last-child {
  animation-name: hintSlideR;
}
@keyframes hintSlideR {
  0%, 100% { transform: translateX(0); opacity: 0.4; }
  50%      { transform: translateX(4px); opacity: 1; }
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 1; }
}

/* Progress bar */
.projects-progress {
  max-width: 240px;
  height: 3px;
  margin: 1rem auto 0;
  background: rgba(255,255,255,0.06);
  border-radius: 50px;
  overflow: hidden;
}

.projects-progress-bar {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 50px;
  transition: width 0.25s ease, transform 0.25s ease;
  box-shadow: 0 0 10px rgba(0,212,255,0.4);
}

/* Auto-hide affordances when carousel has nothing to scroll */
.projects-viewport.is-static .proj-nav,
.projects-viewport.is-static .projects-hint,
.projects-viewport.is-static .projects-progress {
  display: none;
}
.projects-viewport.is-static .projects-track { justify-content: center; }

/* Responsive */
@media only screen and (max-width: 768px) {
  .projects-viewport { padding: 0 1rem; }
  .proj-nav { display: none; }
  .project-card {
    width: min(420px, 88vw);
    min-height: 420px;
  }
  .project-cover { height: 140px; }
  .project-body { padding: 1.6rem 1.8rem 1.8rem; }
  .project-title { font-size: 1.65rem !important; }
}


/* ============================================================
   CONTACT SECTION
   ============================================================ */
#contact {
  background: var(--bg) !important;
}

#contact .section-intro h5 {
  color: var(--green) !important;
  font-family: 'JetBrains Mono', monospace !important;
}

#contact .section-intro h1 {
  color: var(--text) !important;
}

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer {
  background: var(--bg2);
  padding: 4rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer-social-list {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
}

.footer-social-list li {
  display: inline-block;
  padding: 0;
}

.footer-social-list a {
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.3rem;
  text-decoration: none;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-social-list a:hover {
  color: var(--primary) !important;
  text-shadow: 0 0 10px var(--glow-c);
}

.footer-copy {
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
}

.footer-copy a {
  color: var(--primary);
  text-decoration: none;
}

/* ============================================================
   GO TO TOP BUTTON
   ============================================================ */
#go-top {
  /*display: block !important;*/
  right: 2.5rem !important;
  bottom: 2.5rem !important;
  border-radius: 50% !important;
}

#go-top a {
  background: rgba(0, 212, 255, 0.1) !important;
  border: 1px solid rgba(0, 212, 255, 0.35);
  border-radius: 50% !important;
  width: 5rem !important;
  height: 5rem !important;
  line-height: 5rem !important;
  transition: all 0.3s ease !important;
}

#go-top a:hover {
  background: var(--primary) !important;
  box-shadow: 0 0 20px var(--glow-c) !important;
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media only screen and (max-width: 1024px) {
  .intro-content h1 {
    font-size: 6rem !important;
  }
}

@media only screen and (max-width: 768px) {
  .intro-content h1 {
    font-size: 4.5rem !important;
    letter-spacing: -0.1rem !important;
  }

  .typing-container {
    font-size: 1.6rem;
  }

  .research-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
  }

  .about-stats {
    gap: 2.5rem;
  }

  .stat-item + .stat-item::before {
    display: none;
  }
}

@media only screen and (max-width: 480px) {
  .intro-content h1 {
    font-size: 3.5rem !important;
    letter-spacing: 0 !important;
  }

  .intro-tags {
    flex-direction: column;
    align-items: center;
  }

  .stat-number {
    font-size: 3rem;
  }
}
