/* ==========================================================================
   JIMI LIU — FLOATING DIGITAL-MEDIA MINIMALISM (v4)
   Pure normal photography · Open floating constellation ·
   Slow-breathing 3-tone faint pastel flow + fine analog grain ·
   Colorful spinning 3D ASCII "gradient donut" · Clear, refined small navigation
   ========================================================================== */

:root {
  --font-sans: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-brand: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* === JIMI LIU LOGO SETTINGS === */
  --logo-size: clamp(26px, 2.5vw, 34px);
  --logo-weight: 800;
  --logo-tracking: 0.09em;
  --logo-word-gap: 0.08em;
  --logo-scale-x: 1.01;
  --logo-scale-y: 0.88;

  --pad-x: clamp(22px, 3.2vw, 48px);
  --nav-h: 58px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --theme-dur: 0.7s;

  /* 3 slow-breathing pastel tones updated smoothly by donut.js */
  --p-tone-1: rgb(124, 224, 152);
  --p-tone-2: rgb(244, 146, 192);
  --p-tone-3: rgb(136, 174, 250);

  /* Mode 1: Pure Open White */
  --bg: #ffffff;
  --bg-surface: #f5f5f3;
  --bg-nav-fade: linear-gradient(to bottom, rgba(255, 255, 255, 0.94) 45%, rgba(255, 255, 255, 0));
  --bg-lightbox: rgba(255, 255, 255, 0.96);
  --ink: #141414;
  --ink-soft: #52524f;
  --ink-muted: #8c8c87;
  --hairline: rgba(20, 20, 20, 0.09);
  --accent: #141414;
  --donut-color: #d94a04;
  --donut-t1: #4a1100; /* deep dark espresso-burnt orange shadow */
  --donut-t2: #d84300; /* vivid burnt orange midtone */
  --donut-t3: #ffaa24; /* bright sunlit tangerine-amber highlight */
  --frame-border: #ffffff;
  --shadow-float: 0 22px 52px rgba(14, 14, 20, 0.14);
}

/* Mode 2: Deep Darkroom Black */
html[data-theme='black'] {
  --bg: #0b0b0d;
  --bg-surface: #151518;
  --bg-nav-fade: linear-gradient(to bottom, rgba(11, 11, 13, 0.92) 45%, rgba(11, 11, 13, 0));
  --bg-lightbox: rgba(11, 11, 13, 0.96);
  --ink: #f3f2ee;
  --ink-soft: #b2b1ac;
  --ink-muted: #76767a;
  --hairline: rgba(243, 242, 238, 0.11);
  --accent: #f3f2ee;
  --donut-color: #f3f2ee;
  --donut-t1: #6e6e72;
  --donut-t2: #bebeb9;
  --donut-t3: #ffffff;
  --frame-border: #ecebe6;
  --shadow-float: 0 26px 60px rgba(0, 0, 0, 0.6);
}

/* Mode 3: 3-Tone Breathing Pastel Flow + Animated 18fps Old-Film Grain */
html[data-theme='pastel'] {
  --bg: #faf9f6;
  --bg-surface: rgba(255, 255, 255, 0.56);
  --bg-nav-fade: linear-gradient(to bottom, rgba(250, 249, 246, 0.72) 35%, rgba(250, 249, 246, 0));
  --bg-lightbox: rgba(250, 249, 246, 0.96);
  --ink: #161615;
  --ink-soft: #4c4c48;
  --ink-muted: #7d7c77;
  --hairline: rgba(22, 22, 21, 0.1);
  --accent: #161615;
  --donut-color: #3a58e0;
  --frame-border: #ffffff;
  --shadow-float: 0 22px 54px rgba(24, 20, 32, 0.12);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: color var(--theme-dur) var(--ease);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.tiny-meta {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.015em;
  color: var(--ink-muted);
}

.tiny-meta--caps {
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ==========================================================================
   LIVING ATMOSPHERE: 3 SLOW-BREATHING PASTEL TONES + RAPID 18FPS OLD-FILM GRAIN
   ========================================================================== */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.atmosphere__base {
  position: absolute;
  inset: 0;
  background: var(--bg);
  transition: background-color var(--theme-dur) var(--ease);
}

.atmosphere__tone {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  filter: blur(78px);
  transition: opacity 0.95s var(--ease);
  will-change: transform;
}

html[data-theme='pastel'] .atmosphere__tone {
  opacity: 0.72;
}

/* Slow, deep breathing pastel clouds (contrasting with rapid 18fps old-film grain) */
.atmosphere__tone--1 {
  width: 72vmax;
  height: 66vmax;
  top: -18vmax;
  left: -14vmax;
  background: radial-gradient(circle, var(--p-tone-1) 0%, transparent 68%);
  animation: breathe-1 18s ease-in-out infinite alternate;
}

.atmosphere__tone--2 {
  width: 68vmax;
  height: 68vmax;
  top: 6vmax;
  right: -16vmax;
  background: radial-gradient(circle, var(--p-tone-2) 0%, transparent 68%);
  animation: breathe-2 23s ease-in-out infinite alternate;
}

.atmosphere__tone--3 {
  width: 74vmax;
  height: 64vmax;
  bottom: -22vmax;
  left: 12vmax;
  background: radial-gradient(circle, var(--p-tone-3) 0%, transparent 68%);
  animation: breathe-3 28s ease-in-out infinite alternate;
}

@keyframes breathe-1 {
  0%   { transform: translate3d(-4%, -2%, 0) scale(0.92); }
  50%  { transform: translate3d(18%, 13%, 0) scale(1.16); }
  100% { transform: translate3d(6%, 22%, 0) scale(0.96); }
}

@keyframes breathe-2 {
  0%   { transform: translate3d(4%, 8%, 0) scale(1.1); }
  50%  { transform: translate3d(-20%, -10%, 0) scale(0.9); }
  100% { transform: translate3d(-10%, 16%, 0) scale(1.14); }
}

@keyframes breathe-3 {
  0%   { transform: translate3d(-10%, 4%, 0) scale(0.95); }
  50%  { transform: translate3d(16%, -16%, 0) scale(1.18); }
  100% { transform: translate3d(-12%, -6%, 0) scale(0.94); }
}

/* Rapid 18fps random old-film grain overlay */
.atmosphere__grain {
  position: absolute;
  inset: 0;
  background-repeat: repeat;
  background-size: 180px 180px;
  mix-blend-mode: multiply;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}

html[data-theme='pastel'] .atmosphere__grain {
  opacity: 0.88;
}

/* ==========================================================================
   MINIMALIST FLOATING TOP NAVIGATION (CRISP INK, CLEAR & UNCLUTTERED)
   ========================================================================== */
.edge-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad-x);
  background: var(--bg-nav-fade);
  overflow: hidden;
  pointer-events: none;
  transition: padding 0.42s var(--ease);
}

.edge-nav a {
  pointer-events: auto;
}

.edge-brand {
  flex: 0 0 auto;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
  transition: opacity 0.25s ease;
}

.edge-brand:hover {
  opacity: 0.55;
}

.edge-nav__links {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.5vw, 22px);
  opacity: 1;
  transition: opacity 0.4s var(--ease), transform 0.42s var(--ease);
}

.edge-link {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--ink);
  opacity: 0.72;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.edge-link__num {
  font-weight: 500;
  font-size: 11px;
  opacity: 0.55;
  margin-right: 4px;
}

.edge-link:hover,
.edge-link.is-active {
  opacity: 1;
}

.edge-link.is-active {
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

.edge-nav__right {
  position: relative;
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 28px;
}

.edge-location {
  white-space: nowrap;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.38s var(--ease), transform 0.42s var(--ease);
}

.mobile-menu-btn {
  position: absolute;
  right: 0;
  display: inline-flex;
  align-items: center;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--ink);
  padding: 6px 2px;
  transition: opacity 0.4s var(--ease), transform 0.42s var(--ease);
}

/* Full-Screen Minimalist Mobile Index Overlay (hidden on desktop) */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: var(--bg-lightbox);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--nav-h) + 44px) 24px 32px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.28s var(--ease), transform 0.34s var(--ease);
}

.mobile-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mobile-drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mobile-drawer__link {
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--font-sans);
  font-size: clamp(20px, 6vw, 28px);
  font-weight: 400;
  letter-spacing: -0.025em;
  color: var(--ink);
  opacity: 0.78;
  transition: opacity 0.2s ease, transform 0.25s var(--ease);
}

.mobile-drawer__link.is-active,
.mobile-drawer__link:active {
  opacity: 1;
  font-weight: 500;
}

.mobile-drawer__num {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  width: 22px;
}

.mobile-drawer__foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}

/* ==========================================================================
   FREE-FLOATING 3D ASCII SPINNING "GRADIENT DONUT"
   - Dark charcoal on White
   - Chalk white on Black
   - Live shifting multi-color gradient on Pastel Flow mode!
   ========================================================================== */
.floating-donut {
  position: fixed;
  left: clamp(16px, 2.2vw, 30px);
  bottom: clamp(14px, 2vh, 26px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px;
  color: var(--donut-color);
  transition: color 0.5s var(--ease), transform 0.35s var(--ease);
  user-select: none;
}

.floating-donut:hover {
  transform: scale(1.07);
}

.floating-donut.is-kicked .floating-donut__ascii {
  animation: donut-pulse 0.32s var(--ease);
}

@keyframes donut-pulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.floating-donut__ascii {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 5.6px;
  line-height: 0.9;
  letter-spacing: 0.03em;
  font-weight: 600;
  white-space: pre;
  color: currentColor;
  pointer-events: none;
  --donut-live-grad: linear-gradient(135deg, #3a58e0, #e05c86);
}

/* True 3D luminance-shaded glyph tiers (Two-Tone Orange on White / Silver-White on Black) */
.floating-donut__ascii .dt-1 {
  color: var(--donut-t1);
}

.floating-donut__ascii .dt-2 {
  color: var(--donut-t2);
}

.floating-donut__ascii .dt-3 {
  color: var(--donut-t3);
}

/* Colorful live-switching gradient donut in Pastel Flow mode */
html[data-theme='pastel'] .floating-donut__ascii {
  background-image: var(--donut-live-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: saturate(1.18);
}

/* ==========================================================================
   APP STAGE
   ========================================================================== */
.app-stage {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
}

/* ==========================================================================
   STAGE 1: ABSTRACT FLOATY PHOTOGRAPHIC COLLAGE (DESKTOP)
   Full-canvas 18-frame floating plates + dramatic 2.15x scale-up on hover +
   razor-sharp centered typography sitting directly ON TOP of everything
   ========================================================================== */
.field-view {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  animation: fade-soft 0.6s var(--ease);
}

/* Bold Centered Overlay Title sitting directly ON TOP of the abstract collage (borderless!) */
.field-center {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 42;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: min(640px, 88vw);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s var(--ease), transform 0.36s var(--ease);
}

.field-center.is-visible {
  opacity: 1;
}

.field-center__title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(24px, 2.8vw, 38px);
  font-weight: 600;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  line-height: 1.06;
  color: var(--ink);
  text-shadow: 0 0 28px var(--bg), 0 0 10px var(--bg);
}

.field-center__sub {
  margin: 6px 0 0;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-shadow: 0 0 22px var(--bg), 0 0 8px var(--bg);
}

.field-center__count {
  display: none;
}

.field-footer-meta {
  position: fixed;
  right: var(--pad-x);
  bottom: clamp(16px, 2.2vh, 26px);
  z-index: 40;
  display: flex;
  align-items: baseline;
  gap: 18px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

.field-footer-meta__archive {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}

.field-footer-meta a:hover {
  color: var(--ink);
}

.sheet-copyright {
  margin-top: 64px;
  text-align: right;
  font-size: 10.5px;
  color: var(--ink-muted);
}

/* Abstract Floating Collage Layer */
.field-constellation {
  position: absolute;
  inset: 0;
}

.float-plate {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  display: block;
  cursor: pointer;
  z-index: 4;
  transition: opacity 0.4s var(--ease), z-index 0s;
  will-change: transform, opacity;
  -webkit-tap-highlight-color: transparent;
}

.float-plate--mobile-only {
  display: none;
}

/* Gentle organic breathing drift on every plate (pauses seamlessly on hover/tap!) */
.float-plate__drift {
  width: 100%;
  height: 100%;
  animation: var(--drift-anim, drift-a) var(--drift-dur, 12s) ease-in-out infinite alternate;
  animation-delay: var(--drift-delay, 0s);
}

.float-plate:hover {
  z-index: 36;
}

.float-plate:hover .float-plate__drift {
  animation-play-state: paused;
}

/* Calm desktop hover: picture size stays unchanged while bob pauses, shadow lifts & others dim */
.float-plate:hover .float-plate__box {
  box-shadow: var(--shadow-float);
}

/* Smart edge transform-origins so perimeter plates expand inward cleanly without clipping! */
.float-plate[data-origin='top-left'] .float-plate__box { transform-origin: left top; }
.float-plate[data-origin='top'] .float-plate__box { transform-origin: center top; }
.float-plate[data-origin='top-right'] .float-plate__box { transform-origin: right top; }
.float-plate[data-origin='left'] .float-plate__box { transform-origin: left center; }
.float-plate[data-origin='right'] .float-plate__box { transform-origin: right center; }
.float-plate[data-origin='bottom-left'] .float-plate__box { transform-origin: left bottom; }
.float-plate[data-origin='bottom'] .float-plate__box { transform-origin: center bottom; }
.float-plate[data-origin='bottom-right'] .float-plate__box { transform-origin: right bottom; }

@keyframes drift-a {
  0%   { transform: translate3d(-5px, -6px, 0); }
  100% { transform: translate3d(7px, 8px, 0); }
}

@keyframes drift-b {
  0%   { transform: translate3d(6px, -4px, 0); }
  100% { transform: translate3d(-7px, 7px, 0); }
}

@keyframes drift-c {
  0%   { transform: translate3d(-4px, 7px, 0); }
  100% { transform: translate3d(6px, -7px, 0); }
}

.float-plate__box {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-surface);
  transform-origin: center center;
  transition: transform 0.52s var(--ease), box-shadow 0.45s var(--ease);
  will-change: transform;
}

.float-plate__box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.field-view.is-filtering .float-plate {
  opacity: 0.16;
}

.field-view.is-filtering .float-plate.is-focused {
  opacity: 1;
  z-index: 30;
}

.field-view.is-filtering .float-plate:hover {
  z-index: 36;
}

/* ==========================================================================
   STAGE 2A: STREET PHOTOGRAPHY & ART DOCUMENTATION (AIRY, LINELESS GRIDS)
   ========================================================================== */
.sheet-view {
  padding: calc(var(--nav-h) + clamp(34px, 5vh, 62px)) var(--pad-x) 110px;
  animation: fade-soft 0.45s var(--ease);
}

.sheet-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(36px, 5vh, 60px);
}

.sheet-header__title {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.06;
}

.sheet-header__desc {
  margin: 10px 0 0;
  max-width: 50ch;
  font-size: 13px;
  color: var(--ink-soft);
}

.sheet-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.text-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.text-toggle {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: color 0.2s ease;
}

.text-toggle:hover,
.text-toggle.is-active {
  color: var(--ink);
}

.text-toggle.is-active {
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* Rhythmic Asymmetric Photographic Contact Sheet */
.contact-wall {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(24px, 3.2vw, 48px) clamp(18px, 2.4vw, 34px);
  align-items: start;
}

.photo-card {
  grid-column: span 4;
  margin: 0;
  cursor: pointer;
}

.photo-card--wide {
  grid-column: span 6;
}

.photo-card--tall {
  grid-column: span 4;
  margin-top: clamp(16px, 3.2vh, 40px);
}

.photo-card--offset {
  margin-top: clamp(22px, 4.4vh, 56px);
}

.photo-card__media {
  background: var(--bg-surface);
  overflow: hidden;
}

.photo-card__media img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.65s var(--ease);
}

.photo-card:hover .photo-card__media img {
  transform: scale(1.018);
}

.photo-card__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
}

.photo-card__title {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.42;
}

.photo-card__title strong {
  color: var(--ink);
  font-weight: 500;
}

.photo-card__venue {
  display: block;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* Minimal Floating Curatorial Index Table */
.index-table {
  display: flex;
  flex-direction: column;
}

.index-row {
  display: grid;
  grid-template-columns: 52px 1.2fr 1.6fr 0.85fr 1.2fr 56px;
  gap: 14px;
  align-items: baseline;
  padding: 13px 4px;
  border-bottom: 1px solid var(--hairline);
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.25s var(--ease);
}

.index-row:hover {
  transform: translateX(6px);
}

.index-row__title {
  font-weight: 500;
  color: var(--ink);
}

.index-row__sub {
  color: var(--ink-soft);
}

.index-hover-preview {
  position: fixed;
  width: 240px;
  aspect-ratio: 4 / 3;
  z-index: 55;
  pointer-events: none;
  opacity: 0;
  transform: translate(20px, -50%) scale(0.96);
  transition: opacity 0.2s ease, transform 0.24s var(--ease);
  box-shadow: var(--shadow-float);
  background: var(--bg-surface);
  overflow: hidden;
}

.index-hover-preview.is-visible {
  opacity: 1;
  transform: translate(20px, -50%) scale(1);
}

.index-hover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   STAGE 2B & STAGE 3: CALM DUAL-AXIS SPLIT (VERTICAL LEFT + HORIZONTAL RIGHT)
   ========================================================================== */
.split-layout {
  padding-top: var(--nav-h);
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(310px, 35%) 1fr;
  overflow: hidden;
  animation: fade-soft 0.45s var(--ease);
}

.split-left {
  height: calc(100% - 134px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: clamp(20px, 2.8vh, 32px) clamp(24px, 2.8vw, 40px) 56px var(--pad-x);
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 86%, transparent 100%);
}

.split-left::-webkit-scrollbar {
  display: none;
}

.split-left__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.back-link {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: color 0.2s ease, transform 0.25s var(--ease);
}

.back-link:hover {
  color: var(--ink);
  transform: translateX(-3px);
}

.split-title {
  margin: 0;
  font-size: clamp(26px, 2.5vw, 36px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.split-sub {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
  max-width: 42ch;
}

.split-meta-grid {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 6px 14px;
  margin: 22px 0;
  font-size: 12px;
}

.split-meta-grid dt {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.split-meta-grid dd {
  margin: 0;
  color: var(--ink-soft);
}

.split-quote {
  margin: 0 0 18px;
  padding-left: 14px;
  border-left: 1px solid var(--hairline);
  font-size: 12.5px;
  font-style: italic;
  line-height: 1.55;
  color: var(--ink-soft);
}

.split-prose p {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.68;
  color: var(--ink-soft);
}

.split-prose p:first-child {
  color: var(--ink);
}

.split-tech {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

.split-tech__heading {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.split-tech__body {
  margin: 0;
  font-size: 13px;
  line-height: 1.66;
  color: var(--ink-soft);
}

.quiet-list {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quiet-item {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 9px 0;
  text-align: left;
  color: var(--ink-muted);
  transition: color 0.22s ease, transform 0.28s var(--ease);
}

.quiet-item:hover,
.quiet-item.is-active {
  color: var(--ink);
  transform: translateX(5px);
}

.quiet-item__title {
  display: block;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.quiet-item.is-active .quiet-item__title {
  font-weight: 500;
}

.quiet-item__meta {
  display: block;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 2px;
}

.plate-jumps {
  margin-top: 26px;
}

.plate-jumps__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.plate-btn {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-muted);
  transition: color 0.2s ease;
}

.plate-btn:hover,
.plate-btn.is-active {
  color: var(--ink);
}

.plate-btn.is-active {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* RIGHT SIDE: FLOATING HORIZONTAL EXHIBITION WALL / FILMSTRIP */
.split-right {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.h-scroller {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  align-items: center;
  gap: clamp(32px, 4vw, 60px);
  padding: 20px clamp(44px, 5vw, 76px) 52px clamp(20px, 2.5vw, 36px);
  cursor: grab;
  scrollbar-width: none;
}

.h-scroller::-webkit-scrollbar {
  display: none;
}

.h-scroller.is-grabbing {
  cursor: grabbing;
  user-select: none;
}

/* Borderless Horizontal Work Card (Clean normal high-res photography!) */
.h-work-card {
  flex: 0 0 auto;
  width: clamp(320px, 42vw, 560px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
}

.h-work-card__media {
  position: relative;
  height: min(56vh, 470px);
  overflow: hidden;
  background: var(--bg-surface);
}

.h-work-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.65s var(--ease);
}

.h-work-card:hover .h-work-card__media img {
  transform: scale(1.025);
}

.h-work-card__foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.h-work-card__title {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.h-work-card__summary {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
  max-width: 44ch;
  line-height: 1.5;
}

/* Horizontal Project Filmstrip Plate */
.h-plate {
  margin: 0;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.h-plate__stage {
  position: relative;
  display: flex;
  align-items: center;
  height: min(66vh, 580px);
}

.h-plate__img {
  height: 100%;
  width: auto;
  max-width: 68vw;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.55s var(--ease);
}

.h-plate__img:hover {
  transform: scale(1.01);
}

/* Mongrel Rapture Subtle Floating Detail Inset */
.h-plate__inset {
  position: absolute;
  right: -24px;
  bottom: 22px;
  width: clamp(136px, 15vw, 220px);
  aspect-ratio: 4 / 3;
  border: 6px solid var(--frame-border);
  box-shadow: var(--shadow-float);
  background: var(--bg-surface);
  overflow: hidden;
  cursor: zoom-in;
  z-index: 3;
  transition: transform 0.4s var(--ease);
}

.h-plate__inset:hover {
  transform: translateY(-6px) scale(1.04);
}

.h-plate__inset img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.h-plate__caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-size: 11.5px;
  color: var(--ink-soft);
}

/* Video Plate */
.h-video-plate {
  flex: 0 0 auto;
  width: clamp(360px, 48vw, 660px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.h-video-plate__box {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b0b0d;
  overflow: hidden;
}

.h-video-plate__box iframe,
.h-video-plate__box video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.h-next-card {
  flex: 0 0 auto;
  width: 240px;
  height: min(50vh, 420px);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--ink-soft);
  transition: color 0.25s ease, transform 0.35s var(--ease);
}

.h-next-card:hover {
  color: var(--ink);
  transform: translateX(6px);
}

/* Ultra-Minimal Horizontal Scrubber Rail */
.h-rail {
  height: 44px;
  flex-shrink: 0;
  padding: 0 var(--pad-x) 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.h-rail__bar {
  flex: 1;
  max-width: 180px;
  height: 1px;
  background: var(--hairline);
  position: relative;
}

.h-rail__fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 12%;
  background: var(--ink);
  transition: width 0.14s linear;
}

.h-rail__actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.h-rail__btn {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-muted);
  padding: 4px;
  transition: color 0.2s ease;
}

.h-rail__btn:hover {
  color: var(--ink);
}

/* ==========================================================================
   STAGE 2C: ABOUT & FIELD NOTES (OPEN FLOATING COLUMNS)
   ========================================================================== */
.about-portrait {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 240px;
  object-fit: cover;
  object-position: center 22%;
  margin-bottom: 18px;
  background: var(--bg-surface);
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
}

.quiet-link {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}

.quiet-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.cv-sheet {
  flex: 0 0 auto;
  width: clamp(300px, 32vw, 390px);
  height: min(74vh, 640px);
  padding: 8px 16px 16px 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.cv-list--compact {
  gap: 8px;
}

.cv-sheet__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
}

.cv-sheet__title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.cv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.cv-entry__period {
  display: block;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-muted);
}

.cv-entry__main {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.35;
}

.cv-entry__place {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.35;
}

/* ==========================================================================
   SERENE BORDERLESS LIGHTBOX
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s var(--ease);
}

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

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: var(--bg-lightbox);
  backdrop-filter: blur(12px);
}

.lightbox__chrome {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 20px var(--pad-x);
}

.lightbox__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lightbox__close {
  font-size: 12px;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lightbox__close:hover {
  color: var(--ink);
}

.lightbox__stage {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
}

.lightbox__figure {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 0;
}

.lightbox__figure img {
  max-height: calc(100vh - 165px);
  max-width: 100%;
  object-fit: contain;
  box-shadow: var(--shadow-float);
}

.lightbox__caption {
  font-size: 12px;
  color: var(--ink-soft);
  text-align: center;
  max-width: 72ch;
}

.lightbox__nav {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--ink-muted);
  padding: 8px;
  transition: color 0.2s ease;
}

.lightbox__nav:hover {
  color: var(--ink);
}

/* ==========================================================================
   ANIMATIONS & RESPONSIVE BREAKPOINTS
   ========================================================================== */
@keyframes fade-soft {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==========================================================================
   COMPACT / MOBILE CHOREOGRAPHED MORPH STATE (html.is-compact-ui <= 920px)
   Controlled via matchMedia + FLIP in js/app.js so crossing 920px smoothly:
   1. Crossfades 01-05 & BREMEN/KUCHING <-> menu +
   2. Glides & shrinks the spinning 3D orange donut left <-> right
   3. Gathers/scatters all 18 floating frames between desktop collage & mobile ribbon
   ========================================================================== */
html.is-compact-ui .edge-nav {
  padding: 0 20px;
}

html.is-compact-ui .edge-nav__links {
  opacity: 0;
  transform: translate(-50%, calc(-50% - 6px));
  pointer-events: none;
}

html.is-compact-ui .edge-nav__links a {
  pointer-events: none;
}

html.is-compact-ui .edge-location {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

html.is-compact-ui .mobile-menu-btn {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Compact Floating 20x12 3D Orange Thumb-Jewel at Bottom-Right */
html.is-compact-ui .floating-donut {
  left: auto;
  right: 14px;
  bottom: 16px;
  z-index: 60;
  padding: 6px;
}

html.is-compact-ui .floating-donut__ascii {
  font-size: 4.6px;
  line-height: 0.88;
}

/* STAGE 1 COMPACT: Single-Screen Horizontal Floating Ribbon + Finger-Glide Magnification Lens */
html.is-compact-ui .field-view {
  height: 100dvh;
  overflow: hidden;
  padding: 0;
}

html.is-compact-ui .field-constellation {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 54px;
  padding: 86px calc(50vw - 56px) 24px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

html.is-compact-ui .field-constellation::-webkit-scrollbar {
  display: none;
}

html.is-compact-ui .float-plate {
  position: relative;
  left: auto;
  top: auto;
  flex: 0 0 auto;
  width: var(--mw, 114px);
  height: var(--mh, 134px);
  margin: 0 !important;
  align-self: center !important;
  scroll-snap-align: center;
  transition: none;
  will-change: transform, opacity;
}

html.is-compact-ui .float-plate__drift {
  width: 100%;
  height: 100%;
  animation: var(--drift-anim, drift-a) var(--drift-dur, 12s) ease-in-out infinite alternate;
  animation-delay: var(--drift-delay, 0s);
}

html.is-compact-ui .float-plate.is-ribbon-center .float-plate__drift {
  animation-play-state: paused;
}

html.is-compact-ui .float-plate__box {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  transform-origin: center center !important;
  transition: box-shadow 0.35s var(--ease);
}

html.is-compact-ui .float-plate.is-ribbon-center .float-plate__box {
  box-shadow: var(--shadow-float);
}

html.is-compact-ui .float-plate:hover {
  z-index: auto;
}

html.is-compact-ui .float-plate:hover .float-plate__box {
  box-shadow: none;
}

html.is-compact-ui .float-plate.is-ribbon-center:hover .float-plate__box {
  box-shadow: var(--shadow-float);
}

html.is-compact-ui .field-center {
  display: flex;
  top: clamp(92px, 16.5dvh, 148px);
  transform: translate(-50%, 0);
  width: 86vw;
  z-index: 40;
}

html.is-compact-ui .field-center__title {
  font-size: clamp(19px, 5.4vw, 26px);
  text-shadow: none;
}

html.is-compact-ui .field-center__sub {
  font-size: 9.5px;
  letter-spacing: 0.07em;
  text-shadow: none;
}

html.is-compact-ui .field-center__count {
  display: block;
  margin-top: 8px;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

html.is-compact-ui .field-footer-meta {
  position: fixed;
  left: 20px;
  right: 92px; /* clear of bottom-right floating orange donut */
  bottom: 18px;
  margin-top: 0;
  padding-right: 0;
  font-size: 9px;
  line-height: 1.38;
  text-shadow: none;
  flex-direction: column;
  gap: 2px;
}

html.is-compact-ui .field-footer-meta__archive {
  display: none;
}

@media (max-width: 920px) {

  /* STAGE 2A MOBILE: Single-Column Staggered Editorial Photobook Wall */
  .sheet-view {
    padding: calc(var(--nav-h) + 28px) 20px 110px;
  }

  .sheet-header {
    margin-bottom: 32px;
  }

  .contact-wall {
    display: flex;
    flex-direction: column;
    gap: 38px;
  }

  .photo-card,
  .photo-card--wide,
  .photo-card--tall,
  .photo-card--offset {
    width: 100%;
    margin-top: 0;
  }

  /* Subtle photobook width variation in vertical scroll */
  .photo-card:nth-child(3n + 2) {
    width: 80%;
    align-self: flex-end;
  }

  .photo-card:nth-child(5n + 4) {
    width: 78%;
    align-self: flex-start;
  }

  .index-row {
    grid-template-columns: 42px 1fr 48px;
  }

  .index-row__hide-sm {
    display: none;
  }

  /* STAGE 2B & STAGE 3 MOBILE: Vertical Essay + Touch-Swipeable Snap Filmstrip */
  .split-layout {
    height: auto;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .split-left {
    height: auto;
    overflow: visible;
    padding: 20px 20px 26px;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .split-right {
    height: auto;
    min-height: 0;
    padding-bottom: 84px;
  }

  .h-scroller {
    padding: 12px 20px 18px;
    gap: 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  /* 84vw lets the edge of the next photo peek cleanly from the right! */
  .h-work-card {
    width: 84vw;
    scroll-snap-align: center;
  }

  .h-work-card__media {
    height: 54vw;
    min-height: 220px;
    max-height: 340px;
  }

  .h-plate {
    max-width: 86vw;
    scroll-snap-align: center;
  }

  .h-plate__stage {
    height: auto;
    max-height: 56vh;
  }

  .h-plate__img {
    width: 84vw;
    max-width: 84vw;
    height: auto;
    max-height: 54vh;
    object-fit: contain;
  }

  .h-plate__inset {
    right: 8px;
    bottom: 10px;
    width: 106px;
    border-width: 4px;
  }

  .h-video-plate {
    width: 86vw;
    scroll-snap-align: center;
  }

  .h-next-card {
    width: 72vw;
    height: 260px;
    scroll-snap-align: center;
  }

  .cv-sheet {
    width: 84vw;
    height: auto;
    max-height: none;
    scroll-snap-align: start;
  }

  .h-rail {
    padding: 6px 20px 10px;
  }

  /* Lightbox on Mobile: maximum image width + clean touch controls */
  .lightbox__chrome {
    padding: 16px 16px 24px;
  }

  .lightbox__stage {
    grid-template-columns: 1fr;
    position: relative;
    padding: 12px 0;
  }

  .lightbox__nav {
    position: absolute;
    bottom: 0;
    z-index: 4;
    font-size: 18px;
    padding: 10px 16px;
  }

  #lightbox-prev { left: 4px; }
  #lightbox-next { right: 4px; }

  .lightbox__figure {
    padding-bottom: 44px;
  }
}
