:root {
  --color-moss: #7b886f;
  --color-sand: #c19a82;
  --color-slate: #5784ba;
  --color-text: rgba(0, 0, 0, 0.82);
  --color-muted: rgba(0, 0, 0, 0.55);
  --border: rgba(0, 0, 0, 0.15);
  --bg: #fff;
  --bg-right: #f2f4f1;
  --transition: 0.3s ease;
  --left-col-width: 30%;
}

body {
  margin: 0;
  font-family: "Nunito", sans-serif;
  background: var(--bg);
  color: var(--color-text);
  line-height: 1.65;
}

/* Use an actual 2-column grid */
.layout {
  display: grid;
  grid-template-columns: var(--left-col-width) 1fr;
  height: 100vh;
}

/* --- Left Column (Fixed, non-scroll on desktop to avoid double-scroll) --- */
.left-column {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--left-col-width);
  box-sizing: border-box;

  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;

  padding-bottom: 5rem;
  padding-left: clamp(2.5rem, 6vw, 5rem);
  padding-right: clamp(2rem, 4vw, 3.5rem);
  padding-top: clamp(2rem, 4vh, 3.5rem);

  border-right: 1px solid var(--border);

  background-image: url("/assets/images/IMG_0459.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-color: rgba(255, 255, 255, 0.75);
  background-blend-mode: lighten;
}

/* Make sure pseudo-element positioning works as intended */
.left-column {
  position: fixed;
}
.left-column::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3rem;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.85)
  );
  pointer-events: none;
}

.left-column h1 {
  color: var(--color-slate);
  font-size: 2.75rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--color-slate);
}

.intro {
  font-weight: 300;
  font-size: 1.1rem;
}

.resume-link {
  color: var(--color-slate);
  text-decoration: none;
}

.section-group {
  margin-top: 1.75rem;
  padding-top: 0.6rem;
  border-top: 2px solid var(--border);
}

.section-group h2 {
  color: var(--color-slate);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 1rem;
}

ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
li {
  margin: 0.6rem 0;
}
a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover,
a.active {
  color: var(--color-moss);
}

footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 2px solid var(--border);
  color: var(--color-muted);
  font-size: 0.9rem;
}

footer a {
  color: var(--color-muted);
}
footer a:hover {
  color: var(--color-slate);
}

/* --- Right Panel (Scrollable) --- */
.right-pane {
  grid-column: 2;
  background: linear-gradient(180deg, #faf9f7 0%, #bfd593 100%);
  height: 100vh;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 3rem clamp(2rem, 5vw, 4rem);
  box-sizing: border-box;
}

/* Project Header */
.project-header {
  margin-bottom: 1rem;
}

.project-number {
  color: var(--color-slate);
  font-weight: 700;
  font-size: 1.2rem;
  margin-right: 0.5rem;
}

.project-header h3 {
  display: inline-block;
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.metadata {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: var(--color-muted);
  margin-top: 0.3rem;
}

.divider {
  border: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 0.1),
    rgba(0, 0, 0, 0)
  );
  margin: 1rem 0 2rem;
}

/* Content Body */
.content-block {
  margin: 4rem auto 6rem auto;
  max-width: 750px;
}

.content-block h4 {
  margin: 2.5rem 0 1rem;
  color: var(--color-slate);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

/* Quotes + Microviz */
.data-story {
  margin: 3rem 0 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem 2rem;
  gap: 2.25rem;
  background: rgba(193, 154, 130, 0.1);
  border-left: 4px solid var(--color-sand);
  border-radius: 6px;
}

.data-story blockquote {
  font-style: italic;
  color: var(--color-moss);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0;
  max-width: 100%;
}

.microviz {
  text-align: center;
  flex-shrink: 0;
  align-self: flex-start;
  padding-top: 0;
}

.viz-caption {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-top: 0.5rem;
}

/* Portal button */
.portal-link {
  display: inline-block;
  background: linear-gradient(90deg, var(--color-moss), var(--color-sand));
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}
.portal-link:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

.monitor-photo {
  margin: 2rem 0;
  text-align: center;
}
.monitor-photo img {
  max-width: 85%;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}
.photo-caption {
  color: var(--color-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* Slideshow container */
.monitor-slideshow {
  position: relative;
  width: 100%;
  height: 210px;
  margin-top: 2.5rem;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

/* Slides */
.monitor-slideshow .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: fadeSlideshow 28s infinite;
}

.monitor-slideshow img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.92);
  border-radius: 10px;
}

/* Slide timing offsets */
.monitor-slideshow .slide:nth-child(1) {
  animation-delay: 0s;
}
.monitor-slideshow .slide:nth-child(2) {
  animation-delay: 4s;
}
.monitor-slideshow .slide:nth-child(3) {
  animation-delay: 8s;
}
.monitor-slideshow .slide:nth-child(4) {
  animation-delay: 12s;
}
.monitor-slideshow .slide:nth-child(5) {
  animation-delay: 16s;
}
.monitor-slideshow .slide:nth-child(6) {
  animation-delay: 20s;
}
.monitor-slideshow .slide:nth-child(7) {
  animation-delay: 24s;
}

/* Fade animation */
@keyframes fadeSlideshow {
  0% {
    opacity: 0;
  }
  6% {
    opacity: 1;
  }
  22% {
    opacity: 1;
  }
  28% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

/* ============================================
   VERTICAL WETLAB FILMSTRIP 
   ============================================ */

.wetlab-filmstrip {
  display: flex;
  flex-direction: column;
  gap: 1.5rem; /* updated spacing */
  margin: 3rem 0 3.5rem;
  padding-left: 0.5rem;
  border-left: 3px solid var(--color-sand);
}

.filmstrip-frame {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  background: #fff;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.filmstrip-frame:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.filmstrip-frame img {
  width: 100%;
  display: block;
  object-fit: cover;
  filter: brightness(0.97);
}

.filmstrip-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.filmstrip-frame:hover .filmstrip-caption {
  opacity: 1;
}

/* Touch / no-hover devices: captions should be visible */
@media (hover: none) and (pointer: coarse) {
  .filmstrip-caption {
    opacity: 1;
  }
}

/* Results: no card geometry */
.filmstrip-frame.result-frame {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

.frame-number {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--color-slate);
  color: #fff;
  padding: 0.3rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-bottom-right-radius: 6px;
  opacity: 0.92;
}

.method-step-header {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-slate);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 3rem 0 1rem;
  opacity: 0.85;
}

.method-step-sub {
  font-size: 0.95rem;
  color: var(--color-muted);
  margin-bottom: 1rem;
}

.section-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 4rem auto 4rem;
  max-width: 750px;
  opacity: 0.8;
}

.result-frame {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0;
  margin-bottom: 1.5rem;
}

.result-frame img {
  width: 100%;
  border: none;
  border-radius: 0;
  filter: contrast(1.05) brightness(1.02);
}

.result-caption {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 0.35rem;
  letter-spacing: 0.01em;
}

nav {
  margin-top: 2rem;
}

@media (max-width: 900px) {
  .layout {
    display: block;
    padding-left: 0;
    height: auto;
  }
  .left-column {
    position: relative;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    height: auto;
    padding: 2rem 1.5rem 2.5rem;
    background-attachment: scroll;
    overflow: visible;
  }
  .right-pane {
    padding: 2rem 1.5rem;
    height: auto;
    overflow: visible;
  }
  .data-story {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem 1.25rem 1.5rem;
    gap: 1rem;
  }

  .intro p {
    font-size: 1.05rem;
    line-height: 1.6;
  }

  .intro p + p {
    margin-top: 1rem;
  }

  nav {
    margin-top: 1.5rem;
  }

  .section-group {
    margin-top: 1.25rem;
    padding-top: 0.5rem;
  }

  .section-group h2 {
    font-size: 1.1rem;
  }

  .left-column li {
    margin: 0.4rem 0;
  }
}

/* Reduced motion: disable smooth scroll, hover motion, and slideshow animation */
@media (prefers-reduced-motion: reduce) {
  .left-column,
  .right-pane {
    scroll-behavior: auto;
  }

  .portal-link:hover,
  .filmstrip-frame:hover {
    transform: none;
  }

  .monitor-slideshow .slide {
    animation: none;
    opacity: 1;
    position: static;
  }
  .monitor-slideshow {
    height: auto;
  }
  .monitor-slideshow img {
    height: auto;
  }
}
