@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap");
html,
body {
  margin: 0;
  padding: 0;
  background: #f7f8fa;
  font-family: "EB Garamond", Garamond, "Times New Roman", Times, serif;
  color: #21243d;
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font-family: "EB Garamond", Garamond, "Times New Roman", Times, serif;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  background: #fff;
  border-bottom: 1.5px solid #e5e8ee;
  font-size: 1.12em;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 18px 0 10px 0;
  z-index: 1000;
}

.nav-link {
  text-decoration: none;
  color: #2152c1;
  border-bottom: 2px solid transparent;
  transition: border 0.2s;
  padding-bottom: 2px;
}

.nav-link:hover,
.nav-link.active {
  border-bottom: 2px solid #2152c1;
  color: #112244;
}

main {
  max-width: 900px;
  background: #fff;
  margin: 48px auto 40px auto;
  border-radius: 16px;
  box-shadow: 0 2px 16px 0 rgba(30, 45, 70, 0.06);
  padding: 48px 36px 40px 36px;
  text-align: center;
}

.profile-img-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}

.profile-img {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  box-shadow: 0 2px 10px #dbeafe80;
  object-fit: cover;
}

h1 {
  margin: 10px 0 4px 0;
  font-size: 2.2em;
  font-weight: 700;
  color: #1c2233;
}

h2 {
  margin: 2px 0 24px 0;
  font-size: 1.12em;
  font-weight: 500;
  color: #4b5563;
  letter-spacing: 0.02em;
}

h3 {
  margin: 10px 0 4px 0;
  font-size: 1.25em;
  font-weight: 550;
  color: #2453aa;
}

.about-section {
  text-align: left;
  margin: 0 auto 36px auto;
}

.about-section p {
  font-size: 1.2em; /* or any size you prefer */
  line-height: 1.5; /* improves readability */
}

.about-section blockquote {
  background: #f2f5fa;
  border-left: 4px solid #2152c1;
  text-align: center;
  margin: 22px 0 0 0;
  padding: 16px 20px;
  font-size: 1.1em;
  font-style: normal;
  color: #193366;
  border-radius: 0 6px 6px 0;
}

.contact-section {
  margin-top: 20px;
}

.contact-email {
  display: inline-block;
  font-size: 1.07em;
  color: #2152c1;
  text-decoration: none;
  margin-bottom: 14px;
  font-weight: 600;
  border-bottom: 1.5px dotted #b2cdfa;
  transition: color 0.2s;
}
.contact-email:hover {
  color: #193366;
  border-bottom: 1.5px solid #2152c1;
}

.social-links {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 18px;
}
.social-links img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  transition: box-shadow 0.17s, filter 0.2s;
  filter: grayscale(20%);
  background: #f1f2fa;
}
.social-links img:hover {
  filter: none;
  box-shadow: 0 2px 8px #c7d1ee80;
}

footer {
  text-align: center;
  color: #9ca3af;
  font-size: 0.98em;
  margin: 40px 0 10px 0;
  padding-top: 12px;
}
.pub-year {
  margin-bottom: 40px;
}
.pub-year h2 {
  font-size: 1.5em;
  font-weight: 700;
  color: #2453aa;
  margin: 28px 0 20px 0;
  letter-spacing: 0.01em;
  text-align: center;
}
.pub-entry {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 28px;
  text-align: left;
}
.pub-citation {
  flex: 10;
  font-size: 1.08em;
  color: #25253d;
  line-height: 1.5;
  text-align: left;
}
.pub-link {
  flex: 1;
  display: flex;
  align-items: center;
}
.pub-link a {
  display: inline-block;
  background: #2453aa;
  color: #fff;
  padding: 6px 16px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 500;
  text-align: center;
  transition: background 0.2s;
  width: 100%;
  min-width: 40px;
}
.pub-link a:hover {
  background: #193366;
}
.dark-toggle {
  padding: 7px 18px;
  border-radius: 6px;
  border: none;
  background: #ececec;
  color: #222;
  cursor: pointer;
  font-size: 0.98em;
  box-shadow: 0 2px 10px #eee;
  transition: all 0.18s;
  font-weight: 500;
  /* To fit in navbar */
  margin-left: auto;
  margin-right: 0;
}

/* ---------------------- PROJECT GRID LAYOUT ---------------------- */
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* two columns: media + desc */
  align-items: start;
  gap: 40px;
  margin-bottom: 60px;
}

/* make sure project text aligns left */
.project-desc {
  text-align: left;
}

@media (max-width: 600px) {
  /* hide AJ logo on mobile */
  .navbar img,
  .navbar .logo,
  .navbar span {
    display: none !important;
  }

  /* make navbar a simple two-line block */
  .navbar {
    display: block;
    text-align: center;
    background: #fff;
    border-bottom: 1.5px solid #e5e8ee;
    padding: 10px 0 14px 0;
    position: fixed;
    width: 100%;
    z-index: 1000;
  }

  /* make all nav links inline so they sit on one line */
  .navbar .nav-link {
    display: inline-block !important;
    font-size: 1em;
    margin: 4px 8px;
    white-space: nowrap;
  }

  /* put dark mode button centered below links */
  .dark-toggle {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.95em;
    padding: 6px 14px;
  }

  /* push main down so it clears navbar */
  main {
    margin-top: 110px;
    margin-left: 10px;
    margin-right: 10px;
    padding: 28px 20px;
  }
}

/* === Force project sections to stack on mobile === */
@media (max-width: 700px) {
  .project-grid {
    display: flex !important; /* override inline grid */
    flex-direction: column-reverse !important; /* description first */
    gap: 24px !important;
    align-items: stretch !important;
  }

  .project-grid > div {
    width: 100% !important;
  }

  .project-grid iframe,
  .project-grid video,
  .project-grid img {
    width: 100% !important;
    height: auto !important;
    border-radius: 10px;
  }

  .project-desc {
    text-align: left !important;
  }
}

body.dark-mode {
  background: #16181e;
  color: #e7e9ec;
}
body.dark-mode main {
  background: #232433;
  color: #e7e9ec;
  box-shadow: 0 2px 16px 0 rgba(20, 20, 40, 0.19);
}
body.dark-mode nav,
body.dark-mode .navbar {
  background: #232433;
  border-bottom: 1.5px solid #232433;
}
body.dark-mode .nav-link {
  color: #e1cfae;
}
body.dark-mode .nav-link.active,
body.dark-mode .nav-link:hover {
  color: #d5be8b;
  border-bottom: 2px solid #d5be8b;
}
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3 {
  color: #d6cba4;
}
body.dark-mode .pub-link a {
  background: #33344a;
  color: #f9e4b7;
}
body.dark-mode .pub-link a:hover {
  background: #22222a;
}
body.dark-mode .about-section blockquote {
  background: #22222a;
  color: #f5e7c8;
  border-left: 4px solid #f5e7c8;
}
body.dark-mode .contact-email {
  color: #e7c388;
  border-bottom: 1.5px dotted #e7c388;
}
body.dark-mode .contact-email:hover {
  color: #ffe3b0;
  border-bottom: 1.5px solid #ffe3b0;
}
body.dark-mode .social-links img {
  filter: grayscale(40%) brightness(0.92);
  background: #232433;
}
body.dark-mode footer {
  color: #cab88b;
}
body.dark-mode .pub-citation {
  color: #e7e9ec;
}

.carousel {
  position: relative;
  max-width: 900px;
  margin: 48px auto 60px auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 20px rgba(30, 45, 70, 0.3);
  background-color: black;
  height: 480px; /* fixed height */
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 16px;
  overflow: hidden;
  background-color: black;
}

.carousel-slide.active {
  display: flex;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* important! */
  border-radius: 16px 16px 0 0;
  user-select: none;
  pointer-events: none;
}

.caption {
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 12px 20px;
  font-size: 1.1em;
  font-family: "EB Garamond", serif;
  border-radius: 0 0 16px 16px;
  user-select: none;
  text-align: center;
}

.carousel-controls {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  pointer-events: none;
}

.carousel-controls button {
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  font-size: 2rem;
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 50%;
  pointer-events: auto;
  user-select: none;
  transition: background 0.3s ease;
}

.carousel-controls button:hover {
  background: rgba(0, 0, 0, 0.8);
}

/*--------------------Project Cards--------------------*/
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-top: 2rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 16px;
  overflow: hidden;
  background: var(--card, #fff);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}
.card-media {
  position: relative;
  height: 240px;
  overflow: hidden;
}

.card-media img,
.card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-tags {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.card-tags span {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.card-text {
  padding: 1.25rem 1.5rem 1.5rem;
}

.card-text h2 {
  margin: 0 0 0.4rem;
  font-size: 1.3rem;
}

.card-text h3 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.card-text p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-muted, #555);
}

/* =========================== Case Study Layout ======================== */

.case-study {
  max-width: 960px;
  margin: 0 auto 6rem;
  padding: 0 1rem;
  text-align: left;
}

/* ===== Header ===== */

.case-header h1 {
  font-size: 2.2rem;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  text-align: center;
}

.case-header .subtitle {
  font-size: 1.15rem;
  color: #555;
  margin-bottom: 1.15rem;
  text-align: center;
}

.case-meta {
  font-size: 0.95rem;
  color: #666;
  border-left: 3px solid rgba(0, 0, 0, 0.1);
  padding-left: 1rem;
  margin-bottom: 3rem;
}

.case-meta p {
  margin: 0.25rem 0;
}

/* ===== Section Structure ===== */

.case-study section {
  margin-bottom: 3rem;
}

.case-study h2 {
  font-size: 1.6rem;
  margin: 3rem 0 1rem;
}

.case-study h3 {
  font-size: 1.2rem;
  margin: 2rem 0 0.75rem;
}

/* ===== Body Text ===== */

.case-study p {
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.case-study ul,
.case-study ol {
  margin: 1rem 0 1.5rem;
  padding-left: 1.25rem;
}

.case-study li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* ===== At-a-Glance Block ===== */

.case-glance ul {
  list-style: none;
  padding-left: 0;
}

.case-glance li {
  padding-left: 1.2rem;
  position: relative;
}

.case-glance li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: #999;
}

/* ===== Blockquotes / Callouts ===== */

.case-study blockquote {
  margin: 2rem 0;
  padding-left: 1.25rem;
  border-left: 4px solid #2453aa;
  font-style: italic;
  color: #444;
}

/* ===== Media ===== */

.case-study img,
.case-study figure,
.case-study iframe,
.case-study video {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
}

.case-study video {
  width: 100%;
  height: auto;
  display: block;
}

.case-study figure {
  margin: 2.5rem 0;
}

.case-study figcaption {
  font-size: 0.85rem;
  text-align: center;
  color: #666;
  margin-top: 0.5rem;
}

/* ===== Case Study Slideshow ===== */

.case-slideshow {
  position: relative;
  margin: 2.5rem 0;
}

.slideshow-viewport {
  overflow: hidden;
  border-radius: 12px;
}

.slideshow-track {
  display: flex;
  transition: transform 0.6s ease;
  will-change: transform;
}

.slideshow-track img {
  width: 100%;
  flex-shrink: 0;
  border-radius: 12px;
}

/* Controls */
.slideshow-controls {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.slideshow-controls button {
  all: unset;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  width: 36px;
  height: 36px;
  margin: 0 12px;
  border-radius: 999px;
  font-size: 22px;

  display: inline-flex;
  align-items: center; /* vertical center */
  justify-content: center; /* horizontal center */

  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.case-slideshow:hover .slideshow-controls button {
  opacity: 1;
}

.slideshow-controls button:hover {
  transform: scale(1.05);
}

/* ===== Links ===== */

.case-study a {
  color: #2453aa;
  text-decoration: underline;
}

.case-study a:hover {
  color: #193366;
}

/* ===== Responsive ===== */

@media (max-width: 600px) {
  .case-header h1 {
    font-size: 1.9rem;
  }

  .case-study {
    padding: 0 0.75rem;
  }
}
