:root {
  --bg: #FAF6F0;
  --ink: #2B2420;
  --rust: #8C4A2F;
  --rose: #C97B84;
  --muted: #8A7F73;

  --font-display: 'Fraunces', serif;
  --font-body: 'Work Sans', sans-serif;
}

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

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
}

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

a:hover {
  text-decoration: underline;
  text-decoration-color: var(--rose);
}

header {
  border-bottom: 1px solid var(--muted);
}

.header-image-wrap {
  position: relative;
  width: 100%;
}

.logo {
  width: 100%;
  height: auto;
  display: block;
  max-width: none;
}

nav {
  position: absolute;
  bottom: 3.5rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 1.25rem;
}

nav a {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(250, 246, 240, 0.9);
  color: var(--ink);
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  text-decoration: none;
}

nav a:hover {
  background: var(--bg);
  text-decoration: none;
  color: var(--rust);
}

.hero {
  padding: 4rem 2rem 3rem;
  text-align: center;
}

.tagline {
  color: var(--muted);
  font-size: 1.1rem;
  margin-top: 1rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding: 4rem 2rem 4rem;
  max-width: 1000px;
  margin: 0 auto;
}

.category-tile {
  text-align: center;
  color: var(--ink);
  background: #FFFFFF;
  padding: 1.5rem 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(43, 36, 32, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
}

.category-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 18px rgba(43, 36, 32, 0.2);
}

.category-tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  transition: transform 0.2s ease;
}

.category-tile:hover img {
  transform: scale(1.03);
}

.category-tile h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--rust);
  margin-top: 1rem;
}

@media (max-width: 900px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 2rem 0.5rem 3rem;
  }

  .category-tile {
    padding: 1rem 0.5rem;
    overflow: hidden;
  }

  .category-tile h3 {
    font-size: 1rem;
    padding: 0 0.15rem;
    overflow-wrap: break-word;
    hyphens: auto;
  }
}

footer {
  background: #4A9183;
  height: 1in;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

footer p {
  color: #FFFFFF;
  font-size: 1.1rem;
  letter-spacing: 0.03em;
}

.bio-section {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.bio-photo {
  width: 250px;
  height: 320px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
}

.bio-text {
  min-width: 0;
  max-width: 400px;
}

.bio-text h1 {
  margin-bottom: 1rem;
}

.bio-text p {
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .bio-section {
    flex-direction: column;
    align-items: center;
    text-align: left;
    padding: 2rem 1.25rem;
    gap: 1.5rem;
  }

  .bio-text {
    max-width: 100%;
  }

  .bio-photo {
    width: 100%;
    max-width: 280px;
    height: 280px;
  }
}

main {
  padding: 2rem 2rem;
}

.contact-section {
  max-width: 600px;
  margin: 0 auto;
  padding: 3rem 2.5rem;
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(43, 36, 32, 0.15);
}

.contact-intro {
  color: var(--muted);
  margin-bottom: 2rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-form label {
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin-bottom: -1rem;
}

.contact-form input,
.contact-form textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--muted);
  border-radius: 8px;
  background: #FFFFFF;
  color: var(--ink);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--rust);
}

.contact-form button {
  align-self: flex-start;
  background: var(--rust);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.contact-form button:hover {
  background: var(--ink);
}

.menu-toggle {
  display: none;
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 1.8rem;
  background: rgba(250, 246, 240, 0.9);
  border: none;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  cursor: pointer;
  color: var(--ink);
  z-index: 20;
}

nav {
  position: absolute;
  bottom: 3.5rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 1.25rem;
}

nav a {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(250, 246, 240, 0.9);
  color: var(--ink);
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  text-decoration: none;
}

nav a:hover {
  background: var(--bg);
  text-decoration: none;
  color: var(--rust);
}

@media (max-width: 900px) {
  .menu-toggle {
    display: block;
  }

  nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 1.5rem;
    right: 1.5rem;
    bottom: auto;
    background: rgba(37, 44, 50, 1);
    border-radius: 16px;
    padding: 1rem;
    margin-top: 0.5rem;
    gap: 0.5rem;
    z-index: 10;
  }

  nav.open {
    display: flex;
  }

  nav a {
    background: rgba(250, 246, 240, 0.95);
    color: var(--ink);
  }
}

.publication-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.publication-card {
  width: 220px;
  background: #FFFDF9;
  border: 2px solid #252C32;
  border-radius: 16px;
  padding: 1.5rem 1rem 2rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(43, 36, 32, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.publication-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 18px rgba(43, 36, 32, 0.15);
}

.publication-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  margin: 0 auto 1rem;
  display: block;
}

.publication-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.publication-card .pub-meta {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-top: auto;
  margin-bottom: 1rem;
}

.publication-card .pub-button {
  display: inline-block;
  background: #4A9183;
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  align-self: center;
}

.publication-card .pub-button:hover {
  background: var(--ink);
}

.page-title {
  text-align: center;
  padding-top: 1rem;
  padding-bottom: 3rem;
}

.illustration-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem;
  background: #FFFDF9;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(43, 36, 32, 0.1);
}

.illustration-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.illustration-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

@media (max-width: 600px) {
  .illustration-section {
    padding: 1.25rem;
  }

  .illustration-grid {
    gap: 0.75rem;
  }
}

.illustration-thumb:hover {
  transform: scale(1.03);
}

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(43, 36, 32, 0.9);
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: pointer;
  padding: 2rem;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 8px;
  overflow: hidden;
}

.video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 600px) {
  .illustration-section:has(.video-grid) {
    padding: 1.25rem;
  }

  .video-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.success-message {
  text-align: center;
  padding: 2rem 0;
}

.carousel-wrap {
  position: relative;
}

.publication-grid::-webkit-scrollbar {
  display: none;
}

.publication-grid {
  scrollbar-width: none;
}

.carousel-arrow {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(250, 246, 240, 0.95);
  border: 2px solid #252C32;
  border-radius: 50%;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--ink);
  z-index: 5;
}

.carousel-arrow.hidden {
  visibility: hidden;
  pointer-events: none;
}

.carousel-prev {
  left: 0.25rem;
}

.carousel-next {
  right: 0.25rem;
}

@media (max-width: 900px) and (min-width: 500px) {
  .carousel-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 0.5rem;
    max-width: 100%;
    overflow: hidden;
  }

  .carousel-arrow {
    display: flex;
    position: static;
    transform: none;
    flex-shrink: 0;
  }

  .publication-grid {
    flex: 0 1 auto;
    max-width: min(260px, calc(100vw - 6.5rem));
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 0 0 2rem;
  }

  .publication-card {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: center;
  }
}

@media (max-width: 499px) {
  .carousel-arrow {
    display: none !important;
  }

  .carousel-wrap {
    padding: 0;
  }

  .publication-grid {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1.5rem;
    padding: 0 1.5rem 2rem;
    max-width: 100%;
  }

  .publication-card {
    flex: 0 0 220px;
    width: 220px;
    scroll-snap-align: center;
  }
}