/* =========================================================
   Peter Ebraert – style.css
   Design: Editorial Professional
   Fonts: Fraunces (headings) + DM Sans (body)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,500;0,9..144,700;1,9..144,400&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --nav-bg:        #0d1b2a;
  --nav-text:      #c8d6e5;
  --nav-active:    #f0a500;
  --nav-hover:     #f0a500;
  --page-bg:       #f7f4ef;
  --surface:       #ffffff;
  --text:          #1e2d3d;
  --text-muted:    #5e738a;
  --accent:        #1a5fa8;
  --accent-hover:  #134a84;
  --gold:          #b35a00;
  --gold-light:    #fef3e2;
  --border:        #dde4ec;
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.06);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.09);
  --radius:        10px;
  --nav-h:         62px;
  --max-w:         900px;
  --font-h:        'Fraunces', Georgia, serif;
  --font-b:        'DM Sans', system-ui, sans-serif;
  --transition:    0.22s ease;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-b);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--page-bg);
  padding-top: var(--nav-h);
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); text-decoration: underline; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── Navigation ────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  height: var(--nav-h);
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 32px;
}

.nav-brand a {
  font-family: var(--font-h);
  font-size: 1.2rem;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.nav-brand a:hover { color: var(--nav-active); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: flex-end;
}

.nav-links a {
  display: block;
  padding: 6px 14px;
  color: var(--nav-text);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 5px;
  transition: color var(--transition), background var(--transition);
}
.nav-links a:hover { color: var(--nav-active); background: rgba(240,165,0,0.1); text-decoration: none; }
.nav-links a.active { color: var(--nav-active); background: rgba(240,165,0,0.15); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--nav-text);
  font-size: 1.4rem;
  cursor: pointer;
  margin-left: auto;
  padding: 4px 8px;
}

/* ── Page Hero ──────────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--nav-bg) 0%, #1a3050 100%);
  color: #fff;
  padding: 58px 28px 52px;
  text-align: center;
}
.page-hero h1 {
  font-family: var(--font-h);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #fff;
  margin-bottom: 10px;
}
.page-hero p {
  font-size: 1.05rem;
  color: #a8c0d8;
  max-width: 560px;
  margin: 0 auto;
}

/* ── Home Hero ──────────────────────────────────────────── */
.home-hero {
  position: relative;
  padding: 80px 28px 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Solid fallback if image fails */
  background: #0d1b2a;
}

/* Uyuni Salar background photo (unsplash – free to use) */
.home-hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('https://images.unsplash.com/photo-1574482620811-1aa16ffe3c82?auto=format&fit=crop&w=1800&q=80');
  background-size: cover;
  background-position: center 40%;
  /* Subtle Ken-Burns feel without motion to keep things calm */
  transform: scale(1.03);
}

/* Dark gradient overlay – keeps contrast high on the text */
.home-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(8, 18, 32, 0.78) 0%,
    rgba(12, 28, 50, 0.62) 60%,
    rgba(8, 30, 55, 0.72) 100%
  );
}

.home-hero-inner {
  position: relative;       /* sits above bg + overlay */
  z-index: 1;
  max-width: var(--max-w);
  width: 100%;
  display: flex;
  align-items: center;
  gap: 52px;
}

/* Photo wrapper — clips to circle */
.home-hero-photo-wrap {
  flex-shrink: 0;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 4px solid rgba(240, 165, 0, 0.65);
  box-shadow: 0 0 0 6px rgba(240, 165, 0, 0.15), 0 8px 32px rgba(0,0,0,0.5);
  overflow: hidden;
  background: linear-gradient(135deg, #1e3a5f, #2d5986);
}

.home-hero-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  display: block;
}

.home-hero-photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-h);
  font-size: 3rem;
  color: rgba(255,255,255,0.6);
  font-style: italic;
}

.home-hero-text h1 {
  font-family: var(--font-h);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 12px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.home-hero-text .tagline {
  font-size: 1.05rem;
  color: #b8d4ee;
  margin-bottom: 0;
  font-style: italic;
  text-shadow: 0 1px 8px rgba(0,0,0,0.45);
}

/* ── Layout ─────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}

.page-body {
  padding: 52px 0 80px;
}

/* ── Sections & Cards ───────────────────────────────────── */
.section {
  margin-bottom: 52px;
}
.section-title {
  font-family: var(--font-h);
  font-size: 1.55rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gold);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: var(--gold-light);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--gold);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

/* ── Contact Card (Home) ─────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 8px;
}
.contact-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.contact-item .label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 600;
}
.contact-item .value {
  font-size: 0.97rem;
  color: var(--text);
}
.contact-item .value address { font-style: normal; line-height: 1.5; }

.vcard-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
}
.vcard-btn:hover { background: var(--accent-hover); color: #fff; text-decoration: none; transform: translateY(-1px); }

/* ── Research Interests ─────────────────────────────────── */
.research-group {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 26px 30px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.research-group h3 {
  font-family: var(--font-h);
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 14px;
  font-weight: 500;
}
.research-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.research-list li {
  padding: 8px 14px;
  background: var(--page-bg);
  border-left: 3px solid var(--gold);
  border-radius: 0 5px 5px 0;
  font-size: 0.95rem;
}
.research-list li strong { display: block; font-weight: 600; color: var(--text); font-size: 0.93rem; }
.research-list li span { color: var(--text-muted); font-size: 0.88rem; }

.links-list { display: flex; flex-direction: column; gap: 8px; }
.links-list li a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
}
.links-list li a::before { content: '→'; color: var(--gold); font-weight: bold; }

/* ── Publications ────────────────────────────────────────── */
.pub-category {
  margin-bottom: 44px;
}
.pub-category-title {
  font-family: var(--font-h);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.pub-category-title .badge {
  font-family: var(--font-b);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--nav-bg);
  color: #fff;
  padding: 3px 10px;
  border-radius: 20px;
}

.pub-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.pub-item:last-child { border-bottom: none; }
.pub-item .pub-title {
  font-weight: 600;
  font-size: 0.97rem;
  color: var(--text);
  line-height: 1.4;
}
.pub-item .pub-authors {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.pub-item .pub-venue {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
}
.pub-item .pub-download {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pub-item .pub-download:hover { color: var(--accent-hover); }
.pub-item .pub-download::before { content: '↓'; font-size: 0.9rem; }

/* ── Teaching ───────────────────────────────────────────── */
.course-list { display: flex; flex-direction: column; gap: 14px; }
.course-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.course-item .year-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
}
.course-item .course-name {
  font-weight: 600;
  font-size: 0.97rem;
}
.course-item .course-context {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.thesis-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.thesis-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--page-bg);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
.thesis-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.thesis-table tr:last-child td { border-bottom: none; }
.thesis-table .year-col { font-weight: 600; color: var(--gold); }

/* ── CV Timeline ─────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 8px; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--gold), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: 36px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 8px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--gold);
}
.timeline-item.latest::before { background: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow-sm);
}
.timeline-card.latest-card {
  border-color: rgba(26, 95, 168, 0.3);
  box-shadow: 0 0 0 2px rgba(26, 95, 168, 0.1), var(--shadow-sm);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.timeline-org {
  font-family: var(--font-h);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
}
.timeline-period {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--page-bg);
  color: var(--text-muted);
  white-space: nowrap;
  border: 1px solid var(--border);
}
.timeline-role {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 10px;
}
.timeline-body {
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.65;
}
.timeline-body p + p { margin-top: 10px; }
.timeline-body ul {
  margin-top: 8px;
  padding-left: 18px;
  list-style: disc;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.timeline-body strong { color: var(--text); font-weight: 600; }
.timeline-tech {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tech-tag {
  font-size: 0.74rem;
  padding: 2px 9px;
  background: var(--page-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Skills Grid ─────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.skill-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.skill-tag {
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 5px;
  background: var(--page-bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 400;
}
.skill-tag.highlight {
  background: var(--gold-light);
  border-color: rgba(179, 90, 0, 0.2);
  color: var(--gold);
  font-weight: 600;
}

/* Languages special */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 6px;
}
.lang-item {
  text-align: center;
  padding: 10px 8px;
  background: var(--page-bg);
  border-radius: 7px;
  border: 1px solid var(--border);
}
.lang-item .lang-name { font-weight: 600; font-size: 0.88rem; }
.lang-item .lang-level { font-size: 0.75rem; color: var(--text-muted); }

/* ── Education ──────────────────────────────────────────── */
.edu-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.edu-item .edu-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.edu-item .edu-degree {
  font-weight: 600;
  font-size: 0.97rem;
}
.edu-item .edu-year {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.edu-item .edu-org {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.edu-item .edu-body {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── CV Language Selector ────────────────────────────────── */
.lang-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.lang-selector span { font-size: 0.85rem; color: var(--text-muted); }
.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 24px;
  border: 1.5px solid var(--border);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  text-decoration: none;
  transition: all var(--transition);
}
.lang-pill:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.lang-pill.active { border-color: var(--accent); background: var(--accent); color: #fff; }

/* ── Extra Sub-nav ────────────────────────────────────────── */
.sub-nav-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.sub-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}
.sub-nav-inner a {
  display: block;
  padding: 14px 18px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  text-decoration: none;
  transition: color var(--transition), border-color var(--transition);
}
.sub-nav-inner a:hover { color: var(--text); border-color: var(--border); text-decoration: none; }
.sub-nav-inner a.active { color: var(--gold); border-color: var(--gold); }

/* ── Extra Content ────────────────────────────────────────── */
.extra-list { display: flex; flex-direction: column; gap: 10px; }
.extra-list li {
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.93rem;
}
.extra-list li a { font-weight: 500; }

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.tool-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.tool-card p { font-size: 0.91rem; color: var(--text-muted); }

.kado-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.91rem;
}
.kado-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--page-bg);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
.kado-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.kado-table tr:last-child td { border-bottom: none; }
.kado-table .item-for {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
}

/* ── Prose text ─────────────────────────────────────────── */
.prose p { margin-bottom: 14px; color: var(--text-muted); line-height: 1.75; font-size: 0.95rem; }
.prose p:last-child { margin-bottom: 0; }
.prose ul { list-style: disc; padding-left: 22px; margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.prose ul li { font-size: 0.93rem; color: var(--text-muted); }
.prose strong { color: var(--text); font-weight: 600; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  background: var(--nav-bg);
  color: var(--nav-text);
  text-align: center;
  padding: 28px 20px;
  font-size: 0.84rem;
}
.site-footer a { color: #a0b8d0; }
.site-footer a:hover { color: var(--nav-active); }

/* ── Badge / Labels ──────────────────────────────────────── */
.badge-new {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #1a5fa8;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  vertical-align: middle;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 700px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--nav-bg);
    flex-direction: column;
    padding: 16px;
    gap: 2px;
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 16px; font-size: 0.94rem; }
  .home-hero-inner { flex-direction: column; text-align: center; gap: 28px; }
  .home-hero { padding: 60px 20px 56px; }
  .contact-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .lang-grid { grid-template-columns: repeat(2, 1fr); }
  .timeline-header { flex-direction: column; gap: 6px; }
  .timeline { padding-left: 20px; }
  .timeline-item::before { left: -16px; }
}
