/*
  Personal Website Styles — Your Name
  - Light-only theme with playful visuals and image-forward cards
  - Includes reduced-motion fallbacks
*/

/* CSS Variables */
:root {
  --header-h: 64px;
  /* Scroll-driven radial centers */
  --rg1x: -10%;
  --rg1y: -10%;
  --rg2x: 110%;
  --rg2y: 0%;
  --icon-size: 38px;
  --icon-gap: 10px;
  --bg-0: #fbfcff;
  --bg-1: #f6f8ff;
  --text-0: #0a0c12;
  --text-1: #334155;
  --brand: #7c3aed; /* violet-600 */
  --brand-2: #06b6d4; /* cyan-500 */
  --accent: #22c55e; /* green-500 */

  --surface: rgba(10, 12, 18, 0.04);
  --surface-2: rgba(10, 12, 18, 0.06);
  --border: rgba(10, 12, 18, 0.14);

  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji';
  color: var(--text-0);
  background:
    radial-gradient(1200px 600px at var(--rg1x) var(--rg1y), rgba(124, 58, 237, 0.12), transparent 60%),
    radial-gradient(900px 500px at var(--rg2x) var(--rg2y), rgba(6, 182, 212, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
  background-attachment: fixed;
  padding-top: var(--header-h);
}


.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus { left: 16px; top: 12px; width: auto; height: auto; padding: 8px 12px; background: var(--surface); border-radius: 8px; }

.container { width: min(1100px, 92%); margin: 0 auto; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--border), 0 8px 24px rgba(2, 6, 23, 0.06);
}
.site-header .container { position: relative; }
.site-header .progress { position: absolute; left: 0; bottom: -1px; height: 3px; width: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transform-origin: 0 50%; transform: scaleX(var(--scroll-progress, 0)); opacity: 0.8; }
.site-header .nav { height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-0); font-weight: 700; }
.brand.active { background: linear-gradient(135deg, rgba(124,58,237,.16), rgba(6,182,212,.16)); border: 1px solid var(--border); border-radius: 999px; padding: 6px 10px; }
.brand.active .brand-mark { box-shadow: 0 0 0 2px rgba(124,58,237,.35); }
.brand-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: white; font-size: 14px; }
.brand-name { letter-spacing: 0.2px; }

.site-nav { display: flex; gap: 10px; align-items: center; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { color: var(--text-1); text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 999px; white-space: nowrap; }
.site-nav a:hover { color: var(--text-0); background: var(--surface); }
.site-nav a.active { color: var(--text-0); background: linear-gradient(135deg, rgba(124,58,237,.16), rgba(6,182,212,.16)); border: 1px solid var(--border); }



.section { padding: 80px 0; position: relative; min-height: 40vh; }
.section-title { font-size: 28px; margin: 0 0 18px; letter-spacing: 0.3px; }
.section-intro { color: var(--text-1); margin-bottom: 28px; }

.hero { min-height: 92vh; display: grid; place-items: center; padding-top: 96px; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: center; }
.hero .display { font-size: clamp(40px, 7vw, 80px); line-height: 1.05; margin: 8px 0 10px; }
.hero .subtitle { color: var(--text-1); font-size: clamp(16px, 2.4vw, 20px); }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.2fr 0.8fr; gap: 40px; } }

.gradient-text {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.btn { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border-radius: 12px; text-decoration: none; font-weight: 600; border: 1px solid transparent; transition: transform .15s ease, background .15s ease, color .15s ease; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: white; }
.btn-secondary { background: var(--surface); color: var(--text-0); border-color: var(--border); }
.btn:hover { transform: translateY(-1px); }
.btn[data-magnetic] { transition: transform .08s ease-out, box-shadow .2s ease; }
/* Fixed width button equal to four icons + three gaps */
.btn-wide { width: calc(var(--icon-size) * 4 + var(--icon-gap) * 3); justify-content: center; }

.social { display: flex; gap: var(--icon-gap); margin-top: 12px; }
.icon-link { display: inline-grid; place-items: center; width: var(--icon-size); height: var(--icon-size); border-radius: 10px; color: var(--text-0); background: var(--surface); border: 1px solid var(--border); }
.icon-link:hover { background: var(--surface-2); }
.icon-link[data-magnetic] { transition: transform .08s ease-out, box-shadow .2s ease; }

.hero-visual { position: relative; min-height: 380px; display: grid; place-items: center; }
.orb { position: absolute; width: 280px; height: 280px; border-radius: 50%; filter: blur(22px); opacity: 0.7; mix-blend-mode: multiply; }
.orb-a { background: radial-gradient(circle at 30% 30%, #7c3aed, transparent 60%); animation: float 11s ease-in-out infinite; }
.orb-b { background: radial-gradient(circle at 70% 50%, #06b6d4, transparent 60%); animation: float 13s ease-in-out infinite reverse; width: 320px; height: 320px; }
.orb-c { background: radial-gradient(circle at 50% 70%, #22c55e, transparent 60%); animation: float 15s ease-in-out infinite; width: 220px; height: 220px; }

.avatar-wrap { position: relative; z-index: 2; }
.avatar { width: clamp(160px, 28vw, 260px); height: clamp(160px, 28vw, 260px); border-radius: 50%; object-fit: cover; display: block; border: 6px solid #fff; box-shadow: 0 12px 40px rgba(2,6,23,0.15); background: #e2e8f0; }
.avatar-ring { position: absolute; inset: -8px; border-radius: 999px; background: conic-gradient(from 120deg, rgba(124,58,237,.35), rgba(6,182,212,.35), rgba(34,197,94,.35), rgba(124,58,237,.35)); filter: blur(14px); z-index: -1; }

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12px, -18px) scale(1.04); }
  100% { transform: translate(0, 0) scale(1); }
}

.scroll-indicator { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; place-items: center; gap: 8px; color: var(--text-1); font-size: 14px; z-index: 1; }
.scroll-indicator .mouse { width: 20px; height: 32px; border: 2px solid var(--text-1); border-radius: 14px; position: relative; }
.scroll-indicator .mouse::after { content: ""; position: absolute; top: 6px; left: 50%; width: 3px; height: 6px; background: var(--text-1); border-radius: 2px; transform: translateX(-50%); animation: wheel 1.6s ease-in-out infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translate(-50%, 0); } 50% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 6px);} }

.about-grid { display: grid; grid-template-columns: 1.2fr; gap: 18px; }
.about-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1.2fr 0.8fr; gap: 28px; } }
.about-text p { color: var(--text-1); }

.grid-3 { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.media { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; border: 1px solid var(--border); background: #f1f5f9; margin-bottom: 12px; }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-title { font-weight: 700; margin-bottom: 8px; }
.project-card-title { display: inline-flex; align-items: center; gap: 8px; }
.project-card-title .title-text { display: inline-block; }
.bullets { padding-left: 18px; margin: 8px 0 0; color: var(--text-1); }
.bullets li { margin: 6px 0; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; padding: 0; margin: 8px 0 0; list-style: none; }
.tags li { padding: 6px 10px; border-radius: 999px; background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(6, 182, 212, 0.2)); border: 1px solid var(--border); color: var(--text-0); font-size: 12px; }

/* 3D tilt and spotlight */
.card-tilt { transform-style: preserve-3d; transition: transform .2s ease; will-change: transform; }
.card-tilt::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none; border-radius: inherit; opacity: 0; transition: opacity .2s ease;
  background: radial-gradient(300px 200px at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.12), transparent 60%);
}
.card-tilt:hover::after { opacity: 1; }

/* Publications */
.pub-list { display: grid; gap: 12px; }
.pub-card { display: grid; grid-template-columns: clamp(120px, 22vw, 160px) 1fr; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); align-items: start; }
.pub-card .thumb { width: 100%; aspect-ratio: 1 / 1; height: auto; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); background: #f1f5f9; }
.pub-body { display: grid; gap: 6px; }
.pub-title { font-weight: 700; }
.pub-meta { color: var(--text-1); font-size: 14px; }
.pub-meta .pub-authors { margin-top: 2px; }
.pub-meta .pub-venue { margin-top: 2px; }
.pub-meta .pub-year { margin-top: 2px; }
.pub-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
/* Add extra vertical spacing between links row and tags row in Projects */
#project-grid .pub-actions + .pub-actions { margin-top: 8px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  background:
    linear-gradient(0deg, rgba(255,255,255,0.55), rgba(255,255,255,0.55)),
    linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--text-0);
  border: 1px solid rgba(2,6,23,0.04);
  box-shadow: 0 2px 8px rgba(2,6,23,0.08);
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
}
.badge:visited { color: var(--text-0); }
.badge:hover {
  background:
    linear-gradient(0deg, rgba(255,255,255,0.72), rgba(255,255,255,0.72)),
    linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--text-0);
}

/* Distinct style for non-clickable tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-0);
  font-size: 12px;
}
.tag-compact { padding: 2px 8px; font-size: 11px; text-transform: lowercase; }

/* Timeline */
.timeline { position: relative; display: grid; gap: 14px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--brand), transparent); opacity: .6; }
.timeline-item { position: relative; padding-left: 30px; }
.timeline-item::before { content: ""; position: absolute; left: 0; top: 8px; width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 0 0 3px rgba(124,58,237,0.2); }
.timeline .time { color: var(--text-1); font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.timeline .title-with-icon img { width: 25px; height: 25px; border-radius: 0px; display: inline-block; margin-right: 8px; vertical-align: text-bottom; }
.timeline .title-with-icon img.icon-rice { width: 22px; height: 25px; }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 900px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
.gallery-item { position: relative; overflow: hidden; border-radius: 14px; background: #f1f5f9; border: 1px solid var(--border); box-shadow: var(--shadow); display: grid; grid-template-rows: auto auto; }
.gallery-item .img-wrap { width: 100%; aspect-ratio: 1 / 1; overflow: hidden; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item figcaption { padding: 10px 12px; font-size: 14px; color: var(--text-1); background: rgba(255,255,255,0.7); border-top: 1px solid var(--border); display: grid; gap: 2px; }
.gallery-title { font-weight: 700; color: var(--text-0); }
.gallery-desc { color: var(--text-1); font-style: italic; }
.gallery-date { color: var(--text-1); font-size: 13px; opacity: 1.0; text-decoration: underline; }

/* Footer */
.site-footer { padding: 28px 0 40px; color: var(--text-1); border-top: 1px solid var(--border); background: rgba(255,255,255,0.6); backdrop-filter: blur(8px); }
.site-footer p { margin: 0; text-align: center; }

/* Accessibility & utilities */
/* Elements are visible by default; animation sets initial state via JS to avoid hidden content if JS/CSS fails. */
section { scroll-margin-top: 84px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orb, .scroll-indicator .mouse::after { animation: none !important; }
}


