/**
 * RoccOS Application Styles
 * Peach Horizon: glassmorphic surfaces, gradient data cards, tinted glass tags
 */

@font-face { font-family: 'PP Editorial New'; src: url('/assets/fonts/PPEditorialNew.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }

/* ── Peach Horizon Shared Patterns ── */
.data-card {
  background: linear-gradient(135deg, rgba(232, 99, 28, 0.18) 0%, rgba(232, 99, 28, 0.06) 100%);
  border: 1px solid rgba(232, 99, 28, 0.3);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
}

.tag {
  display: inline-block;
  background: var(--os-accent-muted);
  color: var(--os-accent);
  border: 1px solid var(--os-btn-glass-border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

/* ── Shared App Layout ── */
.app-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  font-family: var(--font-system);
  color: var(--os-text);
  background: var(--os-surface);
}

.app-toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--os-surface-raised);
  border-bottom: 1px solid var(--os-border);
  flex-shrink: 0;
}

.app-toolbar button {
  border-radius: var(--radius-sm);
}

.app-body {
  flex: 1;
  overflow: auto;
  padding: var(--sp-4);
}

.app-sidebar {
  width: 180px;
  flex-shrink: 0;
  border-right: 1px solid var(--os-border);
  background: var(--os-bg-warm);
  padding: var(--sp-3);
  overflow-y: auto;
}

.app-split {
  display: flex;
  height: 100%;
}

.finder-proof-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.finder-proof-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--os-border);
  background: var(--os-surface-raised);
  color: var(--os-accent);
  font-size: 0.72rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.06em;
}

/* ── Finder ── */
.finder-main {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ── Carousel ── */
.finder-carousel-wrapper {
  height: 100%;
  position: relative;
}

.finder-carousel {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}

.finder-carousel-card {
  scroll-snap-align: start;
  width: 100%;
  height: 100%;
  min-height: 100%;
  position: relative;
  border: none;
  padding: 0;
  cursor: var(--cur-hand); --crt-cursor: hand;
  display: block;
  background: none;
  font-family: var(--font-system);
  text-align: left;
  flex-shrink: 0;
}

.finder-carousel-thumb {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .finder-carousel-card:hover .finder-carousel-thumb {
    transform: scale(1.03);
  }
}

.finder-carousel-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--sp-8) var(--sp-6);
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.5) 50%, transparent 75%);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.finder-carousel-name {
  font-size: var(--text-3xl);
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  color: #fff;
  letter-spacing: var(--tracking-display);
  line-height: 1.05;
  text-wrap: balance;
}

.finder-carousel-role {
  font-size: var(--text-sm);
  font-family: var(--font-system);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--os-accent);
}

.finder-proof-row {
  margin-top: var(--sp-2);
}

.finder-proof-row--detail {
  margin-top: var(--sp-2);
}

.finder-proof-pill {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.finder-carousel-team {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.6);
  font-style: italic;
}

/* In-progress badge — carousel overlay */
.finder-carousel-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 3px;
  background: var(--os-accent, #F0A030);
  color: var(--os-bg, #0A0A0A);
  margin-top: 6px;
}

.finder-carousel-counter {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.4);
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  pointer-events: none;
  z-index: 2;
  letter-spacing: 0.05em;
}

.finder-phantom {
  pointer-events: none;
  scroll-snap-align: none;
}

/* ── Finder Poster Carousel (Launcher Accordion) ── */

.finder-poster-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: var(--cur-grab); --crt-cursor: grab;
}

.finder-poster-carousel::-webkit-scrollbar {
  display: none;
}

/* Each poster sticks — later posters overlap earlier ones */
.finder-poster {
  position: sticky;
  /* left: set via inline style per index — cascading stack */
  flex: 0 0 90%;
  display: flex;
  flex-direction: column;
  background: var(--poster-bg);
  color: var(--poster-text);
  scroll-snap-align: start;
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
  border: 8px solid var(--poster-bg);
  outline: 4px solid #1A1A1A;
}

/* ── Hero image — full-bleed top half ── */

.finder-poster-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.finder-poster-hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Horizontal tracks */

/* Vertical tracks */

/* ── Poster body — centered content on poster color ── */

.finder-poster-body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  padding: var(--sp-6) var(--sp-6) var(--sp-8);
}

.finder-poster-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
  margin-bottom: var(--sp-1, 4px);
}

.finder-poster-num,
.finder-poster-year {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.5;
  font-weight: 600;
}

.finder-poster-name {
  font-family: var(--font-serif);
  font-size: clamp(26px, 5vw, 44px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0 0 4px;
}

.finder-poster-role {
  font-family: var(--font-sans, var(--font-system));
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: var(--sp-4);
}

.finder-poster-desc {
  font-family: var(--font-sans, var(--font-system));
  font-size: var(--text-sm);
  line-height: 1.6;
  max-width: 38ch;
  opacity: 0.85;
  margin: 0 0 var(--sp-4);
}

.finder-poster-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.finder-poster-pill {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.15);
  opacity: 0.8;
}

.finder-poster-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-sans, var(--font-system));
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--sp-2) var(--sp-6);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: inherit;
  cursor: var(--cur-hand); --crt-cursor: hand;
  transition: background 0.2s ease-out, border-color 0.2s ease-out;
}

.finder-poster-cta:hover {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.5);
}

/* ── Full-screen overlay (case study expand) ── */

.finder-poster-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: rgba(0, 0, 0, 0.6);
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--sp-8) var(--sp-6);
}

.finder-poster-overlay-card {
  position: relative;
  width: 100%;
  max-width: min(720px, calc(100vw - 48px));
  background: var(--poster-bg);
  color: var(--poster-text);
  border: 8px solid var(--poster-bg);
  outline: 4px solid #1A1A1A;
}

/* ── Standalone case-study window (Briefcase / TIA desktop apps) ──
   Same card, rendered directly inside a normal window body instead of the
   fixed full-viewport .finder-poster-overlay. Card must fill the window's
   width rather than clamp against 100vw (the window is usually narrower
   than the viewport, so a 100vw-based clamp would overshoot it). */
.finder-cs-window {
  height: 100%;
  overflow-y: auto;
  background: var(--poster-bg);
  color: var(--poster-text);
  padding: 24px 24px 48px;
  box-sizing: border-box;
}

.finder-cs-window .finder-poster-overlay-card {
  max-width: none;
  margin: 0 auto;
  border-width: 0;
  outline: none;
}

.finder-poster-overlay-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

/* Overlay body — same layout as poster card, larger */
.finder-poster-overlay-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--sp-8) var(--sp-8) var(--sp-6);
}

.finder-poster-overlay-body .finder-poster-meta {
  width: 100%;
  max-width: 900px;
}

.finder-poster-overlay-name {
  font-family: var(--font-serif);
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.finder-poster-overlay-subtitle {
  font-family: var(--font-sans, var(--font-system));
  font-size: 0.8125rem;
  color: var(--poster-text);
  opacity: 0.65;
  margin: 0 0 0.75rem;
  letter-spacing: 0.01em;
}

.finder-poster-overlay-role {
  font-family: var(--font-sans, var(--font-system));
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: var(--sp-6);
}

.finder-poster-overlay-desc {
  font-family: var(--font-sans, var(--font-system));
  font-size: var(--text-base);
  line-height: 1.6;
  max-width: 52ch;
  opacity: 0.85;
}

/* Case-study hero head: eyebrow (role) over the name; index and year level
   with the name at the far left and right */
.finder-poster-overlay-body .cs-hero-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: ". eyebrow ." "num name year";
  align-items: center;
  column-gap: 16px;
  margin-bottom: var(--sp-6);
}
.cs-hero-head .cs-hero-eyebrow { grid-area: eyebrow; margin: 0 0 14px; }
.cs-hero-head .finder-poster-num { grid-area: num; justify-self: start; }
.cs-hero-head .finder-poster-year { grid-area: year; justify-self: end; }
.cs-hero-head .finder-poster-overlay-name { grid-area: name; margin: 0; }
.finder-poster-overlay-body .finder-poster-overlay-desc { max-width: 38rem; font-size: 1.125rem; line-height: 1.6; text-wrap: pretty; }

.finder-poster-overlay-content {
  font-family: var(--font-sans);
  padding: var(--sp-6) var(--sp-8) var(--sp-10);
  max-width: 900px;
  margin: 0 auto;
}

.finder-poster-close {
  position: fixed;
  top: var(--sp-4);
  left: var(--sp-4);
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-sans, var(--font-system));
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--poster-text);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  border: none;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: var(--cur-hand); --crt-cursor: hand;
  opacity: 0.9;
  transition: opacity 0.15s ease;
}

.finder-poster-close:hover {
  opacity: 1;
}

/* Orange back button for gallery + roccoflow overlays */
.finder-gallery-overlay .finder-poster-close {
  background: #F36E16;
  color: #fff;
  opacity: 1;
  backdrop-filter: none;
}

/* Detail styles inside overlay */
.finder-poster-overlay-content .cs-app-body {
  padding: 0;
}

.finder-poster-overlay-content .cs-app-row {
  border-color: rgba(255, 255, 255, 0.12);
}

.finder-poster-overlay-content .cs-app-row:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.finder-poster-overlay-content .cs-app-label {
  color: var(--poster-text);
  opacity: 1;
}

.finder-poster-overlay-content .cs-app-content {
  color: var(--poster-text);
}

/* ── Project Gallery Carousel ── */

.finder-gallery-block {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: var(--cur-zoom); --crt-cursor: zoom;
}

.finder-gallery-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
}

.finder-gallery-img.is-active {
  opacity: 1;
  pointer-events: auto;
}

.finder-gallery-dots {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.4rem;
  z-index: 2;
}

.finder-gallery-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: none;
  padding: 0;
  cursor: var(--cur-hand); --crt-cursor: hand;
  transition: background 0.2s ease;
}

.finder-gallery-dot.is-active {
  background: rgba(255, 255, 255, 0.9);
}

/* ── Lightbox ── */

.finder-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: var(--cur-hand); --crt-cursor: hand;
}

.finder-lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  cursor: var(--cur-arrow); --crt-cursor: arrow;
  display: block;
}

.finder-lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.25rem;
  padding: 0.875rem 1.125rem;
  cursor: var(--cur-hand); --crt-cursor: hand;
  border-radius: 4px;
  transition: background 0.15s ease;
  line-height: 1;
}

.finder-lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.finder-lightbox-btn--prev { left: 1.5rem; }
.finder-lightbox-btn--next { right: 1.5rem; }

.finder-lightbox-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  font-family: var(--font-mono, monospace);
}

.finder-poster-overlay-content .cs-app-content p {
  opacity: 0.85;
}

.finder-poster-overlay-content .cs-app-tag {
  border-color: currentColor;
  border-opacity: 0.2;
  background: rgba(255, 255, 255, 0.08);
  color: var(--poster-text);
}

.finder-poster-overlay-content .cs-list {
  gap: 1.75rem;
}

.finder-poster-overlay-content .cs-step {
  flex-direction: column;
  gap: 0.1rem;
}

.finder-poster-overlay-content .cs-step::before {
  color: var(--poster-text);
  opacity: 0.35;
  font-family: var(--font-serif);
  font-size: 1rem;
  width: auto;
}

.finder-poster-overlay-content .cs-step p {
  color: var(--poster-text);
  opacity: 0.85;
}

.finder-poster-overlay-content .cs-stat {
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  backdrop-filter: none;
}

.finder-poster-overlay-content .cs-stat-value {
  color: var(--poster-text);
  font-size: clamp(2rem, 4vw, 3rem);
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.finder-poster-overlay-content .cs-stat-label {
  color: var(--poster-text);
  opacity: 0.6;
}

.finder-poster-overlay-content .cs-stats + div {
  color: var(--poster-text);
  opacity: 0.85;
  margin-top: 1.5rem;
}

.finder-poster-overlay-content .cs-checklist li {
  color: var(--poster-text);
  opacity: 0.85;
}

.finder-poster-overlay-content .cs-checklist li::before {
  color: var(--poster-text);
  opacity: 0.6;
}

.finder-poster-overlay-content .finder-ed-ext-link {
  color: var(--poster-text);
}

/* ── Detail area below carousel ── */

.finder-poster-detail-area {
  height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 var(--sp-4);
  /* background set via JS to match the poster color */
}

.finder-poster-detail-area .cs-app-body {
  padding: var(--sp-6) 0;
}

.finder-poster-detail-area .cs-app-row {
  border-color: rgba(255, 255, 255, 0.12);
}

.finder-poster-detail-area .cs-app-label {
  color: #FFF;
  opacity: 1;
}

.finder-poster-detail-area .cs-app-content {
  color: #FFF;
}

.finder-poster-detail-area .cs-app-content p {
  opacity: 0.85;
}

.finder-poster-detail-area .cs-app-tag {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #FFF;
}

.finder-poster-detail-area .cs-step::before {
  color: rgba(255, 255, 255, 0.35);
}

.finder-poster-detail-area .cs-stat-value {
  color: #FFF;
}

.finder-poster-detail-area .cs-stat-label {
  color: rgba(255, 255, 255, 0.6);
}

.finder-poster-detail-area .finder-ed-ext-link {
  color: #FFF;
}

/* External link (reused in detail) */
.finder-ed-ext-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #FFF;
  text-decoration: none;
  margin-top: var(--sp-4);
  padding-bottom: var(--sp-4);
  transition: opacity 0.15s ease, transform 160ms ease-out;
}

.finder-ed-ext-link:hover {
  opacity: 0.7;
}

/* Keep vertical rhythm, remove horizontal padding for full-bleed posters */
.launcher-panel-content:has(.finder-poster-carousel) {
  padding: var(--sp-4) 0;
}

/* ── Window (desktop OS) mode — same poster carousel, framed to window bounds ──
   In the launcher the panel is height:auto so posters grow to their natural
   content height. Inside a fixed-height OS window that overflows and gets cut
   off. Here we constrain the carousel + posters to the window height so each
   poster is fully framed (all four marquee borders visible), with only the
   intended scroll: horizontal between posters, and vertical inside a poster's
   body if its content is taller than the window. */
.finder-main--window {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: var(--sp-4) 0;
  box-sizing: border-box;
}

.finder-main--window .finder-poster-carousel {
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
}

/* Posters fill the window height instead of growing past it */
.finder-main--window .finder-poster {
  height: 100%;
  min-height: 0;
}

/* Hero takes a bounded share; body scrolls if content overflows */
.finder-main--window .finder-poster-hero {
  flex: 0 0 auto;
  max-height: 46%;
  aspect-ratio: auto;
}

.finder-main--window .finder-poster-hero:has(.cs-hero-chat) {
  padding: 1.25rem 1.5rem;
}

.finder-main--window .finder-poster-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  justify-content: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-5) var(--sp-6) var(--sp-6);
}

.finder-main--window .finder-poster-body::-webkit-scrollbar {
  width: 6px;
}
.finder-main--window .finder-poster-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 3px;
}

/* Gallery poster keeps its absolutely-positioned TOC; just fill the height */
.finder-main--window .finder-gallery-poster-face {
  height: 100%;
}

/* ── Gallery Poster Face — Mini TOC Preview ── */

.finder-gallery-poster-face {
  overflow: hidden;
  /* position: sticky inherited from .finder-poster — don't override */
}

.finder-gallery-poster-toc {
  position: absolute;
  inset: 14px; /* inside marquee borders */
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.finder-gallery-poster-toc-track {
  animation: gallery-poster-scroll 35s linear infinite;
}

@keyframes gallery-poster-scroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

.finder-gallery-poster-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0;
}

.finder-gallery-poster-row-title {
  font-family: var(--font-serif);
  font-size: clamp(9px, 1vw, 13px);
  font-weight: 400;
  color: var(--poster-text);
  text-align: left;
  padding-left: 24px;
  line-height: 1.3;
  opacity: 0.85;
}

.finder-gallery-poster-row-img {
  overflow: hidden;
  line-height: 0;
}

.finder-gallery-poster-row-img img,
.finder-gallery-poster-row-img video {
  width: 100%;
  height: auto;
  display: block;
}

.finder-gallery-poster-row-meta {
  font-family: var(--font-serif);
  font-size: clamp(8px, 0.9vw, 11px);
  font-weight: 400;
  color: var(--poster-text);
  text-align: right;
  padding-right: 24px;
  opacity: 0.6;
  line-height: 1.3;
}

.finder-gallery-poster-row-meta em {
  font-style: italic;
}

/* ── Gallery Overlay ── */

.finder-gallery-overlay {
  padding: 32px;
  overflow: hidden;
  align-items: center;
}

.finder-gallery-card {
  max-width: calc(100vw - 64px);
  width: 100%;
  background: #F5F0E8;
  color: #1A1A1A;
  border-color: #F5F0E8;
  overflow: hidden;
  height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}

/* Magazine TOC — JS-driven infinite scroll */
.finder-gallery-toc {
  position: relative;
  z-index: 1;
  overflow: hidden;
  flex: 1;
}

/* TOC row — full-width justified with a consistent item rhythm. */
.finder-gallery-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0;
  margin-block-end: 1rem;
  position: relative;
}

.finder-gallery-title {
  font-family: var(--font-serif);
  /* cqi keeps title sizing relative to the gallery container, not the viewport. */
  font-size: clamp(13px, 2.6cqi, 17px);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: #2A2420;
  text-align: left;
  padding-left: 48px;
  line-height: 1.3;
}

.finder-gallery-img-wrap {
  cursor: var(--cur-hand); --crt-cursor: hand;
  overflow: hidden;
  line-height: 0;
  background: #D4CFC7;
  max-width: 100%;
  will-change: transform;
  transform-origin: center center;
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.finder-gallery-img-wrap .finder-gallery-img {
  position: static;
  opacity: 1;
  pointer-events: auto;
  width: 100%;
  height: auto;
  inset: unset;
  display: block;
  object-fit: unset;
}

@media (hover: hover) and (pointer: fine) {
  .finder-gallery-img-wrap:hover {
    transform: scale(1.04);
    z-index: 2;
  }
}

.finder-gallery-meta {
  font-family: var(--font-serif);
  font-size: clamp(12px, 2.2cqi, 15px);
  font-weight: 400;
  color: #2A2420;
  text-align: right;
  padding-right: 48px;
  line-height: 1.3;
}

.finder-gallery-meta em {
  font-style: italic;
}

/* Gallery zoom overlay */
.finder-gallery-zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  cursor: var(--cur-hand); --crt-cursor: hand;
}

.finder-gallery-zoom-img {
  position: fixed;
  object-fit: contain;
  cursor: var(--cur-hand); --crt-cursor: hand;
}
/* Phones: the zoomed design is taller than the screen is wide; swipe sideways */
.finder-gallery-zoom-overlay.is-panning {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: none;
}
.finder-gallery-zoom-overlay.is-panning::-webkit-scrollbar { display: none; }

/* Gallery responsive */
@media (max-width: 700px) {
  .finder-gallery-overlay {
    padding: 16px;
  }

  .finder-gallery-card {
    max-width: 100vw;
    max-height: 100vh;
    border-width: 0;
    outline: none;
  }

  .finder-gallery-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(42, 36, 32, 0.06);
  }

  .finder-gallery-title {
    text-align: left;
    padding-left: 0;
    font-size: 14px;
  }

  .finder-gallery-img-wrap {
    width: 100%;
  }

  .finder-gallery-meta {
    padding-right: 0;
    text-align: left;
    font-size: 12px;
    opacity: 0.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  .finder-gallery-poster-toc-track,
  .finder-gallery-toc-track {
    animation: none;
  }
}

/* ── Gallery Scroller as ROOT Portfolio view ──
   The Portfolio app opens directly to the magazine TOC scroller. It renders
   inline into the app host (OS window body or launcher accordion panel)
   rather than as a fixed overlay. The scroll loop is JS-driven (translateY on
   the track), so the root only needs to clip overflow and provide a height. */
.finder-gallery-root {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--poster-bg, #F5F0E8);
  color: var(--poster-text, #2A2420);
  overflow: hidden;
}

/* Establish a size-query container on the TOC (present in BOTH the root view
   and the legacy overlay) so gallery tiles size against the actual
   window/panel/card width (cqw), not the viewport (vw). This is what keeps the
   featured case-study tiles from spilling past a narrow window's edge. */
.finder-gallery-toc {
  container-type: inline-size;
  container-name: finder-gallery;
}

/* Hard guard: rows never exceed the container's inline size, so a too-wide
   tile can't push the grid past the window edge. min-width:0 lets the grid
   columns (title / meta) actually shrink instead of forcing overflow. */
.finder-gallery-toc .finder-gallery-row {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.finder-gallery-toc .finder-gallery-title,
.finder-gallery-toc .finder-gallery-meta {
  min-width: 0;
  overflow: hidden;
}

/* Window context — fill the .finder window body height. */
.finder-gallery-root--window {
  height: 100%;
}

.finder-gallery-back {
  align-self: flex-start;
  flex-shrink: 0;
  margin: 8px 16px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: #2A2420;
  font: 600 12px/1.4 var(--font-sans);
  cursor: var(--cur-hand);
  --crt-cursor: hand;
}
.finder-gallery-back:focus-visible { outline: 2px solid #254C3D; outline-offset: 3px; }

/* The phone app host otherwise grows to the triplicated track's full height.
   Give Portfolio a bounded viewport so focus and looping use visible space. */
.mob-appview-content:has(> .finder-gallery-root--window) {
  height: 100%;
  margin: 0;
}

/* Launcher accordion — panel is height:auto, so the scroller declares its own
   bounded viewport-relative height and scrolls internally. */
.finder-gallery-root--launcher {
  height: min(680px, 78vh);
}

/* The TOC fills the root and clips the looping track. */
.finder-gallery-root .finder-gallery-toc {
  flex: 1;
  min-height: 0;
}

/* Selected direction B: artwork captions, 5rem wider than design tiles. */
.finder-gallery-toc .finder-gallery-row--case-study {
  display: flex;
  justify-content: center;
  padding: 8px 16px;
}

.finder-gallery-case-tile {
  display: block;
  position: relative;
  width: min(calc(var(--gallery-tile-width) + 5rem), calc(100cqw - 32px));
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #211D18;
  color: #FFF;
  text-align: left;
  cursor: var(--cur-hand);
  --crt-cursor: hand;
}

.finder-gallery-case-tile > .study-cover { height: 100%; aspect-ratio: auto; }
.finder-gallery-case-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 20%, #0003 45%, #000E 100%);
}

.finder-gallery-case-caption {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 20px;
  z-index: 1;
  padding-right: 58px;
}
.finder-gallery-case-name { display: block; font: 700 10px/1.4 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; }
.finder-gallery-case-headline { display: block; margin-top: 8px; font: 400 clamp(22px, 3cqw, 28px)/1.08 var(--font-serif); letter-spacing: -.02em; text-wrap: balance; }
.finder-gallery-case-arrow {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font: 400 24px/1 var(--font-sans);
}
.finder-gallery-case-tile:focus-visible { outline: 2px solid #254C3D; outline-offset: 4px; }

/* Live demos keep the same fixed-size tile and leave room for its caption. */
.finder-gallery-live-cover > .finder-gallery-feat-hero {
  box-sizing: border-box;
  padding-bottom: 64px;
}
.finder-gallery-live-cover > .finder-gallery-feat-hero:has(.cs-hero-chat) {
  padding: clamp(12px, 3cqw, 24px) clamp(16px, 4cqw, 32px) clamp(64px, 12cqw, 80px);
}
.finder-gallery-live-cover .cs-hero-chat { min-height: 0; }
.finder-gallery-live-cover .cs-hero-chat-body { min-height: 0 !important; }
.finder-gallery-live-cover .cs-hero-chat-name { font-size: clamp(9px, 2.2cqw, 12px); }
.finder-gallery-case-tile .finder-gallery-live-cover .cs-hero-bubble { font-size: clamp(9px, 1.9cqw, 11px); }
.finder-gallery-live-cover .cs-hero-source { font-size: clamp(6px, 1.5cqw, 8px); padding: 2px 4px; }
.study-cover-window-video { display: block; width: 100%; aspect-ratio: 2.2; object-fit: cover; }

/* Featured media tile — fills the glow wrapper, shares the same responsive
   width as the other gallery items, and frames the hero at 16/9. z-index
   lifts the card above the glow pseudo-layers. */
.finder-gallery-img-wrap--featured {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  background: #1A1A1A;
  border-radius: 4px;
  overflow: hidden;
}

/* The Briefcase chat hero sizes to its content height — the fixed 16/9 ratio
   leaves a dead band of empty card below the messages, which reads as a gap.
   (Video/image featured tiles keep 16/9.) */
.finder-gallery-img-wrap--featured:has(.cs-hero-chat) {
  aspect-ratio: auto;
}
.finder-gallery-img-wrap--featured:has(.cs-hero-chat) .finder-gallery-feat-hero {
  height: auto;
}

/* The real hero (chat / video) fills the featured tile and is clipped to it —
   it can never be wider than the tile. The shared .finder-poster-hero rules
   style the chat + video; here we make the hero fill + clip. Hover scale uses
   transform (no layout reflow, so offsetTop scroll measurement stays correct). */
.finder-gallery-feat-hero {
  width: 100%;
  height: 100%;
  max-width: 100%;
  aspect-ratio: auto;
  overflow: hidden;
}

/* Video hero fills + cover-crops the tile, never overflowing it. */
.finder-gallery-feat-hero .finder-poster-hero-video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  display: block;
}

/* Chat hero: cap every internal width to 100% so long bubbles wrap inside the
   tile rather than forcing the card wider than its frame. */
.finder-gallery-feat-hero .cs-hero-chat,
.finder-gallery-feat-hero .cs-hero-chat-body,
.finder-gallery-feat-hero .cs-hero-msg,
.finder-gallery-feat-hero .cs-hero-bubble {
  max-width: 100%;
  box-sizing: border-box;
}

.finder-gallery-feat-hero .cs-hero-bubble {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.finder-gallery-img-wrap--featured .cs-hero-chat {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

/* Compact chat padding inside the small featured tile. */
.finder-gallery-feat-hero.finder-poster-hero:has(.cs-hero-chat) {
  padding: 0.85rem 1rem;
}

.finder-gallery-feat-hero .cs-hero-chat-header {
  padding: 0.5rem 0.85rem;
}

.finder-gallery-feat-hero .cs-hero-chat-body {
  padding: 0.7rem 0.85rem;
  gap: 0.5rem;
  min-height: 0;
}

.finder-gallery-feat-hero .cs-hero-bubble {
  font-size: 0.6875rem;
  padding: 0.45rem 0.65rem;
}

/* Narrow CONTAINER (small window OR phone) — the viewport @media above only
   fires on small screens, so a small window on a big screen would still try a
   3-column row. This container query collapses the row to a single column and
   full-widths every tile (standard + featured) whenever the container itself
   is narrow, which is what actually prevents overflow inside a small window.
   Threshold sits above the featured tile's 300px floor + comfortable title/meta
   room, so the 3-column layout only stays while it genuinely fits. */
@container finder-gallery (max-width: 620px) {
  .finder-gallery-toc .finder-gallery-row {
    grid-template-columns: 1fr;
    gap: 4px;
    /* Tight vertical rhythm — the title/meta lines already separate pieces, so
       keep the empty padding band between tiles small. */
    padding: 4px 16px;
  }

  .finder-gallery-toc .finder-gallery-row--case-study {
    padding: 6px 16px;
  }

  .finder-gallery-toc .finder-gallery-title {
    text-align: left;
    padding-left: 0;
  }

  .finder-gallery-toc .finder-gallery-meta {
    text-align: left;
    padding-right: 0;
    opacity: 0.6;
  }

  .finder-gallery-case-caption { left: 16px; right: 16px; bottom: 16px; padding-right: 48px; }
  .finder-gallery-case-headline { font-size: clamp(18px, 5cqw, 24px); }
  .finder-gallery-case-name { font-size: 9px; }

  /* Every tile spans the single column within the row's horizontal padding. */
  .finder-gallery-toc .finder-gallery-img-wrap,
  .finder-gallery-toc .finder-gallery-img-wrap--featured {
    width: 100% !important;
  }
}

/* Shorter launcher panel height on small SCREENS (genuinely viewport-driven). */
@media (max-width: 700px) {
  .finder-gallery-root--launcher {
    height: min(560px, 72vh);
  }
}

/* ── Finder Detail ── */
.finder-detail {
  background: var(--os-surface-opaque);
  color: var(--os-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-y: auto;
  height: 100%;
}

.finder-detail-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

.finder-detail-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

.finder-nav-back {
  cursor: var(--cur-hand); --crt-cursor: hand;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #6B6B63;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  transition: opacity 0.15s;
  opacity: 0.6;
}

.finder-nav-back:hover {
  opacity: 1;
}

.finder-nav-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.finder-nav-prev,
.finder-nav-next {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.03);
  color: #1A1A17;
  cursor: var(--cur-hand); --crt-cursor: hand;
  font-size: 0.8125rem;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  padding: 0;
}

.finder-nav-prev:hover,
.finder-nav-next:hover {
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.2);
}

.finder-nav-count {
  font-size: 0.75rem;
  color: #74746C;
  min-width: 4ch;
  text-align: center;
}

/* ── Team Credit ── */
.finder-detail-team {
  font-size: var(--text-xs);
  color: var(--os-text-muted);
  font-style: italic;
  margin-top: var(--sp-1);
}

/* Typing cursor for type-in effect */
.typing-cursor::after {
  content: '\2588';
  animation: pulse 0.8s step-end infinite;
  color: var(--os-accent);
}

/* ── Mail (Contact) ── */
/* ── Contact — Editorial Card (Deep Green) ── */

.mail-editorial {
  position: relative;
  background: #1B4332;
  color: #C38BC0;
  border: 8px solid #1B4332;
  outline: 4px solid #0D2818;
  padding: 0;
  min-height: 480px;
  overflow: hidden;
}

/* ── Body ── */

.mail-ed-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--sp-8) var(--sp-8) var(--sp-6);
}

.mail-ed-body--success {
  justify-content: center;
  min-height: 400px;
}

.mail-ed-heading {
  font-family: var(--font-serif);
  font-size: clamp(40px, 7vw, 80px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin: var(--sp-6) 0 var(--sp-6);
  color: #C38BC0;
}

.mail-ed-subhead {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  opacity: 0.5;
  margin-bottom: var(--sp-6);
}

.mail-ed-bio {
  font-family: var(--font-sans, var(--font-system));
  font-size: var(--text-base);
  line-height: 1.7;
  max-width: 36ch;
  opacity: 0.8;
  margin-bottom: var(--sp-6);
}

/* ── Form ── */

.mail-ed-form {
  width: 100%;
  max-width: 420px;
  text-align: left;
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-6);
}

.mail-ed-field {
  margin-bottom: var(--sp-3);
}

.mail-ed-field--textarea {
  margin-bottom: var(--sp-4);
}

.mail-ed-label {
  display: block;
  font-family: var(--font-sans, var(--font-system));
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 4px;
}

.mail-ed-input,
.mail-ed-textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(195, 139, 192, 0.25);
  border-radius: 0;
  background: none;
  color: #C38BC0;
  font-family: var(--font-sans, var(--font-system));
  font-size: var(--text-sm);
  padding: var(--sp-2) 0;
  outline: none;
  transition: border-color 0.2s ease-out;
}

.mail-ed-input:focus,
.mail-ed-textarea:focus {
  border-bottom-color: rgba(195, 139, 192, 0.6);
}

.mail-ed-input::placeholder,
.mail-ed-textarea::placeholder {
  color: rgba(195, 139, 192, 0.35);
}

.mail-ed-input--error {
  border-bottom-color: #ef4444 !important;
}

.mail-ed-textarea {
  resize: none;
  line-height: 1.6;
}

/* ── Actions ── */

.mail-ed-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
}

.mail-ed-send {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-sans, var(--font-system));
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--sp-2) var(--sp-6);
  background: rgba(13, 40, 24, 0.5);
  border: 1px solid rgba(195, 139, 192, 0.3);
  border-radius: 999px;
  color: #C38BC0;
  cursor: var(--cur-hand); --crt-cursor: hand;
  transition: background 0.2s ease-out, border-color 0.2s ease-out, transform 160ms ease-out;
}

.mail-ed-send svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.mail-ed-send:hover {
  background: rgba(13, 40, 24, 0.7);
  border-color: rgba(195, 139, 192, 0.5);
}

.mail-ed-resume {
  display: inline-flex;
  transition: transform 160ms ease-out;
  align-items: center;
  margin-top: var(--sp-6);
  font-family: var(--font-sans, var(--font-system));
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #C38BC0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: var(--cur-hand); --crt-cursor: hand;
  transition: opacity 0.2s ease-out;
}

.mail-ed-resume:hover {
  opacity: 0.7;
}

.mail-ed-send:disabled {
  opacity: 0.5;
  cursor: var(--cur-arrow); --crt-cursor: arrow;
}

.mail-ed-error {
  font-size: var(--text-xs);
  color: #ef4444;
  margin: 0;
}

@media (max-width: 600px) {
  .mail-ed-body {
    padding: var(--sp-6) var(--sp-4) var(--sp-4);
  }
}

/* ── About ── */
/* ── About — Editorial Poster (Burnt Orange) ── */

.about-editorial {
  position: relative;
  box-sizing: border-box;
  background: #BA4614;
  color: #EFAD24;
  padding: var(--sp-4);
  min-height: 500px;
  min-height: max(500px, 100%);
  overflow: hidden;
  /* column so the body can grow and the portrait can stand on the bottom edge */
  display: flex;
  flex-direction: column;
  /* Establish a container so the hero name can size off the window/panel
     width (cqw) instead of the viewport (vw) — prevents clipping in narrow
     windows while still scaling up in wide ones. */
  container-type: inline-size;
}

/* Horizontal tracks (top/bottom) */

/* Vertical tracks (left/right) */

/* ── Body — centered content ── */

.about-ed-body {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  text-align: left;
}

.about-ed-name {
  font-family: var(--font-serif);
  /* Size off the container (window/panel) width via cqw so the name never
     clips in a narrow window. Falls back to vw where cqw is unsupported. */
  font-size: clamp(28px, 4.4vw, 48px);
  font-size: clamp(28px, 7.4cqw, 48px);   /* small enough that the poster fits its window */
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.03em;
  margin-top: 48px;
  margin-bottom: 2px;
  max-width: 100%;
  text-wrap: balance;
  overflow-wrap: break-word;
}

/* Role, Company and About share one text style (the About paragraph's) */
.about-ed-role,
.about-ed-company {
  font-family: var(--font-sans, var(--font-system));
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: normal;
  color: #FFF1D6;                 /* cream on the orange: 4.7:1 */
  margin: 0;
}


/* ── Grid: hairline rules between left-aligned cells ──
   1px gaps over a line-coloured grid background; every cell paints the poster orange. */
.about-ed-grid {
  --line: rgba(255, 241, 214, 0.3);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.about-ed-cell {
  background: #BA4614;
  padding: var(--sp-3) var(--sp-4);
  min-width: 0;
  margin: 0;
}
.about-ed-cell--full { grid-column: 1 / -1; }
.about-ed-cell--label { padding-block: var(--sp-3); }
@container (min-width: 520px) {
  .about-ed-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .about-ed-cell--half { grid-column: span 2; }
}
.about-ed-k {
  font: 700 11px/1 var(--font-sans, var(--font-system));
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #EFAD24;
  margin: 0 0 var(--sp-2);
}
.about-ed-cell--label { margin: 0; }
.about-ed-header .about-ed-name { margin: 0; text-align: left; }

/* The Asana talk as a postage stamp (an appearance, not an award): perforated cream
   paper holding the real stage photo (it already reads "2024 asana"), a caption, and an
   ink postmark cancelling its top-right corner. A button: it opens the postcard. */
.about-ed-stamp {
  --perf: 5px;                                   /* perforation hole radius */
  position: relative;
  display: block;
  width: 100%;
  rotate: -3deg;
  container-type: inline-size;
  filter: drop-shadow(0 4px 6px rgba(60, 18, 0, 0.35));
  transition: translate 200ms var(--ease-out, cubic-bezier(.23, 1, .32, 1)), rotate 200ms var(--ease-out, cubic-bezier(.23, 1, .32, 1));
}
.about-ed-stamp-paper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: calc(var(--perf) * 2.2) calc(var(--perf) * 2.2) calc(var(--perf) * 1.6);
  background: #F6EBD3;
  /* holes along every edge; the content box stays solid */
  -webkit-mask: linear-gradient(#000 0 0) content-box,
    radial-gradient(circle var(--perf), #0000 96%, #000) calc(var(--perf) * -1.4) calc(var(--perf) * -1.4) / calc(var(--perf) * 2.8) calc(var(--perf) * 2.8) round;
  mask: linear-gradient(#000 0 0) content-box,
    radial-gradient(circle var(--perf), #0000 96%, #000) calc(var(--perf) * -1.4) calc(var(--perf) * -1.4) / calc(var(--perf) * 2.8) calc(var(--perf) * 2.8) round;
}
.about-ed-stamp-paper img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 58% 40%;
  outline: 1px solid rgba(90, 40, 10, 0.35);
  filter: saturate(0.85) contrast(1.05) sepia(0.12);
}
.about-ed-stamp-caption {
  font: 700 5.6cqi/1.1 var(--font-sans, var(--font-system));
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-transform: uppercase;
  text-align: center;
  color: #7A2A08;
}
.about-ed-postmark {
  position: absolute;
  left: 52%;
  top: -10%;
  width: 82%;
  height: auto;
  color: rgba(40, 18, 8, 0.7);
  mix-blend-mode: multiply;
  rotate: -9deg;
  pointer-events: none;
}
/* Recognition: the Asana stamp + four award coasters as five equal cells.
   Its own ruled grid: 5 across when wide, 3 across in a default window, 2 across on small phones. */
.about-ed-recog { padding: 0; background: var(--line); }
.about-ed-recog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
}
@container (min-width: 360px) {
  .about-ed-recog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container (min-width: 600px) {
  .about-ed-recog-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .about-ed-recog-filler { display: none; }
}
/* the stamp cell is a button (opens the postcard) that looks like the other cells */
.about-ed-award--stamp {
  all: unset;
  box-sizing: border-box;
  background: #BA4614;
  padding: var(--sp-3);
  cursor: var(--cur-hand); --crt-cursor: hand;
}
.about-ed-award--stamp .about-ed-stamp {
  width: clamp(48px, 11.5cqi, 78px);            /* about a coaster's footprint */
  --perf: 3px;
  margin-bottom: var(--sp-3);
}
.about-ed-award--stamp .about-ed-stamp-caption { display: none; }   /* too small to read; the cell caption says it */
.about-ed-award--stamp:hover .about-ed-stamp { translate: 0 -3px; rotate: -1deg; }
.about-ed-award--stamp:focus-visible { outline: 2px solid #FFF1D6; outline-offset: -4px; }
.about-ed-award--stamp .about-ed-award-name { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 241, 214, 0.5); }

/* Award coasters: one per grid cell, left aligned, pop in on open */
.about-ed-recog .about-ed-award { padding: var(--sp-3); }
.about-ed-recog .about-ed-award .about-award-icon,
.about-ed-recog .about-ed-award--stamp .about-ed-stamp { margin-bottom: var(--sp-2); }
.about-ed-award {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  animation: about-award-pop 420ms cubic-bezier(.34, 1.56, .64, 1) both;
  animation-delay: calc(150ms + var(--i) * 70ms);
}
.about-ed-award .about-award-icon {
  width: clamp(40px, 9cqi, 64px);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 10px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.18));
  margin-bottom: var(--sp-3);
  rotate: calc((var(--i) - 2.5) * 3deg);
}
.about-ed-award-name {
  font: 700 var(--text-xs)/1.25 var(--font-sans, var(--font-system));
  color: #FFF1D6;
}
.about-ed-award-detail {
  font: 400 11px/1.3 var(--font-sans, var(--font-system));
  color: #FFF1D6;
  opacity: 0.75;
}
@keyframes about-award-pop {
  from { opacity: 0; scale: 0.6; }
  to { opacity: 1; scale: 1; }
}

/* ── Postcard: the stamp, large, with its tag and a message ── */
.about-postcard-scrim {
  position: fixed;               /* inside .desktop (a filtered ancestor) this pins to the desktop */
  inset: 0;
  z-index: var(--z-overlay);
  display: grid;
  place-items: center;
  padding: var(--sp-6);
  background: rgba(20, 8, 2, 0.55);
  opacity: 0;
  transition: opacity 200ms var(--ease-out, cubic-bezier(.23, 1, .32, 1));
}
.about-postcard-scrim.is-open { opacity: 1; }
/* on <body> (phone app view, /accordion) it must clear the mobile shell's layers (up to 9100) */
body > .about-postcard-scrim { z-index: 9200; }
.about-postcard-scrim.is-closing { transition-duration: 160ms; transition-timing-function: ease-in; }
.about-postcard {
  position: relative;
  width: min(720px, 100%);
  max-height: 100%;
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-6);
  align-items: center;
  padding: var(--sp-8);
  background: #F6EBD3;
  color: #3A1606;
  border-radius: 6px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  scale: 0.94;
  translate: 0 10px;
  transition: scale 260ms var(--ease-out, cubic-bezier(.23, 1, .32, 1)), translate 260ms var(--ease-out, cubic-bezier(.23, 1, .32, 1));
}
.about-postcard-scrim.is-open .about-postcard { scale: 1; translate: 0 0; }
.about-postcard-scrim.is-closing .about-postcard { scale: 0.96; transition-duration: 160ms; transition-timing-function: ease-in; }
.about-postcard-note {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-4);
  padding-right: var(--sp-6);
  border-right: 1px solid rgba(58, 22, 6, 0.2);
}
.about-postcard-tag {
  font: 700 var(--text-xs)/1.2 var(--font-sans, var(--font-system));
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #BA4614;
  margin: 0;
}
.about-postcard-message {
  font: 400 clamp(18px, 2.4vw, 24px)/1.35 var(--font-serif);
  margin: 0;
  text-wrap: pretty;
}
.about-postcard-sign {
  font: italic 400 var(--text-base)/1 var(--font-serif);
  margin: 0;
  opacity: 0.8;
}
.about-postcard-stamp {
  width: 100%;
  rotate: 3deg;
  cursor: auto; --crt-cursor: arrow;
}
.about-postcard-stamp:hover { translate: none; rotate: 3deg; }
.about-postcard-stamp .about-ed-stamp-paper { --perf: 7px; }
.about-postcard-stamp .about-ed-postmark { left: 46%; width: 66%; }
.about-postcard-close {
  all: unset;
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-3);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font: 400 24px/1 var(--font-sans, var(--font-system));
  color: #3A1606;
  border-radius: 50%;
  cursor: var(--cur-hand); --crt-cursor: hand;
}
.about-postcard-close:hover { background: rgba(58, 22, 6, 0.08); }
.about-postcard-close:focus-visible { outline: 2px solid #BA4614; outline-offset: 2px; }
@media (max-width: 600px) {
  .about-postcard { grid-template-columns: 1fr; padding: var(--sp-8) var(--sp-5) var(--sp-6); }
  .about-postcard-note { order: 2; padding-right: 0; border-right: 0; border-top: 1px solid rgba(58, 22, 6, 0.2); padding-top: var(--sp-4); }
  .about-postcard-stamp { width: 82%; justify-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  .about-ed-stamp, .about-postcard-scrim, .about-postcard { transition: none; }
  .about-ed-award--stamp:hover .about-ed-stamp { translate: none; rotate: -3deg; }
  .about-ed-award { animation: none; }
}

.about-ed-bio {
  font-family: var(--font-sans, var(--font-system));
  font-size: var(--text-base);
  line-height: 1.65;
  max-width: 52ch;
  color: #FFF1D6;
  margin: 0;
  text-wrap: pretty;
}

.about-ed-bio + .about-ed-bio { margin-top: var(--sp-3); }

.about-ed-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-6);
  font-family: var(--font-sans, var(--font-system));
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--sp-2) var(--sp-6);
  background: rgba(80, 30, 5, 0.5);
  border: 1px solid rgba(239, 173, 36, 0.3);
  border-radius: 999px;
  color: #EFAD24;
  text-decoration: none;
  transition: background 0.2s ease-out, border-color 0.2s ease-out, transform 160ms ease-out;
}

.about-ed-cta svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.about-ed-cta:hover {
  background: rgba(80, 30, 5, 0.7);
  border-color: rgba(239, 173, 36, 0.5);
}

/* ── Settings ── */
.settings-container {
  padding: var(--sp-4);
}

.settings-section {
  margin-bottom: var(--sp-6);
  border-radius: var(--radius-sm);
}

.settings-section-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--os-accent);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
}

.settings-section:last-child .settings-section-title {
  color: var(--os-error);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3);
  background: var(--os-surface-raised);
  border: 1px solid var(--os-border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-2);
}

.settings-row-label {
  font-size: var(--text-base);
}

/* Toggle switch */
.settings-toggle {
  width: 44px;
  height: 24px;
  border-radius: var(--radius-md);
  background: var(--os-border);
  border: 1px solid var(--os-border);
  cursor: var(--cur-hand); --crt-cursor: hand;
  position: relative;
  transition: background var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast);
}

.settings-toggle.active {
  background: var(--os-accent);
  border-color: var(--os-accent);
}

.settings-toggle::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-sm);
  background: white;
  border: 1px solid rgba(0,0,0,0.1);
  transition: transform var(--duration-fast) var(--ease-out);
}

.settings-toggle.active::after {
  transform: translateX(20px);
}

/* Wallpaper picker */
.settings-wallpapers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-2);
}

.settings-wallpaper {
  appearance: none;
  padding: 0;
  font: inherit;
  aspect-ratio: 16/9;
  border-radius: var(--radius-md);
  border: 1px solid var(--os-border-subtle);
  cursor: var(--cur-hand); --crt-cursor: hand;
  overflow: hidden;
  transition: border-color var(--duration-fast);
}

.settings-wallpaper.active {
  border-color: var(--os-accent);
  box-shadow: 0 0 0 2px var(--os-accent);
}

.settings-wallpaper:focus-visible,
.settings-wallpaper-custom:focus-visible,
.settings-color-any:focus-within {
  outline: 2px solid var(--os-accent);
  outline-offset: 2px;
}

/* "Any colour" swatch: a colour wheel until a custom colour is chosen; the
   native input covers it so a click opens the system picker. */
.settings-color-any {
  position: relative;
  background: conic-gradient(#E8631C, #E5C97F, #2B7A5A, #0E4F55, #1B2A4A, #4A2545, #E8631C);
}

.settings-color-any input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: var(--cur-hand); --crt-cursor: hand;
}

/* Custom wallpaper swatch */
.settings-wallpaper-custom {
  aspect-ratio: 16/9;
  border-radius: var(--radius-md);
  border: 2px dashed var(--os-border-subtle);
  cursor: var(--cur-hand); --crt-cursor: hand;
  overflow: hidden;
  transition: border-color var(--duration-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}

.settings-wallpaper-custom.active {
  border-color: var(--os-accent);
  border-style: solid;
  box-shadow: var(--shadow-sm);
}

.settings-wallpaper-custom.has-image {
  border-style: solid;
}

.settings-wallpaper-custom:not(.has-image) {
  flex-direction: column;
  gap: 2px;
  border-color: var(--os-text-secondary);
  background: var(--os-surface);
  transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
}

.settings-wallpaper-custom:not(.has-image):hover {
  border-color: var(--os-accent);
  background: var(--os-surface-hover);
}

.settings-wallpaper-custom .custom-wp-icon {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
  pointer-events: none;
}

.settings-wallpaper-custom .custom-wp-label {
  font-size: 10px;
  line-height: 1;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--os-text);
  pointer-events: none;
}

/* ── Dither Overlay (CSS pattern for video embeds) ── */
.dither-overlay {
  position: relative;
}

.dither-pattern {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0;
  transition: opacity 0.3s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Ccircle cx='1' cy='1' r='0.8' fill='%23000' opacity='0.6'/%3E%3Ccircle cx='5' cy='1' r='0.5' fill='%23000' opacity='0.4'/%3E%3Ccircle cx='3' cy='3' r='0.6' fill='%23000' opacity='0.5'/%3E%3Ccircle cx='7' cy='3' r='0.4' fill='%23000' opacity='0.3'/%3E%3Ccircle cx='1' cy='5' r='0.5' fill='%23000' opacity='0.4'/%3E%3Ccircle cx='5' cy='5' r='0.8' fill='%23000' opacity='0.6'/%3E%3Ccircle cx='3' cy='7' r='0.4' fill='%23000' opacity='0.3'/%3E%3Ccircle cx='7' cy='7' r='0.6' fill='%23000' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 8px 8px;
}

[data-dither="true"] .dither-pattern {
  opacity: 0.15;
}

/* ── Game Shared ── */
.game-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  gap: var(--sp-4);
  border-radius: var(--radius-sm);
  background: var(--os-surface);
}

.game-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  text-align: center;
  letter-spacing: 0.05em;
}

.game-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-6);
  width: 100%;
  max-width: 500px;
}

.game-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
}

.game-column-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--os-text-secondary);
}

.game-status {
  font-size: var(--text-base);
  color: var(--os-text-secondary);
  text-align: center;
}

.game-btn {
  padding: var(--sp-2) var(--sp-5);
  border: 1px solid var(--os-border);
  border-radius: var(--radius-md);
  background: var(--os-surface-raised);
  color: var(--os-text);
  font-family: var(--font-system);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  cursor: var(--cur-hand); --crt-cursor: hand;
  box-shadow: var(--shadow-sm);
  transition: background var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast);
}

@media (hover: hover) and (pointer: fine) {
  .game-btn:hover {
    background: var(--os-btn-glass-gradient);
    border-color: var(--os-btn-glass-border);
    color: var(--os-accent);
    transform: translateY(-1px);
  }
}

.game-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.game-btn--danger {
  border-color: var(--os-coral);
  color: var(--os-coral);
}

.game-btn--danger:hover {
  background: var(--os-coral);
  border-color: var(--os-coral);
  color: #fff;
}

/* ── Test Your Words Per Minute — Editorial Poster ── */

.typing-editorial {
  position: relative;
  background: #F36E16;
  color: #fff;
  padding: 0;
  min-height: 480px;
  overflow: hidden;
  cursor: var(--cur-text); --crt-cursor: text;
}

/* ── Body ── */

.typing-ed-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: var(--sp-6) var(--sp-6) var(--sp-4);
}

/* ── Header (title + timer) ── */

.typing-ed-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--sp-3);
}

.typing-ed-title {
  font-family: var(--font-serif);
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: #fff;
}

.typing-ed-timer {
  font-family: var(--font-system);
  font-size: clamp(48px, 8vw, 72px);
  font-weight: 300;
  line-height: 0.85;
  opacity: 0.25;
  color: #fff;
  transition: opacity 0.3s ease;
}

.typing-ed-timer--urgent {
  opacity: 1;
  animation: typing-timer-pulse 1s ease-in-out infinite;
}

@keyframes typing-timer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Stats (WPM + Accuracy) ── */

.typing-ed-stats {
  display: flex;
  gap: var(--sp-6);
  margin-bottom: var(--sp-4);
}

.typing-ed-stat {
  display: flex;
  align-items: baseline;
  gap: var(--sp-1);
}

.typing-ed-stat-value {
  font-family: var(--font-system);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 300;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.typing-ed-stat-label {
  font-family: var(--font-sans, var(--font-system));
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.5;
  color: #fff;
}

/* ── Character tracking display ── */

.typing-ed-track {
  font-family: var(--font-serif);
  font-size: clamp(18px, 2.5vw, 24px);
  line-height: 1.5;
  max-height: 280px;
  overflow-y: auto;
  padding: var(--sp-3) 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(185, 229, 250, 0.2) transparent;
}

/* ── Line-by-line layout ── */

.typing-stanza {
  margin-bottom: 0;
}

.typing-stanza-break {
  height: var(--sp-4);
}

.typing-line {
  display: block;
}

/* Spaces between lines — hide visually but keep in typing flow */
.typing-char--space {
  display: inline;
  width: 0;
  font-size: 0;
  line-height: 0;
}

.typing-char--space.typing-char--current::after {
  font-size: clamp(18px, 2.5vw, 24px);
}

/* ── Chorus stanza styling ── */

.typing-stanza--chorus {
  font-size: 1.4em;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.typing-char {
  color: rgba(100, 35, 0, 0.55);
  transition: color 0.1s ease;
  position: relative;
}

.typing-char--correct {
  color: #fff;
}

.typing-char--incorrect {
  color: #fff;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 2px;
  text-decoration: underline;
  text-decoration-color: rgba(255, 80, 80, 0.7);
  text-underline-offset: 2px;
}

.typing-char--current {
  color: rgba(100, 35, 0, 0.55);
}

.typing-char--current::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 2px;
  height: 1.15em;
  background: #fff;
  animation: typing-cursor-blink 1s ease-in-out infinite;
}

@keyframes typing-cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Chorus char overrides ── */

.typing-char--chorus {
  transition: color 0.15s ease;
}

.typing-char--chorus.typing-char--correct {
  color: #fff;
}

/* ── Dithered YouTube video backdrop ── */

.typing-video-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s ease-out;
  pointer-events: none;
  overflow: hidden;
  background: #111;
}

.typing-video-backdrop--visible {
  opacity: 1;
}

.typing-video-iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200vw;
  height: 200vh;
  transform: translate(-50%, -50%);
  border: none;
  pointer-events: none;
}

.typing-video-dither {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Ccircle cx='1' cy='1' r='1' fill='%23000' opacity='0.7'/%3E%3Ccircle cx='4' cy='1' r='0.6' fill='%23000' opacity='0.5'/%3E%3Ccircle cx='2.5' cy='2.5' r='0.8' fill='%23000' opacity='0.6'/%3E%3Ccircle cx='5.5' cy='2.5' r='0.5' fill='%23000' opacity='0.4'/%3E%3Ccircle cx='1' cy='4' r='0.6' fill='%23000' opacity='0.5'/%3E%3Ccircle cx='4' cy='4' r='1' fill='%23000' opacity='0.7'/%3E%3Ccircle cx='2.5' cy='5.5' r='0.5' fill='%23000' opacity='0.4'/%3E%3Ccircle cx='5.5' cy='5.5' r='0.8' fill='%23000' opacity='0.6'/%3E%3C/svg%3E");
  background-size: 6px 6px;
  opacity: 0.55;
}

/* ── Hidden textarea for input capture ── */

.typing-ed-input-hidden {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ── Result ── */

.typing-ed-result {
  text-align: center;
  margin-top: var(--sp-3);
}

.typing-ed-result-line {
  font-family: var(--font-serif);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  color: #fff;
}

/* ── End-game buttons ── */

.typing-ed-actions {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  justify-content: center;
}

.typing-ed-btn {
  font-family: var(--font-sans, var(--font-system));
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--sp-2) var(--sp-5);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: #fff;
  cursor: var(--cur-hand); --crt-cursor: hand;
  transition: background 0.2s ease-out, border-color 0.2s ease-out;
}

.typing-ed-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 600px) {
  .typing-ed-body {
    padding: var(--sp-4) var(--sp-4) var(--sp-3);
  }
  .typing-ed-title {
    font-size: 32px;
  }
  .typing-ed-timer {
    font-size: 40px;
  }
  .typing-ed-track {
    font-size: 16px;
    max-height: 200px;
  }
  .typing-char--chorus {
    font-size: 1.4em;
  }
}

@media (prefers-reduced-motion: reduce) {
  
  .typing-ed-timer--urgent {
    animation: none !important;
    opacity: 1;
  }
  .typing-char--current::after {
    animation: none !important;
    opacity: 1;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   LIMEWIRE — P2P Client Player
   ══════════════════════════════════════════════════════════════════════ */

.listen-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #D4D0C8;
  font-family: Tahoma, 'Segoe UI', sans-serif;
  font-size: 11px;
  color: #000;
}

/* ── Tab Bar ── */
.lw-tab-bar {
  display: flex;
  gap: 1px;
  padding: 2px 4px 0;
  background: #D4D0C8;
}

.lw-tab {
  padding: 3px 12px;
  background: #C8C4BC;
  border: 1px solid #808080;
  border-bottom: none;
  border-radius: 2px 2px 0 0;
  cursor: var(--cur-arrow); --crt-cursor: arrow;
  font-size: 11px;
  font-family: inherit;
  color: #000;
}

.lw-tab.active {
  background: #D4D0C8;
  border-bottom: 1px solid #D4D0C8;
  margin-bottom: -1px;
  font-weight: bold;
}

/* ── Toolbar ── */
.lw-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px;
  border-bottom: 1px solid #808080;
}

.lw-toolbar button {
  padding: 2px 8px;
  background: #D4D0C8;
  border: 2px outset #D4D0C8;
  font-family: inherit;
  font-size: 11px;
  cursor: var(--cur-hand); --crt-cursor: hand;
  color: #000;
  border-radius: 0;
}

.lw-toolbar button:active {
  border-style: inset;
}

.lw-toolbar-sep {
  width: 1px;
  height: 18px;
  background: #808080;
  margin: 0 4px;
}

/* ── Content Area ── */
.lw-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: 0 4px;
  border: 2px inset #D4D0C8;
  background: #fff;
  overflow: hidden;
  min-height: 0;
}

/* ── Column Header ── */
.lw-column-header {
  display: grid;
  grid-template-columns: 1fr 60px 70px;
  background: #D4D0C8;
  border-bottom: 1px solid #808080;
  font-size: 11px;
  font-weight: bold;
}

.lw-col {
  padding: 2px 6px;
  border-right: 1px solid #808080;
  cursor: var(--cur-arrow); --crt-cursor: arrow;
}

.lw-col:last-child {
  border-right: none;
}

/* ── File Row ── */
.lw-file-row {
  display: grid;
  grid-template-columns: 1fr 60px 70px;
  background: #316AC5;
  color: #fff;
  font-size: 11px;
}

.lw-file-row span {
  padding: 2px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lw-file-name {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Video Area ── */
.lw-video-area {
  flex: 1;
  min-height: 0;
}

.listen-video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.listen-video-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ── Status Bar ── */
.lw-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px;
  border-top: 1px solid #808080;
  font-size: 10px;
  color: #444;
  background: #D4D0C8;
}

.lw-status-left,
.lw-status-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Dark Theme ── */
[data-theme="dark"] .listen-container {
  background: #3C3C3C;
  color: #ddd;
}
[data-theme="dark"] .lw-tab-bar { background: #3C3C3C; }
[data-theme="dark"] .lw-tab { background: #333; border-color: #555; color: #ddd; }
[data-theme="dark"] .lw-tab.active { background: #3C3C3C; border-bottom-color: #3C3C3C; }
[data-theme="dark"] .lw-toolbar { border-bottom-color: #555; }
[data-theme="dark"] .lw-toolbar button { background: #3C3C3C; border-color: #555; color: #ddd; }
[data-theme="dark"] .lw-content { background: #1A1A1A; border-color: #555; }
[data-theme="dark"] .lw-column-header { background: #3C3C3C; border-bottom-color: #555; color: #ddd; }
[data-theme="dark"] .lw-col { border-right-color: #555; }
[data-theme="dark"] .lw-status-bar { background: #3C3C3C; border-top-color: #555; color: #999; }

/* ── Retro Theme ── */
[data-theme="retro"] .listen-container {
  background: #0A0A0A;
  color: #33FF33;
}
[data-theme="retro"] .lw-tab-bar { background: #0A0A0A; }
[data-theme="retro"] .lw-tab { background: #111; border-color: #33FF33; color: #33FF33; }
[data-theme="retro"] .lw-tab.active { background: #0A0A0A; border-bottom-color: #0A0A0A; }
[data-theme="retro"] .lw-toolbar { border-bottom-color: #33FF33; }
[data-theme="retro"] .lw-toolbar button { background: #0A0A0A; border-color: #33FF33; color: #33FF33; }
[data-theme="retro"] .lw-content { background: #000; border-color: #33FF33; }
[data-theme="retro"] .lw-column-header { background: #0A0A0A; border-bottom-color: #33FF33; color: #33FF33; }
[data-theme="retro"] .lw-col { border-right-color: #33FF33; }
[data-theme="retro"] .lw-file-row { background: #33FF33; color: #000; }
[data-theme="retro"] .lw-status-bar { background: #0A0A0A; border-top-color: #33FF33; color: #33FF33; }

/* ══════════════════════════════════════════════════════════════════════
   SNAKE
   ══════════════════════════════════════════════════════════════════════ */

/* ── Snake — Win98 program (board lives in .gc-body, see game-chrome.css) ── */

.snake-board {
  background: #0A4942;
  touch-action: none;
}

.snake-canvas {
  position: absolute;
  inset: 0;
  display: block;
}

.snake-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  /* Sit low so the prompt doesn't cover the snake waiting mid-board. */
  align-items: flex-end;
  justify-content: center;
  padding: 16px 16px 20px;
  pointer-events: none;
}

.snake-overlay[hidden] {
  display: none;
}

.snake-overlay-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(10, 73, 66, 0.94);
  color: #F9E8D6;
  box-shadow: 0 0 0 1px rgba(249, 232, 214, 0.35);
  pointer-events: auto;
  animation: snake-msg-in 220ms var(--ease-out);
}

.snake-overlay-text {
  margin: 0;
  font-family: var(--font-system);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
}

@keyframes snake-msg-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .snake-overlay-panel { animation: none; }
}

/* ══════════════════════════════════════════════════════════════════════
   MINESWEEPER
   ══════════════════════════════════════════════════════════════════════ */

.mine-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--os-surface);
  padding: var(--sp-3);
  gap: var(--sp-3);
}

.mine-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) var(--sp-3);
  background: var(--os-surface-raised);
  border: 1px solid var(--os-border);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.mine-counter,
.mine-timer {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--os-accent);
  min-width: 3ch;
  text-align: center;
  letter-spacing: 0.1em;
}

.mine-smiley {
  font-size: var(--text-lg);
  font-family: var(--font-mono);
  padding: var(--sp-1) var(--sp-2);
  border: 1px solid var(--os-border);
  border-radius: var(--radius-md);
  background: var(--os-surface);
  cursor: var(--cur-hand); --crt-cursor: hand;
  box-shadow: var(--shadow-sm);
  transition: background var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast);
}

.mine-smiley:hover {
  background: var(--os-surface-hover);
}

.mine-smiley:active {
  box-shadow: none;
  transform: translateY(1px);
}

.mine-grid {
  flex: 1;
  display: grid;
  gap: 1px;
  background: var(--os-border);
  border: 1px solid var(--os-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.mine-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  font-family: var(--font-mono);
  background: var(--os-surface-raised);
  cursor: var(--cur-hand); --crt-cursor: hand;
  user-select: none;
  aspect-ratio: 1;
  transition: background var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast);
  border: 1px outset rgba(255, 255, 255, 0.2);
}

.mine-cell:hover:not(.revealed) {
  background: var(--os-surface-hover);
}

.mine-cell.revealed {
  background: var(--os-surface);
  border: 1px solid var(--os-border-subtle);
  cursor: var(--cur-arrow); --crt-cursor: arrow;
}

.mine-cell.flagged {
  font-size: var(--text-base);
}

.mine-cell.mine {
  font-size: var(--text-base);
}

.mine-cell.mine.exploded {
  background: var(--os-coral);
  color: var(--os-text-inverse, white);
}

/* ══════════════════════════════════════════════════════════════════════
   PONG — Win98 program (board lives in .gc-body, see game-chrome.css)
   ══════════════════════════════════════════════════════════════════════ */

.pong-board {
  background: #242054;
  touch-action: none;
}

.pong-canvas {
  position: absolute;
  inset: 0;
  display: block;
  cursor: var(--cur-none); --crt-cursor: none;
}

/* Trash talk — floats at the bottom of the board */
.pong-talk {
  position: absolute;
  bottom: 12px;
  left: 16px;
  right: 16px;
  z-index: 2;
  min-height: 1.4em;
  text-align: center;
  font-family: var(--font-system);
  font-size: var(--text-xs);
  font-style: italic;
  color: #F0EEED;
  opacity: 0.7;
  pointer-events: none;
}

.pong-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
}

.pong-overlay[hidden] {
  display: none;
}

.pong-overlay-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(36, 32, 84, 0.9);
  color: #F0EEED;
  box-shadow: 0 0 0 1px rgba(240, 238, 237, 0.25);
  pointer-events: auto;
  cursor: var(--cur-arrow); --crt-cursor: arrow;
  animation: pong-msg-in 220ms var(--ease-out);
}

.pong-overlay-text {
  margin: 0;
  font-family: var(--font-system);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
}

@keyframes pong-msg-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .pong-overlay-panel { animation: none; }
}

/* ══════════════════════════════════════════════════════════════════════
   PORTFOLIO SHOWCASE — Multi-Window Project Display
   ══════════════════════════════════════════════════════════════════════ */

.showcase-overlay {
  position: absolute;
  inset: 0;
  z-index: 500;
  pointer-events: none;
}

.showcase-window {
  pointer-events: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--os-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Showcase windows: use focused (light) title bar */
.showcase-window.os-window .window-title-bar {
  background: var(--os-titlebar-bg);
  border-bottom-color: var(--os-titlebar-border);
}

/* Showcase windows: always show traffic-light colors (override inactive grey) */
.showcase-window.os-window .window-btn-close {
  background: var(--os-btn-close);
}
.showcase-window.os-window .window-btn-minimize {
  background: var(--os-btn-minimize);
}
.showcase-window.os-window .window-btn-maximize {
  background: var(--os-btn-maximize);
}

.showcase-window .window-title-bar:hover .window-btn-close::after,
.showcase-window.focused .window-title-bar:hover .window-btn-close::after {
  opacity: 1;
}

.showcase-window-content {
  flex: 1;
  overflow: hidden;
}

/* ── Bio / README ── */
.showcase-bio-content {
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  background: var(--os-titlebar-bg);
  overflow-y: auto;
}

.showcase-bio-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--os-titlebar-text);
  letter-spacing: 0.03em;
}

.showcase-bio-role {
  font-size: var(--text-sm);
  color: var(--os-accent);
  font-weight: var(--weight-bold);
}

.showcase-bio-team {
  font-size: var(--text-xs);
  color: var(--os-titlebar-text);
  font-style: italic;
  opacity: 0.6;
}

/* In-progress badge — showcase bio window */
.showcase-bio-badge {
  display: inline-block;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--os-accent, #F0A030);
  color: var(--os-bg, #0A0A0A);
  margin-top: 4px;
}

.showcase-bio-desc {
  font-size: var(--text-sm);
  color: var(--os-titlebar-text);
  line-height: var(--leading-normal);
  opacity: 0.8;
}

.showcase-bio-cs-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: auto;
  padding: var(--sp-2) var(--sp-3);
  background: var(--os-accent);
  color: var(--os-accent-text);
  border: 1px solid var(--os-accent);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-align: center;
  text-decoration: none;
  cursor: var(--cur-hand); --crt-cursor: hand;
  transition: opacity var(--duration-fast);
}

.showcase-bio-cs-btn:hover {
  opacity: 0.85;
}

/* ── Stat Windows ── */

/* Override os-window min-size for compact stat windows */
.showcase-window:has(.showcase-stat-content) {
  min-width: 0;
  min-height: 0;
}

/* Compact title bar for stat windows */
.showcase-window:has(.showcase-stat-content) .window-title-bar {
  height: 24px;
  padding: 0 var(--sp-2);
}

.showcase-window:has(.showcase-stat-content) .window-controls {
  gap: 3px;
}

.showcase-window:has(.showcase-stat-content) .window-btn {
  width: 8px;
  height: 8px;
}

.showcase-window:has(.showcase-stat-content) .window-title {
  font-size: 10px;
}

.showcase-stat-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 2px 4px;
  background: linear-gradient(135deg, rgba(232, 99, 28, 0.14) 0%, rgba(232, 99, 28, 0.04) 100%);
  text-align: center;
  height: 100%;
  box-sizing: border-box;
}

.showcase-stat-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: var(--weight-bold);
  color: var(--os-accent);
  line-height: 1;
}

.showcase-stat-label {
  font-size: 11px;
  color: var(--os-titlebar-text);
  font-weight: var(--weight-bold);
}

/* ── Mobile Responsiveness ── */
@media (max-width: 767px) {
  .showcase-stat-value {
    font-size: 28px;
  }

  .showcase-bio-name {
    font-size: var(--text-base);
  }

  .showcase-bio-desc {
    font-size: var(--text-xs);
  }
}

@media (max-width: 479px) {
  .showcase-stat-value {
    font-size: 22px;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   PHOTO BOOTH
   ══════════════════════════════════════════════════════════════════════ */

/* ── Full-screen overlay scrim (Finder pattern) ── */
.pb-scrim {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: rgba(0, 0, 0, 0.6);
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--sp-8, 32px) var(--sp-6, 24px);
}

/* ── Close button ── */
.pb-close {
  position: fixed;
  top: var(--sp-4, 16px);
  left: var(--sp-4, 16px);
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-sans, var(--font-system));
  font-size: var(--text-sm, 0.875rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #60ABB2;
  background: rgba(128, 27, 27, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: var(--cur-hand); --crt-cursor: hand;
  opacity: 0.9;
  transition: opacity 0.15s ease;
}
.pb-close:hover { opacity: 1; }

/* ── Shared container (teaser + booth) ── */
.pb-teaser,
.pb-booth {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #801B1B;
  color: #60ABB2;
  min-height: 100%;
}
.pb-teaser { min-height: 620px; }
/* Window mode: fill the full content height (cream gap below the card
   otherwise shows because the launcher floor of 620px is shorter than the
   window content). Launcher keeps the 620px floor (panel has height:auto). */
.os-window .pb-teaser { min-height: 100%; }
.pb-scrim > .pb-booth {
  width: 100%;
  max-width: 560px;
  height: calc(100vh - 64px);
  min-height: 0;
  overflow: hidden;
}

/* ── Live camera feed ── */
.pb-feed {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
}
.pb-teaser .pb-feed {
  position: absolute;
  inset: 0;
  aspect-ratio: unset;
  z-index: 0;
}
.pb-feed canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pb-feed video {
  position: absolute;
  width: 0; height: 0;
  opacity: 0;
  pointer-events: none;
}

/* Capture feed — keep 4:3, align to top */
.pb-feed--full {
  flex-shrink: 1;
}

/* ── Editorial body (onboarding + teaser) ── */
.pb-body {
  padding: 28px 32px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}
.pb-teaser .pb-body {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 48px;
}
.pb-label {
  font-family: var(--font-sans, var(--font-system));
  font-size: var(--text-xs, 0.6875rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
}
.pb-title {
  font-family: var(--font-serif, Georgia);
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.03em;
  margin: 0;
}
.pb-desc {
  font-family: var(--font-sans, var(--font-system));
  font-size: var(--text-sm, 0.875rem);
  line-height: 1.6;
  opacity: 0.65;
  max-width: 34ch;
  margin: 4px 0 0;
}
.pb-cta {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: var(--sp-2, 8px);
  font-family: var(--font-sans, var(--font-system));
  font-size: var(--text-xs, 0.6875rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 24px;
  margin-top: 16px;
  background: #60ABB2;
  color: #801B1B;
  border: none;
  border-radius: 999px;
  cursor: var(--cur-hand); --crt-cursor: hand;
  transition: background 0.2s ease-out, transform 0.15s ease-out;
}
@media (hover: hover) and (pointer: fine) {
  .pb-cta:hover {
    background: #7AC0C7;
    transform: scale(1.04);
  }
}

/* ── Overlay (countdown numbers + flash) ── */
/* (countdown numbers + flash are now outside the feed) */

/* ── Info panel below feed (countdown + counter) ── */
.pb-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 0;
}
.pb-countdown-num {
  font-family: var(--font-serif, Georgia);
  font-size: clamp(80px, 20vw, 160px);
  font-weight: 700;
  color: #60ABB2;
  line-height: 1;
  animation: pb-tick 1s ease-out;
}
.pb-counter {
  font-family: var(--font-sans, var(--font-system));
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0.6;
}

/* ── Full-card flash ── */
.pb-flash {
  position: absolute;
  inset: 0;
  background: #FFFFFF;
  z-index: 10;
  pointer-events: none;
  animation: pb-flash 500ms ease-out forwards;
}

/* ── Print state ── */
.pb-booth--print {
  align-items: center;
  justify-content: flex-start;
}
.pb-slot {
  width: 55%;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  flex-shrink: 0;
  margin-top: 16px;
}
.pb-print-area {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  padding: 8px 16px 0;
}
.pb-strip {
  max-width: 200px;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  transform: translateY(-120%);
  transition: transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.pb-strip--printing {
  transform: translateY(0);
}

/* ── Actions (save + retake) ── */
.pb-actions {
  display: flex;
  gap: 12px;
  padding: 16px 16px 24px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.4s ease-out;
}
.pb-actions--visible {
  opacity: 1;
}

/* ── Error state ── */
.pb-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  padding: var(--sp-6, 24px);
  text-align: center;
  font-size: var(--text-sm, 0.875rem);
  color: rgba(255, 255, 255, 0.5);
}

/* ── Keyframes ── */
@keyframes pb-tick {
  0%   { transform: scale(1.4); opacity: 0; }
  25%  { opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes pb-flash {
  0%   { opacity: 0; }
  30%  { opacity: 1; }
  60%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ══════════════════════════════════════════════════════════════════════
   GITHUB — Contribution Heatmap
   ══════════════════════════════════════════════════════════════════════ */

.gh-container {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
  overflow: auto;
  position: relative;
}

.gh-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.gh-count {
  font-size: var(--text-sm);
  color: var(--os-text);
  font-weight: 600;
}

.gh-profile-link {
  font-size: var(--text-xs);
  color: var(--os-accent);
  text-decoration: none;
  letter-spacing: 0.06em;
}
.gh-profile-link:hover {
  text-decoration: underline;
}

.gh-graph {
  width: 100%;
  height: auto;
}

.gh-month-label,
.gh-day-label {
  font-size: 9px;
  fill: var(--os-text-muted);
  font-family: var(--font-system);
}

.gh-cell {
  shape-rendering: geometricPrecision;
  transition: opacity var(--duration-fast, 150ms) ease;
}
.gh-cell:hover {
  opacity: 0.75;
  stroke: var(--os-text);
  stroke-width: 1;
}

.gh-tooltip {
  position: absolute;
  padding: var(--sp-1) var(--sp-2);
  background: var(--os-surface-raised);
  color: var(--os-text);
  border: 1px solid var(--os-border);
  border-radius: var(--radius-sm, 4px);
  font-size: var(--text-xs);
  font-family: var(--font-system);
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
  z-index: var(--z-tooltip, 50);
  box-shadow: var(--shadow-sm, 2px 2px 0 rgba(0,0,0,.15));
}
.gh-tooltip[hidden] {
  display: none;
}

.gh-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  padding-top: var(--sp-1);
}

.gh-legend-swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 2px;
}

.gh-legend-label {
  font-size: 9px;
  color: var(--os-text-muted);
  padding: 0 var(--sp-1);
}

.gh-loading,
.gh-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  height: 100%;
  color: var(--os-text-muted);
  font-size: var(--text-sm);
  text-align: center;
}

.gh-retry-btn {
  padding: var(--sp-1) var(--sp-3);
  background: var(--os-surface-raised);
  color: var(--os-text);
  border: 1px solid var(--os-border);
  border-radius: var(--radius-sm, 4px);
  font-family: var(--font-system);
  font-size: var(--text-xs);
  cursor: var(--cur-hand); --crt-cursor: hand;
  letter-spacing: 0.06em;
  transition: background var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast);
}
.gh-retry-btn:hover {
  background: var(--os-btn-glass-gradient);
  color: var(--os-text);
  border-color: var(--os-btn-glass-border);
}

/* ── Theme overrides for heatmap cells ── */

/* Dark: darken empty cells */
[data-theme="dark"] .gh-cell[data-level="0"] { fill: #0A0A0A; }

/* Retro: CRT green phosphor palette */
[data-theme="retro"] .gh-cell[data-level="0"] { fill: #0a0a0a; }
[data-theme="retro"] .gh-cell[data-level="1"] { fill: #0e4429; }
[data-theme="retro"] .gh-cell[data-level="2"] { fill: #006d32; }
[data-theme="retro"] .gh-cell[data-level="3"] { fill: #26a641; }
[data-theme="retro"] .gh-cell[data-level="4"] { fill: #39d353; }

/* ── DOOM — js-dos fills the window, no poster ── */

.doom-screen {
  position: relative;
  height: 100%;
  min-height: 240px;
  background: #000;
  overflow: hidden;
}

/* Flow-layout hosts (/accordion panel, mobile app view) have no fixed
   height — give the screen DOOM's native 4:3 shape there. */
.launcher-panel .doom-screen,
.mob-appview-content .doom-screen {
  height: auto;
  aspect-ratio: 4 / 3;
}

/* Phone app view: black letterbox around the 4:3 screen, not Win98 grey. */
.mob-appview-body:has(.doom-screen) {
  background: #000;
}

.doom-game {
  position: absolute;
  inset: 0;
}

.doom-game canvas {
  image-rendering: pixelated;
}

.doom-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #000;
  color: #C0C0C0;
  font-family: 'Courier New', var(--font-mono);
  font-size: 14px;
  text-align: center;
}

.doom-loading[hidden] {
  display: none;
}

.doom-cursor {
  animation: doom-cursor-blink 1s steps(1, end) infinite;
}

@keyframes doom-cursor-blink {
  50% { opacity: 0; }
}

.doom-error {
  color: #FF5555;
}

.doom-error .doom-cursor {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .doom-cursor { animation: none; }
}

/* ══════════════════════════════════════════════════════════════════════
   CALCULATOR — Classic macOS-style
   ══════════════════════════════════════════════════════════════════════ */

/* ── Calculator — Editorial Poster ── */

.calc-editorial {
  position: relative;
  background: #1E2749;
  color: #E5C97F;
  padding: 0;
  min-height: 480px;
  overflow: hidden;
  user-select: none;
}

/* ── Body ── */

.calc-ed-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: var(--sp-6) var(--sp-6) var(--sp-4);
}

/* ── Screen (display + thought bubble) ── */

.calc-ed-screen {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-4);
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.calc-ed-thought {
  font-family: var(--font-sans, var(--font-system));
  font-size: var(--text-sm);
  font-style: italic;
  color: rgba(229, 201, 127, 0.5);
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, max-height 0.3s ease, margin 0.3s ease;
}

.calc-ed-thought--visible {
  min-height: 20px;
  max-height: 60px;
  opacity: 1;
  margin-bottom: var(--sp-2);
}

.calc-ed-result {
  font-family: var(--font-system);
  font-size: 2.8rem;
  font-weight: 300;
  color: #E5C97F;
  text-align: right;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
  transition: font-size 0.15s ease;
  word-break: break-word;
  white-space: normal;
  line-height: 1.1;
}

/* ── Button Grid ── */

.calc-ed-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.calc-ed-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-system);
  font-size: 1.3rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: var(--cur-hand); --crt-cursor: hand;
  padding: 0;
  min-height: 64px;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.calc-ed-btn:active:not(:disabled) {
  transform: scale(0.94);
}

.calc-ed-btn:disabled {
  opacity: 0.4;
  cursor: var(--cur-not); --crt-cursor: not;
}

/* Number buttons */
.calc-ed-btn--num {
  background: rgba(255, 255, 255, 0.08);
  color: #E5C97F;
}

.calc-ed-btn--num:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

/* Operator buttons */
.calc-ed-btn--op,
.calc-ed-btn--eq {
  background: #E5C97F;
  color: #1E2749;
  font-weight: 700;
}

.calc-ed-btn--op:hover:not(:disabled),
.calc-ed-btn--eq:hover:not(:disabled) {
  filter: brightness(1.1);
}

/* Function buttons (C, +/-, %) */
.calc-ed-btn--fn {
  background: rgba(229, 201, 127, 0.2);
  color: #E5C97F;
  font-weight: 700;
}

.calc-ed-btn--fn:hover:not(:disabled) {
  background: rgba(229, 201, 127, 0.3);
}

/* Zero button spans two columns */
.calc-ed-btn--wide {
  grid-column: span 2;
}

/* 80085 Easter egg */
.calc-ed-easter {
  color: #FF6B6B;
  animation: calc-egg-flash 0.4s ease;
}

@keyframes calc-egg-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Case Study App — Peach Horizon themed ── */

/* Root container */
.cs-app-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--os-surface);
  font-family: var(--font-system);
}

/* ── Card Grid View ── */

.cs-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1.5rem;
  overflow-y: auto;
  height: 100%;
  align-content: start;
}

.cs-app-card {
  background: var(--os-surface-raised);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--os-border-subtle);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  cursor: var(--cur-hand); --crt-cursor: hand;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

@media (hover: hover) and (pointer: fine) {
  .cs-app-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  }
}

.cs-app-card:active {
  transform: scale(0.99);
}

.cs-app-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--os-border-subtle);
}

.cs-app-card-body {
  padding: 0.75rem 1rem;
}

.cs-app-card-name {
  font-family: var(--font-display, 'PP Editorial New', serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--os-text);
  margin: 0 0 0.25rem;
  line-height: 1.2;
}

.cs-app-card-role {
  font-size: 0.75rem;
  color: var(--os-text-muted);
  margin: 0 0 0.5rem;
}

.cs-app-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

/* ── Detail Navigation ── */

.cs-app-detail-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--os-border-subtle);
  flex-shrink: 0;
}

.cs-app-nav-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: var(--cur-hand); --crt-cursor: hand;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--os-accent);
  background: none;
  border: none;
  font-family: var(--font-system);
  padding: 0;
  transition: opacity 0.15s ease;
}

.cs-app-nav-back:hover {
  opacity: 0.7;
}

.cs-app-nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cs-app-nav-prev,
.cs-app-nav-next {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--os-border-subtle);
  background: var(--os-surface-raised);
  cursor: var(--cur-hand); --crt-cursor: hand;
  font-size: 0.8125rem;
  color: var(--os-text-muted);
  transition: color 0.15s ease, border-color 0.15s ease;
  font-family: var(--font-system);
}

.cs-app-nav-prev:hover,
.cs-app-nav-next:hover {
  color: var(--os-accent);
  border-color: var(--os-accent);
}

.cs-app-nav-count {
  font-size: 0.75rem;
  color: var(--os-text-muted);
}

/* ── Detail Content (scrollable) ── */

.cs-app-detail-scroll {
  flex: 1;
  overflow-y: auto;
}

.cs-app-detail-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

/* Project header */
.cs-app-panel-header {
  margin-bottom: 0;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--os-border-subtle);
}

.cs-app-project-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--os-accent);
  margin-bottom: 0.75rem;
}

.cs-app-tag {
  font-family: var(--font-system);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--os-border);
  background: transparent;
  color: var(--os-text-secondary);
}

.cs-app-project-name {
  font-family: var(--font-display, 'PP Editorial New', serif);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: var(--weight-regular);
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
  line-height: 1.0;
  color: var(--os-text);
}

.cs-app-project-subtitle {
  font-family: var(--font-sans, var(--font-system));
  font-size: 0.8125rem;
  color: var(--os-text-muted);
  margin: 0 0 1rem;
  letter-spacing: 0.01em;
}

.cs-app-project-role {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  color: var(--os-text-muted);
  font-size: 0.875rem;
  flex-wrap: wrap;
  margin: 0;
}

/* 2-column editorial rows */
.cs-app-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cs-app-row {
  display: block;
  padding: 2.75rem 0;
  border-bottom: 1px solid var(--os-border-subtle);
}

.cs-app-row:last-child {
  border-bottom: none;
}

.cs-app-label {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--os-text);
  margin-bottom: 1rem;
  line-height: 1.15;
}

.cs-app-content {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--os-text-secondary);
}

.cs-app-content p {
  margin: 0 0 1rem;
}

.cs-app-content p:last-child {
  margin-bottom: 0;
}

/* Process steps (numbered, decimal-leading-zero) */
.cs-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  counter-reset: cs-step;
  list-style: none;
  padding: 0;
  margin: 0;
}

.cs-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  counter-increment: cs-step;
}
.cs-step::before {
  content: counter(cs-step, decimal-leading-zero);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--os-accent);
  flex-shrink: 0;
  width: 1.75rem;
  padding-top: 0.15rem;
}
.cs-step p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--os-text-secondary);
}

/* Stats grid — glassmorphic cards */
.cs-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.cs-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  background: var(--os-surface-raised);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--os-border-subtle);
  border-radius: var(--radius-md, 8px);
}

.cs-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--os-accent);
}

.cs-stat-label {
  font-size: 0.75rem;
  color: var(--os-text-muted);
  line-height: 1.4;
}

/* Project header meta line */
.cs-app-project-role a {
  color: var(--os-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cs-app-project-role a:hover { opacity: 0.7; }

.cs-app-meta-divider {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--os-text-muted);
  vertical-align: middle;
}

.cs-app-live-link {
  color: var(--os-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}
.cs-app-live-link:hover { opacity: 0.7; }

.cs-app-status {
  color: var(--os-text-muted);
  font-style: italic;
}

/* Section image */
.cs-app-image {
  width: 100%;
  border-radius: var(--radius-md, 8px);
  margin-top: 1.5rem;
  aspect-ratio: 16/9;
  object-fit: cover;
  border: 1px solid var(--os-border-subtle);
}

.cs-app-image-caption {
  font-size: 0.75rem;
  color: var(--os-text-muted);
  margin-top: 0.5rem;
  letter-spacing: 0.02em;
}

/* Tags in content body */
.cs-app-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

/* Checklist */
.cs-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.cs-checklist li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.9375rem;
  color: var(--os-text-secondary);
}
.cs-checklist li::before {
  content: '\2713';
  font-weight: 700;
  color: var(--os-accent);
  flex-shrink: 0;
  margin-top: 0.05rem;
}

/* ── Case Study Mobile ── */
@media (max-width: 767px) {
  .cs-app-row {
    padding: 2rem 0;
  }

  .cs-app-label {
    font-size: 1.5rem;
  }

  .cs-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ══════════════════════════════════════════════════════════════
   Chat Demo
   ══════════════════════════════════════════════════════════════ */

.cs-chat-demo { margin-top: 1.25rem; border-radius: 14px; background: #E885AF; overflow: hidden; }
.cs-chat-header { display: flex; align-items: center; gap: 0.5rem; padding: 0.875rem 1.25rem; background: rgba(0,0,0,0.1); }
.cs-chat-status { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.8); animation: cs-pulse-dot 2s ease-in-out infinite; }
@keyframes cs-pulse-dot { 0%,100%{opacity:.7}50%{opacity:1} }
.cs-chat-name { font-size: 0.8125rem; font-weight: 600; color: white; letter-spacing: 0.02em; }
.cs-chat-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.875rem; min-height: 120px; }
.cs-chat-msg { display: flex; flex-direction: column; max-width: 85%; }
.cs-chat-msg--user { align-self: flex-end; align-items: flex-end; }
.cs-chat-msg--assistant { align-self: flex-start; align-items: flex-start; }
.cs-chat-bubble { padding: 0.625rem 0.875rem; border-radius: 12px; font-size: 0.8125rem; line-height: 1.55; min-height: 2rem; }
.cs-chat-msg--user .cs-chat-bubble { background: rgba(255,255,255,0.22); color: white; border-bottom-right-radius: 3px; }
.cs-chat-msg--assistant .cs-chat-bubble { background: white; color: #2E1F1A; border-bottom-left-radius: 3px; }
.cs-chat-cursor { display: inline-block; width: 2px; height: 0.9em; background: #2E1F1A; margin-left: 1px; vertical-align: text-bottom; opacity: 0; }
.cs-chat-cursor.active { animation: cs-blink 0.75s step-end infinite; opacity: 1; }
@keyframes cs-blink { 0%,100%{opacity:1}50%{opacity:0} }
.cs-chat-sources { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: 0.3rem; }
.cs-chat-source { font-size: 0.5625rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; padding: 0.2rem 0.4rem; border-radius: 4px; background: rgba(232,133,175,0.12); color: #E885AF; border: 1px solid rgba(232,133,175,0.3); }

/* ══════════════════════════════════════════════════════════════
   Pipeline Diagram
   ══════════════════════════════════════════════════════════════ */

/* ── Legacy pipeline styles — kept for backward-compat, unused on homepage ── */
.cs-pipeline { margin-top: 1.25rem; display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 1.75rem 1rem; background: transparent; border: none; border-top: 1px solid rgba(232,133,175,0.2); border-bottom: 1px solid rgba(232,133,175,0.2); border-radius: 0; overflow-x: auto; scrollbar-width: none; }
.cs-pipeline::-webkit-scrollbar { display: none; }
.cs-pipeline-sources, .cs-pipeline-outputs { display: flex; flex-direction: column; gap: 0.45rem; flex-shrink: 0; }
.cs-pipeline-source, .cs-pipeline-output-item { display: flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.8rem; border-radius: 10px; border: none; background: #F4E8D0; font-size: 0.75rem; font-weight: 500; white-space: nowrap; color: #1C1410; }
.cs-pipeline-source-icon { font-size: 0.875rem; line-height: 1; }
.cs-pipeline-arrow { flex-shrink: 0; color: rgba(232,133,175,0.55); display: flex; align-items: center; }
.cs-pipeline-center { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.cs-pipeline-node { padding: 0.55rem 1.25rem; border-radius: 100px; background: #E885AF; color: #2A0810; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; }
.cs-pipeline-node-sub { font-size: 0.5625rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(232,133,175,0.75); font-weight: 600; }

/* ══════════════════════════════════════════════════════════════
   Pipeline Carousel — animated data-flow variants
   ══════════════════════════════════════════════════════════════ */

/* ─── Shared chip + center ─── */
.pl-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.85rem 0.5rem 0.5rem;
  border-radius: 10px;
  background: #F4E8D0;
  color: #1C1410;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  opacity: 0;
  animation: pl-fade-in 500ms ease-out forwards;
  animation-delay: var(--delay, 0s);
}
.pl-chip-avatar {
  width: 24px; height: 24px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: white; flex-shrink: 0;
  font-size: 0.7rem; font-weight: 700;
}
.pl-chip-avatar svg { width: 14px; height: 14px; display: block; }
.pl-chip-label { letter-spacing: 0.005em; }

.pl-center {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  opacity: 0;
  animation: pl-fade-in 500ms ease-out forwards;
  animation-delay: 0.35s;
}
.pl-center-node {
  position: relative;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  background: #E885AF;
  color: #2A0810;
  font-size: 1rem; font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 24px rgba(232,133,175,0.4);
}
.pl-center-label { position: relative; z-index: 2; }
.pl-center-ring {
  position: absolute; inset: 0;
  border-radius: 999px;
  border: 2px solid #E885AF;
  opacity: 0;
  animation: pl-pulse 2.4s ease-out infinite;
}
.pl-center-ring--2 { animation-delay: 1.2s; }
.pl-center-sub {
  font-size: 0.625rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(232,133,175,0.8); font-weight: 700;
}

@keyframes pl-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pl-pulse {
  0%   { opacity: 0.7; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.6); }
}

/* Flowing dashed connector line animation */
@keyframes pl-flow {
  to { stroke-dashoffset: -24; }
}

/* ─── Variant A · Horizontal Flow ─── */
.pl-a {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 0;
  padding: 2rem 0;
  margin-top: 1rem;
  min-height: 360px;
}
.pl-a-col { display: flex; flex-direction: column; gap: 0.85rem; z-index: 2; }
.pl-a-col--sources { grid-column: 1; align-items: flex-start; }
.pl-a-col--center { grid-column: 3; align-items: center; }
.pl-a-col--outputs { grid-column: 5; align-items: flex-end; }
.pl-a-svg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
}
.pl-a-line {
  fill: none;
  stroke: #E885AF;
  stroke-width: 1.5;
  stroke-dasharray: 4 8;
  stroke-linecap: round;
  opacity: 0.8;
  animation: pl-flow 1.2s linear infinite;
}

@media (max-width: 767px) {
  .pl-a { grid-template-columns: 1fr; gap: 1rem; min-height: auto; padding: 1rem 0; }
  .pl-a-col { align-items: center !important; }
  .pl-a-svg { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pl-chip, .pl-center { animation: none; opacity: 1; }
  .pl-center-ring { animation: none; opacity: 0; }
  .pl-a-line { animation: none; }
}

/* ══════════════════════════════════════════════════════════════
   One Tool. Any Interface. — three layouts
   ══════════════════════════════════════════════════════════════ */

/* Shared avatar used across all OT variants */
.ot-avatar {
  width: 24px; height: 24px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: white; flex-shrink: 0;
  font-size: 0.7rem; font-weight: 700;
}
.ot-avatar svg { width: 14px; height: 14px; display: block; }

/* ─── Tabbed Interface (tabs inside the card) ─── */
.ot-a { max-width: 680px; margin: 2rem auto 0; }
.ot-a-card {
  background: #2A0810;
  border: 1px solid rgba(232,133,175,0.2);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.ot-a-toolbar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: rgba(232,133,175,0.06);
  border-bottom: 1px solid rgba(232,133,175,0.12);
}
.ot-a-tabs {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.ot-a-tab {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.75rem 0.4rem 0.4rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: rgba(245,240,232,0.55);
  font-family: var(--font-system);
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.01em;
  cursor: var(--cur-hand); --crt-cursor: hand;
  transition: border-color 200ms ease-out, color 200ms ease-out, background 200ms ease-out;
}
.ot-a-tab:hover { color: #F5F0E8; background: rgba(232,133,175,0.08); }
.ot-a-tab--active {
  color: #F5F0E8;
  border-color: var(--brand, #E885AF);
  background: rgba(255,255,255,0.04);
}
.ot-a-tab-avatar { width: 20px; height: 20px; border-radius: 5px; }
.ot-a-tab-avatar svg { width: 12px; height: 12px; }
.ot-a-meta {
  flex-shrink: 0;
  color: rgba(232,133,175,0.55);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  padding-right: 0.35rem;
}
.ot-a-body { padding: 1.25rem 1.5rem 1.5rem; }
.ot-a-query {
  font-family: 'PP Editorial New', Georgia, serif;
  font-style: italic;
  color: #E885AF;
  font-size: 1.0625rem;
  line-height: 1.45;
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(232,133,175,0.15);
}
.ot-a-answer { color: #F4E8D0; font-size: 0.9375rem; line-height: 1.6; }

/* Footnote slot — hidden collapsed, animates open on first non-default tab click */
.ot-a-footnote-slot {
  max-height: 0;
  padding-top: 0;
  overflow: hidden;
  transition: max-height 600ms cubic-bezier(0.22, 1, 0.36, 1), padding-top 600ms cubic-bezier(0.22, 1, 0.36, 1);
}
.ot-a-footnote-slot--open {
  max-height: 400px;
  padding-top: 2rem;
}
.ot-a-footnote {
  margin: 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(232,133,175,0.2);
  font-family: 'PP Editorial New', Georgia, serif;
  font-style: italic;
  color: #E885AF;
  font-size: 0.9rem;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 500ms ease-out 180ms, transform 500ms ease-out 180ms;
}
.ot-a-footnote-slot--open .ot-a-footnote {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 640px) {
  .ot-a-toolbar { flex-direction: column; align-items: flex-start; gap: 0.5rem; padding: 0.75rem 0.85rem; }
  .ot-a-meta { align-self: flex-end; }
}

/* ══════════════════════════════════════════════════════════════
   LLM Grid — mini red-ink chat cards
   ══════════════════════════════════════════════════════════════ */

.cs-llm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-top: 1.25rem; }
.cs-llm-card { border: 1px solid rgba(232,133,175,0.2); border-radius: 12px; overflow: hidden; background: #2A0810; box-shadow: 0 4px 16px rgba(0,0,0,0.25); }
.cs-llm-card-header { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.85rem; border-bottom: 1px solid rgba(232,133,175,0.15); background: rgba(232,133,175,0.06); }
.cs-llm-avatar { width: 20px; height: 20px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 0.625rem; font-weight: 700; color: white; flex-shrink: 0; }
.cs-llm-avatar svg { width: 12px; height: 12px; display: block; }
.cs-llm-name { font-size: 0.7rem; font-weight: 600; color: #E885AF; letter-spacing: 0.02em; }
.cs-llm-card-body { padding: 0.75rem 0.85rem; display: flex; flex-direction: column; gap: 0.5rem; }
.cs-llm-query { font-size: 0.7rem; color: #E885AF; font-style: italic; line-height: 1.45; padding-bottom: 0.5rem; border-bottom: 1px solid rgba(232,133,175,0.15); }
.cs-llm-answer { font-size: 0.7rem; line-height: 1.55; color: #F4E8D0; }
.cs-llm-caption { text-align: center; font-size: 0.625rem; color: rgba(232,133,175,0.7); margin-top: 0.9rem; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 600; }

/* Section caption — intro copy above typed visuals */
.cs-section-caption { color: rgba(232,133,175,0.9); font-size: 0.875rem; line-height: 1.6; margin: 0 0 2.5rem; font-style: italic; max-width: 52ch; }

/* ══════════════════════════════════════════════════════════════
   Tool Belt — 22 MCP tools grouped by verb (ASK / SYNC / PREP / ACT)
   ══════════════════════════════════════════════════════════════ */

.cs-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-top: 1rem; }
.cs-tools-group { display: flex; flex-direction: column; gap: 0.55rem; }
.cs-tools-label {
  font-family: 'PP Editorial New', Georgia, serif;
  font-weight: 400; font-size: 1.625rem; color: #E885AF;
  text-transform: uppercase; letter-spacing: 0.02em; line-height: 1;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(232,133,175,0.3);
  margin-bottom: 0.3rem;
}
.cs-tools-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 0.45rem;
}
.cs-tool-chip {
  background: #F4E8D0; color: #1C1410;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.cs-tool-name {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.7rem; font-weight: 700; color: #AD0F1D;
  letter-spacing: -0.01em;
  word-break: break-word;
}
.cs-tool-desc { font-size: 0.6875rem; color: #1C1410; line-height: 1.35; }
.cs-tool-callout {
  background: rgba(232,133,175,0.08);
  border: 1px solid rgba(232,133,175,0.22);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 0.6875rem; color: #E885AF;
  line-height: 1.5; font-style: italic;
  margin: 0.35rem 0 0;
}

@media (max-width: 1023px) { .cs-tools { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .cs-tools { grid-template-columns: 1fr; } }

/* ══════════════════════════════════════════════════════════════
   Tool Belt — Terminal Log treatment (Variant A, winner)
   ══════════════════════════════════════════════════════════════ */

.tb-a-panel {
  background: #2A0810;
  border-radius: 14px;
  border: 1px solid rgba(232,133,175,0.2);
  padding: 1.75rem 2rem;
  margin-top: 2rem;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.75;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  overflow-x: auto;
}
.tb-a-header {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 1.25rem;
  color: #E885AF;
  font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  border-bottom: 1px solid rgba(232,133,175,0.15);
  padding-bottom: 0.75rem;
}
.tb-a-header::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: #E885AF;
}
.tb-a-group { margin-bottom: 1.5rem; }
.tb-a-group:last-child { margin-bottom: 0; }
.tb-a-group-label {
  font-family: 'PP Editorial New', Georgia, serif;
  font-weight: 400;
  font-size: 1.5rem;
  color: #E885AF;
  line-height: 1;
  letter-spacing: 0.01em;
  margin: 0 0 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(232,133,175,0.2);
}
.tb-a-line { display: grid; grid-template-columns: 230px 1fr; gap: 1rem; color: #F4E8D0; padding-left: 1.5rem; }
.tb-a-cmd { color: #E885AF; font-weight: 700; }
.tb-a-arrow { color: rgba(232,133,175,0.4); }
.tb-a-desc { color: rgba(245,240,232,0.88); }
.tb-a-callout {
  margin: 0.75rem 0 0 1.5rem;
  padding: 0.65rem 1rem;
  border-left: 2px solid #E885AF;
  color: #E885AF;
  font-family: var(--font-system);
  font-style: italic;
  font-size: 0.75rem;
  line-height: 1.55;
}

/* Mobile adjustments */
@media (max-width: 767px) {
  .tb-a-line { grid-template-columns: 1fr; gap: 0; padding-left: 0; }
  .tb-a-line .tb-a-cmd { display: block; }
  .tb-a-panel { padding: 1.25rem 1rem; font-size: 0.75rem; }
}

@media (max-width: 767px) {
  .cs-llm-grid { grid-template-columns: 1fr; }
  .cs-pipeline { flex-direction: column; }
  .cs-pipeline-arrow svg { transform: rotate(90deg); }
}

/* ══════════════════════════════════════════════════════════════
   Hero Chat Demo (Briefcase) — "Pink on Ink"
   Red-tinted black card · pink user bubbles · cream assistant bubbles
   ══════════════════════════════════════════════════════════════ */

.cs-hero-chat { margin: 1rem 0 1.25rem; border-radius: 14px; background: #2A0810; overflow: hidden; font-family: var(--font-system); }
.cs-hero-chat-header { display: flex; align-items: center; gap: 0.5rem; padding: 0.875rem 1.25rem; background: rgba(232,133,175,0.08); border-bottom: 1px solid rgba(232,133,175,0.12); }
.cs-hero-chat-status { width: 8px; height: 8px; border-radius: 50%; background: #E885AF; box-shadow: 0 0 0 2px rgba(232,133,175,0.2); animation: cs-pulse-dot 2s ease-in-out infinite; }
.cs-hero-chat-name { font-size: 0.8125rem; font-weight: 600; color: #E885AF; letter-spacing: 0.02em; }
.cs-hero-chat-body { padding: 1.125rem 1.25rem; display: flex; flex-direction: column; gap: 0.875rem; min-height: 150px; }
.cs-hero-msg { display: flex; flex-direction: column; max-width: 85%; }
.cs-hero-msg--user { align-self: flex-end; align-items: flex-end; }
.cs-hero-msg--assistant { align-self: flex-start; align-items: flex-start; }
.cs-hero-bubble { padding: 0.625rem 0.875rem; border-radius: 14px; font-size: 0.8125rem; line-height: 1.55; }
.cs-hero-msg--user .cs-hero-bubble { background: #E885AF; color: #2A0810; border-bottom-right-radius: 4px; }
.cs-hero-msg--assistant .cs-hero-bubble { background: #F4E8D0; color: #1C1410; border-bottom-left-radius: 4px; min-height: 2rem; }
.cs-hero-sources { display: flex; gap: 0.25rem; flex-wrap: wrap; margin-top: 0.3rem; }
.cs-hero-source { display: inline-block; line-height: 1.35; font-size: 0.5625rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; padding: 0.25rem 0.45rem; border-radius: 3px; background: rgba(232,133,175,0.08); color: #E885AF; border: 1px solid rgba(232,133,175,0.22); }
.cs-chat-cursor { background: #1C1410; }

/* Hero chat filling the poster card hero slot — inset device-frame style */
/* box-sizing: border-box keeps total height identical to TIA's 16/9 video */
.finder-poster-hero:has(.cs-hero-chat),
.finder-poster-overlay-hero:has(.cs-hero-chat) { background: var(--poster-bg); display: flex; box-sizing: border-box; padding: 2.5rem; }
.finder-poster-hero .cs-hero-chat,
.finder-poster-overlay-hero .cs-hero-chat { flex: 1; margin: 0; display: flex; flex-direction: column; box-shadow: 0 8px 32px rgba(0,0,0,0.45); }
.finder-poster-hero .cs-hero-chat-header,
.finder-poster-overlay-hero .cs-hero-chat-header { flex-shrink: 0; }
.finder-poster-hero .cs-hero-chat-body,
.finder-poster-overlay-hero .cs-hero-chat-body { flex: 1; overflow-y: auto; scrollbar-width: none; min-height: 0; }
.finder-poster-hero .cs-hero-chat-body::-webkit-scrollbar,
.finder-poster-overlay-hero .cs-hero-chat-body::-webkit-scrollbar { display: none; }
/* Narrow screens: a 16/9 slot leaves ~100px for the chat, which clips the first
   question mid-line. Give the case-study hero a portrait slot instead. */
@media (max-width: 600px) {
  .finder-poster-overlay-hero:has(.cs-hero-chat) { aspect-ratio: 4 / 5; padding: 1.25rem; }
}

/* ══════════════════════════════════════════════════════════════
   Hero Questions Marquee (alternating LTR / RTL rows)
   ══════════════════════════════════════════════════════════════ */

.cs-hero-questions { overflow: hidden; }
.cs-hq-body { display: flex; flex-direction: column; gap: 0.25rem; overflow: hidden; padding: 1.5rem 0; }
.cs-hq-row { overflow: hidden; }
.cs-hq-track { display: flex; align-items: center; gap: 1.5rem; width: max-content; white-space: nowrap; will-change: transform; }
.cs-hq-row--ltr .cs-hq-track { animation: hq-ltr 42s linear infinite; }
.cs-hq-row--rtl .cs-hq-track { animation: hq-rtl 50s linear infinite; }
@keyframes hq-ltr { from { transform: translateX(-50%); } to { transform: translateX(0%); } }
@keyframes hq-rtl { from { transform: translateX(0%); } to { transform: translateX(-50%); } }
.cs-hq-item { font-size: 2.875rem; font-weight: 400; color: #E885AF; font-family: 'PP Editorial New', Georgia, serif; text-transform: uppercase; letter-spacing: 0.01em; white-space: nowrap; line-height: 1.1; }
.cs-hq-sep { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: #E885AF; font-size: 1.125rem; flex-shrink: 0; line-height: 1; transform: translateY(-0.4rem); }
@media (prefers-reduced-motion: reduce) { .cs-hq-track { animation: none; } }

/* Open card / detail context */
.finder-poster-overlay-content .cs-hero-questions,
.finder-detail-inner > .cs-hero-questions { margin: 0 0 1.5rem; }

/* ── Case-study figure (flow diagram image) ── */
.cs-figure {
  margin: 0;
}

.cs-figure-img {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid;
  border-color: #ffffff #404040 #404040 #ffffff;
  background: #1c4030;
}

.cs-figure-caption {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  opacity: 0.7;
}

/* Case-study prose callouts — a marker-style highlight in the card's accent */
.cs-hl {
  color: #F5EEDC;
  background-image: linear-gradient(transparent 58%, color-mix(in srgb, var(--poster-text, #F09200) 42%, transparent) 58%, color-mix(in srgb, var(--poster-text, #F09200) 42%, transparent) 92%, transparent 92%);
  padding: 0 0.12em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Case-study reading text: 20px with a readable measure, so prose and
   numbered lists don't run edge-to-edge in wide or maximized windows.
   Diagrams, stats and the tool belt keep their own sizes and full width. */
.finder-poster-overlay-content .cs-app-content p:not([class]),
.finder-poster-overlay-content .cs-step p,
.finder-poster-overlay-content .cs-checklist li {
  font-size: 1.25rem;
  line-height: 1.55;
  max-width: 38rem;
  text-wrap: pretty;
}
.finder-poster-overlay-content .cs-list,
.finder-poster-overlay-content .cs-checklist { max-width: 38rem; }
/* One centred reading column: headings, prose, numbered lists and the results
   lead sit on the same 38rem measure; diagrams, stats and the tool belt stay wide. */
.finder-poster-overlay-content .cs-app-label,
.finder-poster-overlay-content .cs-app-content > p:not([class]),
.finder-poster-overlay-content .cs-app-content > div > p:not([class]),
.finder-poster-overlay-content .cs-list,
.finder-poster-overlay-content .cs-checklist,
.finder-poster-overlay-content .cs-stats-intro {
  max-width: 38rem;
  margin-inline: auto;
}
.finder-poster-overlay-content .cs-stats-intro { margin-bottom: 2.5rem; }
.finder-poster-overlay-content .cs-stats-intro + .cs-stats { max-width: 38rem; margin-inline: auto; }
.finder-poster-overlay-content .cs-stats-intro p {
  font-size: 1.25rem;
  line-height: 1.55;
  text-wrap: pretty;
}
/* Key decisions: the call in bold, the reason underneath, on the reading column */
.cs-decisions { display: grid; gap: 1.75rem; max-width: 38rem; margin-inline: auto; counter-reset: cs-dec; }
/* The number shares a baseline with the title's first line */
.cs-decision { counter-increment: cs-dec; display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); }
.cs-decision::before {
  content: counter(cs-dec, decimal-leading-zero);
  grid-column: 1; grid-row: 1; align-self: baseline;
  font: 400 1rem/1 var(--font-serif); color: var(--poster-text); opacity: 0.45;
}
.cs-decision-title { grid-column: 2; grid-row: 1; align-self: baseline; margin: 0 0 0.35rem; font: 700 1.25rem/1.3 var(--font-sans); color: #F5EEDC; }
.cs-decision-text { grid-column: 2; margin: 0; font-size: 1.125rem; line-height: 1.55; color: var(--poster-text); opacity: 0.88; text-wrap: pretty; }
@media (max-width: 600px) { .cs-decision { grid-template-columns: 2.25rem minmax(0, 1fr); } .cs-decision-title { font-size: 1.125rem; } .cs-decision-text { font-size: 1rem; } }

/* No rules between case-study sections: spacing and the diagrams themselves divide them */
.finder-poster-overlay-content .cs-app-row,
.finder-poster-overlay-content .cs-app-row:first-child { border-top: 0; border-bottom: 0; }
/* A section that continues the one above it: no heading, no divider between them */
.cs-app-row:has(+ .cs-app-row--cont) { border-bottom: none; padding-bottom: 1.25rem; }
.cs-app-row--cont { padding-top: 1.25rem; }
/* A diagram with no heading leads its section: the heading sits just below it */
.cs-app-row--figure { padding-bottom: 0.5rem; }
.cs-app-row--figure + .cs-app-row { padding-top: 1.5rem; }
@media (max-width: 600px) {
  .finder-poster-overlay-content .cs-app-content p:not([class]),
  .finder-poster-overlay-content .cs-step p,
  .finder-poster-overlay-content .cs-checklist li { font-size: 1.125rem; }
}

/* Press feedback: pressable pills, links and tiles answer the press */
.about-ed-cta:active,
.mail-ed-send:active:not(:disabled),
.mail-ed-resume:active,
.finder-ed-ext-link:active { transform: scale(0.97); }
.finder-gallery-row { transition: transform 160ms ease-out; }
.finder-gallery-row:active { transform: scale(0.99); }

/* Cross-links between case studies: reads as a link inside highlighted prose */
.cs-xlink {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  cursor: var(--cur-hand); --crt-cursor: hand;
  transition: text-decoration-color 150ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .cs-xlink:hover { text-decoration-color: var(--poster-text, currentColor); }
}

/* Black-and-white case study (`mono: true` in portfolio.json) — matches its film-noir launch film. */
.study-cover--mono > *,
.cs-mono .flow,
.cs-mono .cs-figure,
.cs-mono .finder-gallery-block img { filter: grayscale(1) contrast(1.04); }
