/*
   ==========================================================================
   Kumar Rishav — Personal Site
   Minimal, editorial, restrained-color design system.
   ==========================================================================
*/

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

:root {
  --bg-color: #0a0a0b;
  --bg-darker: #060607;
  --bg-lighter: #17171a;

  --text-primary: #f2f2f0;
  --text-secondary: #9b9b9f;
  --text-muted: #67676c;

  --accent-cyan: #6d8cff;
  --accent-purple: #5c5c66;
  --accent-pink: #e2e8f0;

  --glass-bg: rgba(255, 255, 255, 0.025);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-border-cyan: rgba(109, 140, 255, 0.4);
  --glass-border-purple: rgba(255, 255, 255, 0.14);

  --font-title: 'Space Grotesk', sans-serif;
  --font-ui: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  --transition-speed: 0.3s;
  --header-height: 84px;

  --mx: 50%;
  --my: 50%;
  --r: 0px;
  --lx: 50%;
  --ly: 50%;
  --lr: 0px;
}

/* Base Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.65;
  min-height: 100vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Faint depth vignette — no grid, no clutter */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(ellipse 60% 40% at 50% -10%, rgba(109, 140, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 100% 100%, rgba(255, 255, 255, 0.02) 0%, transparent 60%);
  z-index: -2;
  pointer-events: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.15;
}

p {
  color: var(--text-secondary);
  font-weight: 300;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-darker); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-cyan); }

::selection {
  background: rgba(109, 140, 255, 0.25);
  color: var(--text-primary);
}

/* Eyebrow / kicker label used throughout for small tracked labels */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.eyebrow::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--accent-cyan);
}

/* Sample-data notice — small, honest, unobtrusive */
.sample-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto 44px;
  padding: 12px 18px;
  border: 1px solid var(--glass-border);
  border-left: 2px solid var(--accent-cyan);
  border-radius: 3px;
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-family: var(--font-ui);
}

.sample-banner i { color: var(--accent-cyan); }

/* Header & Sticky Nav */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  background: rgba(10, 10, 11, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 6%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  background-color: transparent;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  overflow: hidden;
}

.logo-icon img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

.logo-text {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
}

.logo-text span {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 36px;
  position: relative;
}

.nav-links a {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-secondary);
  position: relative;
  padding: 8px 0;
  text-transform: lowercase;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent-cyan);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Burger Menu */
.burger-menu {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.burger-menu span {
  width: 22px;
  height: 1px;
  background-color: var(--text-primary);
  transition: all var(--transition-speed) ease;
}

/* Main Container Layouts */
main { padding-top: var(--header-height); }

.container {
  width: 90%;
  max-width: 1180px;
  margin: 0 auto;
  /* .container's own padding shorthand has higher specificity than the
     `main` rule above and was silently overriding its header clearance —
     set top padding explicitly so the fixed header can never overlap
     page content, on any page or viewport. */
  padding-top: calc(var(--header-height) + 40px);
  padding-bottom: 100px;
}

.section-title {
  text-align: center;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.section-lede {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 60px;
  font-size: 1.05rem;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-weight: 500;
  padding: 13px 28px;
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--text-primary);
  border: 1px solid var(--text-primary);
  color: var(--bg-color);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #08080a;
  transform: translateY(-2px) scale(1.03);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* Understated text link with animated arrow, used across the site */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 3px;
  transition: all var(--transition-speed) ease;
}

.link-arrow i { transition: transform var(--transition-speed) ease; }

.link-arrow:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.link-arrow:hover i { transform: translateX(4px); }

/* Cards — flat, restrained, quiet hover */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 34px;
  transition: border-color var(--transition-speed) ease, transform var(--transition-speed) ease;
  position: relative;
}

.glass-card:hover {
  border-color: var(--glass-border-cyan);
  transform: translateY(-2px);
}

/*
   ==========================================================================
   Page-Specific Layouts
   ==========================================================================
*/

/* 1. Hero Section — immersive robotics-lab portal */
.hero-wrapper {
  position: relative;
  height: 100vh;
  min-height: 640px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  background: var(--bg-color);
}

#world-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
  -webkit-mask-image:
    radial-gradient(circle at var(--mx) var(--my), #000 0, #000 var(--r), transparent calc(var(--r) + 130px)),
    radial-gradient(circle at var(--lx) var(--ly), #000 0, #000 var(--lr), transparent calc(var(--lr) + 100px));
  mask-image:
    radial-gradient(circle at var(--mx) var(--my), #000 0, #000 var(--r), transparent calc(var(--r) + 130px)),
    radial-gradient(circle at var(--lx) var(--ly), #000 0, #000 var(--lr), transparent calc(var(--lr) + 100px));
}

.hero-noise {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}

.hero-typo-wrap {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: calc(1 - var(--scroll-progress, 0));
  filter: blur(calc(var(--scroll-progress, 0) * 16px));
  transform: scale(calc(1 + var(--scroll-progress, 0) * 0.2));
}

.hero-typo {
  /* Both the fill and skeleton layers share this grid cell so they
     stack in perfect pixel alignment — no independent centering math
     (flex vs. absolute+transform) to drift out of sync. */
  grid-area: 1 / 1;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: center;
  gap: 0.22em;
  font-family: var(--font-title);
  font-weight: 800;
  color: #f5f5f4;
  font-size: clamp(2.4rem, 15vw, 11.5rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  text-align: center;
  max-width: 94vw;
  min-width: 0;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
  -webkit-mask-image:
    radial-gradient(circle at var(--mx) var(--my), transparent 0, transparent var(--r), #000 calc(var(--r) + 130px)),
    radial-gradient(circle at var(--lx) var(--ly), transparent 0, transparent var(--lr), #000 calc(var(--lr) + 100px));
  mask-image:
    radial-gradient(circle at var(--mx) var(--my), transparent 0, transparent var(--r), #000 calc(var(--r) + 130px)),
    radial-gradient(circle at var(--lx) var(--ly), transparent 0, transparent var(--lr), #000 calc(var(--lr) + 100px));
}

.hero-typo .typo-word {
  display: inline-block;
  white-space: nowrap;
}

/* Skeleton outline — fades in exactly where the fill fades out, instead
   of the letters simply vanishing over the reveal area. */
.hero-typo-skeleton {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(245, 245, 244, 0.55);
  text-stroke: 1.5px rgba(245, 245, 244, 0.55);
  -webkit-mask-image:
    radial-gradient(circle at var(--mx) var(--my), #000 0, #000 var(--r), transparent calc(var(--r) + 130px)),
    radial-gradient(circle at var(--lx) var(--ly), #000 0, #000 var(--lr), transparent calc(var(--lr) + 100px));
  mask-image:
    radial-gradient(circle at var(--mx) var(--my), #000 0, #000 var(--r), transparent calc(var(--r) + 130px)),
    radial-gradient(circle at var(--lx) var(--ly), #000 0, #000 var(--lr), transparent calc(var(--lr) + 100px));
}

.hero-ui-top {
  position: absolute;
  top: calc(var(--header-height) + 46px);
  left: 0;
  right: 0;
  z-index: 4;
  text-align: center;
  pointer-events: none;
  opacity: calc(1 - var(--scroll-progress, 0));
}

.hero-ui-bottom {
  position: absolute;
  bottom: 64px;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  pointer-events: none;
  opacity: calc(1 - var(--scroll-progress, 0));
}

.hero-ui-bottom > * { pointer-events: auto; }

.hero-tagline {
  font-family: var(--font-ui);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.8rem;
}

.hero-title-container {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(1rem, 2.1vw, 1.4rem);
  min-height: 32px;
  max-width: 680px;
  margin: 0 auto;
  color: var(--text-secondary);
  text-align: center;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.7);
}

.typewriter-text {
  color: var(--text-primary);
  border-right: 1px solid var(--accent-cyan);
  animation: blink-caret 0.75s step-end infinite;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.hero-level-indicator {
  position: absolute;
  bottom: 26px;
  right: 26px;
  z-index: 4;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  pointer-events: none;
  opacity: calc(1 - var(--scroll-progress, 0));
  text-align: right;
}

.hero-level-indicator .eyebrow { display: inline-flex; margin-bottom: 4px; }

#hero-level-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

#hero-level-label.pulse { animation: level-pulse 0.7s ease; }

.hero-scroll-cue {
  position: absolute;
  bottom: 26px;
  left: 26px;
  z-index: 4;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: calc(1 - var(--scroll-progress, 0));
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.hero-scroll-cue i { animation: scroll-bounce 1.8s ease-in-out infinite; }

@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(5px); opacity: 1; }
}

@keyframes level-pulse {
  0% { color: var(--accent-cyan); transform: translateY(-3px); }
  100% { color: var(--text-secondary); transform: translateY(0); }
}

/* Custom cursor */
html.cx-active *:not(input):not(textarea) { cursor: none !important; }

.cx-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(109, 140, 255, 0.85);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease, border-color 0.25s ease, background 0.25s ease;
  will-change: transform;
}

.cx-ring.cx-hover {
  border-color: #ffffff;
  background: rgba(109, 140, 255, 0.14);
}

.cx-core {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #bcd2ff;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  box-shadow: 0 0 14px 3px rgba(109, 140, 255, 0.65);
  transition: opacity 0.3s ease;
  will-change: transform;
}

@media (pointer: coarse) {
  .cx-ring, .cx-core { display: none; }
}

@media (max-width: 780px) {
  /* Stack KUMAR / RISHAV as two flex items (not wrapped text) — a
     single text node auto-wrapping under mask-image mis-composites in
     Chromium (glyphs paint outside their line box); two discrete flex
     children avoid that layout path entirely. */
  .hero-typo { flex-direction: column; gap: 0.04em; font-size: clamp(2.4rem, 15vw, 5.5rem); }
  .hero-ui-top { top: calc(var(--header-height) + 20px); }
  .hero-ui-bottom { bottom: 40px; gap: 20px; }
  .hero-level-indicator, .hero-scroll-cue { display: none; }
}

/* Looping marquee strip (noth.in-style repeating line) */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  padding: 22px 0;
  white-space: nowrap;
  position: relative;
  z-index: 2;
  background: var(--bg-color);
}

.marquee-track {
  display: inline-flex;
  width: max-content;
  animation: marquee-scroll 32s linear infinite;
}

.marquee-track span {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: inline-flex;
  align-items: center;
  gap: 36px;
  padding-right: 36px;
}

.marquee-track span i { color: var(--accent-cyan); font-size: 0.45rem; }

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes marquee-scroll-reverse {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

/* Kinetic name banner — big repeating type, noth.in-style */
.kinetic-banner {
  overflow: hidden;
  padding: 26px 0;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  background: var(--bg-color);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kinetic-row {
  overflow: hidden;
  white-space: nowrap;
}

.kinetic-track {
  display: inline-flex;
  width: max-content;
  animation: marquee-scroll 38s linear infinite;
}

.kinetic-row.reverse .kinetic-track {
  animation-name: marquee-scroll-reverse;
}

.kinetic-track span {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(2.2rem, 7vw, 5.2rem);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  padding-right: 44px;
  color: var(--text-primary);
}

.kinetic-row.outline .kinetic-track span {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--text-secondary);
}

.kinetic-row.muted .kinetic-track span { color: var(--text-muted); }

@media (prefers-reduced-motion: reduce) {
  .kinetic-track { animation: none; }
}

@media (max-width: 768px) {
  .kinetic-track { animation-duration: 22s; }
}

/* Scroll-reveal fade-in */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Homepage sections beyond the hero */
.home-section {
  width: 90%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 110px 0;
  border-top: 1px solid var(--glass-border);
}

.statement {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}

.statement p {
  font-family: var(--font-title);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  letter-spacing: -0.01em;
}

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

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 50px;
  gap: 20px;
  flex-wrap: wrap;
}

.section-header-row h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 26px;
}

.cta-section {
  text-align: center;
}

.cta-section h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 24px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* 2. About Section */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  margin-bottom: 70px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.stat-card { text-align: center; padding: 24px; }

.stat-number {
  font-family: var(--font-title);
  font-size: 2.1rem;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 6px;
}

.stat-label {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* Timeline */
.timeline-section { margin-top: 70px; }

.timeline-container {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline-container::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  background: var(--glass-border);
  transform: translateX(-50%);
}

.timeline-item {
  padding: 20px 40px;
  position: relative;
  width: 50%;
  box-sizing: border-box;
}

.timeline-item::after {
  content: '';
  position: absolute;
  width: 9px;
  height: 9px;
  right: -4.5px;
  top: 28px;
  background-color: var(--bg-color);
  border: 1.5px solid var(--accent-cyan);
  border-radius: 50%;
  z-index: 1;
  transition: all var(--transition-speed) ease;
}

.timeline-item.right::after { left: -4.5px; border-color: var(--text-primary); }
.timeline-item.left { left: 0; text-align: right; }
.timeline-item.right { left: 50%; }

.timeline-date {
  font-family: var(--font-title);
  color: var(--accent-cyan);
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.timeline-item.right .timeline-date { color: var(--text-primary); }

.timeline-content {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 22px;
  border-radius: 4px;
}

.timeline-item:hover::after { transform: scale(1.3); background-color: var(--text-primary); }

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
}

.skill-bar-container { display: flex; flex-direction: column; gap: 8px; }

.skill-info {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-ui);
  font-size: 0.88rem;
}

.skill-bar {
  height: 3px;
  background: var(--bg-lighter);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.skill-progress {
  height: 100%;
  background: var(--accent-cyan);
  border-radius: 2px;
  width: 0;
  transition: width 1.4s cubic-bezier(0.1, 0.8, 0.2, 1);
}

/* 3. Research Section */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 26px;
  margin-bottom: 70px;
}

.research-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.research-icon {
  font-size: 1.6rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  transition: color var(--transition-speed) ease;
}

.research-card:hover .research-icon { color: var(--accent-cyan); }

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(6, 6, 7, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-speed) ease;
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-content {
  background: #101012;
  border: 1px solid var(--glass-border);
  width: 90%;
  max-width: 720px;
  max-height: 85vh;
  border-radius: 4px;
  padding: 44px;
  overflow-y: auto;
  position: relative;
  transform: scale(0.96);
  transition: transform var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-content { transform: scale(1); }

.modal-close {
  position: absolute;
  top: 22px;
  right: 24px;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color var(--transition-speed) ease;
  line-height: 1;
}

.modal-close:hover { color: var(--text-primary); }

.modal-body { margin-top: 20px; }

.diagram-placeholder {
  width: 100%;
  height: 200px;
  background: var(--bg-darker);
  border: 1px solid var(--glass-border);
  border-radius: 3px;
  margin: 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Twin canvas */
.twin-demo-container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 26px;
  height: 500px;
  margin-top: 50px;
}

.twin-canvas-wrapper {
  background: var(--bg-darker);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

#twin-canvas { width: 100%; height: 100%; }

.twin-controls {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 30px;
  justify-content: center;
}

.control-group { display: flex; flex-direction: column; gap: 8px; }

.control-group label {
  font-family: var(--font-ui);
  font-size: 0.76rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* 4. Projects */
.filter-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 50px;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: 2px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.filter-btn.active,
.filter-btn:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 26px;
}

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

.project-image-slot {
  height: 170px;
  border-radius: 3px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--font-title);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .project-image-slot { transform: scale(1.04); }

.slot-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 14px 16px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 55%);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.project-card:hover .slot-overlay { opacity: 1; transform: translateY(0); }

.slot-overlay span {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.project-tech-stack { display: flex; flex-wrap: wrap; gap: 8px; margin: 15px 0; }

.tech-badge {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  background: var(--bg-lighter);
  color: var(--text-secondary);
  padding: 4px 9px;
  border-radius: 2px;
  border: 1px solid var(--glass-border);
}

.project-links {
  margin-top: auto;
  display: flex;
  gap: 18px;
  padding-top: 18px;
  flex-wrap: wrap;
}

.project-links a {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.project-links a:hover { color: var(--accent-cyan); }

/* 5. Publications */
.publications-container { display: flex; flex-direction: column; gap: 26px; }

.publication-timeline-item {
  position: relative;
  padding-left: 30px;
  border-left: 1px solid var(--glass-border);
}

.publication-timeline-item::before {
  content: '';
  position: absolute;
  left: -4.5px;
  top: 10px;
  width: 8px;
  height: 8px;
  background: var(--text-primary);
  border-radius: 50%;
}

.publication-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 8px;
}

.pub-title { font-size: 1.1rem; color: var(--text-primary); font-weight: 600; }

.pub-citation-badge {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  background: var(--bg-lighter);
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 3px;
  border: 1px solid var(--glass-border);
  white-space: nowrap;
}

.pub-authors { color: var(--text-secondary); font-style: italic; font-size: 0.9rem; }
.pub-venue { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 12px; }

.pub-actions { display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap; }

.pub-actions a,
.pub-actions button {
  font-family: var(--font-ui);
  font-size: 0.74rem;
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pub-actions a:hover,
.pub-actions button:hover { border-color: var(--text-primary); color: var(--text-primary); }

.bibtex-box {
  margin-top: 15px;
  background: var(--bg-darker);
  border: 1px solid var(--glass-border);
  padding: 16px;
  border-radius: 3px;
  display: none;
  position: relative;
}

.bibtex-box pre {
  font-family: monospace;
  font-size: 0.74rem;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
}

.bibtex-copy-btn { position: absolute; top: 10px; right: 10px; }

/* 6. Blog */
.blog-layout { display: grid; grid-template-columns: 1fr 320px; gap: 40px; }
.blog-grid { display: flex; flex-direction: column; gap: 26px; }
.blog-card { display: flex; flex-direction: column; gap: 10px; cursor: pointer; }
.blog-meta { display: flex; gap: 15px; font-family: var(--font-ui); font-size: 0.74rem; color: var(--text-muted); }
.blog-cat { color: var(--accent-cyan); }
.blog-sidebar { display: flex; flex-direction: column; gap: 26px; }

.search-box {
  width: 100%;
  background: var(--bg-darker);
  border: 1px solid var(--glass-border);
  border-radius: 3px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  transition: border-color var(--transition-speed) ease;
}

.search-box:focus { outline: none; border-color: var(--text-primary); }

.sidebar-categories { list-style: none; display: flex; flex-direction: column; gap: 6px; }

.sidebar-categories li {
  padding: 8px 12px;
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  font-family: var(--font-ui);
  color: var(--text-secondary);
  border: 1px solid transparent;
  font-size: 0.88rem;
}

.sidebar-categories li:hover,
.sidebar-categories li.active {
  background: var(--bg-lighter);
  border-color: var(--glass-border);
  color: var(--text-primary);
}

/* 7. Contact */
.contact-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 50px; }
.contact-info { display: flex; flex-direction: column; gap: 26px; }
.social-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

.social-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 13px;
  border-radius: 3px;
  font-family: var(--font-ui);
  color: var(--text-secondary);
  transition: all var(--transition-speed) ease;
  font-size: 0.85rem;
}

.social-btn:hover { border-color: var(--text-primary); color: var(--text-primary); transform: translateY(-2px); }

.contact-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }

.form-group label {
  font-family: var(--font-ui);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.form-control {
  background: var(--bg-darker);
  border: 1px solid var(--glass-border);
  border-radius: 3px;
  padding: 11px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  transition: border-color var(--transition-speed) ease;
}

.form-control:focus { outline: none; border-color: var(--text-primary); }

/* Institution branding */
.institution-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  margin-top: 30px;
  opacity: 0.7;
  flex-wrap: wrap;
}

.inst-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.inst-badge-logo {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  color: var(--text-primary);
}

/* Footer */
footer {
  position: relative;
  background-color: var(--bg-darker);
  border-top: 1px solid var(--glass-border);
  padding: 60px 0 24px;
  overflow: hidden;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 34px;
}

.footer-socials { display: flex; gap: 18px; }
.footer-socials a { color: var(--text-muted); font-size: 1.05rem; }
.footer-socials a:hover { color: var(--text-primary); }

.copyright { text-align: center; color: var(--text-muted); font-size: 0.78rem; }

/* 404 */
.glitch-wrapper {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.glitch-code {
  font-size: clamp(4rem, 12vw, 7rem);
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.glitch-text {
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 34px;
  letter-spacing: 0.05em;
}

/* Keyframes */
@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--accent-cyan) }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 992px) {
  .about-grid, .contact-layout, .blog-layout { grid-template-columns: 1fr; }
  .twin-demo-container { grid-template-columns: 1fr; height: auto; }
  .twin-canvas-wrapper { height: 400px; }
}

@media (max-width: 768px) {
  header { padding: 0 22px; }
  .burger-menu { display: flex; }
  .hide-mobile { display: none; }

  .nav-links {
    position: fixed;
    top: var(--header-height);
    right: -100%;
    width: 240px;
    height: calc(100vh - var(--header-height));
    background: #0c0c0e;
    border-left: 1px solid var(--glass-border);
    flex-direction: column;
    padding: 40px;
    gap: 22px;
    transition: right var(--transition-speed) ease;
    z-index: 999;
  }

  .nav-links.active { right: 0; }

  .container { padding-top: calc(var(--header-height) + 24px); padding-bottom: 70px; }
  .home-section { padding: 70px 0; }

  .timeline-container::before { left: 20px; }
  .timeline-item { width: 100%; padding-left: 45px; padding-right: 0; }
  .timeline-item.left { text-align: left; }
  .timeline-item.right { left: 0; }
  .timeline-item::after { left: 14px !important; }
  .timeline-item.right::after { left: 14px !important; }
}
