:root {
  --navy: #1e2a3d;
  --navy-soft: #2c3a52;
  --ink: #1a1a1a;
  --muted: #4a4a4a;
  --paper: #ffffff;
  --line: #d8d8d8;
  --max: 1400px;
  --content: 1180px;
  --header-h: 70px;
  --font-display: "Averia Serif Libre", "Iowan Old Style", Palatino, serif;
  --font-body: Bitter, Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
}

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

a {
  color: inherit;
  text-underline-offset: 0.12em;
}

a:hover {
  color: var(--navy);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy);
  color: white;
  padding: 0.5rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* Header — matches Squarespace solid navy bar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.header-inner {
  width: min(100%, var(--max));
  padding: 0 clamp(1rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: 2.75rem 1fr 2.75rem;
  align-items: center;
  overflow: visible;
}

.brand {
  grid-column: 2;
  justify-self: center;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: white;
  text-decoration: none;
  font-style: italic;
  font-weight: 400;
}

.brand:hover {
  color: white;
  opacity: 0.88;
}

.menu-wrap {
  grid-column: 1;
  justify-self: start;
  position: relative;
  z-index: 120;
}

/* Squarespace uses a 2-line menu icon */
.menu-toggle {
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 0.35rem;
}

.menu-toggle span {
  display: block;
  width: 1.4rem;
  height: 1.5px;
  background: white;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle span:nth-child(3) {
  display: none;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(4.25px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  transform: translateY(-4.25px) rotate(-45deg);
}

/* Small dropdown panel — page stays visible.
   JS places it under the icon; these rules style both class names
   so older uploaded HTML (nav-overlay) still works. */
.nav-menu,
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  display: none;
  width: max-content;
  min-width: 12rem;
  margin: 0;
  padding: 0.4rem 0;
  background: #ffffff;
  border: 1px solid #cfcfcf;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.nav-menu.is-open,
.nav-overlay.is-open {
  display: block;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
}

.nav-list a {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.35;
  color: #1a1a1a;
  text-decoration: none;
  padding: 0.5rem 1.2rem;
  white-space: nowrap;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  background: #f0f0f0;
  text-decoration: underline;
}

/* Main */
.site-main {
  width: min(100%, var(--content));
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.25rem, 5vw, 4rem) 5rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.5vw, 2.35rem);
  font-weight: 700;
  font-style: italic;
  color: var(--ink);
  margin: 0 0 1.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 700;
  font-style: italic;
  color: var(--ink);
  margin: 0 0 1.1rem;
}

.prose p {
  margin: 0 0 1.15rem;
}

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

.meta {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink);
  margin: 0.2rem 0 1rem;
  font-size: 1rem;
}

.course-meta {
  color: var(--muted);
  margin: 0 0 1rem;
  font-size: 0.98rem;
}

/* ========== HOME: desktop = centered wide column like Squarespace ========== */
.home-grid {
  display: grid;
  gap: 2.25rem;
  max-width: 52rem;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .home-grid {
    max-width: 58rem;
    gap: 2.75rem;
  }

}

.event-card h3 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-weight: 400;
  margin: 0;
}

.event-card h3 a {
  color: inherit;
}

.event-image {
  margin: 1.5rem 0 0;
}

.event-image img {
  width: 100%;
}

/* ========== ABOUT: desktop text left / images right ========== */
.about-layout {
  display: grid;
  gap: 2rem;
}

.about-images {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .about-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: start;
  }

  .about-copy {
    padding-top: 0.25rem;
  }

  .about-images {
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
  }
}

/* ========== PROJECTS: desktop image + text side by side ========== */
.project {
  margin-bottom: 3.5rem;
}

.project-layout {
  display: grid;
  gap: 1.5rem;
}

.project-media {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .project-layout {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: clamp(1.75rem, 3vw, 3rem);
    align-items: start;
  }

  .project--mapper .project-layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }

  .project--mapper .project-copy {
    order: 1;
  }

  .project--mapper .project-media {
    order: 2;
  }
}

.project h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  font-style: italic;
  margin: 0 0 1rem;
  color: var(--ink);
}

.project h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  font-style: italic;
  margin: 1.75rem 0 0.75rem;
}

/* Content pages */
.content-block {
  margin-bottom: 2.75rem;
}

.content-block h2,
.content-block h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-style: italic;
  color: var(--ink);
}

.content-block h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.7rem);
  margin: 0 0 0.75rem;
}

.content-block h3 {
  font-size: 1.2rem;
  margin: 0 0 0.75rem;
}

.figure {
  margin: 0;
}

.figure img {
  width: 100%;
}

.figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
}

.pub-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.pub-list li {
  margin-bottom: 0.85rem;
}

.collab-list {
  margin: 0.75rem 0 1rem;
  padding-left: 1.25rem;
}

.collab-list li {
  margin-bottom: 0.5rem;
}

/* Teaching: image beside course copy on desktop */
.course {
  margin-bottom: 3.25rem;
}

.course-layout {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .course-layout {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 2rem;
    align-items: start;
  }

  .course-layout .figure {
    order: -1;
  }
}

/* Contact */
.contact-intro {
  margin-bottom: 1.75rem;
  max-width: 40rem;
}

.contact-form {
  max-width: 36rem;
  display: grid;
  gap: 1rem;
}

.form-row {
  display: grid;
  gap: 0.35rem;
}

.form-row label {
  font-size: 0.95rem;
}

.form-row input,
.form-row textarea {
  font: inherit;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fafafa;
  color: var(--ink);
}

.form-row input:focus,
.form-row textarea:focus {
  outline: 2px solid var(--navy);
  outline-offset: 1px;
  background: white;
}

.form-row textarea {
  min-height: 9rem;
  resize: vertical;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn {
  appearance: none;
  border: 0;
  background: var(--navy);
  color: white;
  font-family: var(--font-display);
  font-size: 1rem;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
  justify-self: start;
}

.btn:hover {
  background: var(--navy-soft);
}
