/* ═══════════════════════════════════════════════════════════════
   Liam T. Schmidt — Personal Academic Site v2
   Hand-built. Zero dependencies. Premium polish.
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset & Variables ─────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:          #0f0f0f;
  --bg-card:     #1a1a1a;
  --bg-card-alt: #141414;
  --fg:          #f0f0f0;
  --fg-muted:    #a1a1aa;
  --fg-dim:      #71717a;
  --cyan:        #22d3ee;
  --cyan-bright: #67e8f9;
  --cyan-dim:    rgba(34, 211, 238, 0.10);
  --cyan-glow:   rgba(34, 211, 238, 0.25);
  --purple:      #a78bfa;
  --border:      rgba(255, 255, 255, 0.06);
  --border-light:rgba(255, 255, 255, 0.10);
  --radius:      0.75rem;
  --radius-lg:   1rem;
  --max-w:       1120px;
  --font:        'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', monospace;
  --ease:        cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: var(--cyan); text-decoration: none; transition: color 0.25s var(--ease); }
a:hover { color: var(--cyan-bright); }
img { max-width: 100%; display: block; }
::selection { background: var(--cyan); color: var(--bg); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; color: var(--fg); letter-spacing: -0.02em; }
h1 { font-size: 2.8rem; }
h2 { font-size: 1.5rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }

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

.section-label {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--cyan); margin-bottom: 0.75rem;
}
.section-label::before { content: ''; width: 24px; height: 2px; background: var(--cyan); border-radius: 1px; }

.section-title { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 0.35rem; }
.section-subtitle { color: var(--fg-muted); font-size: 0.9rem; margin-bottom: 2.5rem; max-width: 600px; }

/* ── Layout ────────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
section { padding: 5rem 0; position: relative; }

/* ── Scroll Reveal ─────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(15, 15, 15, 0.6);
  backdrop-filter: blur(20px) saturate(1.8); -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s var(--ease);
}
.navbar.scrolled { background: rgba(15, 15, 15, 0.92); box-shadow: 0 4px 30px rgba(0,0,0,0.3); }
.navbar .container { display: flex; justify-content: center; align-items: center; gap: 0.25rem; height: 56px; }
.navbar a {
  color: var(--fg-dim); font-size: 0.82rem; font-weight: 500;
  padding: 0.5rem 0.75rem; border-radius: 6px; transition: all 0.25s var(--ease);
}
.navbar a:hover, .navbar a.active { color: var(--fg); background: rgba(255,255,255,0.05); }
.navbar a.active { color: var(--cyan); }

/* Scroll progress */
.scroll-progress {
  position: fixed; top: 56px; left: 0; height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  z-index: 1001; box-shadow: 0 0 10px var(--cyan-glow);
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero { padding: 8rem 0 4rem; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; top: -200px; right: -200px; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(34,211,238,0.06) 0%, transparent 70%); pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; bottom: -150px; left: -150px; width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(167,139,250,0.04) 0%, transparent 70%); pointer-events: none;
}

.hero-inner { display: grid; grid-template-columns: 1fr 260px; gap: 3.5rem; align-items: start; position: relative; z-index: 1; }
.hero-text h1 { margin-bottom: 0.5rem; font-size: 3rem; }

.hero-role { font-size: 1.1rem; margin-bottom: 1rem; font-weight: 500; }
.hero-role .typed-text { color: var(--cyan); border-right: 2px solid var(--cyan); padding-right: 2px; }

@keyframes blink { 50% { border-color: transparent; } }
.typing-cursor { animation: blink 0.8s step-end infinite; }

.hero-affiliations { margin-bottom: 1.25rem; }
.hero-affiliations a { display: inline-block; color: var(--fg-muted); font-size: 0.88rem; line-height: 1.6; margin-right: 0.25rem; }
.hero-affiliations a:hover { color: var(--cyan); }
.hero-affiliations a + a::before { content: '·'; margin-right: 0.35rem; color: var(--fg-dim); }
.hero-affiliations a.affiliation-link { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(34,211,238,0.4); transition: text-decoration-color 0.2s, color 0.2s; }
.hero-affiliations a.affiliation-link:hover { color: #fff; text-decoration-color: var(--cyan); }

.hero-bio { color: var(--fg-muted); font-size: 0.95rem; line-height: 1.85; margin-bottom: 1.75rem; max-width: 560px; }

.hero-links { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.hero-links a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; color: var(--fg-muted);
  border: 1px solid var(--border-light); border-radius: 10px;
  transition: all 0.3s var(--ease); position: relative; overflow: hidden;
}
.hero-links a::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--cyan-dim), rgba(167,139,250,0.08));
  opacity: 0; transition: opacity 0.3s;
}
.hero-links a:hover {
  color: var(--cyan); border-color: rgba(34,211,238,0.3);
  transform: translateY(-2px); box-shadow: 0 4px 12px rgba(34,211,238,0.15);
}
.hero-links a:hover::before { opacity: 1; }
.hero-links svg { width: 17px; height: 17px; flex-shrink: 0; position: relative; z-index: 1; }

/* Tooltip for icon links */
.hero-links a[data-tip] { position: relative; }
.hero-links a[data-tip]::after {
  content: attr(data-tip); position: absolute; bottom: -28px; left: 50%; transform: translateX(-50%);
  font-size: 0.68rem; color: var(--fg-dim); white-space: nowrap; opacity: 0;
  transition: opacity 0.2s, bottom 0.2s; pointer-events: none;
}
.hero-links a[data-tip]:hover::after { opacity: 1; bottom: -32px; }

/* Avatar */
.avatar-wrapper { position: relative; }
.avatar-wrapper img {
  width: 260px; height: 260px; object-fit: cover;
  border-radius: var(--radius-lg); border: 1px solid var(--border-light);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.avatar-wrapper img:hover { transform: scale(1.02); box-shadow: 0 20px 60px rgba(34,211,238,0.12); }
.avatar-wrapper::before {
  content: ''; position: absolute; inset: -3px;
  border-radius: calc(var(--radius-lg) + 3px);
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  opacity: 0.15; z-index: -1; transition: opacity 0.5s;
}
.avatar-wrapper:hover::before { opacity: 0.35; }

/* ── Stats ──────────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin: 3rem 0 0; }
.stat-item {
  text-align: center; padding: 1.25rem 0.75rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: all 0.3s var(--ease);
}
.stat-item:hover { border-color: rgba(34,211,238,0.15); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.3); }
.stat-number {
  font-size: 2.2rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.1;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-bright));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-label { color: var(--fg-dim); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.25rem; }

/* ── Education ──────────────────────────────────────────────── */
.education-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.edu-card {
  position: relative; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; overflow: hidden;
  transition: all 0.4s var(--ease);
}
.edu-card:hover { border-color: rgba(34,211,238,0.15); box-shadow: 0 8px 30px rgba(0,0,0,0.35); transform: translateY(-2px); }
.edu-card .bg-img {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0.05; transition: opacity 0.6s var(--ease); pointer-events: none; z-index: 0;
}
.edu-card:hover .bg-img { opacity: 0.2; }
.edu-card > *:not(.bg-img) { position: relative; z-index: 1; }
.edu-degree { font-weight: 700; font-size: 0.92rem; margin-bottom: 0.15rem; }
.edu-school { color: var(--fg-muted); font-size: 0.83rem; }
.edu-date { color: var(--fg-dim); font-size: 0.78rem; margin-top: 0.35rem; }

/* ── Interests ──────────────────────────────────────────────── */
.interests-list { display: flex; flex-wrap: wrap; gap: 0.45rem; list-style: none; margin-top: 1rem; }
.interests-list li {
  background: var(--cyan-dim); color: var(--cyan); font-size: 0.78rem; font-weight: 500;
  padding: 0.3rem 0.75rem; border-radius: 2rem; border: 1px solid rgba(34,211,238,0.08);
  transition: all 0.25s var(--ease); cursor: default;
}
.interests-list li:hover { background: rgba(34,211,238,0.18); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(34,211,238,0.1); }

/* ── Cards ──────────────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }

.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; transition: all 0.4s var(--ease); display: flex; flex-direction: column; position: relative;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--purple)); opacity: 0; transition: opacity 0.4s;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4), 0 0 0 1px rgba(34,211,238,0.08);
  border-color: rgba(34,211,238,0.12);
}
.card:hover::before { opacity: 1; }

.card-img-wrap { overflow: hidden; position: relative; }
.card-img-wrap::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 60px;
  background: linear-gradient(transparent, var(--bg-card)); pointer-events: none;
}
.card-img { width: 100%; height: 180px; object-fit: cover; transition: transform 0.6s var(--ease); }
.card:hover .card-img { transform: scale(1.05); }

.card-body { padding: 1.25rem 1.5rem 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.card h3 a { color: var(--fg); transition: color 0.25s; }
.card h3 a:hover { color: var(--cyan); }
.card p { color: var(--fg-muted); font-size: 0.86rem; line-height: 1.65; flex-grow: 1; }
.card-meta { color: var(--fg-dim); font-size: 0.76rem; margin-top: 0.6rem; font-weight: 500; }
.card-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.75rem; }
.card-tags span { background: var(--cyan-dim); color: var(--cyan); font-size: 0.7rem; font-weight: 500; padding: 0.2rem 0.5rem; border-radius: 2rem; }

.card-links { display: flex; gap: 0.4rem; margin-top: 0.75rem; }
.card-links a {
  font-size: 0.78rem; font-weight: 500; padding: 0.3rem 0.65rem;
  border: 1px solid var(--border-light); border-radius: 6px; color: var(--fg-muted);
  transition: all 0.25s var(--ease);
}
.card-links a:hover { color: var(--cyan); border-color: rgba(34,211,238,0.3); background: var(--cyan-dim); transform: translateY(-1px); }

/* Card list (single column, horizontal) */
.card-list { display: flex; flex-direction: column; gap: 1rem; }
.card-list .card { flex-direction: row; }
.card-list .card-img-wrap { flex-shrink: 0; width: 220px; min-height: 140px; }
.card-list .card-img { height: 100%; min-height: 140px; }
.card-list .card-img-wrap::after { background: linear-gradient(to right, transparent 50%, var(--bg-card)); height: 100%; width: 80px; right: 0; bottom: 0; top: 0; left: auto; }
.card-list .card-body { padding: 1.25rem 1.5rem; }
.card-list .card h3 { font-size: 1rem; }

/* ── Map ───────────────────────────────────────────────────── */
.map-section { padding: 5rem 0; }
#facility-map { width: 100%; height: 500px; border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; z-index: 1; }

/* Leaflet dark theme overrides */
.leaflet-control-zoom a { background: var(--bg-card) !important; color: var(--fg) !important; border-color: var(--border) !important; }
.leaflet-popup-content-wrapper {
  background: rgba(15,15,15,0.97) !important; color: var(--fg) !important;
  border-radius: 10px !important; border: 1px solid var(--cyan) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6) !important;
}
.leaflet-popup-tip { background: rgba(15,15,15,0.97) !important; }
.leaflet-popup-content { margin: 14px 18px !important; font-family: var(--font) !important; font-size: 13px !important; }
.leaflet-popup-close-button { color: var(--fg-dim) !important; }
.facility-popup-name { color: var(--cyan); font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.facility-popup-loc { color: var(--fg-dim); font-size: 12px; margin-bottom: 6px; }
.facility-popup-desc { color: var(--fg-muted); font-size: 13px; line-height: 1.5; }

/* Pulsing marker */
@keyframes pulse-ring { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(3.5); opacity: 0; } }

/* ── Timeline (CV) ──────────────────────────────────────────── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: linear-gradient(to bottom, var(--cyan), var(--purple), transparent); }
.timeline-item { position: relative; margin-bottom: 2.5rem; padding-left: 1.5rem; }
.timeline-item::before {
  content: ''; position: absolute; left: -2.35rem; top: 0.35rem;
  width: 10px; height: 10px; border-radius: 50%; background: var(--cyan);
  border: 3px solid var(--bg); box-shadow: 0 0 8px var(--cyan-glow);
}
.timeline-item h3 { font-size: 1rem; margin-bottom: 0.1rem; }
.timeline-item .org { color: var(--cyan); font-size: 0.88rem; font-weight: 500; }
.timeline-item .dates { color: var(--fg-dim); font-size: 0.78rem; margin-bottom: 0.5rem; }
.timeline-item p { color: var(--fg-muted); font-size: 0.88rem; line-height: 1.75; }

/* ── Skills ────────────────────────────────────────────────── */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.skill-group h3 { font-size: 0.95rem; margin-bottom: 0.75rem; color: var(--cyan); }
.skill-group ul { list-style: none; }
.skill-group li { color: var(--fg-muted); font-size: 0.86rem; padding: 0.35rem 0; display: flex; justify-content: space-between; align-items: center; }
.skill-bar { width: 60px; height: 4px; background: var(--border-light); border-radius: 2px; overflow: hidden; }
.skill-bar-fill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--purple)); border-radius: 2px; transition: width 1s var(--ease); width: 0; }
.skill-bar-fill.animated { /* width set inline */ }

/* ── Awards ────────────────────────────────────────────────── */
.awards-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.awards-list li { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.awards-list li:last-child { border-bottom: none; }
.award-icon { font-size: 1.5rem; flex-shrink: 0; }
.award-title { font-weight: 700; font-size: 0.92rem; }
.award-org { color: var(--fg-muted); font-size: 0.83rem; }
.award-summary { color: var(--fg-dim); font-size: 0.8rem; margin-top: 0.2rem; }

/* ── Footer ────────────────────────────────────────────────── */
.site-footer { padding: 3rem 0; border-top: 1px solid var(--border); text-align: center; }
.site-footer p { color: var(--fg-dim); font-size: 0.82rem; }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 0.75rem; }
.footer-links a { color: var(--fg-dim); font-size: 0.82rem; }
.footer-links a:hover { color: var(--cyan); }

/* ── Detail page ───────────────────────────────────────────── */
.detail-page { padding: 7rem 0 4rem; }
.detail-page h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.detail-meta { color: var(--fg-muted); font-size: 0.88rem; margin-bottom: 2rem; }
.detail-body { color: var(--fg-muted); font-size: 0.95rem; line-height: 1.9; max-width: 720px; }
.detail-body p + p { margin-top: 1.25rem; }
.detail-featured-img { width: 100%; max-width: 720px; border-radius: var(--radius-lg); border: 1px solid var(--border); margin-bottom: 2rem; }
.back-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--fg-dim); font-size: 0.83rem; font-weight: 500;
  margin-bottom: 1.5rem; padding: 0.4rem 0.75rem; border-radius: 6px;
  transition: all 0.25s var(--ease);
}
.back-link:hover { color: var(--cyan); background: var(--cyan-dim); }

/* ── Cursor glow ───────────────────────────────────────────── */
.cursor-glow {
  position: fixed; width: 350px; height: 350px; border-radius: 50%;
  background: radial-gradient(circle, rgba(34,211,238,0.035) 0%, transparent 70%);
  pointer-events: none; z-index: 0; transform: translate(-50%, -50%);
  transition: left 0.4s var(--ease), top 0.4s var(--ease);
}

/* ── Live clock ────────────────────────────────────────────── */
.live-clock {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--fg-dim);
  background: rgba(15,15,15,0.8); backdrop-filter: blur(10px);
  padding: 0.4rem 0.75rem; border-radius: 6px; border: 1px solid var(--border);
  z-index: 100; letter-spacing: 0.04em; transition: color 0.3s;
}
.live-clock:hover { color: var(--cyan); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .card-list .card { flex-direction: column; }
  .card-list .card-img-wrap { width: 100%; min-height: 160px; }
  .card-list .card-img-wrap::after { background: linear-gradient(transparent, var(--bg-card)); height: 60px; width: 100%; left: 0; top: auto; right: auto; }
}

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  .section-title { font-size: 1.5rem; }
  .hero { padding: 6rem 0 3rem; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .avatar-wrapper { order: -1; display: flex; justify-content: center; }
  .avatar-wrapper img { width: 180px; height: 180px; }
  .hero-text h1 { font-size: 2.2rem; }
  .hero-links { justify-content: center; }
  .hero-affiliations { text-align: center; }
  .hero-bio { max-width: none; }
  .interests-list { justify-content: center; }
  .card-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .education-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .navbar .container { gap: 0; overflow-x: auto; scrollbar-width: none; }
  .navbar .container::-webkit-scrollbar { display: none; }
  .navbar a { font-size: 0.78rem; padding: 0.5rem 0.5rem; white-space: nowrap; }
  #facility-map { height: 350px; }
  .cursor-glow, .live-clock { display: none; }
}

@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  section { padding: 3rem 0; }
  .hero { padding: 5rem 0 2rem; }
  .stats-row { gap: 0.75rem; }
  .stat-number { font-size: 1.6rem; }
}
