/* ==========================================================================
   Wylezalek / GALENA — shared modern stylesheet
   ========================================================================== */

:root {
  --ink: #1b1d23;
  --ink-soft: #52565f;
  --ink-faint: #8a8d96;
  --paper: #fbfbfa;
  --paper-alt: #f3f1ec;
  --card: #ffffff;
  --line: #e5e2db;
  --accent: #a3154d;
  --accent-dark: #7c0f3a;
  --accent-soft: #f7e7ee;
  --font-serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --max: 1080px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 8px 24px rgba(20, 20, 20, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #edecea;
    --ink-soft: #b7b6b2;
    --ink-faint: #8a8a88;
    --paper: #121214;
    --paper-alt: #19191c;
    --card: #1c1c1f;
    --line: #2c2c30;
    --accent: #f27ba7;
    --accent-dark: #ffa8c9;
    --accent-soft: #2a1a22;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }

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

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------- Skip link ---------------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------------- Nav ---------------- */
#nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
#nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-brand {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  white-space: nowrap;
}
.nav-brand:hover { color: var(--accent); text-decoration: none; }
.nav-links {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}
.nav-toggle {
  display: none;
  border: none;
  background: none;
  font-size: 1.5rem;
  color: var(--ink);
  cursor: pointer;
  padding: 6px 10px;
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 8px 20px 16px;
    gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
}

/* ---------------- Hero ---------------- */
.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--line);
}
.hero .container {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  align-items: center;
}
.hero-portrait img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: var(--shadow);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
}
.hero h1 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  margin-bottom: 6px;
}
.hero .subtitle {
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.hero .quote {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-faint);
  font-size: 0.95rem;
  max-width: 46em;
  border-left: 2px solid var(--line);
  padding-left: 14px;
}
.hero .quote cite { display: block; font-style: normal; margin-top: 4px; font-size: 0.85rem; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

@media (max-width: 640px) {
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero-portrait { justify-self: center; }
  .hero .quote { margin: 0 auto; text-align: left; }
  .hero-actions { justify-content: center; }
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--card);
}
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

/* ---------------- Sections ---------------- */
section { padding: 64px 0; }
section:nth-of-type(even) { background: var(--paper-alt); }
.section-head { margin-bottom: 36px; max-width: 64em; }
.section-head h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); }
.section-head .eyebrow { margin-bottom: 8px; }
.lede { color: var(--ink-soft); font-size: 1.02rem; }

.prose p { color: var(--ink-soft); }
.prose a { color: var(--accent); }

/* ---------------- Research cards ---------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.card img { width: 100%; height: 170px; object-fit: cover; }
.card .card-body { padding: 20px 22px 22px; }
.float-media {
  float: left;
  width: 260px;
  margin: 0 24px 14px 0;
}
.float-media img { width: 100%; height: auto; border-radius: 8px; display: block; box-shadow: var(--shadow); }
.float-media .credit { font-size: 0.72rem; color: var(--ink-faint); margin-top: 6px; }
.float-media.float-right { float: right; margin: 0 0 14px 24px; }
@media (max-width: 640px) {
  .float-media { float: none; width: 100% !important; margin: 0 0 16px; }
}
.card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.card p { color: var(--ink-soft); font-size: 0.96rem; }
.card .refs { margin-top: 12px; font-size: 0.85rem; color: var(--ink-faint); }
.card .refs a { margin-right: 4px; }

/* ---------------- Research topic list ---------------- */
.topic-list {
  display: flex;
  flex-direction: column;
  max-width: 68em;
}
.topic {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.topic:first-child { padding-top: 0; }
.topic:last-child { border-bottom: none; padding-bottom: 0; }
.topic h3 { font-size: 1.1rem; margin-bottom: 8px; }
.topic p { color: var(--ink-soft); }
.topic .refs { margin-top: 8px; font-size: 0.85rem; color: var(--ink-faint); }
.topic .refs a { margin-right: 4px; }

/* ---------------- Timeline (CV / News) ---------------- */
.timeline-group + .timeline-group { margin-top: 40px; }
.timeline-group h3 {
  font-size: 1.1rem;
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.timeline { position: relative; }
.timeline-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-date {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--accent);
  white-space: nowrap;
}
.timeline-content { color: var(--ink-soft); font-size: 0.96rem; }
.timeline-content strong { color: var(--ink); }
.timeline-content img { border-radius: 10px; margin: 10px 0; }
.timeline-media {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.timeline-media img { width: 220px; height: 150px; object-fit: cover; }

@media (max-width: 640px) {
  .timeline-item { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------------- Publications list ---------------- */
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.pub-list li:first-child { padding-top: 0; }
.pub-list .pub-title { font-weight: 600; color: var(--ink); }
.pub-list .pub-meta { color: var(--ink-faint); font-size: 0.9rem; margin-top: 3px; }
.pub-list .pub-link { font-size: 0.86rem; margin-left: 8px; white-space: nowrap; }

/* ---------------- Team cards (GALENA) ---------------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}
.team-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  box-shadow: var(--shadow);
}
.team-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--accent-soft);
}
.team-avatar-fallback {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.team-card h4 { font-size: 1rem; margin-bottom: 2px; }
.team-role { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); font-weight: 600; margin-bottom: 6px; }
.team-card .meta { font-size: 0.86rem; color: var(--ink-soft); }
.team-card .meta a { word-break: break-word; }

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.roster-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.roster-item h4 { font-size: 0.98rem; margin-bottom: 4px; }
.roster-item .meta { font-size: 0.85rem; color: var(--ink-soft); }

.former-list {
  columns: 2;
  column-gap: 40px;
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.former-list li { padding: 6px 0; break-inside: avoid; }
@media (max-width: 640px) { .former-list { columns: 1; } }

/* ---------------- CV group intro text ---------------- */
.cv-note { color: var(--ink-soft); margin-bottom: 28px; }

/* ---------------- Book feature ---------------- */
.book-feature {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 30px;
  max-width: 68em;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 28px;
  align-items: start;
}
.book-feature .book-cover {
  width: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.book-feature h3 { font-size: 1.2rem; margin-bottom: 4px; }
.book-feature .book-subtitle { font-style: italic; color: var(--ink-faint); margin-bottom: 14px; }
.book-feature .book-meta { font-size: 0.88rem; color: var(--ink-faint); margin-top: 14px; }
.book-feature .book-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 560px) {
  .book-feature { grid-template-columns: 1fr; }
  .book-feature .book-cover { max-width: 160px; }
}

/* ---------------- Contact ---------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: start;
}
.contact-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow);
}
.contact-card address { font-style: normal; color: var(--ink-soft); line-height: 1.8; }
.contact-card.map-card { padding: 0; overflow: hidden; min-height: 280px; }
.contact-card.map-card iframe { display: block; width: 100%; height: 100%; min-height: 280px; border: 0; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------------- Group header (GALENA) ---------------- */
.group-hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.group-hero img.logo { max-height: 160px; margin: 0 auto 18px; }
.group-hero h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.group-hero p { color: var(--ink-soft); max-width: 46em; margin: 0 auto; }

/* ---------------- Footer ---------------- */
#footer {
  background: var(--ink);
  color: #d8d7d5;
  padding: 36px 0;
  font-size: 0.88rem;
}
#footer a { color: #f2c9db; }
#footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------------- Misc ---------------- */
.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  margin-right: 6px;
}
