/* ============================================================================
 * Tardelli Stekel — personal site
 * Light, minimalist, academic. No external dependencies.
 * ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f5;
  --text: #1c1c1e;
  --text-soft: #5b5b63;
  --text-faint: #8a8a93;
  --border: #e6e6e2;
  --accent: #2f5d8a;       /* restrained blue */
  --accent-soft: #eaf1f8;
  --radius: 10px;
  --maxw: 800px;
  --serif: Georgia, "Times New Roman", "Iowan Old Style", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

h1, h2, h3 {
  font-family: var(--serif);
  line-height: 1.25;
  color: var(--text);
}

/* ----------------------------- Header / Nav --------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}
.nav-brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.nav-brand:hover { text-decoration: none; }
.nav-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--text-soft);
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }

/* ------------------------------- Hero --------------------------------- */
.hero {
  display: flex;
  gap: 32px;
  align-items: center;
  padding-top: 56px;
  padding-bottom: 24px;
}
.hero-photo img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  display: block;
}
.hero-text h1 {
  margin: 0 0 6px;
  font-size: 2.1rem;
}
.hero-title {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 600;
}
.hero-title a {
  text-decoration: underline;
  text-decoration-color: rgba(47, 93, 138, 0.4);
  text-underline-offset: 2px;
}
.hero-title a:hover { text-decoration-color: var(--accent); }
.hero-tagline {
  margin: 0 0 16px;
  color: var(--text-soft);
}

.profile-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin: 0;
  padding: 0;
}
.profile-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text-soft);
  background: var(--bg);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.pill-icon {
  flex-shrink: 0;
  color: var(--text-faint);
  transition: color 0.15s ease;
}
.profile-links a:hover .pill-icon { color: var(--accent); }
.profile-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

/* ------------------------------ Sections ------------------------------ */
.section {
  padding-top: 40px;
  padding-bottom: 16px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.section h2 {
  font-size: 1.5rem;
  margin: 0 0 20px;
}
.section-note {
  margin-top: -8px;
  margin-bottom: 24px;
  color: var(--text-soft);
  font-size: 0.95rem;
}

/* ------------------------------ Timeline ------------------------------ */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  padding-bottom: 28px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-period {
  color: var(--text-faint);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  padding-top: 3px;
}
.timeline-body h3 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}
.timeline-body p { margin: 0 0 6px; }
.timeline-org { color: var(--text-soft); font-weight: 600; }
.timeline-thesis { color: var(--text-soft); font-size: 0.95rem; }
.timeline-advisor { color: var(--text-faint); }

/* ------------------------------ Projects ------------------------------ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.project-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 18px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 22px rgba(20, 40, 70, 0.07);
  transform: translateY(-2px);
  text-decoration: none;
}
.project-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.project-title {
  font-family: var(--serif);
  font-size: 1.1rem;
  margin: 0;
}
.project-tag {
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
  flex-shrink: 0;
}
.project-desc {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}
.project-link {
  margin-top: auto;
  color: var(--text-faint);
  font-size: 0.82rem;
  word-break: break-all;
}

/* ---------------------------- Publications ---------------------------- */
.publications { margin-top: 4px; }
.pub-group { margin-bottom: 24px; }
.pub-year {
  font-size: 1.05rem;
  color: var(--accent);
  margin: 0 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: pub;
}
.pub-item {
  position: relative;
  padding: 0 0 14px 26px;
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--text-soft);
}
.pub-item::before {
  counter-increment: pub;
  content: counter(pub) ".";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.pub-authors { color: var(--text); }
.pub-authors strong { color: var(--text); font-weight: 700; }
.pub-title { color: var(--text); }
.pub-venue { font-style: italic; }
.pub-details { color: var(--text-soft); }
.pub-citations {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
  vertical-align: middle;
}

/* ------------------------------- Footer ------------------------------- */
.site-footer {
  margin-top: 64px;
  padding: 32px 0 48px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}
.site-footer p { margin: 0 0 6px; }
.footer-meta { color: var(--text-faint); font-size: 0.9rem; }

/* ----------------------------- Responsive ----------------------------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav-links { gap: 16px; }
  .nav-brand { font-size: 1rem; }
  .hero {
    flex-direction: column;
    text-align: center;
    gap: 18px;
    padding-top: 40px;
  }
  .profile-links { justify-content: center; }
  .hero-text h1 { font-size: 1.7rem; }
  .timeline-item { grid-template-columns: 1fr; gap: 4px; }
  .timeline-period { padding-top: 0; }
  .projects-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .project-card { transition: none; }
}
