:root {
  --bg: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --text: #000000;
  --accent-strong: #5f7896;
  --accent-rgb: 95, 120, 150;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, "Roboto Mono", monospace;
  --radius: 18px;
  --glow1: radial-gradient(800px 800px at 10% 10%, rgba(140, 160, 200, 0.18), transparent 45%);
  --glow2: radial-gradient(900px 900px at 90% 12%, rgba(180, 200, 230, 0.16), transparent 55%);
  --glow3: radial-gradient(700px 700px at 50% 88%, rgba(150, 170, 200, 0.12), transparent 60%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  padding: 0;
  position: relative;
  overflow-x: hidden;
  scroll-behavior: smooth;
  font-size: 16px;
  line-height: 1.2;
}

body::before,
body::after,
.backdrop-glow,
.grid-overlay {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before { background: var(--glow1); }
body::after { background: var(--glow2); }
.backdrop-glow { background: var(--glow3); }

/* Blueprint grid backdrop — subtle plotting-canvas texture */
.grid-overlay {
  background-image:
    linear-gradient(to right, rgba(var(--accent-rgb), 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(var(--accent-rgb), 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000, transparent 80%);
}

.page-shell {
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.content {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 20;
  padding: 12px 0;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  height: 70px;
  padding: 8px 16px;
  background: rgba(122, 122, 122, 0.1);
  border-radius: var(--radius);
  backdrop-filter: blur(10px) saturate(135%);
  transition: transform 0.5s ease, background 0.4s ease;
  font-family: "Roboto", "Inter", system-ui, -apple-system, sans-serif;
}

.nav.scrolled {
  transform: translateY(-5px);
  background: rgba(12, 15, 22, 0.72);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #ffffff;
  width: 200px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  flex: 1;
}

.nav-links a {
  color: #e8eaf2;
  text-decoration: none;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.3s ease, transform 0.2s ease;
}

.nav-links a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.nav-links a.active {
  color: #ffffff;
  background: rgba(180, 184, 192, 0.30);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  text-decoration: none;
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform 0.2s ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

main {
  display: flex;
  flex-direction: column;
  gap: 40px;
  counter-reset: panel;
}

section {
  scroll-margin-top: 110px;
}

.hero {
  min-height: 100vh;
  position: relative;
  background: #05070c;
  color: #ffffff;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.05) 50%, rgba(0, 0, 0, 0.45) 100%);
  z-index: 1;
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

@media (prefers-reduced-motion: reduce) {
  body {
    scroll-behavior: auto;
  }
  .hero-video {
    display: none;
  }
  .hero {
    background-image: url("assets/G12ioApX0AAzDl2.jpeg");
    background-size: cover;
    background-position: center;
  }
}

.panel {
  padding: 30px 0;
}

.panel-heading {
  margin-bottom: 40px;
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, var(--accent-strong), rgba(var(--accent-rgb), 0.4) 30%, transparent 70%) 1;
  padding-top: 20px;
}

.panel-title {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.012em;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.panel-title::before {
  counter-increment: panel;
  content: counter(panel, decimal-leading-zero) " /";
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent-strong);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 60px;
  align-items: start;
}

.about-body {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.about-photo {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.about-photo-frame {
  width: 100%;
  max-width: 230px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  background: #e4e6ec;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-photo-caption {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.01em;
  color: #3f4552;
  text-align: center;
}

@media (max-width: 800px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-photo {
    align-items: flex-start;
  }
}

.about-text {
  margin: 0;
  font-size: 18px;
  line-height: 1.7;
  color: #2f3440;
  overflow-wrap: break-word;
}

.about-text a,
.news-item a {
  color: var(--accent-strong);
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.35);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.about-text a:hover,
.news-item a:hover {
  color: #2f3440;
  border-bottom-color: var(--accent-strong);
}

.about-socials {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
}

.about-social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0c0f16;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.about-social-link:hover {
  color: var(--accent-strong);
}

.about-social-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

.emoji-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.news-list {
  display: flex;
  flex-direction: column;
}

.news-item {
  display: flex;
  align-items: baseline;
  gap: 0;
  padding: 8px 0;
  font-size: 15px;
  color: #2f3440;
  line-height: 1.5;
}

.news-date {
  flex-shrink: 0;
  width: 100px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-strong);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.news-text {
  flex: 1;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.project-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: linear-gradient(160deg, #f4f6fb 0%, #b0b3b9 100%);
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
  min-height: 260px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.12),
              0 0 0 1px rgba(var(--accent-rgb), 0.25),
              0 12px 40px rgba(var(--accent-rgb), 0.22);
}
.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.05);
}

.project-overlay {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  text-shadow: none;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  align-items: end;
}

.project-overlay h3 {
  margin: 0;
  align-self: end;
  text-shadow: 0 0px 10px rgba(0, 0, 0, 0.90);
}

.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #0b0d11;
  background: #e6e8ee;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.tech-blue { background: #dce8ff; color: #0c255a; }
.tech-slate { background: #e7e9ef; color: #14171f; }
.tech-green { background: #def3e5; color: #0f3f23; }
.tech-orange { background: #ffe9d9; color: #5a2c00; }
.tech-navy { background: #e2e7f5; color: #0f1f3f; }

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

.pub-item {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 28px;
  align-items: start;
  padding: 28px 16px;
  margin: 0 -16px;
  border-radius: var(--radius);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.pub-item:hover {
  background: rgba(var(--accent-rgb), 0.05);
  box-shadow: inset 3px 0 0 var(--accent-strong);
  transform: translateX(2px);
}

.pub-item:first-child {
  border-top: none;
}

.pub-image {
  border-radius: 10px;
  overflow: hidden;
  align-self: start;
}

.pub-image img {
  width: 100%;
  height: auto;
  display: block;
}

.pub-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pub-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: #0c0f16;
  line-height: 1.35;
}

.pub-authors {
  margin: 0;
  font-size: 14px;
  color: #3f4552;
}

.pub-author-me {
  font-weight: 600;
  color: #0c0f16;
}

.pub-note {
  font-style: italic;
  color: #8a8f9e;
}

.pub-venue {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--accent-strong);
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pub-link {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  background: #f1f2f5;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #0c0f16;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.pub-link:hover {
  background: #e4e6ec;
  border-color: rgba(0, 0, 0, 0.14);
}

.pub-subheading {
  margin: 40px 0 4px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a8f9e;
}

.pub-compact-list {
  display: flex;
  flex-direction: column;
}

.pub-compact-item {
  padding: 14px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.pub-compact-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #0c0f16;
  line-height: 1.4;
}

.pub-compact-authors {
  margin: 3px 0 0;
  font-size: 13px;
  color: #3f4552;
}

.pub-compact-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 6px 0 0;
}

.pub-compact-venue {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--accent-strong);
}

.pub-compact-meta .pub-links {
  margin-top: 0;
  gap: 6px;
}

.pub-compact-meta .pub-link {
  padding: 2px 9px;
  font-size: 12px;
}

@media (max-width: 640px) {
  .pub-item {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

footer {
  background: #000000;
  color: #ffffff;
  padding: 30px 0;
  margin-top: 100px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

.footer-socials {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
}

.footer-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

@media (max-width: 960px) {
  .nav {
    padding: 8px 12px; 
    gap: 12px;
    height: 60px;
  }
  .nav-links { 
    gap: 6px;
    flex-wrap: nowrap;
  }
  .nav-links a {
    padding: 8px 10px;
    font-size: 14px;
  }
  .logo {
    font-size: 14px;
    width: auto;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .nav { 
    position: fixed; 
    inset: 8px 8px auto 8px;
    height: 50px;
    padding: 6px 10px;
    gap: 8px;
  }
  .nav-links {
    gap: 2px;
  }
  .nav-links a {
    padding: 6px 8px;
    font-size: 13px;
  }
  .logo {
    font-size: 12px;
    letter-spacing: 0.05em;
  }
  /* Hide the empty spacer logo on mobile */
  .logo:empty {
    display: none;
  }
  .panel { padding: 24px; }
}
