
/* ── PANEL (mobile full-screen slide-in) ── */
.panel {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  padding: 0 1.4rem 3rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 300ms ease;
  pointer-events: none;
}
.panel.open { transform: translateX(0); pointer-events: auto; }

.panel-back {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 1.4rem 0 1rem;
  margin: 0 -1.4rem;
  padding-left: 1.4rem;
  width: calc(100% + 2.8rem);
  background: var(--bg);
  border: none;
  cursor: pointer;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: lowercase;
  text-align: left;
  z-index: 1;
  transition: color 0.2s;
}
.panel-back:hover { color: var(--ink); }

.panel h2 { font-size: clamp(2rem, 6vw, 3.5rem); font-weight: 400; line-height: 0.95; margin-bottom: 0.3rem; }
.panel h2 em { font-style: italic; color: var(--muted); }
.panel .zh { font-style: italic; font-size: 1.4rem; color: var(--muted); display: block; margin-bottom: 2rem; }

.panel-body { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 2rem; }
@media (max-width: 600px) { .panel-body { grid-template-columns: 1fr; gap: 2rem; } }

.panel-bio p { font-size: 0.95rem; color: var(--muted); line-height: 1.9; margin-bottom: 1rem; }

.panel-body .sp-video { margin-top: 2rem; }

.pt-item { display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.pt-year { font-family: 'Space Mono', monospace; font-size: 12px; color: var(--muted); }
.pt-title { font-size: 0.95rem; margin-bottom: 0.1rem; }
.pt-venue { font-family: 'Space Mono', monospace; font-size: var(--timeline-venue-sz); color: var(--muted); letter-spacing: 0.04em; }


/* ── STATIC PANELS (about / work / play — desktop featured area) ── */
.static-panel {
  position: absolute;
  inset: 0;
  background: var(--bg);
  z-index: 20;
  overflow-y: auto;
  padding: 3rem 3.5rem;
  display: none;
  flex-direction: column;
  justify-content: flex-start;
}
.static-panel.active { display: flex; }

.sp-label {
  font-family: 'Space Mono', monospace;
  font-size: 12px; letter-spacing: 0.18em;
  color: var(--muted); text-transform: uppercase;
  margin-bottom: 2rem;
}

/* Override sp-label margin for play panel */
.sp-label-panel { margin-bottom: 1.5rem; }

.sp-h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 400; line-height: 0.95;
  margin-bottom: 0.3rem;
}
.sp-h2 em { font-style: italic; color: var(--muted); }
.sp-zh { font-style: italic; font-size: 1.2rem; color: var(--muted); display: block; margin-bottom: 2.5rem; }

.sp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }

.sp-bio p { font-size: 0.92rem; color: var(--muted); line-height: 1.9; margin-bottom: 0.9rem; }

.sp-tl-row {
  display: grid; grid-template-columns: 3rem 1fr;
  gap: 1rem; padding: 0.9rem 0;
  border-bottom: 1px solid var(--border); align-items: baseline;
}
.sp-tl-yr { font-family: 'Space Mono', monospace; font-size: 12px; color: var(--muted); }
.sp-tl-t { font-size: 0.92rem; margin-bottom: 0.1rem; }
.sp-tl-v { font-family: 'Space Mono', monospace; font-size: var(--timeline-venue-sz); color: var(--muted); letter-spacing: 0.04em; }

.sp-work-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 400; line-height: 0.95; margin-bottom: 1.5rem;
}
.sp-work-title em { font-style: italic; color: var(--muted); }
.sp-work a {
  font-family: 'Space Mono', monospace; font-size: 12px;
  letter-spacing: 0.1em; color: var(--ink); text-decoration: none;
  opacity: 0.45; display: block; margin-bottom: 0.4rem; transition: opacity 0.2s;
}
.sp-work a:hover { opacity: 1; }
.sp-work-detail {
  font-family: 'Space Mono', monospace; font-size: 12px;
  color: var(--muted); letter-spacing: 0.06em; line-height: 2.2; margin-top: 2rem;
}

/* Video embed — 16:9 responsive */
.sp-video {
  margin-top: 3rem;
  max-width: 720px;
}
.sp-video-inner {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
}
.sp-video-inner iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* Click-to-play poster for About panel video */
.about-video-poster {
  position: absolute;
  inset: 0;
  background-color: #1a1a1a;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
}
.about-play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #1C1B18;
  pointer-events: none;
  transition: transform 0.2s, background 0.2s;
}
.about-video-poster:hover .about-play-btn {
  transform: scale(1.1);
  background: rgba(255,255,255,1);
}

/* ── PLAY / BLOB ── */
.sp-play {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2rem;
  position: relative;
}
.blob-wrap {
  position: relative;
  width: 100%;
  max-width: 680px;
}
.blob-video {
  width: 100%;
  aspect-ratio: 16/9;
  position: relative;
}
.blob-video iframe {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: none;
}
.blob-clip {
  clip-path: url(#blob-mask);
  border-radius: 0;
  overflow: visible;
}
.blob-deco {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.blob-deco-1 {
  width: 12%;
  aspect-ratio: 1;
  background: #4ECDC4;
  top: -4%;
  left: -4%;
  border-radius: 50% 40% 60% 50% / 50% 60% 40% 50%;
}
.blob-deco-2 {
  width: 9%;
  aspect-ratio: 1;
  background: #1A7A74;
  bottom: -2%;
  right: -2%;
  border-radius: 50%;
}

/* SVG blob mask definition — hidden but must be positioned */
.svg-blob-def { position: absolute; }

/* Mobile panel play — blob overrides */
.panel-play-wrap { position: relative; width: 100%; }
.panel-play-video {
  width: 100%;
  aspect-ratio: 16/9;
  position: relative;
  clip-path: url(#blob-mask-mob);
}
.panel-play-video iframe {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: none;
}
.blob-deco-mob-1 { width: 48px; height: 48px; top: -12px; left: -12px; }
.blob-deco-mob-2 { width: 36px; height: 36px; bottom: -8px; right: -8px; }

/* ── SIDEBAR NAV ITEMS (about / work / play) ── */
.sidebar-nav-item {
  padding: 0.9rem 0;
  padding-left: 10px;
  border-top: 1px solid var(--border);
  cursor: pointer; position: relative; user-select: none;
}
.sidebar-nav-item:last-child { border-bottom: 1px solid var(--border); }
.sidebar-nav-item .pl-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ink); opacity: 0; transition: opacity 0.4s; }
.sidebar-nav-item.active .pl-accent { opacity: 1; background: var(--ink); }
.sidebar-nav-item .pl-title { font-size: 0.95rem; color: var(--muted); transition: color 0.4s var(--ease); }
.sidebar-nav-item.active .pl-title { color: var(--ink); }

/* ── WORK PORTFOLIO ── */
.work-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.work-tab {
  font-family: var(--font-body);
  font-size: var(--work-tab-sz);
  letter-spacing: 0.1em;
  text-transform: lowercase;
  padding: 0.6rem 1.2rem 0.6rem 0;
  margin-right: 1.2rem;
  background: none;
  border: none;
  border-bottom: 1.5px solid transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  position: relative;
  bottom: -1px;
}
.work-tab:hover { color: var(--ink); }
.work-tab.active { color: var(--ink); border-bottom-color: var(--ink); }

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.wg-item {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
  transition: border-color 0.25s, transform 0.25s var(--ease);
  aspect-ratio: unset;
}
.wg-item:hover {
  border-color: rgba(28,27,24,0.22);
  transform: translateY(-2px);
}
.wg-item.hidden { display: none; }

.wg-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #E8E4DC;
  flex-shrink: 0;
}
.wg-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease);
}
.wg-item:hover .wg-thumb img { transform: scale(1.04); }

.wg-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.88);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, background 0.2s;
}
.wg-play::after {
  content: '';
  width: 0; height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid var(--ink);
  margin-left: 2px;
}
.wg-item:hover .wg-play {
  transform: translate(-50%, -50%) scale(1.1);
  background: white;
}

.wg-info {
  padding: 0.75rem 0.9rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.wg-title {
  font-family: var(--font-body);
  font-size: var(--work-title-sz);
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink);
}
.wg-desc {
  font-family: var(--font-body);
  font-size: var(--work-desc-sz);
  letter-spacing: 0.04em;
  color: var(--muted);
  line-height: 1.7;
}

/* ── WORK MODAL ── */
.wg-modal {
  position: fixed;
  inset: 0;
  background: rgba(28,27,24,0.85);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 2rem;
}
.wg-modal.open { display: flex; }

.wg-modal-inner {
  position: relative;
  width: 100%;
  max-width: 860px;
  background: var(--bg);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.wg-modal-media {
  width: 100%;
  aspect-ratio: 16/9;
  background: #111;
  flex-shrink: 0;
}
.wg-modal-media img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.wg-modal-media iframe {
  width: 100%; height: 100%;
  border: none;
  display: block;
}

.wg-modal-body {
  padding: 1.4rem 1.8rem 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.wg-modal-title {
  font-family: 'EB Garamond', serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.2;
}
.wg-modal-desc {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--muted);
  line-height: 1.8;
}

.wg-modal-close {
  position: absolute;
  top: 0.8rem; right: 0.8rem;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(28,27,24,0.6);
  border: none;
  cursor: pointer;
  color: #F4F1EC;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  line-height: 1;
  z-index: 2;
}
.wg-modal-close:hover { background: rgba(28,27,24,0.9); }

/* Static panels hidden on mobile/portrait */
@media (max-width: 767px), (orientation: portrait) {
  .static-panel { display: none !important; }
}

/* ── WORK ITEM THUMB STATES ── */
.wg-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: #E8E4DC;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wg-thumb-video {
  width: 100%;
  height: 100%;
  background: #1C1B18;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wg-play-icon {
  font-size: 2rem;
  color: white;
  opacity: 0.8;
  pointer-events: none;
}
