/* ═══════════════════════════════════════════════════════════════════════════
   canvas-folio — Overlay
   Full-screen overlay panel for viewing portfolio item detail pages.
   Paste-board themed interior: taped images, pinned cards, sticky-note
   callouts, organic rotations — matching the canvas aesthetic.
   Tokens from tokens.css (paste-board design system).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Container ────────────────────────────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity var(--dur-fast, 0.3s) ease,
    visibility var(--dur-fast, 0.3s) ease;
}

.overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ─── Backdrop ─────────────────────────────────────────────────────────── */

.overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(44, 36, 22, 0.45);
  transition: opacity 0.25s ease;
}

/* ─── Sheet (outer wrapper) ────────────────────────────────────────────── */

.overlay-sheet {
  position: relative;
  z-index: 101;
  width: 90vw;
  height: 90vh;

  transform: scale(0.92);
  opacity: 0;
  transition:
    transform 0.35s var(--spring, cubic-bezier(0.34, 1.56, 0.64, 1)),
    opacity 0.35s var(--spring, cubic-bezier(0.34, 1.56, 0.64, 1));
}

.overlay.is-open .overlay-sheet {
  transform: scale(1);
  opacity: 1;
}

/* ─── Panel (scrollable inner) ─────────────────────────────────────────── */

.overlay-panel {
  width: 100%;
  height: 100%;
  background: #ffffff;
  border: 1px solid var(--color-border, #c7b9a5);
  border-radius: 4px;
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
}

/* ─── Close Button ─────────────────────────────────────────────────────── */

.overlay-close {
  position: absolute;
  top: -18px;
  right: -18px;
  z-index: 102;
  width: 48px;
  height: 48px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--color-sticky, #ffd54f);
  color: var(--color-text-primary, #2c2416);
  font-family: var(--font-hand, 'Caveat', cursive);
  font-size: 2rem;
  font-weight: var(--weight-bold, 700);
  line-height: 1;

  border: 2px solid rgba(44, 36, 22, 0.15);
  border-radius: 50%;
  box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;

  transform: rotate(-6deg);
  transition:
    transform var(--dur-fast, 0.3s) var(--spring, cubic-bezier(0.34, 1.56, 0.64, 1)),
    box-shadow var(--dur-fast, 0.3s) ease;
}

.overlay-close:hover {
  transform: rotate(0deg) scale(1.1);
  box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.22);
}

.overlay-close:focus-visible {
  outline: 2px solid var(--color-accent, #e85d2f);
  outline-offset: 2px;
}

/* ─── Content Area ─────────────────────────────────────────────────────── */

.overlay-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 80px;
}

@media (max-width: 640px) {
  .overlay-content {
    padding: 24px 16px;
  }
}

/* ─── Hero Section ─────────────────────────────────────────────────────── */

.overlay-hero {
  text-align: center;
  margin-bottom: 48px;
}

/* ─── Title ────────────────────────────────────────────────────────────── */

.overlay-title {
  font-family: var(--font-editorial, 'Playfair Display', serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: var(--weight-regular, 400);
  line-height: 1.15;
  color: var(--color-text-primary, #2c2416);
  margin-bottom: 12px;
}

/* ─── Subtitle / Tagline ──────────────────────────────────────────────── */

.overlay-subtitle {
  font-family: var(--font-hand, 'Caveat', cursive);
  font-size: 1.25rem;
  font-weight: var(--weight-semibold, 600);
  color: var(--color-text-muted, #5a4e3a);
}

/* ─── Tags ─────────────────────────────────────────────────────────────── */

.overlay-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm, 8px);
  justify-content: center;
  margin-top: 20px;
}

.overlay-tag {
  font-family: var(--font-hand, 'Caveat', cursive);
  font-size: var(--size-label, 0.875rem);
  font-weight: var(--weight-semibold, 600);
  color: var(--color-white, #ffffff);
  background: var(--color-secondary, #3d6b4f);
  padding: var(--space-xs, 4px) 14px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

/* ─── Body Text ────────────────────────────────────────────────────────── */

.overlay-body {
  font-family: var(--font-body, 'Lora', serif);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--color-text-primary, #2c2416);
  margin-bottom: 32px;
}

.overlay-body p {
  margin-bottom: 1.25em;
}

/* ─── Section Titles ──────────────────────────────────────────────────── */

.overlay-section-title {
  font-family: var(--font-hand, 'Caveat', cursive);
  font-size: 1.5rem;
  font-weight: var(--weight-bold, 700);
  color: var(--color-accent, #e85d2f);
  margin-bottom: 12px;
  margin-top: 40px;
}

/* ─── Lists (bullet points) ──────────────────────────────────────────── */

.overlay-list {
  font-family: var(--font-body, 'Lora', serif);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--color-text-primary, #2c2416);
  margin: 0 0 1.25em 0;
  padding-left: 1.5em;
}

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

.overlay-list li::marker {
  color: var(--color-accent, #e85d2f);
}

/* ─── Section Subtitle (h4 — phases, sub-sections) ───────────────────── */

.overlay-section-subtitle {
  font-family: var(--font-editorial, 'Playfair Display', serif);
  font-size: 1.15rem;
  font-weight: var(--weight-semibold, 600);
  color: var(--color-text-primary, #2c2416);
  margin-top: 32px;
  margin-bottom: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PASTE-BOARD THEMED COMPONENTS
   All image containers, callouts, stats, and details use the same organic
   paper/tape/pin aesthetic as the canvas items outside the overlay.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Split Hero — text left, image right (case study layout) ──────────── */
/* Two-column hero: title + subtitle + intro on the left, product image
   on the right. The image sits on a slightly rotated white photo border
   with a tape strip, matching the paste-board aesthetic.                   */

.overlay-hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  margin: -20px -20px 40px -20px;
  padding: 40px;
  background: linear-gradient(135deg, var(--color-surface-mid, #ede4d3) 0%, var(--color-surface-light, #fff8e7) 100%);
  border-radius: 4px 4px 0 0;
  border-bottom: 1px solid var(--color-border, #c7b9a5);
}

.overlay-hero-text {
  text-align: left;
}

.overlay-hero-text .overlay-title {
  text-align: left;
}

.overlay-hero-text .overlay-subtitle {
  text-align: left;
}

.overlay-hero-text .overlay-tags {
  justify-content: flex-start;
}

.overlay-hero-intro {
  font-family: var(--font-body, 'Lora', serif);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text-muted, #5a4e3a);
  margin-top: 20px;
}

/* Image side — taped photo on the board */
.overlay-hero-image {
  position: relative;
  padding: 10px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 2px;
  box-shadow:
    3px 4px 12px rgba(0, 0, 0, 0.12),
    0 1px 3px rgba(0, 0, 0, 0.06);
  transform: rotate(1.2deg);
}

/* Tape strip on hero image */
.overlay-hero-image::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  width: 90px;
  height: 24px;
  background: rgba(212, 184, 120, 0.45);
  border: 1px solid rgba(212, 184, 120, 0.25);
  z-index: 2;
  pointer-events: none;
}

.overlay-hero-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

/* ─── Project Details — index card pinned to board ────────────────────── */
/* Looks like a slightly rotated index card with a pin at top-left.        */

.overlay-details {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-lg, 24px);
  padding: var(--space-lg, 24px) var(--space-lg, 24px) var(--space-lg, 24px) 32px;
  background: #faf6ee;
  border: 1px solid var(--color-border, #c7b9a5);
  border-radius: 2px;
  margin-bottom: 40px;
  transform: rotate(-0.4deg);
  box-shadow:
    2px 3px 6px rgba(0, 0, 0, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Red pin dot on the index card */
.overlay-details::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 20px;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at 40% 35%, #f06040, #c0392b);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  z-index: 1;
}

.overlay-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.overlay-detail-label {
  font-family: var(--font-hand, 'Caveat', cursive);
  font-size: var(--size-label, 0.875rem);
  font-weight: var(--weight-bold, 700);
  color: var(--color-accent, #e85d2f);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.overlay-detail-value {
  font-family: var(--font-body, 'Lora', serif);
  font-size: 0.9375rem;
  color: var(--color-text-primary, #2c2416);
  line-height: 1.5;
}

/* ─── Full-Width Image — taped screenshot ─────────────────────────────── */
/* Each full-width image sits on a white photo border with a tape strip
   at top center, like a print taped to the board.                         */

.overlay-img-full {
  position: relative;
  width: 100%;
  margin: 40px 0;
  padding: 10px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 2px;
  box-shadow:
    3px 4px 10px rgba(0, 0, 0, 0.1),
    0 1px 3px rgba(0, 0, 0, 0.06);
  transform: rotate(0.3deg);
}

/* Tape strip on full-width images */
.overlay-img-full::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-1deg);
  width: 90px;
  height: 24px;
  background: rgba(212, 184, 120, 0.45);
  border: 1px solid rgba(212, 184, 120, 0.25);
  z-index: 2;
  pointer-events: none;
}

/* Placeholder full-width (div) */
div.overlay-img-full {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted, #5a4e3a);
  font-family: var(--font-hand, 'Caveat', cursive);
  font-size: 1rem;
}

/* Real full-width image */
img.overlay-img-full {
  display: block;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  height: auto;
  object-fit: contain;
  padding: 10px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 2px;
  box-shadow:
    3px 4px 10px rgba(0, 0, 0, 0.1),
    0 1px 3px rgba(0, 0, 0, 0.06);
}

/* When img is inside a wrapper that has the tape, reset the img itself */
.overlay-img-full img {
  display: block;
  width: 100%;
  height: auto;
}

/* ─── Image Grid — 2-column side-by-side with tape ───────────────────── */

.overlay-img-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 720px;
  margin: 40px 0;
}

.overlay-img-grid--three {
  grid-template-columns: 1fr 1fr 1fr;
}

/* Each grid image: white photo border, slight rotation, tape at top */
.overlay-img-half {
  position: relative;
  padding: 8px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 2px;
  box-shadow:
    2px 3px 8px rgba(0, 0, 0, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Alternate rotations for organic feel */
.overlay-img-half:nth-child(odd) {
  transform: rotate(-0.8deg);
}

.overlay-img-half:nth-child(even) {
  transform: rotate(0.6deg);
}

/* Tape strips on grid images */
.overlay-img-half::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(1.5deg);
  width: 70px;
  height: 20px;
  background: rgba(212, 184, 120, 0.45);
  border: 1px solid rgba(212, 184, 120, 0.25);
  z-index: 2;
  pointer-events: none;
}

.overlay-img-half:nth-child(even)::before {
  transform: translateX(-50%) rotate(-2deg);
}

/* Placeholder half (div) */
div.overlay-img-half {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted, #5a4e3a);
  font-family: var(--font-hand, 'Caveat', cursive);
  font-size: 0.875rem;
}

/* Real half image */
img.overlay-img-half {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  padding: 0;
}

/* ─── Callout Box — sticky note style ─────────────────────────────────── */
/* Looks like a yellow sticky note with a slight tilt and corner fold.     */

.overlay-callout {
  position: relative;
  background: var(--color-sticky, #ffd54f);
  padding: var(--space-lg, 24px) var(--space-xl, 40px);
  margin: 36px 0;
  border-radius: 1px;
  transform: rotate(-0.6deg);
  box-shadow:
    2px 3px 8px rgba(0, 0, 0, 0.12),
    inset 0 -2px 4px rgba(0, 0, 0, 0.04);
}

/* Corner fold on sticky note */
.overlay-callout::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--color-sticky, #ffd54f) 50%, rgba(0, 0, 0, 0.06) 50%);
  border-radius: 0 0 0 0;
}

.overlay-callout p {
  font-family: var(--font-hand, 'Caveat', cursive);
  font-size: 1.25rem;
  font-style: normal;
  line-height: 1.55;
  color: var(--color-text-primary, #2c2416);
  margin: 0;
}

.overlay-callout cite {
  display: block;
  margin-top: var(--space-sm, 8px);
  font-family: var(--font-hand, 'Caveat', cursive);
  font-size: var(--size-label, 0.875rem);
  font-style: normal;
  color: rgba(44, 36, 22, 0.65);
}

/* ─── Stats Row — stamped numbers on torn cards ──────────────────────── */
/* Each stat looks like a small card with a pin, slightly rotated.         */

.overlay-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 20px;
  margin: 44px 0;
  text-align: center;
}

.overlay-stat {
  position: relative;
  padding: 24px 18px 20px;
  background: var(--color-sticky, #ffd54f);
  border: none;
  border-radius: 1px;
  box-shadow:
    2px 3px 8px rgba(0, 0, 0, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Folded corner — bottom-right triangle */
.overlay-stat::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  background: linear-gradient(
    135deg,
    var(--color-sticky, #ffd54f) 50%,
    rgba(0, 0, 0, 0.06) 50%,
    rgba(0, 0, 0, 0.02) 100%
  );
}

/* Alternate tilts for organic feel */
.overlay-stat:nth-child(odd) {
  transform: rotate(-1.5deg);
}

.overlay-stat:nth-child(even) {
  transform: rotate(1.2deg);
}

.overlay-stat:nth-child(3n) {
  background: #ffe082;
}

.overlay-stat-number {
  display: block;
  font-family: var(--font-editorial, 'Playfair Display', serif);
  font-size: 2.25rem;
  font-weight: var(--weight-bold, 700);
  color: #2c2416;
  line-height: 1.1;
  margin-bottom: 6px;
}

.overlay-stat-label {
  font-family: var(--font-hand, 'Caveat', cursive);
  font-size: 0.95rem;
  font-weight: var(--weight-semibold, 600);
  color: #3d3224;
  line-height: 1.4;
}

/* ─── Divider — washi tape strip ─────────────────────────────────────── */
/* Instead of a plain line, a wide translucent tape strip across the page. */

.overlay-divider {
  border: none;
  height: 18px;
  margin: 48px -20px;
  background: rgba(212, 184, 120, 0.3);
  border-top: 1px solid rgba(212, 184, 120, 0.2);
  border-bottom: 1px solid rgba(212, 184, 120, 0.2);
  transform: rotate(-0.3deg);
}

/* ─── Before/After — comparison pair with labels ─────────────────────── */

.overlay-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 40px 0;
}

.overlay-comparison-item {
  text-align: center;
}

/* Comparison images: white border + tape, matching grid images */
.overlay-comparison-img {
  position: relative;
  padding: 8px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 2px;
  box-shadow:
    2px 3px 8px rgba(0, 0, 0, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.05);
  margin-bottom: var(--space-sm, 8px);
}

/* Placeholder comparison (div) */
div.overlay-comparison-img {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted, #5a4e3a);
  font-family: var(--font-hand, 'Caveat', cursive);
  font-size: 0.875rem;
}

.overlay-comparison-item:first-child .overlay-comparison-img {
  transform: rotate(-0.8deg);
}

.overlay-comparison-item:last-child .overlay-comparison-img {
  transform: rotate(0.5deg);
}

.overlay-comparison-label {
  font-family: var(--font-hand, 'Caveat', cursive);
  font-size: 1rem;
  font-weight: var(--weight-semibold, 600);
  color: var(--color-text-muted, #5a4e3a);
}

/* ─── CTA / External Link ─────────────────────────────────────────────── */

.overlay-link {
  font-family: var(--font-hand, 'Caveat', cursive);
  font-size: 1.25rem;
  font-weight: var(--weight-semibold, 600);
  color: var(--color-accent, #e85d2f);
  text-decoration: none;
  display: inline-block;
  margin-top: var(--space-lg, 24px);
  padding: 8px 20px;
  background: var(--color-sticky, #ffd54f);
  border-radius: 2px;
  transform: rotate(-1deg);
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.1);
  transition:
    transform var(--dur-fast, 0.3s) var(--spring, cubic-bezier(0.34, 1.56, 0.64, 1)),
    box-shadow var(--dur-fast, 0.3s) ease;
}

.overlay-link:hover {
  transform: rotate(0deg) scale(1.04);
  box-shadow: 3px 4px 10px rgba(0, 0, 0, 0.15);
}

.overlay-link:focus-visible {
  outline: 2px solid var(--color-accent, #e85d2f);
  outline-offset: 2px;
}

/* ─── Scrollbar Styling ──────────────────────────────────────────────── */

.overlay-panel::-webkit-scrollbar {
  width: 8px;
}

.overlay-panel::-webkit-scrollbar-track {
  background: transparent;
}

.overlay-panel::-webkit-scrollbar-thumb {
  background: var(--color-border, #c7b9a5);
  border-radius: 4px;
}

.overlay-panel::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted, #5a4e3a);
}

/* ─── Case Studies Grid — Polaroid gallery ───────────────────────────── */
/* Two-column grid of Polaroid cards reusing the canvas .item-polaroid
   component. Grid-context overrides convert absolute-positioned canvas
   items into flowing grid children with natural image proportions.       */

.case-studies-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start; /* Don't stretch cards to fill row height */
  /* Break fully out of .overlay-content constraints to fill the panel */
  width: 85vw;
  max-width: 1200px;
  margin-left: 50%;
  transform: translateX(-50%);
  margin-top: 20px;
  margin-bottom: 40px;
}

/* ─── Grid-context overrides for Polaroid canvas items ───────────────── */
/* Canvas items are position: absolute; in the grid they must flow.      */

.case-studies-grid .canvas-item {
  position: relative;
  left: auto;
  top: auto;
  z-index: auto;
  cursor: pointer;
}

.case-studies-grid .item-polaroid {
  width: 100%;
  padding-bottom: 12px;
}

/* Pull the 4th card (right column row 2) up to fill the gap left by
   the shorter Pickio card above it. Staggered look. */
.case-studies-grid .item-polaroid:nth-child(4) {
  margin-top: -180px;
}

/* Organic rotations — same angles as the old card design */
.case-studies-grid .item-polaroid:nth-child(odd) {
  transform: rotate(-0.8deg);
}

.case-studies-grid .item-polaroid:nth-child(even) {
  transform: rotate(0.6deg);
}

.case-studies-grid .item-polaroid:hover {
  transform: rotate(0deg) translateY(-4px) !important;
}

/* Let images use natural aspect ratio instead of square */
.case-studies-grid .polaroid-img {
  aspect-ratio: auto;
}

.case-studies-grid .polaroid-photo {
  position: relative;
  inset: auto;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Crop videos slightly to hide watermarks at the bottom edge */
.case-studies-grid .polaroid-img:has(video) {
  aspect-ratio: 4 / 2.65;
  overflow: hidden;
}

.case-studies-grid video.polaroid-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* Larger pushpin for bigger cards */
.case-studies-grid .item-polaroid::before {
  width: 16px;
  height: 16px;
  top: -8px;
}

/* ─── Rich text in the Polaroid gutter ───────────────────────────────── */

.case-study-polaroid-text {
  padding: 4px 4px 0;
}

.case-study-card-title {
  font-family: var(--font-editorial, 'Playfair Display', serif);
  font-size: 1.75rem;
  font-weight: var(--weight-bold, 700);
  line-height: 1.2;
  color: var(--color-text-primary, #2c2416);
  margin: 0 0 10px 0;
}

.case-study-card-meta {
  font-family: var(--font-hand, 'Caveat', cursive);
  font-size: 1.1rem;
  font-weight: var(--weight-semibold, 600);
  color: var(--color-text-muted, #5a4e3a);
  margin: 0 0 14px 0;
  line-height: 1.3;
}

.case-study-card-description {
  font-family: var(--font-body, 'Lora', serif);
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--color-text-muted, #5a4e3a);
  margin: 0 0 18px 0;
}

.case-study-card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border, #c7b9a5);
}

.case-study-card-metric {
  font-family: var(--font-hand, 'Caveat', cursive);
  font-size: 0.95rem;
  font-weight: var(--weight-semibold, 600);
  color: var(--color-accent, #e85d2f);
  line-height: 1.3;
  white-space: nowrap;
}

/* Responsive: stack to 1 column on narrow viewports */
@media (max-width: 640px) {
  .case-studies-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   EXPERIMENT CARDS — CLIPBOARD / LAB-NOTE AESTHETIC
   Visually distinct from case study cards (white photo border + tape).
   Experiments use a cream ruled-paper background, binder clip at top, and
   a subtly academic/lab-notebook feel.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Experiments Grid — clipboard card gallery ──────────────────────── */
/* Two-column grid of clickable experiment cards. Same break-out pattern
   as .case-studies-grid but cards use the clipboard aesthetic.            */

.experiments-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  /* Break fully out of .overlay-content constraints to fill the panel */
  width: 85vw;
  max-width: 1200px;
  margin-left: 50%;
  transform: translateX(-50%);
  margin-top: 20px;
  margin-bottom: 40px;
}

/* ─── Experiment Card — clipboard / ruled lab-note ───────────────────── */
/* Cream paper with faint ruled lines, thick clipboard border, binder
   clip at top center. NOT the white photo-border + tape of case studies. */

.experiment-card {
  position: relative;
  /* Cream ruled-paper background */
  background-color: #fefcf3;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 27px,
    rgba(176, 196, 222, 0.25) 27px,
    rgba(176, 196, 222, 0.25) 28px
  );
  border: 2px solid #d4c9a8;
  border-radius: 3px;
  box-shadow:
    2px 3px 8px rgba(0, 0, 0, 0.07),
    0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 28px 24px 24px;
  cursor: pointer;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease;
}

/* Alternate rotations for organic feel — matches board aesthetic */
.experiment-card:nth-child(odd) {
  transform: rotate(-0.8deg);
}

.experiment-card:nth-child(even) {
  transform: rotate(0.6deg);
}

.experiment-card:hover {
  transform: translateY(-4px) rotate(0deg);
  box-shadow:
    4px 8px 24px rgba(0, 0, 0, 0.14),
    0 2px 6px rgba(0, 0, 0, 0.07);
}

/* Binder clip — center bar with two round handles ────────────────────── */
/* Instead of a tape strip, a metal binder clip grips the top of the card. */
.experiment-card::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 16px;
  background: #555;
  border-radius: 2px 2px 0 0;
  z-index: 2;
  /* Two round clip handles on either side */
  box-shadow:
    -10px -2px 0 0 #777,
    10px -2px 0 0 #777,
    -10px -2px 0 1px #444,
    10px -2px 0 1px #444;
}

/* ─── Experiment Card Illustration — SVG thumbnail area ──────────────── */
/* Slightly warm tint area for the inline SVG/illustration preview.        */

.experiment-card-illustration {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f0e4;
  border-radius: 2px;
  margin-bottom: 16px;
}

.experiment-card-illustration img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}

/* ─── Experiment Card Title ──────────────────────────────────────────── */

.experiment-card-title {
  font-family: var(--font-editorial, 'Playfair Display', serif);
  font-size: 1.75rem;
  font-weight: var(--weight-bold, 700);
  line-height: 1.2;
  color: var(--color-text-primary, #2c2416);
}

/* ─── Experiment Card Subtitle ───────────────────────────────────────── */

.experiment-card-subtitle {
  font-family: var(--font-hand, 'Caveat', cursive);
  font-size: 1.1rem;
  font-weight: var(--weight-semibold, 600);
  color: var(--color-text-muted, #5a4e3a);
  margin-top: 4px;
  line-height: 1.3;
}

/* ─── Experiment Card on Canvas ──────────────────────────────────────── */
/* When placed directly on the canvas (not inside the overlay grid),      */
/* the card needs absolute positioning and a fixed width.                  */

.experiment-card--canvas {
  position: absolute;
  width: 260px;
  z-index: 1;
}

/* ─── Experiment Detail Body ─────────────────────────────────────────── */
/* Detail view inherits standard overlay body/title styles.               */

.experiment-detail-body .overlay-title {
  /* Inherits .overlay-title — no overrides needed */
}

.experiment-detail-body .overlay-body {
  /* Inherits .overlay-body — no overrides needed */
}

/* ─── Experiment Detail Collage — overlapping 2-image layout ─────────── */
/* Desktop and phone mockups arranged in an overlapping offset layout,
   both with white photo borders matching the paste-board aesthetic.      */

.experiment-detail-collage {
  position: relative;
  margin: 40px 0;
  min-height: 400px;
}

/* First image — desktop view, larger, sits behind */
.experiment-detail-collage-img--desktop {
  position: relative;
  width: 75%;
  max-height: 450px;
  overflow: hidden;
  padding: 8px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  box-shadow:
    3px 4px 12px rgba(0, 0, 0, 0.12),
    0 1px 3px rgba(0, 0, 0, 0.06);
  transform: rotate(0.8deg);
  z-index: 1;
}

.experiment-detail-collage-img--desktop img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  object-fit: cover;
  object-position: top;
}

/* Second image — phone mockup, smaller, overlaps bottom-right */
.experiment-detail-collage-img--phone {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 35%;
  padding: 8px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  box-shadow:
    4px 6px 18px rgba(0, 0, 0, 0.18),
    0 2px 4px rgba(0, 0, 0, 0.08);
  transform: rotate(-1.2deg);
  z-index: 2;
}

.experiment-detail-collage-img--phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

/* ─── Experiment Detail — Live Website Preview (browser mockup) ──────── */

.experiment-detail-preview {
  /* Break out of .overlay-content max-width to fill the panel */
  width: 90vw;
  max-width: 1400px;
  margin-left: 50%;
  transform: translateX(-50%);
  margin-top: 40px;
  margin-bottom: 40px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.10);
  background: #1e1e1e;
}

/* Browser chrome — title bar with traffic lights and address bar */
.experiment-detail-preview-chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #2d2d2d;
  border-bottom: 1px solid #3a3a3a;
}

.experiment-detail-preview-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.experiment-detail-preview-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.experiment-detail-preview-dots span:nth-child(1) { background: #ff5f57; }
.experiment-detail-preview-dots span:nth-child(2) { background: #febc2e; }
.experiment-detail-preview-dots span:nth-child(3) { background: #28c840; }

.experiment-detail-preview-url {
  flex: 1;
  background: #1a1a1a;
  border-radius: 6px;
  padding: 5px 12px;
  font-family: -apple-system, 'SF Pro Text', sans-serif;
  font-size: 12px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Fullscreen button */
.experiment-detail-preview-fullscreen {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.experiment-detail-preview-fullscreen:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

/* Fullscreen state — fill entire screen */
.experiment-detail-preview.is-fullscreen {
  width: 100%;
  max-width: none;
  margin: 0;
  transform: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.experiment-detail-preview.is-fullscreen .experiment-detail-preview-viewport {
  flex: 1;
}

/* Viewport container — renders iframe at 1440px and scales to fit */
.experiment-detail-preview-viewport {
  width: 1440px;
  height: 900px;
  transform-origin: top left;
  /* scale is set via JS based on container width */
}

.experiment-detail-preview iframe {
  display: block;
  width: 1440px;
  height: 900px;
  border: none;
  background: #fff;
}

/* ─── Experiment Detail — Single Hero Image ─────────────────────────── */

.experiment-detail-hero-img {
  margin: 40px 0;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--color-border, #c7b9a5);
  border-radius: 4px;
  box-shadow: 2px 4px 12px rgba(0,0,0,.08);
  transform: rotate(0.4deg);
}

.experiment-detail-hero-img img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

/* ─── Experiment Detail Tags ─────────────────────────────────────────── */
/* Reuses existing .overlay-tags and .overlay-tag styles — no overrides.  */

.experiment-detail-tags {
  /* Inherits .overlay-tags layout — apply class alongside .overlay-tags */
}

/* ─── Experiments — Responsive ───────────────────────────────────────── */

@media (max-width: 640px) {
  .experiments-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .experiment-detail-collage {
    min-height: auto;
  }

  .experiment-detail-collage-img--desktop {
    width: 100%;
    max-height: none;
    transform: rotate(0deg);
  }

  .experiment-detail-collage-img--phone {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    transform: rotate(0deg);
    margin-top: 20px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Resume Viewer
   PDF iframe with download button
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Resume Download Button ─────────────────────────────────────────── */

.resume-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: var(--color-text-primary, #2c2416);
  color: #fff;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.resume-download-btn:hover {
  background: var(--color-text-muted, #5a4e3a);
  transform: translateY(-1px);
}

/* ─── Resume Note ────────────────────────────────────────────────────── */
/* Rendered as a cream ruled-paper note with a red margin line,          */
/* matching the clipboard/lab-note aesthetic of the canvas.              */

.resume-note {
  padding: 0 48px 48px;
}

.resume-note-inner {
  position: relative;
  background-color: #fefcf3;
  background-image:
    /* Red margin line */
    linear-gradient(to right, transparent 59px, #e8a0a0 59px, #e8a0a0 61px, transparent 61px),
    /* Ruled lines */
    repeating-linear-gradient(to bottom, transparent 0, transparent 31px, rgba(176, 196, 222, 0.3) 31px, rgba(176, 196, 222, 0.3) 32px);
  border: 1px solid #d4c9a8;
  border-radius: 2px;
  box-shadow:
    2px 3px 12px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.04);
  padding: 40px 48px 48px 80px;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  color: #2c2416;
  line-height: 1.6;
}

/* Spiral binding holes along the top */
.resume-note-inner::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 20px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid #aaa;
  box-shadow:
    0 40px 0 0 transparent,  0 40px 0 2px #aaa,
    0 80px 0 0 transparent,  0 80px 0 2px #aaa,
    0 120px 0 0 transparent, 0 120px 0 2px #aaa,
    0 160px 0 0 transparent, 0 160px 0 2px #aaa,
    0 200px 0 0 transparent, 0 200px 0 2px #aaa,
    0 240px 0 0 transparent, 0 240px 0 2px #aaa,
    0 280px 0 0 transparent, 0 280px 0 2px #aaa,
    0 320px 0 0 transparent, 0 320px 0 2px #aaa,
    0 360px 0 0 transparent, 0 360px 0 2px #aaa,
    0 400px 0 0 transparent, 0 400px 0 2px #aaa;
}

.resume-header {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 2px solid #d4c9a8;
}

.resume-name {
  font-family: var(--font-editorial, 'Playfair Display', serif);
  font-size: 2rem;
  font-weight: 400;
  margin: 0 0 6px;
  color: #2c2416;
}

.resume-contact {
  font-size: 0.85rem;
  color: #5a4e3a;
  margin: 0;
}

.resume-contact a {
  color: #8b5e3c;
  text-decoration: underline;
  text-decoration-style: dotted;
}

.resume-section {
  margin-bottom: 24px;
}

.resume-section-title {
  font-family: var(--font-editorial, 'Playfair Display', serif);
  font-size: 1.1rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b5e3c;
  margin: 0 0 12px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(139, 94, 60, 0.3);
}

.resume-entry {
  margin-bottom: 20px;
}

.resume-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}

.resume-company {
  font-weight: 600;
  font-size: 0.95rem;
}

.resume-role {
  font-weight: 400;
  color: #5a4e3a;
}

.resume-date {
  font-size: 0.8rem;
  color: #5a4e3a;
  white-space: nowrap;
  font-style: italic;
}

.resume-bullets {
  margin: 0;
  padding-left: 18px;
  font-size: 0.88rem;
  color: #3d3326;
}

.resume-bullets li {
  margin-bottom: 4px;
}

.resume-edu {
  font-size: 0.9rem;
  margin: 0 0 4px;
}

.resume-edu strong {
  color: #2c2416;
}

/* ─── Resume Preview Card (on canvas) ────────────────────────────────── */

.resume-note-preview {
  position: absolute;
  width: 220px;
  cursor: pointer;
  z-index: 1;
}

.resume-note-preview-inner {
  position: relative;
  background-color: #fefcf3;
  background-image:
    linear-gradient(to right, transparent 29px, #e8a0a0 29px, #e8a0a0 31px, transparent 31px),
    repeating-linear-gradient(to bottom, transparent 0, transparent 23px, rgba(176, 196, 222, 0.3) 23px, rgba(176, 196, 222, 0.3) 24px);
  border: 1px solid #d4c9a8;
  border-radius: 2px;
  box-shadow:
    2px 3px 8px rgba(0, 0, 0, 0.07),
    0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 16px 16px 16px 42px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.resume-note-preview:hover .resume-note-preview-inner {
  transform: translateY(-3px);
  box-shadow:
    4px 8px 20px rgba(0, 0, 0, 0.12),
    0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Spiral holes */
.resume-note-preview-inner::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #aaa;
  background: transparent;
  box-shadow:
    0 30px 0 0 transparent, 0 30px 0 2px #aaa,
    0 60px 0 0 transparent, 0 60px 0 2px #aaa,
    0 90px 0 0 transparent, 0 90px 0 2px #aaa,
    0 120px 0 0 transparent, 0 120px 0 2px #aaa;
}

.resume-note-preview-name {
  font-family: var(--font-editorial, 'Playfair Display', serif);
  font-size: 1.15rem;
  font-weight: 400;
  color: #2c2416;
  margin: 0 0 2px;
}

.resume-note-preview-role {
  font-family: var(--font-hand, 'Caveat', cursive);
  font-size: 0.95rem;
  color: #8b5e3c;
  margin: 0 0 12px;
}

.resume-note-preview-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.resume-note-preview-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #5a4e3a;
}

.resume-note-preview-cta {
  font-family: var(--font-hand, 'Caveat', cursive);
  font-size: 0.95rem;
  color: #d65ba8;
  margin: 0;
}

@media (max-width: 640px) {
  .resume-note {
    padding: 0 4px 24px;
  }

  .resume-note-inner {
    padding: 24px 12px 24px 36px;
    background-image:
      linear-gradient(to right, transparent 23px, #e8a0a0 23px, #e8a0a0 25px, transparent 25px),
      repeating-linear-gradient(to bottom, transparent 0, transparent 27px, rgba(176, 196, 222, 0.3) 27px, rgba(176, 196, 222, 0.3) 28px);
  }

  .resume-note-inner::before {
    left: 5px;
    width: 10px;
    height: 10px;
    box-shadow:
      0 30px 0 0 transparent, 0 30px 0 2px #aaa,
      0 60px 0 0 transparent, 0 60px 0 2px #aaa,
      0 90px 0 0 transparent, 0 90px 0 2px #aaa,
      0 120px 0 0 transparent, 0 120px 0 2px #aaa;
  }

  .resume-name {
    font-size: 1.5rem;
  }

  .resume-contact {
    font-size: 0.78rem;
    word-break: break-word;
  }

  .resume-entry-header {
    flex-direction: column;
    gap: 2px;
  }

  .resume-bullets {
    padding-left: 14px;
    font-size: 0.82rem;
  }
}

/* ─── Reduced Motion ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .overlay-sheet {
    transition: none;
  }
}
