:root {
  /* Color palette */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #22223a;
  --text-primary: #e8e8f0;
  --text-secondary: #9898b0;
  --text-muted: #6868808a;
  --accent: #6c5ce7;
  --accent-glow: #6c5ce740;
  --border: #2a2a3e;
  --border-hover: #3a3a55;

  /* Layout */
  --max-width: 1200px;
  --nav-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

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

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

/* ── Navigation ────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10, 10, 15, 0.85);
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  transition: color 0.2s;
}

.nav__logo:hover {
  color: var(--accent);
}

.nav__links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav__links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
  position: relative;
}

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

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s var(--ease-out);
}

.nav__links a:hover::after,
.nav__links a.active::after {
  width: 100%;
}

/* Mobile nav toggle */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: all 0.3s;
  border-radius: 2px;
}

/* ── About Hero ────────────────────────────────────── */
.about-hero {
  padding: calc(var(--nav-height) + 80px) 24px 64px;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 56px;
}

.profile-photo {
  width: 220px;
  height: 220px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow:
    0 0 0 3px var(--bg-primary),
    0 0 0 5px var(--border),
    0 24px 60px -12px rgba(0, 0, 0, 0.6);
  position: relative;
}

.profile-photo::after {
  content: "EP";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-secondary);
  background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
}

.profile-photo img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-hero__text {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-hero__name {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.about-hero__bio {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.7;
}

@media (max-width: 640px) {
  .about-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
    padding-top: calc(var(--nav-height) + 48px);
  }

  .profile-photo {
    width: 160px;
    height: 160px;
  }
}

/* ── Hero / Header ─────────────────────────────────── */
.hero {
  padding: calc(var(--nav-height) + 80px) 24px 60px;
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

/* ── Filter Tags ───────────────────────────────────── */
.filters {
  max-width: var(--max-width);
  margin: 0 auto 40px;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.filter-btn {
  padding: 8px 18px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-card);
}

.filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* ── Project Grid ──────────────────────────────────── */
.grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

/* ── Project Tile ──────────────────────────────────── */
.tile {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.4s var(--ease-out);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(24px);
}

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

.tile:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.5);
}

.tile.featured {
  grid-column: span 2;
}

.tile__thumb {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.tile__thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.tile:hover .tile__thumb-img {
  transform: scale(1.05);
}

.tile__thumb-gradient {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.15);
  letter-spacing: -0.03em;
  text-transform: uppercase;
  transition: transform 0.6s var(--ease-out);
}

.tile:hover .tile__thumb-gradient {
  transform: scale(1.05);
}

.tile__body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tile__date {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.tile__title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.3;
}

.tile__tagline {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}

.tile__tagline a,
.project-hero__tagline a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tile__tagline a:hover,
.project-hero__tagline a:hover {
  opacity: 0.8;
}

.tile__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tile__tag {
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.6875rem;
  font-weight: 500;
}

/* Featured badge */
.tile__featured-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--accent);
  color: white;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
}

/* ── Project Detail Page ───────────────────────────── */
.project-hero {
  padding: calc(var(--nav-height) + 60px) 24px 40px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.project-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 32px;
  transition: color 0.2s;
}

.project-hero__back:hover {
  color: var(--text-primary);
}

.project-hero__back svg {
  width: 16px;
  height: 16px;
}

.project-hero__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.project-hero__date {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.project-hero__title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 12px;
}

.project-hero__tagline {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 720px;
  margin-bottom: 32px;
}

.project-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.project-hero__tag {
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
}

/* Action buttons */
.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 48px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn--primary {
  background: var(--accent);
  color: white;
}

.btn--primary:hover {
  background: #5a4bd6;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn--secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

/* Description section */
.project-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 40px;
}

.project-description {
  max-width: 720px;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.project-description p {
  margin-bottom: 16px;
}

/* PDF Viewer */
.pdf-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 40px;
}

.pdf-section__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.pdf-viewer {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.pdf-viewer iframe,
.pdf-viewer embed,
.pdf-viewer object {
  width: 100%;
  height: 90vh;
  min-height: 900px;
  border: none;
  display: block;
}

/* ── Footer ────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
}

.footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__text {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer__links {
  display: flex;
  gap: 20px;
}

.footer__links a {
  color: var(--text-secondary);
  transition: color 0.2s;
}

.footer__links a:hover {
  color: var(--text-primary);
}

.footer__links svg {
  width: 20px;
  height: 20px;
}

/* ── Scroll animations ─────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.6s var(--ease-out) forwards;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .tile.featured {
    grid-column: span 1;
  }

  .nav__links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 16px;
  }

  .nav__links.open {
    display: flex;
  }

  .nav__toggle {
    display: block;
  }

  .nav__toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav__toggle.open span:nth-child(2) {
    opacity: 0;
  }

  .nav__toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero {
    padding-top: calc(var(--nav-height) + 48px);
    padding-bottom: 40px;
  }

  .footer__inner {
    flex-direction: column;
    gap: 16px;
  }

  .project-actions {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .grid {
    padding: 0 16px 60px;
  }

  .tile__body {
    padding: 20px;
  }

  .hero {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ── No-results message ───────────────────────────── */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
  font-size: 1rem;
}

/* ── About Page Cards ─────────────────────────────── */
.about-sections {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.about-card {
  display: flex;
  flex-direction: column;
  padding: 32px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.4s var(--ease-out);
  cursor: pointer;
}

.about-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.5);
}

.about-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.about-card__icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.about-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.about-card__desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Lecture Table ─────────────────────────────────── */
.lecture-table-wrapper {
  max-width: 720px;
}

.lecture-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.lecture-table thead th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.lecture-table tbody tr {
  transition: background 0.15s;
}

.lecture-table tbody tr:hover {
  background: var(--bg-card);
}

.lecture-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.lecture-table__num {
  width: 48px;
  color: var(--text-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.lecture-table__title {
  color: var(--text-primary);
  font-weight: 500;
}

.lecture-table__date {
  white-space: nowrap;
  font-size: 0.8125rem;
}

.lecture-table__link {
  white-space: nowrap;
}

.lecture-table__youtube {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ff0000;
  font-weight: 500;
  font-size: 0.8125rem;
  transition: opacity 0.2s;
}

.lecture-table__youtube:hover {
  opacity: 0.8;
}

.lecture-table__youtube svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 768px) {
  .about-sections {
    grid-template-columns: 1fr;
  }

  .lecture-table {
    font-size: 0.8125rem;
  }

  .lecture-table td,
  .lecture-table thead th {
    padding: 10px 8px;
  }
}
