/* ============================================================
   Sathnindu Kottage — personal site
   "The view from orbit": a planet-scale UI. Dark = night side
   of the planet (default), light = dayside. Starfield, aurora
   nebulae and a glowing horizon arc under the hero.
   ============================================================ */

@font-face {
  font-family: "Mona Sans";
  src: url("../fonts/Mona-Sans.woff2") format("woff2-variations");
  font-weight: 200 900;
  font-display: swap;
}

/* ---------- design tokens ---------- */
:root {
  /* night side (default) */
  --bg: #04060f;
  --bg-2: #070b1a;
  --panel: rgba(11, 16, 36, 0.72);
  --panel-solid: #0b1024;
  --card: rgba(13, 19, 42, 0.55);
  --line: rgba(148, 163, 255, 0.14);
  --line-strong: rgba(148, 163, 255, 0.28);
  --text: #e9edff;
  --muted: #97a3c9;
  --faint: #5c6890;

  --indigo: #7c8cff;
  --cyan: #38e1ff;
  --violet: #b78cff;
  --magenta: #f470ce;
  --green: #2eff9e;
  --coral: #ff8a5c;
  --amber: #ffc75c;

  --accent: var(--indigo);
  --grad: linear-gradient(93deg, #2eff9e 0%, #38e1ff 32%, #7c8cff 62%, #c084fc 100%);
  --grad-soft: linear-gradient(93deg, rgba(46,255,158,.18), rgba(56,225,255,.16), rgba(124,140,255,.16), rgba(192,132,252,.16));

  --glow-indigo: 0 0 40px rgba(124, 140, 255, 0.25);
  --radius: 18px;
  --nav-h: 52px;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Mona Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* dayside */
html[data-theme="light"] {
  --bg: #eef4ff;
  --bg-2: #fbfdff;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --card: rgba(255, 255, 255, 0.75);
  --line: rgba(30, 58, 138, 0.13);
  --line-strong: rgba(30, 58, 138, 0.26);
  --text: #0e1531;
  --muted: #4d5b81;
  --faint: #8b97b8;

  --indigo: #4f5fe8;
  --cyan: #0891b2;
  --violet: #7c3aed;
  --magenta: #d63b9f;
  --green: #00b368;
  --coral: #e8632f;
  --amber: #b47b12;

  --accent: var(--indigo);
  --grad: linear-gradient(93deg, #00b368 0%, #0891b2 32%, #4f5fe8 62%, #8b3fe8 100%);
  --grad-soft: linear-gradient(93deg, rgba(0,179,104,.12), rgba(8,145,178,.10), rgba(79,95,232,.10), rgba(139,63,232,.10));
  --glow-indigo: 0 0 40px rgba(79, 95, 232, 0.12);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; }

body {
  margin: 0;
  background: var(--bg);
  background-image: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 140vh);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s ease, color 0.5s ease;
}

.mono { font-family: var(--mono); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

::selection { background: rgba(124, 140, 255, 0.35); }

h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 0.5em; }

/* gradient accent text */
.accent, .accent-purple, .accent-pink {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.accent-purple { background: linear-gradient(93deg, var(--violet), var(--magenta)); -webkit-background-clip: text; background-clip: text; }
.accent-pink   { background: linear-gradient(93deg, var(--magenta), var(--coral));  -webkit-background-clip: text; background-clip: text; }

/* ---------- cosmic backdrop layers ---------- */
#space {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
}

/* nebula haze — huge soft color fields drifting behind everything */
.aurora {
  position: fixed;
  inset: -20%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(42% 34% at 16% 12%, rgba(124, 92, 246, 0.16), transparent 70%),
    radial-gradient(38% 30% at 86% 22%, rgba(56, 189, 248, 0.13), transparent 70%),
    radial-gradient(46% 36% at 68% 86%, rgba(232, 121, 249, 0.09), transparent 70%),
    radial-gradient(30% 26% at 34% 64%, rgba(46, 255, 158, 0.09), transparent 70%);
  filter: blur(40px);
  animation: nebula-drift 46s ease-in-out infinite alternate;
}
html[data-theme="light"] .aurora {
  background:
    radial-gradient(40% 32% at 84% 8%, rgba(255, 200, 90, 0.35), transparent 70%),
    radial-gradient(44% 36% at 12% 18%, rgba(147, 197, 253, 0.45), transparent 70%),
    radial-gradient(40% 34% at 70% 80%, rgba(196, 181, 253, 0.30), transparent 70%),
    radial-gradient(30% 24% at 30% 70%, rgba(167, 243, 208, 0.28), transparent 70%);
  filter: blur(50px);
}
@keyframes nebula-drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(2%, 2%, 0) scale(1.06); }
}

/* ============================================================
   NAV — floating glass pill
   ============================================================ */
.nav {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: min(980px, calc(100% - 24px));
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 18px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 8px 32px rgba(2, 4, 12, 0.35), inset 0 1px 0 rgba(255,255,255,0.05);
}
html[data-theme="light"] .nav {
  box-shadow: 0 8px 32px rgba(30, 58, 138, 0.10), inset 0 1px 0 rgba(255,255,255,0.7);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: "Archivo", var(--sans);
  font-weight: 800;
  font-stretch: 115%;
  font-size: 0.92rem;
  letter-spacing: 0.07em;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
/* a tiny planet as the mark */
.brand::before {
  content: "";
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #9db4ff 0%, #5a6cf0 40%, #241f66 85%);
  box-shadow: 0 0 10px rgba(124, 140, 255, 0.8), inset -2px -2px 5px rgba(0,0,0,0.5);
  flex: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-links a {
  font-family: "Archivo", var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 7px 11px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: rgba(148, 163, 255, 0.10); text-decoration: none; }

.nav-cta {
  color: #fff !important;
  background: var(--grad) !important;
  box-shadow: 0 2px 14px rgba(90, 120, 255, 0.45);
  padding: 7px 15px !important;
}
.nav-cta:hover { filter: brightness(1.1); }

.theme-toggle {
  width: 32px;
  height: 32px;
  margin-left: 5px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.3s;
}
.theme-toggle:hover { background: rgba(148, 163, 255, 0.12); transform: rotate(24deg); }

/* ============================================================
   HERO — in orbit above the planet
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 40px) 22px 70px;
}

/* the planet: a huge circle whose top arc glows at the bottom
   of the first viewport */
.orbit-scene {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  --arc: clamp(130px, 22vh, 240px);      /* visible arc height */
  --psize: max(240vw, 1700px);           /* planet diameter */
}

.planet {
  position: absolute;
  left: 50%;
  bottom: calc(-1 * var(--psize) + var(--arc));
  width: var(--psize);
  height: var(--psize);
  margin-left: calc(var(--psize) / -2);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 6%,
      #16295e 0%, #0d1a42 10%, #081128 26%, #04081a 48%, #01030c 72%);
  box-shadow:
    0 -4px 24px 2px  rgba(151, 205, 255, 0.55),
    0 -12px 80px 8px rgba(99, 132, 255, 0.38),
    0 -30px 200px 40px rgba(56, 130, 246, 0.20),
    0 -60px 380px 110px rgba(99, 102, 241, 0.12);
  transition: background 0.6s ease, box-shadow 0.6s ease;
}
/* thin bright atmosphere line hugging the rim */
.planet::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  box-shadow: inset 0 6px 18px -4px rgba(190, 225, 255, 0.9);
  filter: blur(1px);
}
/* aurora ribbon dancing on the horizon */
.planet::after {
  content: "";
  position: absolute;
  top: -3vh;
  left: 50%;
  width: 62%;
  height: 9vh;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(90deg,
    rgba(46, 255, 158, 0.0) 0%,
    rgba(46, 255, 158, 0.6) 22%,
    rgba(56, 225, 255, 0.5) 46%,
    rgba(124, 140, 255, 0.45) 68%,
    rgba(192, 132, 252, 0.0) 100%);
  filter: blur(26px);
  opacity: 0.65;
  animation: aurora-dance 9s ease-in-out infinite alternate;
}
@keyframes aurora-dance {
  from { transform: translateX(-58%) scaleY(1);    opacity: 0.5; }
  to   { transform: translateX(-42%) scaleY(1.35); opacity: 0.85; }
}

/* dayside planet */
html[data-theme="light"] .planet {
  background:
    radial-gradient(circle at 50% 6%,
      #ffffff 0%, #dbeafe 12%, #b7d3fd 30%, #8db8f9 55%, #6ba3f5 80%);
  box-shadow:
    0 -4px 24px 2px  rgba(255, 255, 255, 0.9),
    0 -12px 80px 8px rgba(147, 197, 253, 0.7),
    0 -30px 200px 40px rgba(147, 197, 253, 0.35);
}
html[data-theme="light"] .planet::before {
  box-shadow: inset 0 6px 18px -4px rgba(255, 255, 255, 1);
}
html[data-theme="light"] .planet::after { opacity: 0.35; }

/* a small moon drifting across the sky */
.moon {
  position: absolute;
  bottom: calc(var(--arc) + 16vh);
  left: -40px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #f2f5ff 0%, #b9c2dd 45%, #5d6685 90%);
  box-shadow: 0 0 14px rgba(220, 230, 255, 0.55);
  opacity: 0.9;
  animation: moon-drift 90s linear infinite;
}
@keyframes moon-drift {
  0%   { transform: translate(0, 0) scale(0.8); }
  50%  { transform: translate(55vw, -9vh) scale(1); }
  100% { transform: translate(110vw, 0) scale(0.8); }
}

/* the git-graph fills the whole hero sky */
.hero > #universe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* shading: left scrim so the overlaid type stays readable */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(96deg,
    color-mix(in srgb, var(--bg) 94%, transparent) 0%,
    color-mix(in srgb, var(--bg) 82%, transparent) 30%,
    color-mix(in srgb, var(--bg) 40%, transparent) 52%,
    transparent 72%);
}

.hero-grid {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  pointer-events: none;   /* clicks fall through to the canvas */
}

/* text block overlaid on the left; empty areas let the sky
   receive drags, while links/buttons stay clickable */
.hero-intro {
  max-width: 620px;
  pointer-events: none;
}
.hero-intro a,
.hero-intro button { pointer-events: auto; }

/* thin editorial rule with year + since */
.hero-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--faint);
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: clamp(22px, 4vh, 42px);
}

/* giant Archivo display type */
.display {
  font-family: "Archivo", var(--sans);
  font-weight: 800;
  font-stretch: 115%;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: -0.015em;
}

.hero-intro h1 {
  font-size: clamp(2.4rem, 5.6vw, 4.6rem);
  margin: 0;
  text-shadow: 0 2px 40px color-mix(in srgb, var(--bg) 70%, transparent);
}

.hero-role {
  font-size: clamp(1.05rem, 2.2vw, 1.55rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  margin: clamp(14px, 2.4vh, 24px) 0 0;
}

.hero-skills {
  font-size: clamp(0.74rem, 1.2vw, 0.85rem);
  color: var(--cyan);
  letter-spacing: 0.06em;
  margin: 10px 0 clamp(30px, 5.5vh, 52px);
}

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: clamp(26px, 4.5vh, 44px);
}

/* terminal-chip CTAs — same family as the timeline controls */
.btn-primary, .btn-outline {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  padding: 12px 24px;
  border-radius: 999px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn-primary {
  background: var(--grad-soft);
}
.btn-primary:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(124, 140, 255, 0.28);
  text-decoration: none;
}
.btn-outline {
  background: var(--panel);
}
.btn-outline:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  text-decoration: none;
}

.prompt {
  font-size: 0.78rem;
  color: var(--faint);
  letter-spacing: 0.02em;
  margin: 0;
}
.prompt-dim { color: var(--faint); opacity: 0.75; }

#universe {
  display: block;
  cursor: grab;
  touch-action: pan-y;
}
#universe:active { cursor: grabbing; }

#uni-tooltip {
  display: none;
  position: absolute;
  z-index: 5;
  max-width: 260px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  font-size: 0.82rem;
  line-height: 1.45;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.tt-sha { color: var(--cyan); font-family: var(--mono); margin-right: 6px; }
.tt-date { display: block; color: var(--faint); font-family: var(--mono); font-size: 0.74rem; }

.uni-controls {
  position: absolute;
  right: clamp(18px, 3vw, 46px);
  bottom: clamp(18px, 4vh, 34px);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
}
.uni-controls button {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.uni-controls button:hover { border-color: var(--accent); background: rgba(124, 140, 255, 0.10); }
.uni-hint {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--faint);
  text-align: center;
}

/* ============================================================
   INSPECTOR — slide-in commit panel
   ============================================================ */
.inspector {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  width: min(460px, 92vw);
  padding: 28px 26px;
  overflow-y: auto;
  background: var(--panel-solid);
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 80px rgba(2, 4, 12, 0.6);
  transform: translateX(105%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
}
.inspector.open { transform: translateX(0); }
.inspector::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 2px;
  background: var(--grad);
}

.insp-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.insp-close:hover { color: var(--text); border-color: var(--accent); }

.insp-sha { color: var(--cyan); font-size: 0.8rem; margin: 0 0 6px; }
.inspector h3 { font-size: 1.3rem; margin: 0 0 8px; }
.insp-meta { color: var(--faint); font-size: 0.78rem; margin: 0 0 16px; }
#insp-img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}
#insp-desc { color: var(--muted); }

.insp-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(2, 4, 12, 0.5);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.insp-backdrop.open { opacity: 1; pointer-events: auto; }

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  position: relative;
  max-width: 1160px;
  margin: 0 auto;
  padding: 110px 22px 30px;
}

.sec-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(8px);
  margin: 0 0 18px;
}
/* glowing dot on the label */
.sec-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rail, var(--accent));
  box-shadow: 0 0 10px var(--rail, var(--accent)), 0 0 0 3px color-mix(in srgb, var(--rail, var(--accent)) 22%, transparent);
}

#about      { --rail: var(--green); }
#career     { --rail: var(--indigo); }
#research   { --rail: var(--violet); }
#oss        { --rail: var(--coral); }
#github     { --rail: var(--cyan); }
#community  { --rail: var(--magenta); }
.honors     { --rail: var(--amber); }
#contact    { --rail: var(--green); }

.section h2 {
  font-size: clamp(1.9rem, 4.4vw, 3.1rem);
  font-weight: 850;
  margin: 0 0 14px;
  text-wrap: balance;
}

.sec-sub {
  color: var(--muted);
  max-width: 640px;
  margin: 0 0 34px;
}

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 54px;
  align-items: center;
}

.about-photo {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto;
}
.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  position: relative;
  z-index: 1;
}
/* orbital ring around the photo */
.about-photo::before {
  content: "";
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 1px dashed var(--line-strong);
  animation: spin 40s linear infinite;
}
.about-photo::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--indigo);
  box-shadow: 0 0 12px var(--indigo);
  transform: rotate(0deg) translateY(-156px);
  animation: orbit 40s linear infinite;
}
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes orbit {
  from { transform: rotate(0deg)   translateY(-156px); }
  to   { transform: rotate(360deg) translateY(-156px); }
}

.about-text h2 { margin-top: 6px; }
.about-text p { color: var(--muted); }
.about-text strong { color: var(--text); }

/* stats */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 30px;
}
.stat {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(8px);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.stat:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: 0 20px 60px rgba(2, 4, 12, 0.5), var(--glow-indigo); }
.stat .n {
  font-size: 1.55rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat .l { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

/* ---------- career: grouped by company ---------- */
.careers { margin-top: 18px; display: flex; flex-direction: column; gap: 40px; }

/* company header: logo appears once, name + tenure beside it */
.co-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.t-logo {
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: #ffffff;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 2px 14px rgba(2, 4, 12, 0.35);
}
.t-logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

.co-title { min-width: 0; }
.co-title h3 { font-size: 1.28rem; margin: 0 0 2px; letter-spacing: -0.01em; }
.co-meta { font-size: 0.74rem; color: var(--faint); margin: 0; letter-spacing: 0.03em; }
.co-meta .promo { color: var(--green); }
.co-meta .promo.concurrent { color: var(--amber); }

/* role cards hang off a soft spine aligned under the logo */
.co-roles {
  position: relative;
  margin-left: 27px;          /* center of the 54px logo */
  padding-left: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.co-roles::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 2px;
  bottom: 14px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--indigo), rgba(124, 140, 255, 0.05));
}

.t-item {
  position: relative;
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(8px);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.t-item:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: 0 20px 60px rgba(2, 4, 12, 0.5), var(--glow-indigo); }
/* dot connecting each role card to the spine */
.t-item::before {
  content: "";
  position: absolute;
  left: -35.5px;
  top: 24px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--indigo);
}
.t-item.is-current::before {
  background: var(--indigo);
  box-shadow: 0 0 10px rgba(124, 140, 255, 0.85);
}

.t-when { font-size: 0.73rem; color: var(--cyan); letter-spacing: 0.05em; margin-bottom: 4px; }
.t-item h4 { font-size: 1.04rem; margin: 0 0 6px; letter-spacing: -0.01em; }
.t-item p { color: var(--muted); margin: 0; font-size: 0.94rem; }
.t-item strong { color: var(--text); }

.pill {
  display: inline-block;
  font-size: 0.66rem;
  padding: 2px 9px;
  border-radius: 999px;
  vertical-align: 2px;
  margin-left: 8px;
}
.head-pill {
  color: #04060f;
  background: var(--green);
  box-shadow: 0 0 14px rgba(46, 255, 158, 0.7);
  font-weight: 700;
}

/* ---------- research ---------- */
.research-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 44px;
  align-items: start;
}

.paper-title {
  font-size: 1.18rem;
  font-weight: 750;
  line-height: 1.45;
  color: var(--text);
  padding: 18px 22px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--grad-soft);
  backdrop-filter: blur(8px);
}
.paper-meta { font-size: 0.78rem; color: var(--faint); margin: 16px 0; }
.research-text > p:not(.paper-title):not(.paper-meta) { color: var(--muted); }
.paper-links a { margin-right: 20px; font-size: 0.85rem; }

.research-photos { display: grid; gap: 12px; }
.rp-main, .rp-row img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  transition: transform 0.3s, box-shadow 0.3s;
  display: block;
}
.rp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rp-main:hover, .rp-row img:hover { transform: scale(1.02); box-shadow: var(--glow-indigo); }

/* ---------- projects ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.project {
  position: relative;
  display: block;
  padding: 22px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(8px);
  color: var(--text);
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.project:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 20px 60px rgba(2, 4, 12, 0.5), var(--glow-indigo);
  text-decoration: none;
}
/* cursor spotlight */
.project::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%),
    rgba(124, 140, 255, 0.14), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.project:hover::before { opacity: 1; }

.p-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.p-top h3 { font-size: 1.14rem; margin: 0; }
.p-lang { font-family: var(--mono); font-size: 0.7rem; color: var(--faint); white-space: nowrap; }
.project p { color: var(--muted); font-size: 0.92rem; margin: 10px 0 14px; }

.p-badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}
.p-badge.flagship {
  color: #04060f;
  background: var(--grad);
  border: none;
  font-weight: 700;
  box-shadow: 0 0 18px rgba(90, 120, 255, 0.5);
}

/* ---------- github live ---------- */
.gh-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}
.gh-stats .stat .n { font-family: var(--mono); }

.constellation-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(12px);
  padding: 20px 22px 14px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.constellation-wrap::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  opacity: 0.7;
}
.c-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.c-head h3 { font-size: 1.02rem; margin: 0 0 8px; }
.c-note { font-family: var(--mono); font-size: 0.74rem; color: var(--faint); }
#constellation { display: block; width: 100%; height: 190px; }

/* live activity feed */
.activity-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(12px);
  padding: 20px 22px 10px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.activity-wrap::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--indigo));
  opacity: 0.7;
}
.activity {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}
.activity li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.activity li:last-child { border-bottom: none; }
.a-icon { color: var(--green); flex: none; width: 18px; text-align: center; }
.a-text { color: var(--muted); flex: 1 1 auto; min-width: 0; }
.a-text a { color: var(--text); font-weight: 600; }
.a-text a:hover { color: var(--accent); }
.a-time { flex: none; font-size: 0.72rem; color: var(--faint); }

.gh-langs {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 10px;
}
.gh-langs span { display: block; height: 100%; }

.gh-lang-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  margin-bottom: 28px;
}
.gh-lang-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}
.repo {
  display: block;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(8px);
  color: var(--text);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.repo:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: 0 20px 60px rgba(2, 4, 12, 0.5), var(--glow-indigo); text-decoration: none; }
.r-name { font-family: var(--mono); font-size: 0.88rem; color: var(--cyan); font-weight: 600; }
.repo p { color: var(--muted); font-size: 0.85rem; margin: 8px 0 12px; min-height: 2.4em; }
.r-meta { display: flex; gap: 16px; font-family: var(--mono); font-size: 0.74rem; color: var(--faint); }

.gh-foot { font-family: var(--mono); font-size: 0.72rem; color: var(--faint); margin-top: 22px; }

/* ---------- community gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.gallery figure {
  position: relative;
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  transition: transform 0.3s, box-shadow 0.3s;
}
.gallery figure:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 24px 60px rgba(2,4,12,0.5), var(--glow-indigo); }
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s;
}
.gallery figure:hover img { transform: scale(1.06); }
.gallery figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 14px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(2, 4, 12, 0.85));
}

/* ---------- honors ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  font-size: 0.78rem;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(8px);
  color: var(--muted);
  transition: border-color 0.25s, color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.tag:hover {
  color: var(--text);
  border-color: var(--amber);
  box-shadow: 0 0 20px rgba(255, 199, 92, 0.25);
  transform: translateY(-2px);
}

/* ---------- contact ---------- */
.contact { text-align: center; padding-bottom: 80px; }
.contact .sec-label { margin-left: auto; margin-right: auto; }
.contact .sec-sub { margin-left: auto; margin-right: auto; }

.contact-big { display: flex; flex-direction: column; gap: 8px; margin: 26px 0 30px; }
/* email links have no href until first interaction — keep them clickable */
.email-link { cursor: pointer; }
.contact-line {
  font-size: clamp(1.4rem, 4.4vw, 2.6rem);
  font-weight: 850;
  letter-spacing: -0.02em;
  color: var(--text);
  transition: 0.25s;
}
.contact-line:hover {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
}

.socials { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.socials a {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  transition: 0.25s;
}
.socials a:hover { color: var(--text); border-color: var(--accent); box-shadow: var(--glow-indigo); text-decoration: none; }

/* ---------- footer ---------- */
.footer {
  position: relative;
  text-align: center;
  padding: 46px 22px 60px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
.footer p { font-size: 0.76rem; color: var(--faint); margin: 0; }
/* horizon glow at the very bottom of the page */
.footer::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(900px, 90vw);
  height: 1px;
  background: var(--grad);
  box-shadow: 0 0 40px 6px rgba(124, 140, 255, 0.35);
  opacity: 0.7;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .about-grid { grid-template-columns: 1fr; gap: 34px; text-align: center; }
  .about-text { text-align: left; }
  .research-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 840px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }

  /* hero: text anchors to the top, the graph breathes below it,
     and the shading turns vertical so both stay legible */
  .hero {
    align-items: flex-start;
    min-height: 100svh;
    padding-top: calc(var(--nav-h) + 34px);
    padding-bottom: 96px;
  }
  .hero-scrim {
    background: linear-gradient(180deg,
      color-mix(in srgb, var(--bg) 92%, transparent) 0%,
      color-mix(in srgb, var(--bg) 78%, transparent) 38%,
      color-mix(in srgb, var(--bg) 30%, transparent) 58%,
      transparent 78%);
  }
  .hero-intro { max-width: 100%; }
  .hero-intro h1 { font-size: clamp(2.3rem, 9.5vw, 3.6rem); }
  .uni-controls { right: auto; left: 22px; bottom: 20px; }
}

@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .gallery { grid-template-columns: 1fr; }
  .about-photo { width: 220px; height: 220px; }
  @keyframes orbit {
    from { transform: rotate(0deg)   translateY(-126px); }
    to   { transform: rotate(360deg) translateY(-126px); }
  }
  .t-logo { width: 46px; height: 46px; }
  .co-roles { margin-left: 23px; padding-left: 24px; }
  .t-item::before { left: -29.5px; }

  .hero { padding-bottom: 84px; }
  .hero-cta { gap: 10px; }
  .btn-primary, .btn-outline { padding: 12px 22px; font-size: 0.92rem; }
  .prompt { font-size: 0.7rem; }
}


/* ---------- shared cursor spotlight (same as .project) ---------- */
.stat, .repo { position: relative; }
.stat::before, .repo::before, .t-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%),
    rgba(124, 140, 255, 0.14), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.stat:hover::before, .repo:hover::before, .t-item:hover::after { opacity: 1; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
