/* Base reveal.js styles
 *
 * Copy this file as styles.css for each new presentation.
 * Customize the CSS variables (especially colors) for your theme.
 *
 * IMPORTANT: All font sizes use pt (points) for predictable sizing.
 * Base text is intentionally small (16pt) to fit content-heavy slides.
 * Use .text-lg, .text-xl, etc. classes when slides have less content.
 */

/* ===========================================
   CSS VARIABLES - Customize these for each presentation
   =========================================== */
:root {
  /* Nord Light theme - https://www.nordtheme.com */
  --nord0: #2E3440;
  --nord3: #4C566A;
  --nord4: #D8DEE9;
  --nord5: #E5E9F0;
  --nord6: #ECEFF4;
  --nord7: #8FBCBB;
  --nord8: #88C0D0;
  --nord9: #81A1C1;
  --nord10: #5E81AC;
  --nord11: #BF616A;
  --nord12: #D08770;
  --nord13: #EBCB8B;
  --nord14: #A3BE8C;
  --nord15: #B48EAD;

  --background-color: var(--nord6);
  --section-divider-bg: var(--nord10);

  /* Section divider typography hierarchy */
  --section-divider-title-size: 52pt;
  --section-divider-title-color: var(--nord6);
  --section-divider-title-margin-bottom: 0.4em;
  --section-divider-subtitle-size: 24pt;
  --section-divider-subtitle-color: rgba(236, 239, 244, 0.95);
  --section-divider-subtitle-margin-top: 0.5em;

  /* Typography - ALWAYS use pt for font sizes */
  --heading-font: "Source Sans Pro", Helvetica, sans-serif;
  --body-font: "Source Sans Pro", Helvetica, sans-serif;
  --mono-font: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  --base-font-size: 32px;   /* Only px value - sets reveal.js base */
  --text-size: 16pt;        /* Base body text - intentionally small */
  --h1-size: 48pt;
  --h2-size: 36pt;
  --h3-size: 24pt;
  --footnote-size: 11pt;

  /* Nord: primary = Frost blue, secondary = Aurora green + Frost teal/cyan */
  --primary-color: var(--nord10);
  --secondary-color: var(--nord14);
  --text-color: var(--nord0);
  --muted-color: var(--nord3);
  --line-color: var(--nord10);
  --uncertainty-bar: var(--nord11);
  --confidence-high: var(--nord14);
  --confidence-medium: var(--nord13);
  --confidence-low: var(--nord11);
  --accent-teal: var(--nord7);
  --accent-cyan: var(--nord8);
  --accent-green: var(--nord14);

  /* Layout */
  --slide-padding: 60px;
  --slide-padding-top: 40px;
  --content-gap: 30px;
  --demo-container-padding: 24px;  /* Equal L/R/B so bottom matches sides */
  /* Viewport-relative padding for demo slides (no fixed pixels) */
  --slide-padding-v: 4vw;           /* left & right */
  --slide-padding-top-v: 2.5vh;
  --slide-padding-bottom-v: 1vw;    /* bottom: minimal so content gets more height */

  /* Boxes & Borders */
  --box-radius: 8px;           /* Set to 0 for sharp corners */
  --box-bg: var(--nord5);
  --box-border: var(--nord4);
  --accent-border-width: 6px;

  /* Callout colors */
  --blue: var(--nord9);
  --blue-bg: rgba(136, 192, 208, 0.15);
  --blue-border: var(--nord8);

  --orange: var(--nord12);
  --orange-bg: rgba(235, 203, 139, 0.2);
  --orange-border: var(--nord13);

  --green: var(--nord14);
  --green-bg: rgba(163, 190, 140, 0.2);
  --green-border: var(--nord14);

  --gray: var(--nord3);
  --gray-bg: var(--nord5);
  --gray-border: var(--nord4);
}

/* ===========================================
   BASE STYLES - Override reveal.js defaults
   =========================================== */

.reveal {
  font-family: var(--body-font);
  font-size: var(--base-font-size);
}

/* Apply background colors */
.reveal-viewport {
  background-color: var(--background-color);
}

/* Section divider background via data-state */
.reveal-viewport.is-section-divider .slide-background.present {
  background-color: var(--section-divider-bg) !important;
}

.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4,
.reveal h5,
.reveal h6 {
  font-family: var(--heading-font);
  text-transform: none;
  color: var(--text-color);
}

.reveal h1 { font-size: var(--h1-size); }
.reveal h2 { font-size: var(--h2-size); }
.reveal h3 { font-size: var(--h3-size); }

.reveal p,
.reveal li,
.reveal .callout,
.reveal blockquote {
  font-size: var(--text-size);
  color: var(--text-color);
  line-height: 1.4;
}

/* Prevent double-sizing for nested elements */
.reveal .callout p,
.reveal .callout li,
.reveal blockquote p {
  font-size: inherit;
  line-height: 1.4;
}

.reveal .callout p + p {
  margin-top: 0.5em;
}

/* ===========================================
   SLIDE LAYOUT
   =========================================== */

.reveal .slides section {
  height: 100%;
  display: flex !important;
  flex-direction: column !important;
  padding: var(--slide-padding-top) var(--slide-padding) var(--slide-padding) var(--slide-padding) !important;
  box-sizing: border-box;
  text-align: left;
}

/* Demo slides: viewport-relative padding (smaller bottom to avoid excess space) */
.reveal .slides section:has(.demo-container) {
  padding: var(--slide-padding-top-v) var(--slide-padding-v) var(--slide-padding-bottom-v) var(--slide-padding-v) !important;
}

/* Takeaway as subtitle under the slide title (demo slides only) */
.demo-slide-subtitle {
  font-size: 15pt;
  margin: 0.2em 0 0.6em 0;
  line-height: 1.35;
  flex-shrink: 0;
}

/* Vertical stack wrapper - no padding, just pass through */
.reveal .slides section.stack {
  padding: 0 !important;
}

/* Content area - fills remaining space */
.reveal .slides section > .content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: var(--content-gap);
  text-align: left;
}

/* Footnotes at bottom */
.reveal .slides section > .footnote {
  position: absolute;
  bottom: 15px;
  left: var(--slide-padding);
  right: var(--slide-padding);
  font-size: var(--footnote-size);
  color: var(--muted-color);
}

/* ===========================================
   SECTION DIVIDERS - Centered title slides
   =========================================== */

.reveal .slides section.section-divider {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center;
}

/* Section divider typography hierarchy (no inline styles) */
.reveal .slides section.section-divider .section-divider-title {
  font-size: var(--section-divider-title-size);
  font-weight: 600;
  text-align: center;
  color: var(--section-divider-title-color) !important;
  margin: 0 0 var(--section-divider-title-margin-bottom) 0;
  line-height: 1.2;
}

.reveal .slides section.section-divider .section-divider-subtitle {
  font-size: var(--section-divider-subtitle-size);
  font-weight: 400;
  text-align: center;
  color: var(--section-divider-subtitle-color) !important;
  margin: var(--section-divider-subtitle-margin-top) 0 0 0;
  line-height: 1.35;
}

/* Fallback for section dividers without classes (legacy) */
.reveal .slides section.section-divider h1:not(.section-divider-title) {
  font-size: var(--section-divider-title-size);
  color: var(--section-divider-title-color) !important;
  margin-bottom: var(--section-divider-title-margin-bottom);
}

.reveal .slides section.section-divider p:not(.section-divider-subtitle) {
  font-size: var(--section-divider-subtitle-size);
  color: var(--section-divider-subtitle-color) !important;
  margin-top: var(--section-divider-subtitle-margin-top);
}

/* Title slide: more negative space + presenter */
.reveal .slides section.title-slide h1 {
  margin-bottom: 0.35em;
}

.reveal .slides section.title-slide .title-subtitle {
  margin-top: 0.5em;
  margin-bottom: 0;
}

.reveal .slides section.title-slide .title-presenter {
  margin-top: 1.25em;
  font-size: 18pt !important;
  color: rgba(255, 255, 255, 0.85) !important;
}

/* ===========================================
   TEXT SIZE UTILITIES

   Base text is 16pt - use these to scale UP when
   slides have less content and you want to fill space.
   =========================================== */

.text-lg { font-size: 18pt !important; line-height: 1.4; }   /* Slightly larger */
.text-xl { font-size: 20pt !important; }   /* Medium emphasis */
.text-2xl { font-size: 24pt !important; }  /* Strong emphasis */
.text-3xl { font-size: 28pt !important; }  /* Very large */
.text-4xl { font-size: 32pt !important; }  /* Maximum body text */

/* Other text utilities */
.text-muted { color: var(--muted-color) !important; }
.text-center { text-align: center !important; }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.1em; }
.font-light { font-weight: 300; }
.font-bold { font-weight: 600; }

/* ===========================================
   BOXES / CONTAINERS
   =========================================== */

/* Basic box - filled background with border */
.box {
  background: var(--box-bg);
  border: 1px solid var(--box-border);
  border-radius: var(--box-radius);
  padding: 20px;
  margin: 10px 0;
}

/* Outlined box - border only, no fill */
.box-outlined {
  border: 1px solid var(--box-border);
  border-radius: var(--box-radius);
  padding: 20px;
  margin: 10px 0;
}

/* ===========================================
   BLOCKQUOTES
   =========================================== */

.reveal blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 20px;
  margin: 20px 0;
  font-style: italic;
  background: none;
  box-shadow: none;
  width: 100%;
  max-width: none;
}

.reveal blockquote cite {
  display: block;
  margin-top: 10px;
  font-style: normal;
  color: var(--muted-color);
}

/* ===========================================
   CALLOUTS - Accent-bordered containers
   =========================================== */

.callout {
  border-left: var(--accent-border-width) solid var(--primary-color);
  padding: 15px 20px;
  margin: 15px 0;
  background: #f9f9f9;
  border-radius: var(--box-radius);
  line-height: 1.4;
}

.callout p {
  margin: 0;
  line-height: 1.4;
}

/* Color variants */
.callout-blue {
  border-left-color: var(--blue);
  background: var(--blue-bg);
}

.callout-orange {
  border-left-color: var(--orange);
  background: var(--orange-bg);
}

.callout-green {
  border-left-color: var(--green);
  background: var(--green-bg);
}

.callout-gray {
  border-left-color: var(--gray);
  background: var(--gray-bg);
}

/* Bordered variant - adds border on all sides */
.callout-bordered {
  border: 1px solid var(--box-border);
  border-left: var(--accent-border-width) solid var(--primary-color);
}

.callout-bordered.callout-blue {
  border-color: var(--blue-border);
  border-left-color: var(--blue);
}

.callout-bordered.callout-orange {
  border-color: var(--orange-border);
  border-left-color: var(--orange);
}

.callout-bordered.callout-green {
  border-color: var(--green-border);
  border-left-color: var(--green);
}

.callout-bordered.callout-gray {
  border-color: var(--gray-border);
  border-left-color: var(--gray);
}

/* Top border variant */
.callout-top {
  border-left: none;
  border-top: var(--accent-border-width) solid var(--primary-color);
}

.callout-top.callout-blue { border-top-color: var(--blue); }
.callout-top.callout-orange { border-top-color: var(--orange); }
.callout-top.callout-green { border-top-color: var(--green); }
.callout-top.callout-gray { border-top-color: var(--gray); }

/* ===========================================
   OPTIONAL: TITLE WITH UNDERLINE

   Add this to presentations where you want
   a line under the slide title.
   =========================================== */

/*
.reveal .slides section > h1,
.reveal .slides section > h2 {
  flex-shrink: 0;
  margin: 0;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--line-color);
}
*/

/* ===========================================
   OPTIONAL: DECORATIVE ELEMENTS
   =========================================== */

/* Top decorative line on all slides */
/*
.reveal .slides section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-color);
}
*/

/* Bottom decorative line */
/*
.reveal .slides section::after {
  content: '';
  position: absolute;
  bottom: 40px;
  left: var(--slide-padding);
  right: var(--slide-padding);
  height: 2px;
  background: var(--line-color);
}
*/

/* ===========================================
   DEMO STYLES - Uncertainty bars, range bars, confidence labels
   =========================================== */

/* All demo slides: bottom dead space viewport-relative (tuned so total isn’t excessive) */
.reveal .slides section:has(.demo-container) .content {
  padding-bottom: var(--slide-padding-bottom-v);
  min-height: 0;
}

.demo-container {
  background: #fff;
  border: 1px solid var(--box-border);
  border-left: 4px solid var(--accent-cyan);
  border-radius: var(--box-radius);
  padding: var(--demo-container-padding);
  margin: 15px 0;
  color: var(--text-color);
  box-sizing: border-box;
  min-width: 0;   /* allow shrinking so children (e.g. wide select) don’t overflow */
}

.demo-container p,
.demo-container span,
.demo-container label {
  color: var(--text-color);
}

/* Semantic layout and typography within demos */
.demo-intro-para {
  margin-bottom: 0.75em;
}

.demo-spacer-bottom {
  margin-bottom: 1em;
}

.demo-block-spacer {
  margin-top: 20px;
}

.demo-spacer-top {
  margin-top: 12px;
}

.demo-score-value {
  font-size: 20pt;
  margin: 8px 0;
  color: var(--text-color);
}

.demo-top-label {
  font-size: 18pt;
  margin: 8px 0;
  color: var(--text-color);
}

.demo-controls-row {
  margin-bottom: 15px;
}

.demo-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 15px;
}

.demo-controls-grid-tight {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0;
}

.demo-title-inline {
  margin-left: 15px;
}

.demo-label-inline {
  margin: 0 8px;
}

.demo-divider {
  margin: 15px 0;
  border: none;
  border-top: 1px solid var(--box-border);
}

.demo-decision-heading {
  margin-top: 15px;
}

.demo-takeaway {
  margin-top: 12px;
  font-size: 14pt;
}

.demo-chart-wrap {
  position: relative;
  min-height: 180px;
  height: 28vh;   /* viewport-relative so chart gets more height, less bottom padding feel */
}

.demo-fusion-uncertainty {
  font-size: 14pt;
}

/* Fusion slide: two columns — left = demo, right = schematic */
.fusion-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

.fusion-demo-card {
  min-width: 0;
}

/* Tall demos (longitudinal, chromatography, contrastive): scrollable container so slide fits viewport and no page scrollbar. #demo-rwd excluded to avoid vertical slide indicator. */
#demo-longitudinal .content,
#demo-chromatography .content,
#demo-contrastive .content {
  min-height: 0;
  flex: 1 1 auto;
}

#demo-longitudinal .demo-container,
#demo-chromatography .demo-container,
#demo-contrastive .demo-container {
  max-height: calc(100vh - 240px);
  overflow-y: auto;
  box-sizing: border-box;
}

/* Hide Reveal.js vertical/slide indicator (dashed line on left) when on external-control slide only */
.reveal-viewport:has(.slides section.present#demo-rwd) .scrollbar {
  display: none !important;
}
.reveal-viewport:has(.slides section.present#demo-rwd) .controls .navigate-up,
.reveal-viewport:has(.slides section.present#demo-rwd) .controls .navigate-down {
  display: none !important;
}

.demo-title {
  font-size: var(--h3-size);
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-color);
}

/* Dot with bars: point estimate + uncertainty interval (for all quantitative number + uncertainty) */
.demo-dot-with-bars {
  margin: 8px 0;
}

.demo-dot-bars-track {
  height: 24px;
  background: var(--box-bg);
  border-radius: 4px;
  position: relative;
  overflow: visible;
}

.demo-dot-bars-ci {
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--uncertainty-bar);
  opacity: 0.5;
  border-radius: 2px;
}

/* Molecular slide: error bar = lighter shade of dot (primary blue) */
#demo-sequence-number .demo-dot-bars-ci {
  background: var(--primary-color);
  opacity: 0.4;
}

.demo-dot-bars-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--primary-color);
  z-index: 1;
}

.demo-range-bar {
  height: 24px;
  background: var(--box-bg);
  border-radius: 4px;
  position: relative;
  margin: 8px 0;
  overflow: hidden;
}

.demo-range-bar-tall {
  height: 28px;
}

.demo-range-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--primary-color);
  opacity: 0.6;
}

.demo-range-ci {
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--uncertainty-bar);
  opacity: 0.4;
}

/* Axis labels under range bars (0% … 100% or scale) */
.demo-range-axis {
  display: flex;
  justify-content: space-between;
  font-size: 12pt;
  color: var(--muted-color);
}

.demo-dist-bar {
  display: flex;
  align-items: center;
  margin: 6px 0;
  font-size: 14pt;
  color: var(--text-color);
}

.demo-dist-label {
  min-width: 140px;
  color: var(--text-color);
}

.demo-dist-bar-inner {
  flex: 1;
  height: 20px;
  background: var(--box-bg);
  border-radius: 4px;
  overflow: hidden;
  margin: 0 10px;
}

.demo-dist-bar-fill {
  height: 100%;
  background: var(--primary-color);
  border-radius: 4px;
}

.demo-warning {
  font-size: 12pt;
  color: var(--confidence-low);
  margin-top: 10px;
}

/* Paper / overview link: inline at bottom of demo container */
.demo-paper-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--nord4);
  background: var(--nord5);
  font-size: 12pt;
  color: var(--muted-color);
  transition: border-color 0.2s, background 0.2s;
}

.demo-paper-card:hover {
  border-color: var(--accent-cyan);
  background: var(--nord6);
}

.demo-paper-card a {
  color: var(--primary-color);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.demo-paper-card a:hover {
  color: var(--nord10);
}

.demo-paper-icon {
  font-size: 11pt;
  opacity: 0.8;
}

/* Tentatively deprecated slide — visible marker for deck review */
.potentially-deprecated {
  border-left: 4px dashed var(--muted-color);
}

.slide-deprecated-label {
  font-size: 12pt;
  font-style: italic;
  margin: 0.2em 0 0.4em 0;
}

.demo-confidence-high { color: var(--confidence-high); }
.demo-confidence-medium { color: var(--confidence-medium); }
.demo-confidence-low { color: var(--confidence-low); }

.demo-select, .demo-input {
  font-size: 14pt;
  padding: 6px 10px;
  border: 1px solid var(--box-border);
  border-radius: 4px;
  margin: 4px 8px 4px 0;
  max-width: 100%;
  box-sizing: border-box;
}

.demo-btn {
  font-size: 14pt;
  padding: 8px 20px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.demo-btn:hover {
  opacity: 0.9;
}

.demo-btn-secondary {
  background: var(--secondary-color);
}

.demo-tile-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 15px 0;
}

.demo-tile {
  width: 80px;
  height: 80px;
  border: 3px solid var(--box-border);
  border-radius: 8px;
  cursor: pointer;
  background: #e8e8e8;
}

.demo-tile.selected {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-color);
}

.demo-slider-row {
  display: flex;
  align-items: center;
  margin: 10px 0;
  gap: 15px;
}

.demo-slider-row label {
  min-width: 120px;
  font-size: 14pt;
}

.demo-slider {
  flex: 1;
  max-width: 300px;
}

/* ===========================================
   Problem classes slide: table + vertical rhythm + matched typography
   =========================================== */

/* ===========================================
   Framework slide: decision-first cards
   =========================================== */

.framework-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin: 1em 0 1.25em 0;
}

.framework-card {
  background: #fff;
  border: 1px solid var(--box-border);
  border-left: 4px solid var(--primary-color);
  border-radius: var(--box-radius);
  padding: 24px 28px;
  position: relative;
}

.framework-card:nth-child(2) {
  border-left-color: var(--secondary-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.framework-card-number {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 28pt;
  font-weight: 700;
  color: var(--primary-color);
  opacity: 0.35;
  line-height: 1;
}

.framework-card-title {
  font-size: 20pt;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0 0 0.4em 0;
}

.framework-card-body {
  font-size: 16pt;
  color: var(--text-color);
  line-height: 1.45;
  margin: 0;
}

.framework-close {
  font-size: 16pt;
  color: var(--muted-color);
  margin-top: 0.5em;
}

/* ===========================================
   Recap / Takeaways slide — Nord card theme
   =========================================== */

.takeaway-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 24px;
  margin-top: 0.75em;
}

.takeaway-card {
  background: #fff;
  border: 1px solid var(--box-border);
  border-radius: var(--box-radius);
  padding: 14px 18px;
  border-left: 4px solid var(--primary-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.takeaway-card:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(46, 52, 64, 0.12);
}

.takeaway-card--primary {
  border-left-color: var(--primary-color);
  background: rgba(94, 129, 172, 0.05);
}

.takeaway-card--secondary {
  border-left-color: var(--secondary-color);
  background: rgba(163, 190, 140, 0.08);
}

.takeaway-card--accent {
  border-left-color: var(--accent-cyan);
  background: rgba(136, 192, 208, 0.06);
}

.takeaway-card-label {
  display: block;
  font-size: 15pt;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.takeaway-card--secondary .takeaway-card-label {
  color: var(--secondary-color);
}

.takeaway-card--accent .takeaway-card-label {
  color: var(--accent-cyan);
}

.takeaway-card-body {
  font-size: 14pt;
  color: var(--text-color);
  line-height: 1.4;
  margin: 0;
}

#recap .demo-slide-subtitle {
  margin-bottom: 0.25em;
}

/* ===========================================
   Problem classes slide
   =========================================== */

.problem-classes-content {
  padding-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.problem-classes-intro {
  font-size: 20pt !important;
  color: var(--text-color) !important;
  margin-bottom: 1em !important;
  line-height: 1.35;
}

/* Flip cards: 4 top row, 3 bottom row; rows centered */
.problem-classes-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 0 0 1.25em 0;
}

.flip-card {
  width: calc((100% - 3 * 16px) / 4);
  aspect-ratio: 4 / 3;
  perspective: 800px;
  cursor: pointer;
  outline: none;
}

.flip-card:focus-visible .flip-card-inner {
  box-shadow: 0 0 0 3px var(--primary-color);
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
  border-radius: var(--box-radius);
  border: 1px solid var(--box-border);
  background: var(--box-bg);
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  border-radius: var(--box-radius);
  box-sizing: border-box;
}

.flip-card-front {
  background: rgba(94, 129, 172, 0.08);
  border: 1px solid rgba(94, 129, 172, 0.2);
  color: var(--text-color);
}

.flip-card-front p,
.flip-card-back p {
  margin: 0;
  font-size: 14pt;
  line-height: 1.35;
  color: var(--text-color);
  text-align: center;
}

.flip-card-back {
  background: var(--box-bg);
  border: 1px solid var(--box-border);
  transform: rotateY(180deg);
  color: var(--text-color);
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 10px;
  overflow-y: auto;
}

.flip-card-back p {
  font-weight: 500;
  margin-bottom: 8px;
}

.flip-card-back .flip-card-table {
  width: 100%;
  max-width: 100%;
  font-size: 9pt;
  line-height: 1.25;
  border-collapse: collapse;
  color: var(--text-color);
  margin-top: 0;
}

.flip-card-back .flip-card-table th,
.flip-card-back .flip-card-table td {
  padding: 2px 4px;
  text-align: left;
  border: 1px solid var(--nord4);
}

.flip-card-back .flip-card-table th {
  font-weight: 600;
  background: rgba(94, 129, 172, 0.1);
  color: var(--primary-color);
}

.problem-classes-examples {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 1em;
  margin-bottom: 1em;
}

.problem-classes-box {
  background: rgba(94, 129, 172, 0.06);
  border: 1px solid rgba(94, 129, 172, 0.25);
  border-radius: var(--box-radius);
  padding: 16px 20px;
  font-size: 16pt;
  color: var(--text-color) !important;
}

.problem-classes-box strong,
.problem-classes-box code {
  color: var(--text-color);
}

.problem-classes-box code {
  font-size: 14pt;
}

.problem-classes-close {
  font-size: 16pt !important;
  color: var(--text-color) !important;
  margin-top: 0.75em !important;
  line-height: 1.4;
}

/* ===========================================
   Sample data tables slide (dropdown + live table)
   =========================================== */

.sample-data-table-wrapper {
  overflow-x: auto;
  margin-top: 0.5em;
  border: 1px solid var(--box-border);
  border-radius: var(--box-radius);
  background: #fff;
}

.sample-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15pt;
}

.sample-data-table th,
.sample-data-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--box-border);
  color: var(--text-color);
}

.sample-data-table th {
  font-weight: 600;
  color: var(--primary-color);
  background: rgba(94, 129, 172, 0.1);
}

/* Outcome / number column: subtle shade so it's obvious that's what we're predicting */
.sample-data-table th.number-col,
.sample-data-table td.number-col {
  background: rgba(163, 190, 140, 0.25);
}

.sample-data-table th.number-col {
  background: rgba(163, 190, 140, 0.35);
  color: #616f4a;
}

.sample-data-table tbody tr:last-child td {
  border-bottom: none;
}

.sample-data-table tbody tr:hover td.number-col {
  background: rgba(163, 190, 140, 0.35);
}

.sample-data-table tbody tr:hover {
  background: rgba(136, 192, 208, 0.08);
}

.sample-data-table-warning {
  margin-top: 1em;
  padding: 0.75em 1em;
  border-radius: var(--box-radius);
  border-left: 4px solid var(--confidence-low);
  background: rgba(191, 97, 106, 0.12);
}

.sample-data-table-warning.is-hidden {
  display: none;
}

.sample-data-table-warning .demo-warning {
  margin-top: 0;
}

.sample-data-table-wrapper--incomparable {
  border-color: rgba(191, 97, 106, 0.4);
  background: rgba(191, 97, 106, 0.05);
}

/* ===========================================
   Chromatography demo: human vs model integration
   =========================================== */

.chrom-toggle-row {
  margin: 12px 0 16px 0;
}

.chrom-mode-btn {
  margin-right: 10px;
}

.chrom-human-layout {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 1rem;
  align-items: stretch;
  margin: 12px 0;
}

.chrom-human-layout .chrom-chart-wrap {
  flex: 0 0 auto;
  width: 100%;
  min-height: 200px;
}

.chrom-right-column {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.essay-chrom-demo .chrom-human-panel.is-hidden,
.essay-chrom-demo .chrom-model-panel.is-hidden {
  display: none;
}

.chrom-human-panel {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--box-bg);
  border: 1px solid var(--box-border);
  border-radius: 6px;
  box-sizing: border-box;
}

.chrom-human-panel-label {
  display: block;
  font-size: 11pt;
  font-weight: 600;
  margin-bottom: 0.35em;
  color: var(--text-color);
}

.chrom-next-click {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 1rem;
}

.chrom-bounds-display {
  font-size: 12pt;
  margin-bottom: 0.75rem;
}

.chrom-bound-line,
.chrom-area-line {
  margin: 0.35em 0;
}

.chrom-bound-label {
  display: inline-block;
  min-width: 6em;
  color: var(--muted-color);
}

.chrom-bound-value,
.chrom-area-value {
  font-family: var(--mono-font);
  font-weight: 600;
}

.chrom-human-hint {
  font-size: 10pt;
  color: var(--muted-color);
  margin: 0;
}

.chrom-chart-wrap {
  position: relative;
  min-height: 200px;
  height: 28vh;
  margin: 0;
}

.essay-chrom-demo .chrom-human-layout .chrom-chart-wrap {
  flex: 0 0 220px;
  margin: 0;
  height: 220px;
  min-height: 220px;
  width: 100%;
}

.chrom-note {
  margin-top: 10px;
  font-size: 14pt;
}

.chrom-model-panel {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--box-bg);
  border: 1px solid var(--box-border);
  border-radius: 6px;
  box-sizing: border-box;
  overflow: auto;
  font-size: 11pt;
}

.essay-chrom-demo .chrom-right-column .chrom-model-panel .chrom-params-title {
  font-size: 12pt;
  margin-bottom: 8px;
}

.essay-chrom-demo .chrom-right-column .chrom-model-panel .chrom-params-table {
  font-size: 11pt;
  margin-bottom: 8px;
}

.essay-chrom-demo .chrom-right-column .chrom-model-panel .chrom-interp-note {
  font-size: 10pt;
  margin: 0;
}

.chrom-note.is-hidden {
  display: none;
}

.chrom-params-title {
  font-size: 14pt;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.chrom-params-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13pt;
  margin-bottom: 12px;
}

.chrom-params-table th,
.chrom-params-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--box-border);
}

.chrom-params-table th {
  font-weight: 600;
  color: var(--primary-color);
}

.chrom-interp-note {
  font-size: 13pt;
  color: var(--muted-color);
  margin: 0;
}

/* ===========================================
   ESSAY LAYOUT (index.html) — written essay with margin/side notes
   =========================================== */

html {
  scroll-behavior: smooth;
}

.essay-page {
  font-family: var(--body-font);
  font-size: 11pt;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  min-height: 100vh;
}

/* MkDocs-style left navigation */
.essay-nav {
  flex-shrink: 0;
  width: 16rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--box-bg);
  border-right: 1px solid var(--box-border);
  padding: 1.5rem 0;
}

.essay-nav-inner {
  padding: 0 1rem;
}

.essay-nav-section {
  margin-bottom: 1.25rem;
}

.essay-nav-section:last-child {
  margin-bottom: 0;
}

.essay-nav-section-title {
  font-family: var(--heading-font);
  font-size: 10pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-color);
  margin: 0 0 0.5rem 0;
  padding: 0 0.25rem;
}

.essay-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.essay-nav-list li {
  margin-bottom: 0.25rem;
}

.essay-nav-list a {
  display: block;
  padding: 0.35rem 0.5rem;
  font-size: 11pt;
  color: var(--text-color);
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease;
}

.essay-nav-list a:hover {
  background: rgba(94, 129, 172, 0.12);
  color: var(--primary-color);
}

.essay-nav-list a:active {
  background: rgba(94, 129, 172, 0.18);
}

.essay {
  flex: 1;
  min-width: 0;
  max-width: 52rem;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

@media (max-width: 768px) {
  .essay-nav {
    display: none;
  }
  .essay-page {
    padding: 2rem 1rem 4rem;
  }
}

.essay-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--line-color);
}

.essay-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.essay-title {
  font-family: var(--heading-font);
  font-size: 28pt;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 0.35em 0;
}

.essay-byline {
  font-size: 12pt;
  color: var(--muted-color);
  margin: 0;
}

.essay-lead {
  font-size: 13pt;
  line-height: 1.65;
  margin: 0 0 2rem 0;
  color: var(--text-color);
}


.essay-section {
  margin-bottom: 2.5rem;
}

.essay-section-title {
  font-family: var(--heading-font);
  font-size: 18pt;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0 0 0.75em 0;
}

.essay-section p {
  margin: 0 0 1em 0;
}

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

.essay-list {
  margin: 0 0 1em 0;
  padding-left: 1.5em;
}

.essay-list li {
  margin-bottom: 0.5em;
}

/* In-essay demo block (e.g. chromatography) */
.essay-demo {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid var(--box-border);
  border-left: 4px solid var(--accent-cyan);
  border-radius: var(--box-radius);
  box-sizing: border-box;
}

.essay-demo .essay-demo-title,
.essay-demo .demo-title {
  font-size: 12pt;
  font-weight: 600;
  margin-bottom: 0.75em;
}

/* Cell painting & SAM 2 demo */
.essay-sam2-demo .sam2-status {
  font-size: 11pt;
  color: var(--muted-color);
  margin-bottom: 0.75rem;
}

.essay-sam2-demo .sam2-demo-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-start;
}

.essay-sam2-demo .sam2-image-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 512px;
  max-width: 100%;
  height: 512px;
  cursor: pointer;
}

.essay-sam2-demo .sam2-image,
.essay-sam2-demo .sam2-overlay,
.essay-sam2-demo .sam2-points {
  position: absolute;
  left: 0;
  top: 0;
  width: 512px;
  height: 512px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.essay-sam2-demo .sam2-image {
  z-index: 0;
}

.essay-sam2-demo .sam2-overlay {
  z-index: 1;
  pointer-events: none;
}

.essay-sam2-demo .sam2-points {
  z-index: 2;
  pointer-events: none;
}

.essay-sam2-demo .sam2-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-width: 200px;
}

.essay-sam2-demo .sam2-point-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.essay-sam2-demo .sam2-point-mode-label {
  font-size: 11pt;
  font-weight: 600;
  margin-right: 0.25rem;
}

.essay-sam2-demo .sam2-mode-btn.is-positive {
  font-weight: 600;
}

.essay-demo-note {
  font-size: 11pt;
  color: var(--muted-color);
  margin-top: 1rem;
  margin-bottom: 0;
}

.essay-chrom-demo .chrom-chart-wrap {
  height: 220px;
  margin: 0.75em 0;
}

/* Molecule property demo: flip card with prediction (front) and training table (back) */
.prop-flip-card-wrap {
  position: relative;
}

.prop-flip-card-wrap .prop-flip-card {
  height: 340px;
  perspective: 1000px;
}

.prop-flip-card-wrap .prop-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

.prop-flip-card-wrap.prop-flipped .prop-flip-inner {
  transform: rotateY(180deg);
}

.prop-flip-card-wrap .prop-flip-front,
.prop-flip-card-wrap .prop-flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--box-border);
  border-radius: var(--box-radius);
  padding: 1rem 1.25rem;
  box-sizing: border-box;
}

.prop-flip-card-wrap .prop-flip-back {
  transform: rotateY(180deg);
}

.prop-flip-card-wrap .prop-flip-front {
  position: relative;
  overflow: hidden;
}

.prop-flip-card-wrap .prop-flip-front .prop-demo-layout {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.prop-flip-card-wrap .prop-flip-front .prop-demo-left {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 100%;
}

.prop-flip-card-wrap .prop-flip-front .prop-mol-view {
  width: 200px;
  height: 200px;
  max-width: 100%;
  max-height: calc(100% - 4rem);
}

.prop-flip-card-wrap .prop-flip-btn {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
}

.prop-flip-card-wrap .prop-flip-back-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.prop-flip-card-wrap .prop-flip-back-title {
  flex: 0 0 auto;
  font-size: 11pt;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0 0 0.5rem 0;
}

.prop-flip-card-wrap .prop-training-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--box-border);
  border-radius: var(--box-radius);
}

.prop-flip-card-wrap .prop-training-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10pt;
}

.prop-flip-card-wrap .prop-training-table th,
.prop-flip-card-wrap .prop-training-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--box-border);
}

.prop-flip-card-wrap .prop-training-table th {
  font-weight: 600;
  color: var(--primary-color);
  background: var(--box-bg);
  position: sticky;
  top: 0;
  z-index: 1;
}

.prop-flip-card-wrap .prop-training-table code {
  font-size: 9pt;
  word-break: break-all;
}

/* Part 2: Data-first flip card (describe vs table) */
.data-first-flip-wrap {
  position: relative;
}

.data-first-flip-wrap .prop-flip-card {
  height: 380px;
  perspective: 1000px;
}

.data-first-flip-wrap .prop-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

.data-first-flip-wrap.data-first-flipped .prop-flip-inner {
  transform: rotateY(180deg);
}

.data-first-flip-wrap .prop-flip-front,
.data-first-flip-wrap .prop-flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--box-border);
  border-radius: var(--box-radius);
  padding: 1rem 1.25rem;
  box-sizing: border-box;
}

.data-first-flip-wrap .prop-flip-back {
  transform: rotateY(180deg);
}

.data-first-flip-wrap .data-first-prose {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.data-first-prose-label {
  font-size: 10pt;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0 0 0.5rem 0;
}

.data-first-prose-text {
  font-size: 11pt;
  line-height: 1.55;
  color: var(--text-color);
  margin: 0 0 0.75rem 0;
}

.data-first-prose-hint {
  font-size: 10pt;
  color: var(--muted-color);
  margin: 0;
  font-style: italic;
}

.data-first-flip-wrap .prop-flip-btn {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
}

.data-first-flip-wrap .prop-flip-back-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.data-first-flip-wrap .prop-flip-back-content .prop-flip-back-title {
  flex: 0 0 auto;
  font-size: 11pt;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0 0 0.5rem 0;
}

.data-first-flip-wrap .prop-training-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--box-border);
  border-radius: var(--box-radius);
}

.data-first-flip-wrap .prop-training-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10pt;
}

.data-first-flip-wrap .prop-training-table th,
.data-first-flip-wrap .prop-training-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--box-border);
}

.data-first-flip-wrap .prop-training-table th {
  font-weight: 600;
  color: var(--primary-color);
  background: var(--box-bg);
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-first-flip-wrap .prop-training-table code {
  font-size: 9pt;
  word-break: break-all;
}

/* Part 2: impact flip card (audience interaction — reveal example) */
.impact-flip-wrap {
  position: relative;
}

.impact-flip-wrap .impact-flip-card {
  height: 220px;
  perspective: 1000px;
}

.impact-flip-wrap .impact-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

.impact-flip-wrap.impact-flipped .impact-flip-inner {
  transform: rotateY(180deg);
}

.impact-flip-wrap .impact-flip-front,
.impact-flip-wrap .impact-flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: #fff;
  border: 1px solid var(--box-border);
  border-radius: var(--box-radius);
  padding: 1.5rem 1.25rem;
  box-sizing: border-box;
}

.impact-flip-wrap .impact-flip-back {
  transform: rotateY(180deg);
  justify-content: flex-start;
  align-items: stretch;
  text-align: left;
  overflow: auto;
}

.impact-flip-prompt {
  font-size: 16pt;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 0.75rem 0;
  line-height: 1.4;
}

.impact-flip-instruction {
  font-size: 12pt;
  color: var(--muted-color);
  margin: 0;
  line-height: 1.5;
  max-width: 28em;
}

.impact-flip-back-title {
  font-size: 11pt;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0 0 0.75rem 0;
}

/* Two individually flippable ask cards (surfaced, no wrapper box) */
.impact-ask-intro {
  font-size: 11pt;
  color: var(--muted-color);
  margin: 0.5rem 0 0.75rem 0;
}

.impact-ask-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0 0 1.5rem 0;
}

.impact-ask-card {
  perspective: 800px;
  cursor: pointer;
  outline: none;
  min-height: 160px;
}

.impact-ask-card:focus-visible {
  box-shadow: 0 0 0 3px var(--primary-color);
  border-radius: var(--box-radius);
}

.impact-ask-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 160px;
  transition: transform 0.45s ease;
  transform-style: preserve-3d;
}

.impact-ask-card.is-flipped .impact-ask-card-inner {
  transform: rotateY(180deg);
}

.impact-ask-card-front,
.impact-ask-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.25rem 1rem;
  border-radius: var(--box-radius);
  border: 1px solid var(--box-border);
  box-sizing: border-box;
}

.impact-ask-card-front {
  background: var(--box-bg);
}

.impact-ask-card-back {
  transform: rotateY(180deg);
  justify-content: flex-start;
  align-items: stretch;
  text-align: left;
  overflow: auto;
  background: #fff;
}

.impact-ask-card--curiosity .impact-ask-card-front,
.impact-ask-card--curiosity .impact-ask-card-back {
  border-left: 4px solid var(--muted-color);
}

.impact-ask-card--impact .impact-ask-card-front,
.impact-ask-card--impact .impact-ask-card-back {
  border-left: 4px solid var(--secondary-color);
}

.impact-ask-card-label {
  display: block;
  font-size: 12pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.impact-ask-card--curiosity .impact-ask-card-label {
  color: var(--muted-color);
}

.impact-ask-card--impact .impact-ask-card-label {
  color: var(--secondary-color);
}

.impact-ask-card-hint {
  font-size: 11pt;
  color: var(--muted-color);
  margin: 0;
  line-height: 1.4;
}

.impact-ask-card-body {
  font-size: 12pt;
  line-height: 1.5;
  color: var(--text-color);
  margin: 0 0 0.5rem 0;
}

.impact-ask-card-meta {
  font-size: 10pt;
  color: var(--muted-color);
  margin: 0;
  line-height: 1.4;
}

.impact-flip-wrap .impact-flip-btn {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
}

/* Taller back when content (two cards) needs more space */
.impact-flip-wrap .impact-flip-card {
  height: auto;
  min-height: 220px;
}

.impact-flip-wrap.impact-flipped .impact-flip-card {
  min-height: 320px;
}

/* Part 2: domain-shift demo */
.essay-demo-domain-shift .essay-demo-caption {
  font-size: 11pt;
  color: var(--muted-color);
  margin: 0 0 0.75rem 0;
  line-height: 1.5;
}

.domain-shift-chart-wrap {
  height: 200px;
  position: relative;
  margin: 0.75rem 0;
}

.essay-demo-clustering .essay-demo-caption {
  font-size: 11pt;
  color: var(--muted-color);
  margin: 0 0 0.75rem 0;
  line-height: 1.5;
}

.clustering-chart-wrap {
  height: 280px;
  position: relative;
  margin: 0.75rem 0;
}

/* Part 2: impact vs curiosity cards */
.essay-framework-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.25rem 0;
}

.essay-framework-card {
  background: #fff;
  border: 1px solid var(--box-border);
  border-radius: var(--box-radius);
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--primary-color);
}

.essay-framework-card--curiosity {
  border-left-color: var(--muted-color);
  background: var(--box-bg);
}

.essay-framework-card--impact {
  border-left-color: var(--secondary-color);
  background: rgba(163, 190, 140, 0.08);
}

.essay-framework-card-label {
  display: block;
  font-size: 11pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.essay-framework-card--curiosity .essay-framework-card-label {
  color: var(--muted-color);
}

.essay-framework-card--impact .essay-framework-card-label {
  color: var(--secondary-color);
}

.essay-framework-card-body {
  font-size: 12pt;
  line-height: 1.5;
  color: var(--text-color);
  margin: 0 0 0.5rem 0;
}

.essay-framework-card-meta {
  font-size: 10pt;
  color: var(--muted-color);
  margin: 0;
  line-height: 1.4;
}

/* Molecule property demo: 2D structure + horizontal bar chart */
.essay-prop-demo .prop-demo-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}

.essay-prop-demo .prop-demo-left {
  flex: 0 0 auto;
}

.essay-prop-demo .prop-demo-label {
  display: block;
  font-size: 11pt;
  font-weight: 600;
  margin-bottom: 0.4em;
  color: var(--text-color);
}

.essay-prop-demo .prop-mol-select {
  margin-bottom: 0.75em;
  min-width: 180px;
}

.essay-prop-demo .prop-mol-view {
  width: 240px;
  height: 240px;
  border: 1px solid var(--box-border);
  border-radius: var(--box-radius);
  background: #ffffff;
  overflow: hidden;
}

.essay-prop-demo .prop-mol-view canvas,
.essay-prop-demo .prop-mol-view img.prop-mol-structure {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}

/* Lighten any gray baked into structure images from external APIs */
.essay-prop-demo .prop-mol-view img.prop-mol-structure {
  filter: brightness(1.08) contrast(1.02);
}

.essay-prop-demo .prop-demo-right {
  flex: 1 1 280px;
  min-width: 0;
}

.essay-prop-demo .prop-chart-caption {
  font-size: 10pt;
  color: var(--muted-color);
  margin: 0 0 0.5em 0;
}

.essay-prop-demo .prop-chart-wrap {
  height: 180px;
  position: relative;
}

/* Structure demo: full-width dropdown, then two halves — sequence left, 3D right */
.essay-struct-demo .struct-demo-header {
  margin-bottom: 1rem;
}

.essay-struct-demo .struct-demo-label {
  display: block;
  font-size: 11pt;
  font-weight: 600;
  margin-bottom: 0.35em;
  color: var(--text-color);
}

.essay-struct-demo .struct-nb-select {
  width: 100%;
  box-sizing: border-box;
}

.essay-struct-demo .struct-demo-layout {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 1.5rem;
  align-items: stretch;
}

.essay-struct-demo .struct-demo-left {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.essay-struct-demo .struct-seq-wrap {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--box-bg);
  border: 1px solid var(--box-border);
  border-radius: 6px;
  overflow: auto;
  box-sizing: border-box;
}

.essay-struct-demo .struct-seq {
  font-family: var(--mono-font);
  font-size: 10pt;
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-color);
}

.essay-struct-demo .struct-demo-right {
  flex: 1 1 0;
  min-width: 0;
}

.essay-struct-demo .struct-viewer {
  position: relative;
  width: 100%;
  min-width: 280px;
  height: 320px;
  min-height: 280px;
  background: #fff;
  border: 1px solid var(--box-border);
  border-radius: 6px;
  overflow: hidden;
  isolation: isolate;
}

.essay-struct-demo .struct-viewer canvas {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  display: block;
}

/* Generative design: diffusion animation (GIF from IPD) */
.essay-gen-demo {
  margin: 1.5rem 0;
}

.essay-gen-demo .gen-diffusion-viewer {
  width: 100%;
  text-align: center;
}

.essay-gen-demo .gen-diffusion-gif {
  display: block;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.essay-gen-demo .gen-diffusion-caption {
  font-size: 11pt;
  color: var(--muted-color);
  margin: 0.5rem 0 0 0;
}

.essay-gen-demo .gen-diffusion-credit {
  display: block;
  font-style: normal;
  margin-top: 0.35rem;
  font-size: 10pt;
}

.essay-gen-demo .gen-diffusion-credit a {
  color: var(--primary-color);
  text-decoration: none;
}

.essay-gen-demo .gen-diffusion-credit a:hover {
  text-decoration: underline;
}

/* Drawer: slide-in panel from the right (demos & notes) */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  pointer-events: none;
  visibility: hidden;
}

.drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(46, 52, 64, 0.25);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.drawer.is-open .drawer-backdrop {
  opacity: 1;
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 90vw);
  max-width: 100%;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer.is-open .drawer-panel {
  transform: translateX(0);
}

.drawer-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--box-border);
}

.drawer-title {
  font-family: var(--heading-font);
  font-size: 14pt;
  font-weight: 600;
  margin: 0;
  color: var(--text-color);
}

.drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--muted-color);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.drawer-close:hover {
  background: var(--box-bg);
  color: var(--text-color);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem 1.5rem;
}

.drawer-section {
  margin-bottom: 1.5rem;
}

.drawer-section:last-child {
  margin-bottom: 0;
}

.drawer-section-title {
  font-family: var(--heading-font);
  font-size: 11pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary-color);
  margin: 0 0 0.6rem 0;
}

.drawer-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.drawer-list li {
  margin-bottom: 0.5rem;
  font-size: 11pt;
  line-height: 1.5;
}

.drawer-list a {
  color: var(--primary-color);
}

.drawer-list a:hover {
  text-decoration: underline;
}

.drawer-note {
  margin-bottom: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--box-border);
}

.drawer-note:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.drawer-note-label {
  display: block;
  font-weight: 600;
  font-size: 10pt;
  color: var(--primary-color);
  margin-bottom: 0.35rem;
}

.drawer-note p {
  margin: 0;
  font-size: 11pt;
  line-height: 1.5;
  color: var(--text-color);
}

body.drawer-open {
  overflow: hidden;
}

/* Placeholder / interactive zone */
.essay-interactive-zone .essay-placeholder {
  color: var(--muted-color);
  font-style: italic;
}

.essay-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--box-border);
  font-size: 11pt;
  color: var(--muted-color);
}

.essay-footer a {
  color: var(--primary-color);
}
