/* ============================================================
   PANELS.CSS — SPA panel system
   Loaded by index.html only. Provides:
     1. Panel chrome (slide-up animation, header, back button)
     2. Content styles for section and detail panels
        (mirrors pages.css content rules, without page-layout)
   ============================================================ */

/* ============================================================
   Panel variables
   ============================================================ */

:root {
  /* Panel colour tokens — day values are defaults */
  --panel-bg:               #faf6ee;
  --panel-rgb:              250, 246, 238;
  --panel-text:             #2a1d42;
  --panel-text-secondary:   rgba(42, 29, 66, 0.55);
  --panel-card-bg:          #ffffff;
  --panel-card-alt-bg:      #fdf8f2;
  --panel-border:           rgba(42, 29, 66, 0.07);
  --panel-accent:           #c8a0b8;
  --panel-accent-hover:     #9a7090;
  --panel-muted:            #9b8aaa;
  --panel-pill-text:        #6b5d7e;
  --panel-pill-bg:          rgba(200, 160, 184, 0.13);
  --panel-pill-bg-hover:    rgba(200, 160, 184, 0.28);
  --panel-pill-border:      rgba(200, 160, 184, 0.32);
  --panel-pill-active:      #c8a0b8;
  --panel-pill-active-text: #2a1d42;
  --panel-media-bg:         #fefcf8;
  --panel-shadow:           rgba(42, 29, 66, 0.07);
  --panel-shadow-hover:     rgba(42, 29, 66, 0.14);
}

/* Dawn — warm parchment */
body[data-theme="dawn"] {
  --panel-bg:           #f5ede0;
  --panel-rgb:          245, 237, 224;
  --panel-card-bg:      #fdf8ef;
  --panel-card-alt-bg:  #f9f2e5;
  --panel-border:       rgba(42, 29, 66, 0.08);
  --panel-media-bg:     #faf4e8;
  --panel-shadow:       rgba(42, 29, 66, 0.06);
  --panel-shadow-hover: rgba(42, 29, 66, 0.12);
}

/* Night — dark mode */
body[data-theme="night"] {
  --panel-bg:               #0e1b2d;
  --panel-rgb:              14, 27, 45;
  --panel-text:             #cdd5e8;
  --panel-text-secondary:   rgba(180, 195, 225, 0.62);
  --panel-card-bg:          #132030;
  --panel-card-alt-bg:      #152435;
  --panel-border:           rgba(80, 110, 160, 0.15);
  --panel-accent:           #7090b8;
  --panel-accent-hover:     #9ab0d0;
  --panel-muted:            #6a80a8;
  --panel-pill-text:        #8fa5c8;
  --panel-pill-bg:          rgba(80, 120, 180, 0.15);
  --panel-pill-bg-hover:    rgba(80, 120, 180, 0.28);
  --panel-pill-border:      rgba(80, 120, 180, 0.25);
  --panel-pill-active:      #3d6080;
  --panel-pill-active-text: #d0daea;
  --panel-media-bg:         #0a1520;
  --panel-shadow:           rgba(0, 0, 0, 0.25);
  --panel-shadow-hover:     rgba(0, 0, 0, 0.40);
}

/* ============================================================
   Panel stack — fixed container, sits above scene layers
   ============================================================ */

#panel-stack {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
}

/* Elevate nav above panels */
.site-nav {
  z-index: 100;
}

/* ============================================================
   Panel — slide-up container
   ============================================================ */

.panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition:
    transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1),
    visibility 0s linear 0.65s;
  visibility: hidden;
  will-change: transform;
  pointer-events: none;
  z-index: 2;
}

.panel.is-open {
  transform: translateY(0);
  transition:
    transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1),
    visibility 0s linear 0s;
  visibility: visible;
  pointer-events: auto;
}

/* ============================================================
   Panel chrome — fixed header, does not scroll
   ============================================================ */

.panel__chrome {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 66px 6% 14px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--panel-border);
  position: relative;
  z-index: 1;
  transition: background-color 3s ease, border-color 3s ease;
}

.panel__back {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 14px;
  color: var(--panel-text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  letter-spacing: 0.04em;
  font-variation-settings: "SOFT" 80, "WONK" 0, "opsz" 12;
  transition: color 0.25s ease;
}

.panel__back:hover {
  color: var(--panel-text);
}

.panel__heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.panel__title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(24px, 3vw, 38px);
  color: var(--panel-text);
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 72;
  transition: color 3s ease;
}

.panel__subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(11px, 1.3vw, 14px);
  color: var(--panel-text-secondary);
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variation-settings: "SOFT" 80, "WONK" 0, "opsz" 24;
  transition: color 3s ease;
}

/* ============================================================
   Panel scroll area
   ============================================================ */

.panel__scroll {
  flex: 1;
  overflow-y: auto;
  background: rgba(var(--panel-rgb), 0.85);
  -webkit-overflow-scrolling: touch;
}

.panel__content {
  padding: 40px 6% 120px;
}

/* ============================================================
   Content layout
   ============================================================ */

.content-inner {
  max-width: 1200px;
  margin: 0 auto;
}

/* ============================================================
   Filter bar — pill row for studio and birds grids
   ============================================================ */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.filter-pill {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--panel-pill-text);
  background: var(--panel-pill-bg);
  border: 1px solid var(--panel-pill-border);
  border-radius: 20px;
  padding: 6px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  font-variation-settings: "SOFT" 80, "WONK" 0, "opsz" 12;
}

.filter-pill:hover {
  background: var(--panel-pill-bg-hover);
  color: var(--panel-pill-active-text);
}

.filter-pill.is-active {
  background: var(--panel-pill-active);
  color: var(--panel-pill-active-text);
  border-color: var(--panel-pill-active);
}

/* ============================================================
   Era sections — groups masonry cards by time period
   ============================================================ */

.era-section {
  margin-bottom: 48px;
}

.era-section.is-hidden {
  display: none;
}

.era-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--panel-muted);
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.era-title::before,
.era-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--panel-border);
}

/* ============================================================
   Masonry grid
   ============================================================ */

.masonry-grid {
  columns: 3;
  column-gap: 24px;
}

/* ============================================================
   Project card
   ============================================================ */

.project-card {
  break-inside: avoid;
  margin-bottom: 24px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-card-bg);
  box-shadow: 0 2px 12px var(--panel-shadow);
  transition: transform 0.5s ease, box-shadow 0.5s ease, opacity 0.4s ease,
              background-color 3s ease;
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px var(--panel-shadow-hover);
}

.project-card.is-hidden {
  display: none;
}

.project-card--writing {
  background: var(--panel-card-alt-bg);
}

.writing-label {
  position: absolute;
  top: 14px;
  right: 14px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--panel-accent);
  pointer-events: none;
}

.card-wip {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 9px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #7a3e2a;
  background: #f0c89a;
  border-radius: 20px;
  pointer-events: none;
}

.project-card[data-wip="true"] .card-image,
.project-card[data-wip="true"] .card-video {
  filter: saturate(0);
  transition: filter 0.4s ease;
}

.project-card[data-wip="true"]:hover .card-image,
.project-card[data-wip="true"]:hover .card-video {
  filter: saturate(1);
}

/* ============================================================
   Card image / placeholder
   ============================================================ */

.card-image,
.card-video {
  width: 100%;
  display: block;
}

.card-image-placeholder {
  width: 100%;
  display: block;
}

/* ============================================================
   Card body
   ============================================================ */

.card-body {
  padding: 16px 18px 20px;
}

.card-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  color: var(--panel-text);
  line-height: 1.3;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 36;
  transition: color 3s ease;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.card-tag {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--panel-muted);
  background: rgba(155, 138, 170, 0.1);
  border-radius: 12px;
  padding: 3px 10px;
  font-variation-settings: "SOFT" 60, "WONK" 0, "opsz" 9;
  transition: color 3s ease;
}

.card-excerpt {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 400;
  font-size: 14px;
  color: var(--panel-text-secondary);
  margin-top: 8px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 3s ease;
}

.card-read-more {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: var(--panel-accent);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.25s ease;
}

.card-read-more:hover {
  color: var(--panel-accent-hover);
}

/* ============================================================
   Lightbox overlay
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(18, 10, 32, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__inner {
  position: relative;
  max-width: 820px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  background: #fefcf8;
  border-radius: 6px;
  padding-bottom: 36px;
}

.lightbox__image {
  width: 100%;
  display: block;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}

.lightbox__body {
  padding: 24px 28px 0;
}

.lightbox__title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 26px;
  color: #2a1d42;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 72;
  line-height: 1.2;
}

.lightbox__desc {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  color: #6b5d7e;
  margin-top: 10px;
  line-height: 1.68;
}

.lightbox__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: #2a1d42;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 10;
}

.lightbox__close:hover {
  background: #ffffff;
}

/* ============================================================
   Note banner (birds panel)
   ============================================================ */

.note-banner {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 14px;
  color: var(--panel-muted);
  text-align: center;
  padding: 0 0 24px;
  letter-spacing: 0.04em;
}

/* ============================================================
   Media panel — receipt layout
   ============================================================ */

.media-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.media-filter-pill {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 13px;
  color: var(--panel-pill-text);
  background: var(--panel-pill-bg);
  border: 1px solid var(--panel-pill-border);
  border-radius: 20px;
  padding: 6px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.25s ease, color 0.25s ease;
  font-variation-settings: "SOFT" 80, "WONK" 0, "opsz" 12;
}

.media-filter-pill:hover {
  background: var(--panel-pill-bg-hover);
  color: var(--panel-pill-active-text);
}

.media-filter-pill.is-active {
  background: var(--panel-pill-active);
  color: var(--panel-pill-active-text);
  border-color: var(--panel-pill-active);
}

.media-filter-pill--fave {
  color: #a0622a;
  background: transparent;
  border-color: #e8b87a;
}

.media-filter-pill--fave:hover {
  background: #f0c89a;
  color: #7a3e2a;
  border-color: #e8b87a;
}

.media-filter-pill--fave.is-active {
  background: #f0c89a;
  color: #7a3e2a;
  border-color: #f0c89a;
}

.receipt-frame {
  width: 520px;
  max-width: 90vw;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  border-radius: 2px;
  box-shadow:
    0 4px 32px rgba(42, 29, 66, 0.14),
    0 1px 6px rgba(42, 29, 66, 0.08);
}

.receipt {
  background: var(--panel-media-bg);
  padding: 40px 44px 60px;
  border-radius: 0 0 2px 2px;
  clip-path: polygon(
    0%   3px, 5%  1px, 10% 3px, 15%  0px, 20% 2px,
    25%  3px, 30% 1px, 35% 3px, 40%  0px, 45% 2px,
    50%  3px, 55% 1px, 60% 3px, 65%  0px, 70% 2px,
    75%  3px, 80% 1px, 85% 3px, 90%  0px, 95% 2px,
    100% 3px, 100% 100%, 0% 100%
  );
}

.media-entry {
  border-bottom: 1px dashed rgba(42, 29, 66, 0.14);
  padding: 22px 0;
}

.media-entry:first-child { padding-top: 0; }

.media-entry.is-hidden { display: none; }

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

.entry-date {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--panel-muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-variation-settings: "SOFT" 40, "WONK" 0, "opsz" 9;
}

.entry-rating {
  display: flex;
  gap: 1px;
  font-size: 14px;
  color: var(--panel-accent);
  line-height: 1;
  flex-shrink: 0;
}

.rating-star { display: inline-block; }
.rating-star--empty { color: rgba(200, 160, 184, 0.38); }

.rating-star--half {
  position: relative;
  display: inline-block;
  width: 0.88em;
  color: transparent;
}
.rating-star--half::before {
  content: '☆';
  color: rgba(200, 160, 184, 0.38);
}
.rating-star--half::after {
  content: '★';
  position: absolute;
  left: 0; top: 0;
  width: 52%;
  overflow: hidden;
  color: var(--panel-accent);
  display: block;
}

.entry-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 22px;
  color: var(--panel-text);
  margin: 6px 0 2px;
  line-height: 1.2;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  transition: color 3s ease;
}

.entry-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.entry-meta {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--panel-muted);
  margin-top: 4px;
  font-variation-settings: "SOFT" 40, "WONK" 0, "opsz" 9;
}

.entry-fave {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #7a3e2a;
  background: #f0c89a;
  border-radius: 20px;
  flex-shrink: 0;
  margin-top: 6px;
}

.entry-notes {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.68;
  color: var(--panel-text-secondary);
  margin-top: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entry-notes.is-expanded {
  display: block;
  overflow: visible;
}

.entry-expand {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--panel-accent);
  background: none;
  border: none;
  padding: 4px 0 0;
  cursor: pointer;
  display: block;
  transition: color 0.2s ease;
  font-variation-settings: "SOFT" 80, "WONK" 0, "opsz" 12;
}

.entry-expand:hover {
  color: var(--panel-accent-hover);
}

.receipt-footer {
  margin-top: 24px;
  border-top: 1px dashed var(--panel-border);
  padding-top: 20px;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 13px;
  color: var(--panel-muted);
  letter-spacing: 0.06em;
}

/* ============================================================
   About panel
   ============================================================ */

.about-column {
  max-width: 600px;
  margin: 0 auto;
}

.about-intro {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.72;
  color: var(--panel-text);
  transition: color 3s ease;
}

.about-photo-placeholder {
  aspect-ratio: 4 / 5;
  background: linear-gradient(145deg, #c8a0b8 0%, #8da8c8 55%, #b8a0c8 100%);
  border-radius: 4px;
  max-width: 280px;
  margin: 32px auto;
  display: block;
}

.about-mediums {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  color: var(--panel-text-secondary);
  line-height: 1.72;
  margin-top: 28px;
}

.about-links {
  display: flex;
  gap: 28px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.about-link {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 15px;
  color: var(--panel-accent);
  text-decoration: none;
  letter-spacing: 0.03em;
  border-bottom: 1px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
  font-variation-settings: "SOFT" 80, "WONK" 0, "opsz" 12;
}

.about-link:hover {
  color: var(--panel-accent-hover);
  border-bottom-color: var(--panel-accent-hover);
}

/* ============================================================
   Project detail — markdown-rendered content
   ============================================================ */

.project-body {
  max-width: 680px;
  margin: 0 auto;
}

.project-body .project-h1 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  color: var(--panel-text);
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.1;
  margin-bottom: 12px;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
}

.project-body .project-h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(22px, 2.5vw, 32px);
  color: var(--panel-text);
  line-height: 1.2;
  margin: 36px 0 10px;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 72;
}

.project-body .project-h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(16px, 1.8vw, 22px);
  color: var(--panel-text-secondary);
  margin: 28px 0 8px;
  font-variation-settings: "SOFT" 80, "WONK" 0, "opsz" 36;
}

.project-body .project-p {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.75;
  color: var(--panel-text);
  opacity: 0.86;
  margin: 0 0 20px;
}

.project-body img {
  width: 100%;
  display: block;
  border-radius: 4px;
  margin: 28px 0;
}

.project-body .project-rule {
  border: none;
  border-top: 1px solid var(--panel-border);
  margin: 36px 0;
}

.project-body a {
  color: var(--panel-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.project-body a:hover {
  color: var(--panel-accent-hover);
  border-bottom-color: var(--panel-accent-hover);
}

/* ---- Write-up extras: h4, lists, labels, figures, video ---- */

.project-body .project-h4 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 17px;
  color: var(--panel-text);
  margin: 24px 0 6px;
}

.project-body .project-list {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: var(--panel-text-secondary);
  margin: 0 0 20px;
  padding-left: 1.3em;
}

.project-body .project-list li { margin-bottom: 4px; }

.project-body .project-label,
.project-body .recipe__col-label {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--panel-muted);
  margin: 0 0 8px;
}

.project-body .project-figure { margin: 28px 0; }
.project-body .project-figure img { margin: 0; }

.project-body figcaption {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.6;
  color: var(--panel-muted);
  text-align: center;
  margin: 10px auto 0;
  max-width: 90%;
}

.project-body video {
  width: 100%;
  display: block;
  border-radius: 4px;
  margin: 28px 0;
}

/* ---- Notes (> **Label:** text) — same look inside and outside cards ---- */

.project-body .note {
  background: var(--panel-pill-bg);
  border-left: 2px solid var(--panel-accent);
  border-radius: 0 8px 8px 0;
  padding: 12px 18px 14px;
  margin: 0 0 20px;
}

.project-body .note__tag {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--panel-pill-text);
  margin-bottom: 4px;
}

.project-body .note p {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  color: var(--panel-text);
  margin: 0;
}

/* ---- Recipe / make card (:::recipe) ---- */

.project-body .recipe {
  background: var(--panel-card-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: 0 2px 16px var(--panel-shadow);
  margin: 32px 0 44px;
  overflow: hidden;
  scroll-margin-top: 24px;
}

.project-body .recipe__head {
  padding: 24px 28px 18px;
  border-bottom: 1px dashed var(--panel-pill-border);
}

.project-body .recipe__head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.project-body .recipe__title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(22px, 2.5vw, 30px);
  line-height: 1.2;
  color: var(--panel-text);
  margin: 0;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 72;
}

.project-body .recipe__tag {
  flex-shrink: 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--panel-pill-text);
  background: var(--panel-pill-bg);
  border: 1px solid var(--panel-pill-border);
  border-radius: 999px;
  padding: 3px 10px;
}

.project-body .recipe__source {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 400;
  font-size: 15px;
  color: var(--panel-muted);
  margin: 8px 0 0;
}

.project-body a.recipe__button {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  color: var(--panel-pill-text);
  border: 1px solid var(--panel-pill-border);
  border-radius: 999px;
  padding: 4px 14px;
  transition: background 0.25s ease, color 0.25s ease;
}

.project-body a.recipe__button:hover {
  background: var(--panel-pill-bg-hover);
  color: var(--panel-text);
  border-color: var(--panel-pill-border);
}

.project-body .recipe__body { padding: 20px 28px 4px; }
.project-body .recipe__body > :first-child { margin-top: 0; }

.project-body .project-h2,
.project-body .recipe__part { scroll-margin-top: 24px; }

.project-body .recipe__part {
  border-top: 1px dashed var(--panel-pill-border);
  padding-top: 18px;
  margin-top: 22px;
}

.project-body .recipe__body > .recipe__part:first-child {
  border-top: none;
  padding-top: 0;
}

.project-body .recipe__part-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 20px;
  color: var(--panel-text);
  margin: 0 0 12px;
}

.project-body .recipe__grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 28px;
  margin: 4px 0 22px;
}

.project-body .recipe__grid--single { grid-template-columns: minmax(0, 1fr); }

.project-body .recipe__col-label {
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 6px;
  margin-bottom: 6px;
}

.project-body .recipe__subgroup {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 14px;
  color: var(--panel-accent-hover);
  margin: 14px 0 2px;
}

.project-body .recipe__ing-list,
.project-body .recipe__steps,
.project-body .recipe__changes-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--panel-text);
}

.project-body .recipe__ing-list li {
  font-size: 15px;
  line-height: 1.45;
  padding: 6px 0;
  border-bottom: 1px dotted var(--panel-border);
}

.project-body .recipe__amt {
  color: var(--panel-accent-hover);
  font-variant-numeric: tabular-nums;
}

.project-body .recipe__steps { counter-reset: step; }

.project-body .recipe__steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.2em;
  margin: 8px 0 14px;
  font-size: 15.5px;
  line-height: 1.65;
}

.project-body .recipe__steps li::before {
  content: counter(step);
  font-family: var(--font-display);
  position: absolute;
  left: 0;
  top: -0.1em;
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
  color: var(--panel-accent);
}

/* Bold times / temps in steps read as little tags */
.project-body .recipe__steps strong {
  font-weight: inherit;
  white-space: nowrap;
  background: var(--panel-pill-bg);
  border-radius: 999px;
  padding: 0 0.45em;
}

.project-body .recipe__changes {
  background: var(--panel-card-alt-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 12px 18px 8px;
  margin: 0 0 20px;
}

.project-body .recipe__changes .recipe__col-label { border-bottom: none; padding-bottom: 0; }

.project-body .recipe__changes-list li {
  position: relative;
  padding-left: 1.3em;
  margin-bottom: 6px;
  font-size: 15.5px;
  line-height: 1.6;
}

.project-body .recipe__changes-list li::before {
  content: '~';
  position: absolute;
  left: 0;
  color: var(--panel-accent);
}

.project-body .recipe__notes {
  background: var(--panel-card-alt-bg);
  border-top: 1px dashed var(--panel-pill-border);
  padding: 18px 28px 2px;
}

/* ---- Image beside text (:::side) ----
   The image floats, so text wraps beside it and returns to full width below it. */

.project-body .project-side {
  display: flow-root;   /* contain the float */
  margin: 28px 0 8px;
}

.project-body .project-side__media {
  float: left;
  width: 45%;
  margin: 6px 28px 16px 0;
}

.project-body .project-side--right .project-side__media {
  float: right;
  margin: 6px 0 16px 28px;
}

.project-body .project-side .project-figure { margin: 0; }
.project-body .project-side__text > :first-child { margin-top: 0; }

/* ---- Photo rows (back-to-back image lines) ---- */

.project-body .project-row { margin: 28px 0; }

.project-body .project-row__items {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* flex-grow is set to each item's aspect ratio by layoutRows() → equal heights */
.project-body .project-row__item { flex: 1 1 0%; min-width: 0; }

.project-body .project-row__item img,
.project-body .project-row__item video {
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
  border-radius: 4px;
}

/* ---- Galleries (:::gallery) ---- */

.project-body .project-gallery { margin: 32px 0; }

.project-body .project-gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.project-body .project-gallery__item {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  cursor: zoom-in;
  background: var(--panel-card-alt-bg);
}

.project-body .project-gallery__item img,
.project-body .project-gallery__item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
  transition: transform 0.5s ease;
}

.project-body .project-gallery__item:hover img,
.project-body .project-gallery__item:hover video { transform: scale(1.04); }

.project-body .project-gallery__item:focus-visible {
  outline: 2px solid var(--panel-accent);
  outline-offset: 2px;
}

.project-body .project-gallery__item--video::after {
  content: '▶';
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 10px;
  line-height: 1;
  color: #fff;
  background: rgba(18, 10, 32, 0.45);
  border-radius: 999px;
  padding: 5px 6px 5px 7px;
  pointer-events: none;
}

/* Lightbox in gallery mode: fit the photo on screen, arrows on the overlay */
.lightbox--gallery .lightbox__image {
  background: #f3ede4;
  display: flex;
  justify-content: center;
}

.lightbox--gallery .lightbox__image img,
.lightbox--gallery .lightbox__image video {
  width: auto !important;
  max-width: 100%;
  max-height: 70vh;
}

.lightbox__count {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #9b8aaa;
  margin-top: 8px;
}

.lightbox__count:empty { display: none; }

.lightbox__nav {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  color: #2a1d42;
  font-size: 18px;
  cursor: pointer;
  z-index: 11;
  transition: background 0.2s ease;
}

.lightbox__nav:hover { background: #fff; }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }

.lightbox--gallery .lightbox__nav { display: flex; align-items: center; justify-content: center; }
.lightbox--single .lightbox__nav { display: none; }

/* ---- Menu card (:::menu) ---- */

.project-body .project-menu {
  text-align: center;
  max-width: 460px;
  margin: 36px auto 44px;
  padding: 30px 28px 14px;
  background: var(--panel-card-bg);
  border: 1px solid var(--panel-pill-border);
  outline: 1px solid var(--panel-pill-border);
  outline-offset: 5px;
  border-radius: 4px;
}

.project-body .project-menu__title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 28px;
  color: var(--panel-text);
  margin: 0 0 6px;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 72;
}

.project-body .project-menu .project-label { margin: 22px 0 8px; }

.project-body .project-menu .project-list {
  list-style: none;
  padding: 0;
  font-style: italic;
  color: var(--panel-text);
}

.project-body .project-menu .project-p { font-size: 15px; }

@media (max-width: 640px) {
  .project-body .recipe__head  { padding: 20px 20px 16px; }
  .project-body .recipe__body  { padding: 18px 20px 4px; }
  .project-body .recipe__notes { padding: 16px 20px 2px; }
  .project-body .recipe__grid  { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .project-body .project-row__items { flex-direction: column; }
  .project-body .project-row__item  { flex: none !important; width: 100%; }
  .project-body .project-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lightbox__nav { top: auto; bottom: 16px; transform: none; }
  .project-body .project-side__media,
  .project-body .project-side--right .project-side__media { float: none; width: 100%; margin: 0 0 18px; }
  .project-body .recipe__head-row { flex-direction: column-reverse; align-items: flex-start; gap: 8px; }
}

/* ============================================================
   Responsive — tablet (≤ 900px)
   ============================================================ */

@media (max-width: 900px) {
  .masonry-grid { columns: 2; }
}

/* ============================================================
   Responsive — mobile (≤ 600px)
   ============================================================ */

@media (max-width: 600px) {
  .panel__content { padding: 28px 5% 80px; }

  .panel__title { font-size: clamp(22px, 6vw, 30px); }

  .masonry-grid { columns: 1; }

  .receipt { padding: 32px 24px 48px; }

  .about-intro { font-size: 17px; }

  .entry-title { font-size: 19px; }
}

/* ============================================================
   Media section — floating receipt
   Panel background is transparent so the sky shows on both sides.
   Clicking the transparent sides (outside .media-inner) closes the panel.
   ============================================================ */

#panel-section[data-section="media"] .panel__chrome {
  display: none;
}

#panel-section[data-section="media"] .panel__scroll {
  background: transparent;
  transition: none;
}

#panel-section[data-section="media"] .panel__content {
  padding-top: 32px;
  padding-bottom: 80px;
  cursor: default;
}

.media-inner {
  max-width: 520px;
  margin: 0 auto;
  cursor: auto;
  position: relative;
}

.media-close {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  letter-spacing: 0.04em;
  /* Big tap target (44px+ tall, extra width) while the text stays put:
     padding grows the hit area, negative margins cancel it visually. */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 28px 10px 14px;
  margin: -10px 0 0 -14px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease;
  font-variation-settings: "SOFT" 80, "WONK" 0, "opsz" 12;
}

.media-close:hover {
  color: rgba(255, 255, 255, 1);
}

/* ============================================================
   Night-specific overrides — complex rgba values that can't
   be expressed as simple custom properties
   ============================================================ */

body[data-theme="night"] .receipt-frame {
  box-shadow:
    0 4px 32px rgba(0, 0, 0, 0.4),
    0 1px 6px rgba(0, 0, 0, 0.25);
}

body[data-theme="night"] .media-entry {
  border-bottom-color: rgba(80, 110, 160, 0.2);
}

body[data-theme="night"] .card-tag {
  background: rgba(80, 110, 160, 0.18);
}

body[data-theme="night"] .rating-star--empty {
  color: rgba(80, 120, 180, 0.35);
}

body[data-theme="night"] .rating-star--half::before {
  color: rgba(80, 120, 180, 0.35);
}

body[data-theme="night"] .lightbox__inner {
  background: #0e1b2d;
}

body[data-theme="night"] .lightbox__title {
  color: #cdd5e8;
}

body[data-theme="night"] .lightbox__desc {
  color: rgba(180, 195, 225, 0.62);
}

body[data-theme="night"] .lightbox__close {
  background: rgba(30, 50, 80, 0.9);
  color: #cdd5e8;
}

body[data-theme="night"] .lightbox__close:hover {
  background: rgba(40, 65, 100, 1);
}

body[data-theme="night"] .lightbox--gallery .lightbox__image { background: #0b1522; }

/* ============================================================
   Studio "gallery" cards + lightbox strip mode
   ============================================================ */

.card-count {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 9px;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #fff;
  background: rgba(18, 10, 32, 0.45);
  backdrop-filter: blur(4px);
  border-radius: 20px;
  pointer-events: none;
}

.lightbox--strip .lightbox__inner { max-width: 1120px; }

.lightbox--strip .lightbox__image {
  border-radius: 6px 6px 0 0;
  background: #f3ede4;
}

.lightbox__strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 24px;
  padding: 24px;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.lightbox__strip-item {
  flex: none;
  margin: 0;
  scroll-snap-align: center;
}

.lightbox__strip-item img,
.lightbox__strip-item video {
  display: block;
  height: min(60vh, 560px);
  width: auto;
  max-width: 85vw;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox__strip-item figcaption {
  max-width: 100%;
  width: 0;
  min-width: 100%;
  margin-top: 8px;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 14px;
  line-height: 1.5;
  color: #6b5d7e;
}

.lightbox--strip .lightbox__nav { display: flex; align-items: center; justify-content: center; }
.lightbox--strip.lightbox--single .lightbox__nav { display: none; }

body[data-theme="night"] .lightbox--strip .lightbox__image { background: #0b1522; }

@media (max-width: 640px) {
  .lightbox__strip { padding: 14px; gap: 8px; scroll-padding: 0 14px; }
  .lightbox__strip-item img,
  .lightbox__strip-item video { height: 48vh; }
}
.filter-bar[hidden] { display: none; }


/* On narrow screens the site wordmark sits top-left over the panel;
   start the floating panels below it so "← close" doesn't overlap it. */
@media (max-width: 640px) {
  #panel-section[data-section="media"] .panel__content {
    padding-top: 84px;
  }
}

/* ---- "this site" write-up: clouds, comparison, bird demo ---- */

.project-body .project-row__item img[src*="pixel_cloud"] { image-rendering: pixelated; }

.project-body .sky-clouds {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 22px;
  margin: 28px 0;
  padding: 28px 20px;
  border-radius: 8px;
  background: linear-gradient(180deg, #8ab4e3 0%, #a9c9ea 100%);
}
.project-body .sky-clouds img { width: auto; height: 110px; max-width: 45%; object-fit: contain; margin: 0; }

.project-body .cloud-compare {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 28px 0;
}
.project-body .cloud-compare__label {
  margin: 0 0 2px;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}
.project-body .cloud-compare__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 110px;
  padding: 8px;
  border-radius: 6px;
}
.project-body .cloud-compare__cell--dawn  { background: linear-gradient(180deg, #e8b4a0, #f0c9b0); }
.project-body .cloud-compare__cell--day   { background: linear-gradient(180deg, #7aa9de, #a9c9ea); }
.project-body .cloud-compare__cell--night { background: linear-gradient(180deg, #1c2550, #2c3570); }
.project-body .cloud-compare__cell img { max-width: 100%; max-height: 100%; width: auto; height: auto; margin: 0; }

.project-body .bird-demo {
  width: 200px;
  height: 200px;
  margin: 24px auto;
  background: url('../images/studio/site-project/bird_strip.png') no-repeat 0 0 / auto 200px;
  animation: bird-demo-flap 1.4s steps(13) infinite;
}
@keyframes bird-demo-flap {
  from { background-position: 0 0; }
  to   { background-position: -2600px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .project-body .bird-demo { animation: none; }
}

/* ---- ▶ badge on hover-to-play videos (cards + write-ups) ---- */

.video-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  font-size: 11px;
  line-height: 1;
  color: #fff;
  background: rgba(18, 10, 32, 0.5);
  border-radius: 999px;
  padding: 7px 7px 7px 9px;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Cards: the badge sits over the video, which fills the top of the card */
.project-card { position: relative; }
.project-card .card-video + .video-badge { bottom: auto; top: 10px; right: 10px; }
.project-card:hover .card-video + .video-badge { opacity: 0; }

.project-body .hover-video { position: relative; display: block; }
.project-body .hover-video video { margin: 0; }
.project-body .hover-video.is-playing .video-badge { opacity: 0; }
.project-body .project-row__item .video-badge { right: 8px; bottom: 8px; }

/* ============================================================
   Gallery mode — studio / birds float over the bare sky
   (body.gallery-mode fades the rest of the scene; see style.css).
   Header and filters sit directly on the sky, so they take the
   scene's cream text; the cards keep their own solid backgrounds.
   ============================================================ */

body.gallery-mode #panel-section .panel__scroll {
  background: transparent;
  transition: none;
}

body.gallery-mode #panel-section .panel__chrome {
  background: transparent;
  border-bottom-color: transparent;
  --panel-text: var(--text-cream, rgba(255, 236, 217, 0.95));
  --panel-text-secondary: rgba(255, 244, 232, 0.78);
}

body.gallery-mode #panel-section .panel__title,
body.gallery-mode #panel-section .panel__subtitle,
body.gallery-mode #panel-section .panel__back {
  text-shadow: 0 1px 10px rgba(30, 40, 80, 0.35);
}

body.gallery-mode #panel-section .filter-bar {
  --panel-pill-text: #4a3a66;
  --panel-pill-bg: rgba(255, 252, 246, 0.62);
  --panel-pill-bg-hover: rgba(255, 252, 246, 0.85);
  --panel-pill-border: rgba(255, 255, 255, 0.75);
  --panel-pill-active: rgba(42, 29, 66, 0.82);
  --panel-pill-active-text: #fff6ec;
}

body.gallery-mode #panel-section .filter-pill {
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

body.gallery-mode #panel-section .era-title {
  color: rgba(255, 246, 236, 0.85);
  text-shadow: 0 1px 8px rgba(30, 40, 80, 0.3);
}

body.gallery-mode #panel-section .era-title::before,
body.gallery-mode #panel-section .era-title::after {
  background: rgba(255, 255, 255, 0.35);
}

/* Night: pills glow softly on the dark sky; the active one is light */
body[data-theme="night"].gallery-mode #panel-section .filter-bar {
  --panel-pill-text: rgba(225, 232, 250, 0.95);
  --panel-pill-bg: rgba(120, 140, 200, 0.2);
  --panel-pill-bg-hover: rgba(140, 160, 220, 0.34);
  --panel-pill-border: rgba(170, 190, 240, 0.4);
  --panel-pill-active: rgba(235, 240, 255, 0.92);
  --panel-pill-active-text: #1a2140;
}

body.gallery-mode #panel-section .note-banner {
  color: rgba(255, 246, 236, 0.9);
  text-shadow: 0 1px 8px rgba(30, 40, 80, 0.3);
}

/* The scene's page title replaces the panel's own heading (kept for screen readers) */
body.gallery-mode #panel-section .panel__heading {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

body.gallery-mode #panel-section .panel__chrome {
  padding-top: calc(5vh + 62px);   /* clears the title above */
  padding-left: 4vw;               /* lines up with the title's left edge */
}

/* About: the text needs a surface, so it sits on a card over the sky */
body.gallery-mode #panel-section[data-section="about"] .about-column {
  background: var(--panel-card-bg);
  border-radius: 12px;
  padding: 40px 44px;
  box-shadow: 0 6px 28px var(--panel-shadow);
}

@media (max-width: 640px) {
  body.gallery-mode #panel-section[data-section="about"] .about-column { padding: 28px 24px; }
}

/* ---- Write-ups (detail panel) float over the sky too ---- */

body.gallery-mode #panel-detail .panel__scroll {
  background: transparent;
  transition: none;
}

body.gallery-mode #panel-detail .panel__chrome {
  background: transparent;
  border-bottom-color: transparent;
  padding-top: calc(5vh + 62px);
  padding-left: 4vw;
  --panel-text: var(--text-cream, rgba(255, 236, 217, 0.95));
  --panel-text-secondary: rgba(255, 244, 232, 0.78);
}

body.gallery-mode #panel-detail .panel__back { text-shadow: 0 1px 10px rgba(30, 40, 80, 0.35); }

/* The write-up text sits on a page-coloured card over the sky */
body.gallery-mode #panel-detail .project-body {
  background: var(--panel-bg);
  border-radius: 12px;
  padding: 40px 48px;
  box-shadow: 0 6px 28px var(--panel-shadow);
}

@media (max-width: 640px) {
  body.gallery-mode #panel-detail .project-body { padding: 28px 20px; }
}

/* Gallery cards fade away behind an open write-up instead of popping off */
#panel-section { transition: transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0s linear 0.65s, opacity 0.5s ease; }
#panel-section.is-open { transition: transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0s linear 0s, opacity 0.5s ease; }
body.detail-open #panel-section { opacity: 0; }
