/* ============================================
   ETHANWEED.GITHUB.IO — Custom Stylesheet
   Inspired by markdingemanse.net aesthetic
   ============================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,300;0,400;0,600;1,400&family=Source+Serif+4:ital,wght@0,400;0,600;1,400&display=swap');

/* --- CSS Variables --- */
:root {
  --color-bg:        #fafaf8;
  --color-text:      #2c2c2c;
  --color-muted:     #6b6b6b;
  --color-accent:    #3a6ea5;
  --color-accent-hover: #2a5080;
  --color-border:    #e2e2de;
  --font-body:       'Source Sans 3', system-ui, sans-serif;
  --font-serif:      'Source Serif 4', Georgia, serif;
  --max-width:       860px;
  --line-height:     1.75;
}

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

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

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: var(--line-height);
  color: var(--color-text);
  background-color: var(--color-bg);
  padding: 0 1.5rem;
  scrollbar-gutter: stable; 
}


/* --- Layout Container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 0 5rem;
}

/* --- Header / Site Title --- */
header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 0 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2.5rem;
}

header h1 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

header h1 a {
  color: var(--color-text);
  text-decoration: none;
}

/* --- Navigation --- */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  padding-bottom: 1rem;
  font-size: 0.95rem;
}

nav a {
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

nav a:hover,
nav a.active {
  color: var(--color-accent);
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2.25rem;
  margin-bottom: 0.6rem;
  color: var(--color-text);
}

h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; border-bottom: 1px solid var(--color-border); padding-bottom: 0.3rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; font-style: italic; font-weight: 400; }

p {
  margin-bottom: 1.2rem;
}

/* --- Links --- */
a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

a:hover {
  color: var(--color-accent-hover);
  border-bottom-color: var(--color-accent-hover);
}

/* --- Profile / Intro Block --- */
.profile {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.profile img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  filter: grayscale(15%);
}

.profile-text p:last-child {
  margin-bottom: 0;
}

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

.pub-list li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.97rem;
  line-height: 1.6;
}

.pub-list li:last-child {
  border-bottom: none;
}

.pub-year {
  font-size: 0.82rem;
  color: var(--color-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.15rem;
}

.pub-title {
  font-style: italic;
}

.pub-authors {
  color: var(--color-muted);
  font-size: 0.92rem;
}

/* --- Tags / Labels --- */
.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: var(--color-border);
  color: var(--color-muted);
  margin-left: 0.4rem;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- Footer --- */
footer {
  max-width: var(--max-width);
  margin: 4rem auto 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-muted);
}

/* --- Responsive --- */
@media (max-width: 600px) {
  html { font-size: 16px; }

  .profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  nav {
    gap: 0.25rem 1rem;
  }
}

/* --- Carousel of Research Figures --- */
.carousel-section {
  margin-top: 2.5rem;
}

.carousel {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.carousel-track-container {
  overflow: hidden;
  width: 100%;
}

.carousel-track {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  transition: transform 0.4s ease;
}

.carousel-slide {
  min-width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.carousel-slide a {
  display: block;
  border-bottom: none;
  text-decoration: none;
}

.carousel-slide img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  transition: opacity 0.2s ease;
}

.carousel-slide a:hover img {
  opacity: 0.85;
}

.carousel-caption {
  margin-top: 0.6rem;
  font-size: 0.88rem;
  color: var(--color-muted);
  font-style: italic;
}

.carousel-btn {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1rem;
  cursor: pointer;
  color: var(--color-muted);
  flex-shrink: 0;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.carousel-btn:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* Carousel dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-border);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease;
}

.carousel-dot.active {
  background: var(--color-accent);
}

/* Videos */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
