@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap");

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

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --ink:           #1b1716;
  --muted:         #675d59;
  --line:          rgba(127, 17, 19, 0.1);
  --surface:       #fffaf6;
  --surface-soft:  #f7eee8;
  --maroon-light:  #a11d23;
  --maroon:        #7f1113;
  --maroon-deep:   #4f090c;
  --gold:          #d7aa43;
  --gold-light:    #f3c45a;
  --shadow:        0 22px 48px rgba(79, 9, 12, 0.1);
  --page-gutter:   var(--layout-page-gutter, 24px);
}

html { scroll-behavior: smooth; }

body {
  background: #f6efe8;
  overflow-x: hidden;
}

.main-content,
.main-content button,
.main-content input,
.main-content textarea,
.main-content select {
  font-family: "Poppins", sans-serif;
}

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

.main-content {
  width: 100%;
  margin: 0;
  padding: 0;
  min-height: 0;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.research-breadcrumb.layout-breadcrumb {
  width: min(1180px, 100%);
  max-width: 1180px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  align-self: stretch;
  justify-self: stretch;
  margin: 14px 0 8px;
  padding: 14px var(--page-gutter) 12px;
  border: none;
  background: transparent;
  border-radius: 0;
  color: var(--maroon);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.research-breadcrumb.layout-breadcrumb::before {
  content: "";
  width: 46px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.research-breadcrumb.layout-breadcrumb a {
  color: var(--maroon);
  text-decoration: none;
  padding: 4px 0;
}

.research-breadcrumb.layout-breadcrumb span {
  color: var(--maroon);
  font-weight: 800;
}

.research-breadcrumb.layout-breadcrumb strong {
  color: var(--ink);
  font-weight: 800;
}

/* ============================================================
   ACADEMIC SHELL
   ============================================================ */
.academic-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  justify-items: center;
}

.research-page-shell {
  width: 100%;
  max-width: none;
  margin: 0 auto 0;
  display: grid;
  gap: 10px;
  justify-items: stretch;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
}

/* ============================================================
   HERO SHELL + CAROUSEL
   ============================================================ */
.hero-shell {
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  transform: none;
  z-index: 1;
}

.carousel-section { height: 100%; margin-top: 0; }

.carousel {
  position: relative;
  min-height: 340px;
  background: linear-gradient(180deg, #4b090c 0%, #120304 100%);
  overflow: hidden;
}

.full-carousel { border-bottom: 1px solid rgba(127, 17, 19, 0.1); }

.carousel-stage {
  position: relative;
  width: 100%;
  min-height: 340px;
  height: 340px;
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.carousel-slide.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.carousel-split {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  height: 100%;
}

.carousel-half {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.84) sepia(0.08);
}

.carousel-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 10%, rgba(240, 200, 90, 0.2), transparent 45%),
    linear-gradient(145deg, rgba(45, 0, 0, 0.5), rgba(12, 8, 8, 0.4));
}

.carousel-caption {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #fffaf4;
  text-align: center;
  pointer-events: none;
}

.carousel-caption h2 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(1.9rem, 4vw, 3.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 14px 30px rgba(18, 3, 4, 0.45);
}

.carousel-prev,
.carousel-next,
.carousel-indicators { display: none; }

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.72s ease-out, transform 0.72s ease-out;
  will-change: opacity, transform;
}

.reveal.active { opacity: 1; transform: translateY(0); }

body.scroll-down .reveal:not(.active) { transform: translateY(40px); }
body.scroll-up  .reveal:not(.active) { transform: translateY(-40px); }

.reveal.delay-100 { transition-delay: 0.1s; }
.reveal.delay-200 { transition-delay: 0.2s; }

/* ============================================================
   SECTION TAG
   ============================================================ */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--maroon);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.section-tag::before {
  content: "";
  width: 30px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.research-page-intro {
  display: flex;
  justify-content: center;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: -8px;
  margin-bottom: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
  position: relative;
  z-index: 4;
  justify-self: stretch;
  align-self: start;
}

.research-story-card {
  position: relative;
  max-width: 100%;
  width: 100%;
  margin: 0;
  min-height: 0;
  padding: 28px clamp(24px, 4.2vw, 64px) 30px;
  background: linear-gradient(180deg, var(--maroon-light) 0%, var(--maroon) 50%, var(--maroon-deep) 100%);
  color: #fffaf4;
  overflow: visible;
  z-index: 4;
}

.research-story-layout {
  display: block;
  width: 100%;
  margin: 0;
}

.research-story-copy {
  min-width: 0;
  max-width: 1080px;
  padding-left: 0;
  padding-right: 0;
}

.research-story-tag {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 241, 231, 0.84);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.research-story-tag::before {
  content: "";
  width: 46px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.research-story-card h1 {
  margin: 8px 0 10px;
  color: #fffaf4;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.12;
}

.research-story-card p {
  color: rgba(255, 245, 238, 0.9);
  font-size: 0.94rem;
  line-height: 1.7;
}

.research-story-description {
  margin: 0;
  max-width: 72ch;
  color: rgba(255, 245, 238, 0.9);
  font-size: 0.94rem;
  line-height: 1.7;
}

.research-story-description p {
  margin: 0 0 0.9em;
}

.research-story-description > :first-child { margin-top: 0; }
.research-story-description > :last-child { margin-bottom: 0; }

.students-contents-strip {
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: -10px;
  padding: 24px 32px 28px;
  background:
    linear-gradient(135deg, rgba(255, 247, 237, 0.96) 0%, rgba(247, 239, 232, 0.92) 54%, rgba(215, 170, 67, 0.16) 100%);
  box-shadow: var(--shadow);
  z-index: 1;
}

.students-contents-inner {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.students-contents-head { margin-bottom: 16px; }
.students-contents-head .section-tag { color: var(--maroon); margin-bottom: 0; }
.students-contents-head h2 { display: none; }

.students-cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 280px);
  gap: 18px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(127, 17, 19, 0.24) transparent;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}

.students-cards::-webkit-scrollbar { height: 8px; }
.students-cards::-webkit-scrollbar-thumb {
  background: rgba(127, 17, 19, 0.22);
  border-radius: 999px;
}

.students-card {
  position: relative;
  isolation: isolate;
  height: 340px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 239, 232, 0.88) 100%);
  border: 1px solid rgba(127, 17, 19, 0.12);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.22);
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
  scroll-snap-align: start;
}

.students-card:hover,
.students-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(127, 17, 19, 0.22);
  box-shadow: 0 18px 28px rgba(79, 9, 12, 0.2);
}

.students-card-inner { position: relative; width: 100%; height: 100%; }

.students-card-front,
.students-card-back {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  overflow: hidden;
}

.students-card-front {
  background: #f2f2f2;
  display: grid;
  grid-template-rows: 1fr auto;
  z-index: 1;
}

.students-card-front img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: none;
  transition: transform 0.45s ease, filter 0.45s ease;
}

.students-card-copy {
  position: relative;
  min-height: 72px;
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--maroon);
  z-index: 2;
}

.students-card-copy h3 {
  margin: 0;
  color: #fffaf4;
  font-size: clamp(0.82rem, 2.8vw, 1rem);
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
}

.students-card-back {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: 20px 18px 22px;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 72% 28%, rgba(161, 29, 35, 0.24) 0%, rgba(161, 29, 35, 0.12) 18%, transparent 42%),
    linear-gradient(180deg, rgba(161, 29, 35, 0.96) 0%, rgba(127, 17, 19, 0.94) 52%, rgba(63, 7, 11, 0.98) 100%);
  color: #fffaf4;
  opacity: 0;
  transform: translateY(100%);
  transition: transform 0.62s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.48s ease;
  pointer-events: none;
  z-index: 3;
}

.students-card-back::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, transparent 38%, rgba(63, 7, 11, 0.22) 100%);
  pointer-events: none;
  z-index: 0;
}

.students-card-overlay-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.4s ease, transform 0.42s ease;
  text-align: center;
}

.students-card-overlay-copy h3 {
  margin: 0;
  color: #fffaf4;
  font-size: clamp(0.82rem, 2.8vw, 1rem);
  font-weight: 800;
  line-height: 1.25;
}

.students-card-overlay-copy p {
  margin: 0;
  color: rgba(255, 250, 244, 0.82);
  font-size: clamp(0.76rem, 2.4vw, 0.88rem);
  line-height: 1.6;
}

.students-card-description,
.students-card-description p {
  margin: 0;
  color: rgba(255, 250, 244, 0.82);
  font-size: clamp(0.76rem, 2.4vw, 0.88rem);
  line-height: 1.6;
}

.students-card-description > :first-child { margin-top: 0; }
.students-card-description > :last-child { margin-bottom: 0; }

.students-card-action {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  color: #2d1606;
  font-size: 0.82rem;
  font-weight: 800;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.42s ease, transform 0.42s ease;
}

.students-card:hover .students-card-back,
.students-card:focus-visible .students-card-back {
  opacity: 1;
  transform: translateY(0);
}

.students-card:hover .students-card-overlay-copy,
.students-card:hover .students-card-action,
.students-card:focus-visible .students-card-overlay-copy,
.students-card:focus-visible .students-card-action {
  opacity: 1;
  transform: translateY(0);
}

.students-card:hover .students-card-front img,
.students-card:focus-visible .students-card-front img {
  transform: scale(1.05);
  filter: none;
}

/* ============================================================
   DARK MODE
   ============================================================ */
body.pup-dark-mode .research-breadcrumb.layout-breadcrumb strong { color: #f5e8e8 !important; }

body.pup-dark-mode .research-story-card {
  background: linear-gradient(180deg, rgba(74, 10, 12, 0.98) 0%, rgba(46, 6, 8, 0.99) 52%, rgba(22, 2, 3, 1) 100%);
}

body.pup-dark-mode .research-story-card p,
body.pup-dark-mode .research-story-description {
  color: rgba(255, 232, 224, 0.82);
}

body.pup-dark-mode .students-contents-strip {
  background: linear-gradient(135deg, rgba(26, 10, 12, 0.98) 0%, rgba(18, 8, 10, 0.96) 54%, rgba(40, 20, 5, 0.14) 100%);
}

body.pup-dark-mode .students-card {
  background: linear-gradient(180deg, rgba(55, 8, 10, 0.95) 0%, rgba(35, 4, 6, 0.98) 100%);
  border-color: rgba(180, 130, 40, 0.14);
  box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.25);
  color: #f5e8e8;
}

body.pup-dark-mode .students-card:hover,
body.pup-dark-mode .students-card:focus-visible {
  border-color: rgba(215, 170, 67, 0.28);
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.65);
}

body.pup-dark-mode .students-card-front { background: rgba(45, 6, 8, 0.72); }

body.pup-dark-mode .students-card-copy {
  background: linear-gradient(180deg, rgba(90, 12, 15, 0.98) 0%, rgba(60, 6, 9, 0.99) 100%);
}

body.pup-dark-mode .students-card-back {
  background:
    radial-gradient(circle at 72% 28%, rgba(80, 10, 12, 0.28) 0%, rgba(50, 6, 8, 0.14) 18%, transparent 42%),
    linear-gradient(180deg, rgba(55, 8, 10, 0.98) 0%, rgba(35, 4, 6, 0.97) 52%, rgba(18, 2, 3, 0.99) 100%);
}

body.pup-dark-mode .students-card-overlay-copy h3 { color: #fff4eb; }
body.pup-dark-mode .students-card-overlay-copy p  { color: rgba(255, 230, 210, 0.78); }
body.pup-dark-mode .students-card-action {
  background: linear-gradient(135deg, #f3c45a 0%, #d7aa43 100%);
  color: #2d1606;
}

/* ============================================================
   MISC
   ============================================================ */
pup-footer .footer { margin-top: 0; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .carousel-stage,
  .carousel { min-height: 280px; height: 280px; }
  .carousel-caption { padding: 18px; }
  .research-story-card { padding: 24px var(--page-gutter) 26px; }
  .students-contents-strip { padding: 20px var(--page-gutter); }
}

@media (max-width: 768px) {
  .main-content { padding-bottom: 32px; }

  .academic-shell { width: 100%; margin-top: 0; gap: 0; }

  .research-breadcrumb.layout-breadcrumb {
    font-size: 0.74rem;
    gap: 6px;
    margin: 14px 0 8px;
    padding: 14px var(--page-gutter) 12px;
  }

  .carousel,
  .carousel-stage,
  .carousel-half { min-height: 230px; height: 230px; }

  .carousel-split { grid-template-columns: 1fr; }
  .carousel-half-right { display: none; }
  .carousel-caption { padding: 16px; }
  .carousel-caption h2 {
    max-width: 14ch;
    font-size: clamp(1.5rem, 8vw, 2.3rem);
  }

  .research-story-card h1 {
    font-size: clamp(1.7rem, 7vw, 2.3rem);
  }

  .students-cards {
    grid-auto-columns: minmax(200px, 240px);
    gap: 12px;
  }

  .students-card { height: 300px; }
}

@media (max-width: 480px) {
  .carousel,
  .carousel-stage,
  .carousel-half { min-height: 210px; height: 210px; }

  .carousel-caption h2 { font-size: 1.35rem; max-width: 14ch; }

  .research-story-card {
    padding: 20px 16px 22px;
  }

  .research-story-card h1 {
    margin-bottom: 12px;
  }

  .students-cards { grid-auto-columns: minmax(180px, 210px); gap: 10px; }

  .students-card { height: 270px; }

  .students-card-copy h3,
  .students-card-overlay-copy h3 { font-size: 0.85rem; }

  .students-card-overlay-copy p { font-size: 0.76rem; }
}

@media (prefers-reduced-motion: reduce) {
  .students-card:hover { transform: none; }
  .students-card-back,
  .students-card-overlay-copy,
  .students-card-front img { transition: none; }
}

@media (hover: none) {
  .students-card:hover { transform: none; border-color: rgba(127, 17, 19, 0.12); box-shadow: none; }
  .students-card:hover .students-card-back { opacity: 0; transform: translateY(100%); }
  .students-card:hover .students-card-overlay-copy,
  .students-card:hover .students-card-action { opacity: 0; transform: translateY(18px); }
  .students-card:hover .students-card-front img { transform: none; filter: none; }
}

body.pup-dark-mode .students-card:hover,
body.pup-dark-mode .students-card:focus-visible,
body.pup-dark-mode .contents-card:hover,
body.pup-dark-mode .contents-card:focus-visible,
body.pup-dark-mode .contents-card.active {
  border-color: rgba(200, 80, 80, 0.32);
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.4);
}
