:root {
  --bg: #0a0a0c;
  --bg-soft: #111114;
  --card: #141418;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ededf0;
  --muted: #8a8a94;
  --faint: #5a5a63;
  --accent: #7c8cff;
  --accent-soft: rgba(124, 140, 255, 0.14);
  --radius: 16px;
  --max: 920px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Background decor */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
  z-index: -2;
}
.bg-glow {
  position: fixed;
  top: -22%;
  left: 50%;
  transform: translate(calc(-50% + var(--px, 0px)), var(--py, 0px));
  width: 720px;
  height: 720px;
  background: radial-gradient(circle, rgba(124,140,255,0.20), transparent 60%);
  filter: blur(44px);
  z-index: -1;
  pointer-events: none;
  transition: transform 0.6s var(--ease);
  animation: glowPulse 9s ease-in-out infinite;
}
.bg-glow::after {
  content: "";
  position: absolute;
  inset: -10% 30% 40% -10%;
  background: radial-gradient(circle, rgba(201,160,255,0.16), transparent 60%);
  filter: blur(30px);
  animation: glowDrift 14s ease-in-out infinite alternate;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.75; filter: blur(44px); }
  50% { opacity: 1; filter: blur(66px); }
}
@keyframes glowDrift {
  from { transform: translate(-8%, 0) scale(1); }
  to { transform: translate(22%, 14%) scale(1.15); }
}

/* Layout helpers */
main { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav__brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border-strong);
  padding: 6px 10px;
  border-radius: 10px;
}
.nav__links { display: flex; gap: 22px; }
.nav__links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s var(--ease);
}
.nav__links a:hover { color: var(--text); }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--faint);
}
.lang-toggle__opt { transition: color 0.2s var(--ease); }
.lang-toggle__opt.is-active { color: var(--accent); }
.lang-toggle__sep { color: var(--faint); }

/* Hero */
.hero { padding: 110px 0 70px; position: relative; }

/* Interactive banner (LinkedIn-cover style) */
.hero__banner {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: calc(100% + 120px);
  z-index: 0;
  overflow: hidden;
  opacity: 1;
  animation: none;
  pointer-events: none;
}
#heroCanvas { width: 100%; height: 100%; display: block; }
.hero__banner-fade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 90% at 20% 40%, transparent 0%, rgba(10,10,12,0.35) 70%),
    linear-gradient(180deg, transparent 40%, var(--bg) 100%);
}

/* Staggered entrance for hero children (banner excluded) */
.hero > *:not(.hero__banner) { position: relative; z-index: 1; opacity: 0; animation: heroReveal 0.9s var(--ease) forwards; }
.hero__eyebrow { animation-delay: 0.05s; }
.hero__title  { animation-delay: 0.18s; }
.hero__lead   { animation-delay: 0.34s; }
.hero__actions{ animation-delay: 0.5s; }
.hero__tags   { animation-delay: 0.66s; }

@keyframes heroReveal {
  from { opacity: 0; transform: translateY(30px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes titleShimmer { to { background-position: 200% center; } }
@keyframes tagPop {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

.hero__eyebrow {
  font-family: "Space Grotesk", sans-serif;
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero__title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(42px, 8vw, 76px);
  line-height: 1.18;
  padding-top: 0.12em;
  margin-top: -0.12em;
  font-weight: 700;
  letter-spacing: -1.5px;
  margin-bottom: 24px;
  background: linear-gradient(100deg, #ffffff 18%, var(--accent) 42%, #c9a0ff 58%, #ffffff 82%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: heroReveal 0.9s var(--ease) 0.18s forwards, titleShimmer 7s linear 1.1s infinite;
}
.hero__lead {
  max-width: 620px;
  font-size: clamp(16px, 2.4vw, 19px);
  color: var(--muted);
  margin-bottom: 34px;
}
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 44px; }

.btn {
  display: inline-flex;
  align-items: center;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 999px;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: #0a0a0c; font-weight: 600; }
.btn--primary:hover { background: #93a0ff; }
.btn--ghost { border: 1px solid var(--border-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero__tags { display: flex; flex-wrap: wrap; gap: 10px; animation: none; opacity: 1; }
.hero__tags span {
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  opacity: 0;
  animation: tagPop 0.6s var(--ease) forwards;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.hero__tags span:nth-child(1) { animation-delay: 0.72s; }
.hero__tags span:nth-child(2) { animation-delay: 0.80s; }
.hero__tags span:nth-child(3) { animation-delay: 0.88s; }
.hero__tags span:nth-child(4) { animation-delay: 0.96s; }
.hero__tags span:nth-child(5) { animation-delay: 1.04s; }
.hero__tags span:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Sections */
.section { padding: 60px 0; border-top: 1px solid var(--border); }
.section__head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 28px; }
.section__index {
  font-family: "Space Grotesk", sans-serif;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}
.section__title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 600;
  letter-spacing: -0.5px;
}
.section__sub { color: var(--muted); max-width: 620px; margin-bottom: 28px; }

.about__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.about__grid p { color: var(--muted); font-size: 16px; }

/* Talks */
.talks {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.talk {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.talk:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.talk__badge {
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--faint);
}
.talk__place {
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}
.talk--global {
  background: var(--accent-soft);
  border-color: rgba(124, 140, 255, 0.35);
}
.talk--global .talk__badge { color: var(--accent); }

/* Timeline */
.timeline { list-style: none; position: relative; }
.tl-item {
  position: relative;
  padding: 0 0 34px 26px;
  border-left: 1px solid var(--border);
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.tl-item__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.tl-item__role { font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 17px; }
.tl-item__org { color: var(--accent); font-size: 15px; }
.tl-item__date { color: var(--faint); font-size: 13px; margin-left: auto; }
.tl-item__desc { color: var(--muted); font-size: 15px; max-width: 640px; }

/* Cards */
.cards { display: grid; grid-template-columns: 1fr; gap: 18px; }
.cards--writing { grid-template-columns: 1fr 1fr; }
.cards--writing > a:last-child:nth-child(odd) { grid-column: 1 / -1; }
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 26px;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
a.card { display: block; text-decoration: none; color: inherit; }
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.card__hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}
.link-more {
  display: inline-flex;
  margin-top: 22px;
  color: var(--text);
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.link-more:hover { color: var(--accent); border-color: var(--accent); }
.card__top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.card__title { font-family: "Space Grotesk", sans-serif; font-size: 22px; font-weight: 600; }
.card__tag {
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
}
.card__desc { color: var(--muted); margin-bottom: 16px; }
.card__stack { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.card__stack li {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
}

/* Chat */
.chatbox {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  max-width: 640px;
}
.chatbox__messages {
  height: 360px;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}
.msg { max-width: 82%; display: flex; flex-direction: column; gap: 4px; }
.msg p { margin: 0; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; }
.msg__author {
  font-family: "Space Grotesk", sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--faint);
}
.msg--bot { align-self: flex-start; }
.msg--bot p {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px 14px 14px 4px;
  padding: 10px 14px;
  color: var(--text);
}
.msg--user { align-self: flex-end; align-items: flex-end; }
.msg--user p {
  background: var(--accent);
  color: #0a0a0c;
  border-radius: 14px 14px 4px 14px;
  padding: 10px 14px;
  font-weight: 500;
}
.msg--user .msg__author { text-align: right; }
.msg--typing p {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 12px 16px;
}
.msg--typing .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--faint);
  animation: typingBounce 1.1s infinite ease-in-out;
}
.msg--typing .dot:nth-child(2) { animation-delay: 0.15s; }
.msg--typing .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.chatbox__form {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--border);
}
.chatbox__form input {
  flex: 1;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 11px 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.2s var(--ease);
}
.chatbox__form input:focus { border-color: var(--accent); }
.chatbox__send {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #0a0a0c;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.chatbox__send:hover { background: #93a0ff; transform: scale(1.05); }
.chatbox__send:disabled { opacity: 0.5; cursor: default; transform: none; }
.chatbox__hint {
  padding: 10px 22px 16px;
  font-size: 12px;
  color: var(--faint);
  border-top: 1px solid var(--border);
}

/* Contact */
.section--contact { padding-bottom: 80px; }
.contact__lead { color: var(--muted); max-width: 560px; font-size: 18px; margin-bottom: 28px; }
.contact__links { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact__link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  text-decoration: none;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.contact__link:hover { transform: translateY(-4px); border-color: var(--accent); }
.contact__label {
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--faint);
}
.contact__value { color: var(--text); font-size: 17px; }

/* Footer */
.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 30px 24px 50px;
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero > *, .hero__title, .hero__tags span { opacity: 1 !important; animation: none !important; }
  .bg-glow, .bg-glow::after { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* Responsive */
@media (max-width: 720px) {
  .nav__links { display: none; }
  .about__grid { grid-template-columns: 1fr; }
  .talks { grid-template-columns: 1fr 1fr; }
  .cards--writing { grid-template-columns: 1fr; }
  .contact__links { grid-template-columns: 1fr; }
  .tl-item__date { margin-left: 0; width: 100%; }
}
@media (max-width: 460px) {
  .talks { grid-template-columns: 1fr; }
}
