/* ==========================================================================
   FUTURE THEME — light, interactive layer on top of the base theme.
   Loaded after main.css from _includes/head/custom.html.
   ========================================================================== */

:root {
  --fx-bg: #ffffff;
  --fx-bg-2: #f5f8ff;
  --fx-text: #2b3445;
  --fx-muted: #6b7489;
  --fx-head: #0b1220;
  --fx-accent: #2563eb;
  --fx-accent-2: #60a5fa;
  --fx-line: rgba(37, 99, 235, 0.14);
  --fx-card: #ffffff;
  --fx-mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --fx-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html { background: var(--fx-bg); }
body {
  background: transparent; /* let the glow + particle canvas show through */
  color: var(--fx-text);
  font-family: var(--fx-display);
}

/* Background canvas + very soft blue glow, behind everything */
#fx-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}
#fx-top {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 50;
  pointer-events: none;
}
body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(40vmax 30vmax at 12% 8%, rgba(96, 165, 250, 0.10), transparent 60%),
    radial-gradient(45vmax 35vmax at 92% 35%, rgba(37, 99, 235, 0.06), transparent 60%),
    var(--fx-bg);
  animation: fx-aurora 24s ease-in-out infinite alternate;
}
@keyframes fx-aurora {
  to { transform: translate3d(3vmax, -2vmax, 0) rotate(4deg); }
}

/* ---------- Masthead ---------- */
.masthead {
  background: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--fx-line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.greedy-nav, .greedy-nav .hidden-links { background: transparent; }
.greedy-nav a, .greedy-nav .visible-links a { color: var(--fx-text); }
.greedy-nav .visible-links a:before { background: var(--fx-accent); }
.greedy-nav .visible-links a:hover { color: var(--fx-head); }
.masthead__menu-item--lg a {
  font-family: var(--fx-mono);
  letter-spacing: 0.04em;
  color: var(--fx-head) !important;
}
.greedy-nav button { background: transparent; }
.greedy-nav .navicon, .greedy-nav .navicon:before, .greedy-nav .navicon:after { background: var(--fx-text); }
.greedy-nav .hidden-links { background: var(--fx-bg); border-color: var(--fx-line); }

/* ---------- Text ---------- */
:is(.page__content, .archive), :is(.page__content, .archive) p, :is(.page__content, .archive) li { color: var(--fx-text); }
.page__title, :is(.page__content, .archive) h1, :is(.page__content, .archive) h2, :is(.page__content, .archive) h3,
:is(.page__content, .archive) h4, .archive__subtitle, .author__name { color: var(--fx-head); }
a { color: var(--fx-accent); }
a:visited { color: #1d4ed8; }
a:hover { color: #1e3a8a; }
:is(.page__content, .archive) a { text-decoration: none; border-bottom: 1px dashed rgba(37, 99, 235, 0.35); }
:is(.page__content, .archive) a:hover { border-bottom-style: solid; }
:is(.page__content, .archive) strong { color: var(--fx-head); }
hr { border-color: var(--fx-line); }

/* Section headings: terminal-style label + gradient underline */
:is(.page__content, .archive) h2, :is(.page__content, .archive) h3 {
  font-family: var(--fx-mono);
  letter-spacing: 0.02em;
  border-bottom: 0;
  position: relative;
  padding-bottom: 0.35em;
  margin-top: 2.2em;
}
:is(.page__content, .archive) h2::before, :is(.page__content, .archive) h3::before {
  content: "> ";
  color: var(--fx-accent);
}
:is(.page__content, .archive) h2::after, :is(.page__content, .archive) h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--fx-accent), var(--fx-accent-2) 35%, transparent);
}
.page__title { font-family: var(--fx-mono); }

/* ---------- Typing tagline under the intro title ---------- */
.fx-tagline {
  font-family: var(--fx-mono);
  font-size: 0.95em;
  color: var(--fx-muted);
  margin: -0.5em 0 1.4em;
  min-height: 1.6em;
}
.fx-tagline .fx-typed { color: var(--fx-accent); }
.fx-tagline .fx-caret {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--fx-accent);
  animation: fx-blink 1s steps(1) infinite;
}
@keyframes fx-blink { 50% { opacity: 0; } }

/* ---------- Cards: experience / education / publications ---------- */
:is(.page__content, .archive) table {
  border: 1px solid var(--fx-line) !important;
  border-radius: 14px;
  border-collapse: separate !important;
  overflow: hidden;
  background: var(--fx-card);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
:is(.page__content, .archive) table:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.4) !important;
  box-shadow: 0 14px 36px -14px rgba(37, 99, 235, 0.35);
}
/* Home page (work experience / education): no frame, just the entries */
.page__content table,
.page__content table:hover {
  border: 0 !important;
  box-shadow: none;
  background: transparent;
  transform: none;
}
:is(.page__content, .archive) td, :is(.page__content, .archive) th { border: 0 !important; color: var(--fx-text); }
:is(.page__content, .archive) tr { background: transparent !important; }

:is(.page__content, .archive) img[src*="/logo/"] { border-radius: 10px; }
:is(.page__content, .archive) img[src*="/publications/"], :is(.page__content, .archive) video {
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--fx-line);
}

/* ---------- News timeline ---------- */
.fx-timeline {
  list-style: none;
  margin-left: 0.4em;
  padding-left: 1.4em;
  border-left: 1px solid var(--fx-line);
}
.fx-timeline > li {
  position: relative;
  margin-bottom: 0.9em;
}
.fx-timeline > li::before {
  content: "";
  position: absolute;
  left: calc(-1.4em - 5px);
  top: 0.55em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--fx-accent-2);
  box-sizing: border-box;
}
.fx-date {
  font-family: var(--fx-mono);
  font-size: 0.85em;
  color: var(--fx-accent);
  margin-right: 0.35em;
}

/* Scroll reveal */
.fx-reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.fx-reveal.fx-in { opacity: 1; transform: none; }

/* ---------- Sidebar / avatar ---------- */
.author__urls { border-color: var(--fx-line); }
.author__name { font-family: var(--fx-mono); }

.fx-avatar {
  position: relative;
  display: inline-block;
  perspective: 700px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fx-avatar-inner {
  position: relative;
  border-radius: 50%;
  transform-style: preserve-3d;
  transition: transform 0.25s ease-out;
  will-change: transform;
}
.fx-avatar img {
  display: block;
  border-radius: 50%;
  position: relative;
  z-index: 1;
  border: 0 !important;
  padding: 0 !important;
}
/* thin ring with a light arc travelling around it */
.fx-avatar-inner::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background:
    conic-gradient(from var(--fx-angle, 0deg), transparent 0deg, var(--fx-accent-2) 60deg, var(--fx-accent) 100deg, transparent 160deg, transparent 360deg),
    rgba(37, 99, 235, 0.12);
  animation: fx-spin 5s linear infinite;
  z-index: 0;
}
.fx-avatar-inner::after { /* soft shadow-glow */
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(37, 99, 235, 0.25), transparent);
  filter: blur(10px);
  opacity: 0.6;
  z-index: -1;
  transition: opacity 0.3s ease;
}
.fx-avatar:hover .fx-avatar-inner::after { opacity: 1; }
@property --fx-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes fx-spin { to { --fx-angle: 360deg; } }

/* glare that follows the cursor */
.fx-glare {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.45), transparent 45%);
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.fx-avatar:hover .fx-glare { opacity: 1; }

/* diffusion overlay: noisy -> clean on hover */
.fx-diffuse {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
}
.fx-diffuse.fx-on { opacity: 1; }
.fx-step {
  position: absolute;
  left: 50%;
  bottom: 10%;
  transform: translateX(-50%);
  font-family: var(--fx-mono);
  font-size: 11px;
  white-space: nowrap;
  color: var(--fx-accent);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--fx-line);
  border-radius: 999px;
  padding: 1px 8px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 4;
}
.fx-step.fx-on { opacity: 1; }

/* HUD readout under the name */
.fx-hud {
  font-family: var(--fx-mono);
  font-size: 11px;
  line-height: 1.55;
  color: var(--fx-head);
  margin-top: 0.9em;
  padding: 0.55em 0.7em;
  border: 1px solid var(--fx-line);
  border-radius: 8px;
  background: var(--fx-bg-2);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease;
}
.fx-hud dl { display: grid; grid-template-columns: auto 1fr; gap: 0.15em 0.8em; margin: 0; }
.fx-hud dt { color: var(--fx-muted); }
.fx-hud dd { margin: 0; }
.sidebar:hover .fx-hud, .fx-hud.fx-open { max-height: 20em; opacity: 1; }

/* burst particles */
.fx-particle {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
}

/* ---------- Footer ---------- */
.page__footer {
  background: rgba(245, 248, 255, 0.9);
  border-top: 1px solid var(--fx-line);
  color: var(--fx-muted);
}
.page__footer a, .page__footer footer { color: var(--fx-muted); }

/* ---------- Accessibility: respect reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  /* Ambient, self-running loops stop. Hover/click effects stay: the visitor starts them. */
  body::before, .fx-avatar-inner::before, .fx-tagline .fx-caret { animation: none !important; }
  .fx-reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Sponsors: single-row carousel ---------- */
.fx-sponsors {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  overflow: hidden;
  margin: 1em 0 0.5em;
  padding: 6px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.fx-sponsors-track {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  width: max-content;
  animation: fx-marquee 28s linear infinite;
}
.fx-sponsors:hover .fx-sponsors-track,
.fx-sponsors:focus-within .fx-sponsors-track { animation-play-state: paused; }
@keyframes fx-marquee { to { transform: translateX(-50%); } }
.fx-sponsors a,
.fx-sponsors-track a {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 1.6em; /* spacing lives in padding so both halves of the loop are equal */
}
.page__content .fx-sponsors a { border-bottom: 0; line-height: 0; }
.fx-sponsors img {
  height: auto;
  width: auto;
  max-height: 36px;
  max-width: 130px;
  object-fit: contain;
  transition: transform 0.25s ease;
}
.fx-sponsors a:hover img { transform: translateY(-2px) scale(1.05); }
.fx-sponsors img[src*="nsf"] { max-height: 54px; }
.fx-sponsors img[src*="gatech"] { max-width: 190px; max-height: 44px; } /* wide wordmark needs more room to read */ /* round seal reads small at the shared height */
.fx-sponsors img[src*="Adb_logo"] { max-height: 26px; } /* bold red wordmark reads heavier than the rest */
