/* ============================================================
   style.css — sjaehnigen.github.io
   ============================================================ */

/* 1. RESET & VARIABLES
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:        #1a1a18;
  --ink-muted:  #6b6b64;
  --ink-faint:  #b8b8b0;
  --paper:      #f5f3ee;
  --paper-warm: #edeae2;
  --accent:     #2d5a3d;
  --accent-light:#e8f0eb;
  --line:       #dedad2;
  --serif: 'DM Serif Display', Georgia, serif;
  --sans:  'DM Sans', system-ui, sans-serif;
  --mono:  'DM Mono', monospace;
}

/* 2. BASE
   ------------------------------------------------------------ */
html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 300;
}

mark {
  background: none;
  color: inherit;
  padding: 0;
  font-family: var(--mono);
}

/* 3. NAVIGATION
   ------------------------------------------------------------ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 4rem;
  background: rgba(245,243,238,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-name {
  font-family: var(--mono); font-size: 15px;
  letter-spacing: 0.08em; color: var(--ink-muted);
  text-decoration: none;
}
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  font-size: 15px; color: var(--ink-muted);
  text-decoration: none; letter-spacing: 0.04em;
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

/* Hamburger button (hidden on desktop) */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.nav-burger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--ink-muted);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
}
nav.nav-open .nav-burger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
nav.nav-open .nav-burger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
nav.nav-open .nav-burger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* 4. BUTTONS
   ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.5rem; border-radius: 2px;
  font-size: 13px; font-family: var(--mono); letter-spacing: 0.06em;
  text-decoration: none; transition: all 0.2s; cursor: pointer;
  border: 1.5px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: #1e3d2a; border-color: #1e3d2a; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--ink-muted); }

/* 5. HERO  (index.html only)
   ------------------------------------------------------------ */
.hero {
  min-height: 100vh;
  display: grid; grid-template-columns: 1fr;
  padding-top: 80px;
}
.hero-profile {
  padding: 8rem 4rem 4rem;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.hero-tag {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em;
  color: var(--accent); text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.hero-avatar {
  display: flex; position: relative; justify-content: center; align-items: center;
  margin-bottom: 1.5rem;
}
.hero-name {
  font-family: var(--serif); font-size: 27px;
  line-height: 1.1; font-weight: 400;
  margin-bottom: 1rem;
}
.hero-name em { font-style: italic; color: var(--ink-muted); }
.hero-bio {
  font-size: 17px; color: var(--ink-muted); max-width: 480px;
  line-height: 1.75; margin-bottom: 2.5rem;
  text-align: center;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-highlights {
  background: var(--paper-warm);
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column;
  align-items: stretch; justify-content: center;
  padding: 2rem 4rem 3rem;
  position: relative; overflow: hidden;
}

.hero-highlights::after {
  content: "";
  position: absolute;
  bottom: 4rem;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--paper-warm));
  pointer-events: none;
}

.hero-highlights.expanded::after {
  display: none;
}

.avatar-placeholder {
  width: 200px; height: 200px; border-radius: 50%;
  background: var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 3rem; color: var(--ink-faint);
  position: relative;
}
.avatar-ring {
  position: absolute; width: 230px; height: 230px; border-radius: 50%;
  border: 1px dashed var(--line);
}

/* highlights */
.highlights-title { font-family: var(--mono); color: var(--accent); font-size: 1.2rem; letter-spacing: 0.12em; font-weight: 100; text-transform: uppercase;}
  /* margin-bottom: 1.5rem; */

.highlights-grid {
  width: 100%;
  padding: 0.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-auto-rows: 300px;
  gap: 1rem;
  max-height: calc(360px + 2rem);
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.highlights-grid.expanded {
  max-height: 2000px;     /* large enough for all cards */
}

.highlights-toggle {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
  cursor: pointer;
  text-align: center;
  margin-top: 0.5rem;
}

.highlight-card {
  background: var(--paper);
  border: 1px solid var(--line); border-radius: 2px;
  display: flex; 
  flex-direction: column; 
  overflow: hidden;
  align-items: center;
}
.highlight-num {
  flex: 1; min-height: 0;
}
.highlight-num img {
  width: 100%;
  height: 100%;
  object-fit: contain; 
  display: block;
  padding: 0.5rem;
}
.highlight-label {
  font-family: var(--sans); font-size: 13px; color: var(--ink-muted); line-height: 1.2;
  padding: 0.4rem 0.75rem;
  flex-shrink: 0;
  height: 6rem;
}

.orcid-link-icon img{
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

.scholar-link-icon img {
  width: 16px;
  height: 16px;
  /* vertical-align: middle; */
  filter: brightness(0) opacity(55%);
}


/* 6. SECTIONS  (index.html only)
   ------------------------------------------------------------ */
section { padding: 6rem 4rem; }
section + section { border-top: 1px solid var(--line); }
.section-header { display: flex; align-items: baseline; gap: 1.5rem; margin-bottom: 3.5rem; }
.section-num  { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.section-title { font-family: var(--serif); font-size: 2.2rem; font-weight: 400; }
.section-line  { flex: 1; height: 1px; background: var(--line); }

/* 7. RESEARCH AREA CARDS  (index.html)
   ------------------------------------------------------------ */
.areas-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.area-card {
  padding: 2rem; border: 1px solid var(--line); border-radius: 2px;
  background: var(--paper-warm);
  transition: border-color 0.2s, transform 0.2s;
}
.area-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.area-icon  { font-size: 1.75rem; margin-bottom: 1rem; }
.area-icon  img {  height: 10rem; object-fit: cover; display: block; padding: 1rem;}
.area-name  { font-family: var(--serif); font-size: 1.3rem; margin-bottom: 0.5rem; }
.area-desc  { font-size: 15px; color: var(--ink-muted); line-height: 1.6; }


/* 9. CONTACT  (index.html)
   ------------------------------------------------------------ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }
.contact-text  { font-size: 15px; color: var(--ink-muted); line-height: 1.8; }
.contact-links { display: flex; flex-direction: column; gap: 1rem; }
.contact-link {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); border-radius: 2px;
  transition: border-color 0.2s, background 0.2s;
  font-size: 14px;
}
.contact-link:hover { background: var(--paper-warm); border-color: var(--ink-muted); }
.contact-link-icon  { color: var(--ink-muted); font-size: 18px; }
.contact-link-label { color: var(--ink-muted); font-family: var(--mono); font-size: 12px; display: block; }

/* 10. FADE-IN ANIMATION  (index.html)
   ------------------------------------------------------------ */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* 11. PAGE HEADER  (subpages)
   ------------------------------------------------------------ */
.page-header { padding: 10rem 4rem 3rem; border-bottom: 1px solid var(--line); }
.page-header--split {
  /* about.html two-column variant */
  padding: 10rem 4rem 4rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: end;
}
.page-tag {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em;
  color: var(--accent); text-transform: uppercase; margin-bottom: 1rem;
}
.page-title {
  font-family: var(--serif); font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 400; line-height: 1.1; margin-bottom: 1rem;
}
.page-subtitle { font-size: 14px; color: var(--ink-muted); }
.page-subtitle a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-light); }
.page-subtitle a:hover { border-color: var(--accent); }

/* 12. GROUP HEADERS  (publications, talks)
   ------------------------------------------------------------ */
.group-title { font-family: var(--serif); font-size: 1.5rem; font-weight: 400; margin-bottom: 0.4rem; }
.group-count  { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); letter-spacing: 0.08em; margin-bottom: 2rem; }

/* 13. PUBLICATIONS  (publications.html)
   ------------------------------------------------------------ */
.pub-group { padding: 3.5rem 4rem 0; }
.pub-group + .pub-group { border-top: 1px solid var(--line); }

.pub-list { display: flex; flex-direction: column; }

/* Compact variant used on index.html */
.pub-item {
  display: grid; grid-template-columns: 56px 1fr 80px;
  gap: 1.75rem; align-items: start;
  padding: 1.5rem 0; border-bottom: 1px solid var(--line);
}
.pub-item:last-child { border-bottom: none; padding-bottom: 3.5rem; }
.pub-year   { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); padding-top: 3px; }
.pub-body   { display: flex; flex-direction: column; gap: 3px; }
.pub-title  { font-size: 14.5px; font-weight: 400; line-height: 1.5; color: var(--ink); }
.pub-title a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); transition: border-color 0.2s; }
.pub-title a:hover { border-color: var(--accent); }
.pub-journal  { font-size: 13px; color: var(--ink-muted); font-style: italic; }
.pub-authors  { font-size: 12px; color: var(--ink-faint); font-family: var(--mono); margin-top: 2px; }
.pub-me       { color: var(--ink); font-weight: 400; }
.pub-note     { font-size: 12px; color: var(--accent); font-family: var(--mono); margin-top: 4px; }
.pub-links    { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.pub-link {
  font-family: var(--mono); font-size: 11px; padding: 2px 9px;
  border: 1px solid var(--line); border-radius: 2px;
  color: var(--ink-muted); text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.pub-link:hover { border-color: var(--accent); color: var(--accent); }
.pub-badge-col { display: flex; justify-content: flex-end; padding-top: 3px; }
.pub-meta { font-size: 13px; color: var(--ink-muted); font-style: italic; }

/* Simple badge used on index.html selected publications */
.pub-badge {
  font-family: var(--mono); font-size: 11px; padding: 3px 8px;
  background: var(--accent-light); color: var(--accent);
  border-radius: 2px; white-space: nowrap; align-self: center;
}

/* Full badge system used on publications.html */
.badge {
  font-family: var(--mono); font-size: 10px; padding: 3px 9px;
  border-radius: 2px; white-space: nowrap; text-align: center;
  letter-spacing: 0.04em;
}
.badge-review   { background: var(--accent-light); color: var(--accent); }
.badge-vip      { background: #fef3c7; color: #92400e; }
.badge-article  { background: var(--paper-warm); color: var(--ink-muted); border: 1px solid var(--line); }
.badge-preprint { background: #f3f0ff; color: #5b21b6; }
.badge-software { background: var(--paper-warm); color: var(--ink-muted); border: 1px solid var(--line); }
.badge-invited  { background: var(--accent-light); color: var(--accent); }
.badge-conf     { background: var(--paper-warm); color: var(--ink-muted); border: 1px solid var(--line); }
.badge-colloquium { background: var(--paper-warm); color: var(--ink-faint); border: 1px solid var(--line); }

.cover-list { padding: 2.5rem 4rem 3.5rem; display: flex; gap: 1.5rem; flex-wrap: wrap; border-top: 1px solid var(--line); }
.cover-item { font-size: 13px; color: var(--ink-muted); }
.cover-item a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-light); }
.cover-item a:hover { border-color: var(--accent); }

/* 14. TALKS  (talks.html)
   ------------------------------------------------------------ */
.talk-group { padding: 3.5rem 4rem 0; }
.talk-group + .talk-group { border-top: 1px solid var(--line); }

.talk-list { display: flex; flex-direction: column; }
.talk-item {
  display: grid; grid-template-columns: 100px 1fr 90px;
  gap: 2rem; align-items: start;
  padding: 1.5rem 0; border-bottom: 1px solid var(--line);
}
.talk-item:last-child { border-bottom: none; padding-bottom: 3.5rem; }
.talk-date     { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); padding-top: 3px; line-height: 1.6; }
.talk-body     { display: flex; flex-direction: column; gap: 3px; }
.talk-title    { font-size: 14.5px; font-weight: 400; line-height: 1.5; font-style: italic; color: var(--ink); }
.talk-venue    { font-size: 13.5px; color: var(--ink); font-weight: 300; margin-top: 2px; }
.talk-location { font-size: 12px; color: var(--ink-faint); font-family: var(--mono); margin-top: 2px; }
.badge-col     { display: flex; justify-content: flex-end; padding-top: 3px; }

/* 15. ABOUT — BIO, TIMELINE, TWO-COL  (about.html)
   ------------------------------------------------------------ */
.bio-text { font-size: 15px; color: var(--ink-muted); line-height: 1.85; }

.cv-section { padding: 3.5rem 4rem 0; }
.cv-section + .cv-section { border-top: 1px solid var(--line); }
.section-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 2rem;
}

.timeline { display: flex; flex-direction: column; padding-bottom: 3.5rem; }
.tl-item {
  display: grid; grid-template-columns: 160px 1fr;
  gap: 2rem; padding: 1.25rem 0; border-bottom: 1px solid var(--line);
}
.tl-item:last-child { border-bottom: none; }
.tl-date  { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); padding-top: 3px; line-height: 1.6; }
.tl-body  { display: flex; flex-direction: column; gap: 2px; }
.tl-role  { font-size: 15px; font-weight: 400; color: var(--ink); }
.tl-place { font-size: 13.5px; color: var(--ink-muted); }
.tl-note  { font-size: 12px; color: var(--ink-faint); font-family: var(--mono); margin-top: 2px; }
.tl-badge {
  display: inline-block; margin-top: 4px;
  font-family: var(--mono); font-size: 10px; padding: 2px 8px;
  border-radius: 2px; letter-spacing: 0.04em;
}
.badge-dfg   { background: var(--accent-light); color: var(--accent); }
.badge-leave { background: var(--paper-warm); color: var(--ink-faint); border: 1px solid var(--line); }
.badge-prize { background: #fef3c7; color: #92400e; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding-bottom: 3.5rem; }
.two-col > div + div { border-left: 1px solid var(--line); padding-left: 3rem; }
.col-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 1.5rem;
}
.item-list  { display: flex; flex-direction: column; gap: 1.1rem; }
.item-entry { display: grid; grid-template-columns: 60px 1fr; gap: 1rem; align-items: start; }
.item-year  { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); padding-top: 2px; }
.item-title { font-size: 14px; color: var(--ink); line-height: 1.5; }
.item-sub   { font-size: 12px; color: var(--ink-muted); font-style: italic; margin-top: 1px; }

/* 16. FOOTER
   ------------------------------------------------------------ */
footer {
  padding: 2rem 4rem; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 12px; color: var(--ink-faint);
  margin-top: 2rem;
}

/* 17. IMPRESSUM MODAL
   ------------------------------------------------------------ */
.impressum-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(26,26,24,0.55); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.impressum-overlay.open { display: flex; }
.impressum-box {
  background: var(--paper); border: 1px solid var(--line);
  max-width: 820px; width: 90%; padding: 2.5rem;
  border-radius: 2px; position: relative; max-height: 80vh; overflow-y: auto;
}
.impressum-close {
  position: absolute; top: 1rem; right: 1.25rem;
  background: none; border: none; cursor: pointer;
  font-family: var(--mono); font-size: 13px; color: var(--ink-muted);
}
.impressum-close:hover { color: var(--ink); }
.impressum-title  { font-family: var(--serif); font-size: 1.6rem; margin-bottom: 1.5rem; }
.impressum-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; font-size: 14px; color: var(--ink-muted); line-height: 1.9; }
.impressum-label  { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--ink-faint); margin-bottom: 0.5rem; }

/* 18. MEDIA QUERIES
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  /* --- Nav: hamburger --- */
  nav {
    padding: 1rem 1.5rem;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
  }
  .nav-name    { flex: 1; }
  .nav-burger  { display: flex; }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding: 0.5rem 0 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid var(--line);
  }
  .nav-links a {
    display: block;
    padding: 0.7rem 0;
    font-size: 15px;
  }
  nav.nav-open .nav-links { display: flex; }

  /* --- Footer --- */
  footer { padding: 1.5rem; flex-direction: column; gap: 0.5rem; text-align: center; }

  /* --- index.html --- */
  .hero            { min-height: auto; }
  .hero-profile    { padding: 7rem 1.5rem 3rem; }
  .hero-highlights { padding: 2rem 1.5rem 2.5rem; }
  .highlights-grid { grid-template-columns: 1fr; }

  section              { padding: 4rem 1.5rem; }
  .areas-grid,
  .contact-grid        { grid-template-columns: 1fr; }

  /* subpages */
  .page-header,
  .page-header--split  { padding: 8rem 1.5rem 2.5rem; }
  .page-header--split  { grid-template-columns: 1fr; gap: 2rem; }
  .pub-group,
  .cover-list,
  .talk-group,
  .cv-section          { padding-left: 1.5rem; padding-right: 1.5rem; }

  /* publications */
  .pub-item            { grid-template-columns: 48px 1fr; }
  .pub-badge-col       { display: none; }

  /* talks */
  .talk-item           { grid-template-columns: 72px 1fr; }
  .badge-col           { display: none; }

  /* about */
  .tl-item             { grid-template-columns: 90px 1fr; gap: 1rem; }
  .two-col             { grid-template-columns: 1fr; }
  .two-col > div + div { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 2rem; margin-top: 2rem; }

  /* impressum */
  .impressum-grid      { grid-template-columns: 1fr; }
}
