/* Aesthetic homepage — premium glass + soft gradients + clean type */

:root {
  --bg: #070a12;
  --panel: rgba(255, 255, 255, 0.06);
  --panel2: rgba(255, 255, 255, 0.045);
  --text: #eaf0ff;
  --muted: rgba(234, 240, 255, 0.7);
  --border: rgba(255, 255, 255, 0.1);

  --accent: #8b5cf6; /* violet */
  --accent2: #22c55e; /* green  */
  --accent3: #38bdf8; /* sky    */

  --shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  --shadow2: 0 10px 30px rgba(0, 0, 0, 0.28);

  --radius: 18px;
  --max: 1120px;

  --font:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica,
    Arial;
}

:root[data-theme="light"] {
  --bg: #f7f8fc;
  --panel: rgba(255, 255, 255, 0.72);
  --panel2: rgba(255, 255, 255, 0.65);
  --text: #0b1020;
  --muted: rgba(11, 16, 32, 0.72);
  --border: rgba(11, 16, 32, 0.1);
  --shadow: 0 20px 50px rgba(16, 24, 40, 0.12);
  --shadow2: 0 10px 24px rgba(16, 24, 40, 0.1);
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}
img {
  display: block;
  max-width: 100%;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 18px;
}

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

/* Background art */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}
.blob {
  position: absolute;
  width: 700px;
  height: 700px;
  filter: blur(60px);
  opacity: 0.75;
  transform: translate3d(0, 0, 0);
}
.blob.b1 {
  left: -240px;
  top: -220px;
  background:
    radial-gradient(
      circle at 30% 30%,
      rgba(139, 92, 246, 0.75),
      transparent 60%
    ),
    radial-gradient(
      circle at 70% 60%,
      rgba(56, 189, 248, 0.45),
      transparent 55%
    );
}
.blob.b2 {
  right: -280px;
  top: -240px;
  background:
    radial-gradient(
      circle at 30% 40%,
      rgba(34, 197, 94, 0.55),
      transparent 60%
    ),
    radial-gradient(circle at 70% 60%, rgba(139, 92, 246, 0.4), transparent 55%);
}
.grain {
  position: absolute;
  inset: -50px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  opacity: 0.08;
  mix-blend-mode: overlay;
  z-index: -1;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  background: rgba(7, 10, 18, 0.55);
  border-bottom: 1px solid var(--border);
}
:root[data-theme="light"] .nav {
  background: rgba(247, 248, 252, 0.7);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  letter-spacing: 0.01em;
}
.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 0 7px rgba(139, 92, 246, 0.18);
}
.brand-text {
  font-size: 15px;
}

.nav-links {
  display: flex;
  gap: 6px;
  align-items: center;
}
.nav-links a {
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.nav-links a:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}
.nav-links a.active {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--text);
  border-radius: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow2);
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.09);
}
.btn:active {
  transform: translateY(0px);
}

.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), #3b82f6);
  box-shadow: 0 20px 60px rgba(139, 92, 246, 0.22);
}
.btn.ghost {
  background: transparent;
  box-shadow: none;
}
.btn-arrow {
  opacity: 0.9;
}

/* =========================
   Theme Toggle Button
   ========================= */

.theme-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
}

/* Dark mode — make it more visible */
:root[data-theme="dark"] .theme-btn {
  border-color: rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.12);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.15);
}

/* Light mode */
:root[data-theme="light"] .theme-btn {
  border-color: rgba(11, 16, 32, 0.15);
  background: rgba(11, 16, 32, 0.05);
}

.theme-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.25);
}

.theme-icon {
  font-size: 16px;
  line-height: 1;
  color: rgba(234, 240, 255, 0.85);
}

:root[data-theme="light"] .theme-icon {
  color: rgba(11, 16, 32, 0.85);
}

/* Hero */
.hero {
  padding: 54px 0 20px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
  align-items: start;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}
.pill .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent3), var(--accent2));
  box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.12);
}

.title {
  margin: 14px 0 10px;
  font-size: 52px;
  letter-spacing: -0.03em;
  line-height: 1.02;
}
.title-strong {
  background: linear-gradient(135deg, var(--text), rgba(234, 240, 255, 0.6));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.title-soft {
  display: block;
  margin-top: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  font-size: 17px;
  color: var(--muted);
  max-width: 70ch;
}

.cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.mini-card {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.045);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.mini-k {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.mini-v {
  font-weight: 650;
  color: rgba(234, 240, 255, 0.86);
}
:root[data-theme="light"] .mini-v {
  color: rgba(11, 16, 32, 0.9);
}

/* Glass cards */
.glass-card,
.portrait-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.portrait-card {
  overflow: hidden;
}
.portrait {
  aspect-ratio: 16/11;
  background: rgba(255, 255, 255, 0.04);
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}
.portrait-meta {
  padding: 14px 14px 16px;
}
.name {
  font-weight: 800;
  letter-spacing: -0.01em;
}
.meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.links {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}
.chip:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}

.glass-card {
  padding: 16px 16px 14px;
  margin-top: 12px;
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.card-head h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--muted);
}
.check {
  display: inline-flex;
  width: 18px;
  color: rgba(234, 240, 255, 0.85);
}

/* Sections */
.section {
  padding: 44px 0;
}
.section-head h2 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.section-head p {
  margin: 0;
}

.cards3 {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel2);
  padding: 16px;
  box-shadow: var(--shadow2);
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}
.card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.07);
}
.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 10px;
}
.card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}
.card p {
  margin: 0 0 10px;
  color: var(--muted);
}
.card-link {
  color: rgba(234, 240, 255, 0.85);
  font-weight: 650;
}
:root[data-theme="light"] .card-link {
  color: rgba(11, 16, 32, 0.9);
}

/* Contact */
.contact-card {
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.contact-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Footer */
.footer {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .cards3 {
    grid-template-columns: 1fr;
  }
  .title {
    font-size: 44px;
  }
}
@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .nav-links {
    position: absolute;
    left: 18px;
    right: 18px;
    top: 64px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(7, 10, 18, 0.92);
    backdrop-filter: blur(14px) saturate(140%);
  }
  :root[data-theme="light"] .nav-links {
    background: rgba(247, 248, 252, 0.95);
  }
  .nav-links.open {
    display: flex;
  }
  .theme-btn {
    width: 100%;
    height: auto;
    padding: 12px 14px;
    border-radius: 14px;
  }
  .mini {
    grid-template-columns: 1fr;
  }
  .contact-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .btn,
  .card {
    transition: none;
  }
}

/* =========================
   Publications page (All by default + Year filter)
   ========================= */

.pub-hero {
  padding: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.pub-hero-left {
  flex: 1 1 640px;
  min-width: min(680px, 100%);
}

.pub-hero-right {
  flex: 0 0 240px;
}

.pub-h1 {
  margin: 12px 0 6px;
  font-size: 34px;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.pub-lead {
  margin: 0;
}

.pub-controls {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.pub-panel {
  padding: 14px;
}

/* Inputs */
.pub-field {
  min-width: 180px;
}
.pub-field.grow {
  flex: 1 1 320px;
}

.pub-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}

.pub-input,
.pub-select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  outline: none;
}
.pub-input::placeholder {
  color: rgba(234, 240, 255, 0.55);
}
:root[data-theme="light"] .pub-input::placeholder {
  color: rgba(11, 16, 32, 0.45);
}

/* Publication count block */

.pub-stat {
  padding: 18px;
  text-align: center;
}

.pub-stat-total {
  font-size: 32px;
  font-weight: 850;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.pub-stat-word {
  font-size: 32px; /* same size as number */
  font-weight: 850; /* same weight */
  letter-spacing: -0.02em;
  color: rgba(234, 240, 255, 0.85);
}

:root[data-theme="light"] .pub-stat-word {
  color: rgba(11, 16, 32, 0.85);
}
/* List items */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.pub-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 14px;
  box-shadow: var(--shadow2);
}

.pub-title {
  color: var(--text);
  margin-bottom: 6px;
}
.pub-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.pub-bottom {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.pub-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pub-link {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
}
.pub-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}

.pub-pill {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

/* Grouped by year (All years mode) */
.pub-year-block {
  margin-top: 18px;
}
.pub-year {
  margin: 10px 2px 10px;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: rgba(234, 240, 255, 0.88);
}
:root[data-theme="light"] .pub-year {
  color: rgba(11, 16, 32, 0.88);
}

/* Error box */
.pub-error {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  overflow: auto;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

/* Mobile */
@media (max-width: 980px) {
  .pub-hero-right {
    flex: 1 1 260px;
  }
}
@media (max-width: 820px) {
  .pub-field {
    min-width: 100%;
  }
  .pub-h1 {
    font-size: 30px;
  }
}

/* Highlight author name in publications */
.author-hi {
  display: inline-block;
  padding: 1px 8px;
  margin: 0 2px;
  border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.18),
    rgba(56, 189, 248, 0.12)
  );
  color: rgba(234, 240, 255, 0.95);
  font-weight: 750;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

:root[data-theme="light"] .author-hi {
  border-color: rgba(139, 92, 246, 0.28);
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.14),
    rgba(56, 189, 248, 0.1)
  );
  color: rgba(11, 16, 32, 0.92);
}

.pub-lead {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: -0.01em;
  color: rgba(234, 240, 255, 0.75);
  max-width: 640px;
}

:root[data-theme="light"] .pub-lead {
  color: rgba(11, 16, 32, 0.72);
}

.pub-em {
  font-weight: 650;
  background: linear-gradient(
    90deg,
    rgba(139, 92, 246, 0.85),
    rgba(56, 189, 248, 0.85)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Compact Featured (for home sidebar replacement) */

.hi-grid-compact {
  display: grid;
  gap: 10px;
}

.hi-item {
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  transition: all 0.15s ease;
}

.hi-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(139, 92, 246, 0.35);
  transform: translateY(-1px);
}

.hi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.hi-pill {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.hi-item-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 4px;
}

.hi-meta {
  font-size: 12px;
}

/* Home: Who Am I section */

.whoami {
  margin-top: -20px;
  max-width: 720px;
}

.whoami-title {
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}

.whoami-text {
  font-size: 15px;
  line-height: 1.8;
  letter-spacing: -0.005em;
  color: rgba(234, 240, 255, 0.82);
  text-align: justify; /* ← important */
  text-justify: inter-word; /* better spacing */
  margin-bottom: 14px;
}

:root[data-theme="light"] .whoami-text {
  color: rgba(11, 16, 32, 0.75);
}

.whoami-card {
  position: relative;
  padding: 16px 16px 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.whoami-accent {
  position: absolute;
  inset: -40px -60px auto auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(139, 92, 246, 0.2),
    rgba(56, 189, 248, 0.1),
    rgba(0, 0, 0, 0)
  );
  filter: blur(2px);
  pointer-events: none;
}

.hero-hook {
  margin: 14px 0 10px;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(234, 240, 255, 0.82);
  max-width: 760px;
}

:root[data-theme="light"] .hero-hook {
  color: rgba(11, 16, 32, 0.78);
}

.hero-em {
  font-weight: 850;
  background: linear-gradient(
    90deg,
    rgba(139, 92, 246, 0.9),
    rgba(56, 189, 248, 0.9)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.title-name {
  display: inline-flex; /* keeps it on one line naturally */
  margin: 0px 0px 0px 5px;
  align-items: baseline;
  gap: 6px; /* clean spacing */
  flex-wrap: nowrap; /* prevents wrap */
}
.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* ← this right-aligns everything */
  text-align: left; /* ← makes text align right */
  gap: 16px;
}
