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

:root {
  --primary: #1a3c6e;
  --primary-light: #2a5ea8;
  --accent: #d4a843;
  --bg: #fafbfc;
  --bg-card: #ffffff;
  --text: #2c3e50;
  --text-light: #5a6d80;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 14px rgba(0,0,0,.1);
  --radius: 8px;
  --max-w: 1080px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(circle at top, #f7fbff 0, var(--bg) 32%, #f4f7fb 100%);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-light); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(212, 168, 67, .45);
  outline-offset: 3px;
}

img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: #fff;
  color: var(--primary);
  border-radius: 999px;
  padding: .7rem 1rem;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* ===== Navigation ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 60, 110, .96);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.navbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.nav-brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  padding: .9rem 0;
  letter-spacing: -.02em;
}

.nav-links { display: flex; gap: .15rem; list-style: none; flex-wrap: wrap; }

.nav-links a {
  color: rgba(255,255,255,.82);
  font-size: .82rem;
  font-weight: 500;
  padding: .75rem .65rem;
  border-radius: 4px;
  transition: background .2s, color .2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: .5rem;
  line-height: 1;
}

/* ===== Hero (home page) ===== */
.hero {
  background: linear-gradient(135deg, rgba(26,60,110,.55) 0%, rgba(30,79,143,.50) 100%),
              url('assets/alps-hero.jpg') center 42%/cover no-repeat;
  color: #fff;
  padding: 4.25rem 1.5rem 4rem;
}

.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 3rem;
}

.hero-photo {
  width: 184px;
  height: 184px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255,255,255,.28);
  box-shadow: 0 16px 38px rgba(10, 22, 41, .28);
  flex-shrink: 0;
}

.hero-text { max-width: 720px; }
.hero-text h1 { font-size: 2.35rem; font-weight: 700; letter-spacing: -.03em; margin-bottom: .35rem; }
.hero-text .subtitle { font-size: 1.05rem; opacity: .94; margin-bottom: .55rem; }
.hero-text .subtitle-muted { font-size: .95rem; opacity: .82; }
.hero-text .subtitle a { color: #fff; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(255,255,255,.45); text-underline-offset: 2px; }
.hero-lede {
  margin: 1rem 0 1.3rem;
  max-width: 58ch;
  font-size: 1rem;
  color: rgba(255,255,255,.92);
}
.hero-contact { font-size: .9rem; opacity: .82; line-height: 1.8; }
.hero-contact a { color: var(--accent); }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin: 1.35rem 0 1rem;
}

/* ===== Page Header (sub-pages) ===== */
.page-header {
  background: linear-gradient(135deg, rgba(26,60,110,.55) 0%, rgba(30,79,143,.50) 100%),
              url('assets/alps-hero.jpg') center 42%/cover no-repeat;
  color: #fff;
  padding: 2.2rem 1.5rem 1.8rem;
}
.page-header-inner { max-width: var(--max-w); margin: 0 auto; }
.page-header h1 { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; }
.page-header p { opacity: .8; margin-top: .3rem; font-size: .95rem; }
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 1.1rem;
}

/* ===== Main Content ===== */
.main { max-width: var(--max-w); margin: 0 auto; padding: 2rem 1.5rem 4rem; }

/* ===== Section Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--accent);
  letter-spacing: -.01em;
}

.card h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin: 1rem 0 .4rem; }
.card p + p { margin-top: .75rem; }

.eyebrow {
  display: inline-block;
  margin-bottom: .5rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.8);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: .8rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .92rem;
  transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
  border: 1px solid transparent;
}
.button:hover { transform: translateY(-1px); color: inherit; }
.button-primary {
  background: #fff;
  color: var(--primary);
}
.button-primary:hover {
  background: #f5f8fc;
  color: var(--primary);
}
.button-secondary {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.26);
  color: #fff;
}
.button-secondary:hover {
  background: rgba(255,255,255,.2);
  color: #fff;
}
.button-dark {
  background: var(--primary);
  color: #fff;
}
.button-dark:hover {
  background: var(--primary-light);
  color: #fff;
}
.button-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--primary);
}
.button-outline:hover {
  background: #f5f8fc;
  color: var(--primary);
}

/* ===== Tags / Badges ===== */
.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-journal   { background: #e8f4fd; color: #1a6fb5; }
.badge-code      { background: #e6f9ee; color: #1a8a4a; }
.badge-pdf       { background: #fef3e2; color: #b5741a; }
.badge-new       { background: #ffe8e8; color: #c0392b; }
.badge-accepted  { background: #e8f4fd; color: #1a6fb5; }
.badge-wp        { background: #f3e8fd; color: #7b2ea8; }

.tag-list,
.clean-list {
  list-style: none;
  padding: 0;
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1rem;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: .38rem .7rem;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.92);
  font-size: .8rem;
}

.clean-list li {
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
}
.clean-list li:last-child { border-bottom: none; }

.detail-label {
  display: block;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: .1rem;
}

/* ===== Publication List ===== */
.pub-list { list-style: none; }

.pub-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.pub-item:last-child { border-bottom: none; }

.pub-title { font-weight: 600; font-size: .95rem; }
.pub-title a { color: var(--primary-light); }
.pub-title a:hover { color: var(--accent); text-decoration: underline; }
.pub-authors { font-size: .85rem; color: var(--text-light); margin: .2rem 0; }
.pub-venue { font-size: .85rem; color: var(--text-light); font-style: italic; }
.pub-links { margin-top: .4rem; display: flex; gap: .5rem; flex-wrap: wrap; }

/* ===== Announcement Banner ===== */
.announcement-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.announcement-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.announcement-text {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.announcement-text strong {
  font-size: 1.05rem;
}
.announcement-text span {
  font-size: .88rem;
  opacity: .9;
}
.announcement-deadline {
  font-weight: 600;
  opacity: 1 !important;
  color: var(--accent);
}
.announcement-banner .button {
  background: #fff;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.announcement-banner .button:hover {
  background: var(--accent);
  color: #fff;
}
@media (max-width: 600px) {
  .announcement-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .announcement-banner .button {
    align-self: stretch;
    text-align: center;
  }
}

/* ===== News List ===== */
.news-item { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.news-item:last-child { border-bottom: none; }
.news-date { font-size: .78rem; color: var(--text-light); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.news-text { font-size: .92rem; margin-top: .15rem; }

/* ===== Info Grid ===== */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.home-main,
.home-side {
  display: grid;
  gap: 1.5rem;
}

.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.spotlight-card {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}

.spotlight-card .eyebrow {
  color: var(--primary-light);
  margin-bottom: .35rem;
}

.spotlight-card h3 { margin-top: 0; }

.stack-sm > * + * { margin-top: .9rem; }
.stack-sm .button { width: 100%; }

/* ===== Code Repos ===== */
.repo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .15s;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.repo-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.repo-card h3 { font-size: .95rem; margin-bottom: .4rem; color: var(--primary); }
.repo-card p { font-size: .85rem; color: var(--text-light); margin-bottom: .6rem; }
.repo-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.repo-img { width: 240px; height: 160px; object-fit: contain; border-radius: 6px; flex-shrink: 0; background: #f5f7fa; border: 1px solid var(--border); }
.repo-body { flex: 1; min-width: 0; }
@media (max-width: 768px) {
  .repo-card { flex-direction: column; }
  .repo-img { width: 100%; height: auto; max-height: 240px; }
}

/* ===== Seminar Schedule ===== */
.seminar-item { padding: .8rem 0; border-bottom: 1px solid var(--border); }
.seminar-item:last-child { border-bottom: none; }
.seminar-date { font-size: .8rem; font-weight: 600; color: var(--primary-light); }
.seminar-speaker { font-weight: 600; font-size: .92rem; }
.seminar-topic { font-size: .88rem; color: var(--text-light); font-style: italic; }
.seminar-links { margin-top: .3rem; display: flex; gap: .5rem; }

/* ===== Teaching ===== */
.teaching-year { font-size: 1.1rem; font-weight: 700; color: var(--primary); margin: 1.5rem 0 .75rem; padding-bottom: .3rem; border-bottom: 1px solid var(--border); }
.teaching-year:first-child { margin-top: 0; }

.course-item { padding: .6rem 0 .6rem 1rem; border-left: 3px solid var(--accent); margin-bottom: .75rem; }
.course-title { font-weight: 600; font-size: .92rem; }
.course-meta { font-size: .82rem; color: var(--text-light); margin-top: .15rem; }

/* ===== Activity Timeline ===== */
.timeline-item { position: relative; padding: .75rem 0 .75rem 1.5rem; border-left: 2px solid var(--border); }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 1.1rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-light);
}
.timeline-year { font-size: .78rem; font-weight: 700; color: var(--primary-light); text-transform: uppercase; letter-spacing: .03em; }

.mini-timeline {
  list-style: none;
  padding: 0;
}

.mini-timeline li {
  padding: .75rem 0 .75rem 1rem;
  border-left: 3px solid rgba(42, 94, 168, .18);
  margin-left: .25rem;
}

.mini-timeline strong {
  display: block;
  color: var(--primary);
  margin-bottom: .15rem;
}

.pub-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: .85rem;
  margin-top: .5rem;
}

.search-input,
.search-select {
  width: 100%;
  padding: .78rem .95rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font: inherit;
}

.filter-status {
  margin-top: .85rem;
  font-size: .88rem;
  color: var(--text-light);
}

.empty-state {
  text-align: center;
  padding: 2rem 1.25rem;
  color: var(--text-light);
}

/* ===== Footer ===== */
.footer {
  background: var(--primary);
  color: rgba(255,255,255,.7);
  text-align: center;
  padding: 1.5rem;
  font-size: .82rem;
}
.footer a { color: var(--accent); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; width: 100%; padding: .5rem 0; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .navbar-inner { flex-wrap: wrap; }
  .hero-inner { flex-direction: column; text-align: center; }
  .hero-photo { width: 120px; height: 120px; }
  .hero-text h1 { font-size: 1.6rem; }
  .hero-actions,
  .page-actions { justify-content: center; }
  .hero-lede { margin-left: auto; margin-right: auto; }
  .home-layout,
  .spotlight-grid,
  .pub-toolbar { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .home-layout,
  .spotlight-grid {
    grid-template-columns: 1fr;
  }
}
