/* ==========================================================================
   1. VARIABLES & ROOT STYLES
   ========================================================================== */

:root {
  /* Colors */
  --color-bg: #fafafa;
  --color-text-base: #333;
  --color-text-heading: #1a1a1a;
  --color-text-muted: #666;
  --color-text-subtle: #888;
  --color-accent: #cc0000;
  --color-border: #ddd;
  --color-tag-bg: #f0f0f0;

  /* Typography */
  --font-primary: "Lexend", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --line-height-base: 1.7;

  /* Transitions */
  --transition-fast: all 0.2s ease-in-out;
}

/* ==========================================================================
   2. GLOBAL RESETS & BASE STYLES
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
}

body {
  font-family: var(--font-primary);
  line-height: var(--line-height-base);
  color: var(--color-text-base);
  background: var(--color-bg);
  font-weight: 300;
  font-size: 0.9rem;
}

/* ==========================================================================
   3. LAYOUT
   ========================================================================== */

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 20px;
}

/* ==========================================================================
   4. TYPOGRAPHY
   ========================================================================== */

h1 {
  font-weight: 500;
  color: var(--color-text-heading);
  font-size: 2rem;
  margin-bottom: 40px;
}

.bio {
  font-size: 0.9rem;
  margin-bottom: 50px;
  color: #444;
}

.bio p {
  margin-bottom: 1.2em;
}

/* ==========================================================================
   5. LINKS
   ========================================================================== */

.bio a,
.contact-links a,
.back-link {
  text-decoration: none;
  color: var(--color-text-base);
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition-fast);
}

.bio a:hover,
.contact-links a:hover,
.back-link:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.contact-links a {
  font-weight: 400;
}

.contact-links .separator {
  margin: 0 8px;
  color: var(--color-text-subtle);
}

/* ==========================================================================
   6. CAROUSEL
   ========================================================================== */

.carousel {
  --strip-height: 300px;
  --slide-gap: 16px;
}

.carousel-track {
  display: flex;
  gap: var(--slide-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
  outline: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-track.dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  scroll-behavior: auto;
}

.carousel-track:focus-visible {
  outline: 1px solid var(--color-border);
  outline-offset: 6px;
}

.slide {
  flex: 0 0 auto;
  max-width: 100%;
  scroll-snap-align: start;
  user-select: none;
}

.slide a {
  display: block;
}

.slide img {
  height: var(--strip-height);
  width: auto;
  max-width: 100%;
  /* An image wider than the column shrinks to fit; it keeps its aspect and sits on the caption. */
  object-fit: contain;
  object-position: left bottom;
  display: block;
  -webkit-user-drag: none;
}

.slide figcaption {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  transition: color 0.2s ease-in-out;
}

.slide .year {
  color: var(--color-text-subtle);
}

.slide a:hover + figcaption {
  color: var(--color-accent);
}

.carousel-nav {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 12px;
}

.carousel-btn {
  font-family: var(--font-primary);
  font-size: 1.4rem;
  font-weight: 300;
  line-height: 1;
  color: var(--color-text-subtle);
  background: none;
  border: 0;
  padding: 4px 10px;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

/* ==========================================================================
   7. FOOTER
   ========================================================================== */

.info-footer {
  margin-top: 60px;
}

.info-footer hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin-bottom: 25px;
}

.info-footer .contact-links {
  text-align: center;
  font-size: 0.85rem;
}

/* ==========================================================================
   8. MEDIA QUERIES
   ========================================================================== */

@media (max-width: 768px) {
  .container {
    padding: 40px 20px;
  }

  h1 {
    font-size: 1.6rem;
  }

  .bio {
    font-size: 0.85rem;
  }

  .carousel {
    --strip-height: 220px;
  }
}

@media (min-width: 1600px) {
  html {
    font-size: 16px;
  }

  h1 {
    font-size: 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .carousel-track {
    scroll-behavior: auto;
  }
}
