:root {
  color-scheme: light;
  --paper: #d9dbd0;
  --ink: #202521;
  --muted: #4b5349;
  --line: #a9aea1;
  --gutter: clamp(12px, 1.3vw, 28px);
  --gap: clamp(7px, .62vw, 13px);
  --ease: cubic-bezier(.22, .75, .23, 1);
  --label: 29px;
  --card: max(21vw, min(28vw, (100svh - 8.25rem) * .8));
  --media-height: min(var(--card) * 1.25, 100svh - 7.25rem);
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 1rem; }
h1, h2, p, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:is(a, button, [tabindex]):focus-visible { outline: 2px solid #3a5440; outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip { position: fixed; z-index: 5; top: .6rem; left: var(--gutter); padding: .6rem; background: var(--paper); transform: translateY(-150%); }
.skip:focus { transform: none; }

.masthead { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: var(--gutter); }
.wordmark { display: inline-flex; align-items: center; gap: .55rem; line-height: 1.12; font-size: 1rem; font-weight: 650; white-space: nowrap; }
.wordmark-en { display: block; margin-top: .22rem; font-size: .75rem; font-weight: 450; letter-spacing: .045em; color: var(--muted); }
.mark { position: relative; width: 18px; height: 16px; border: 1px solid currentColor; border-radius: 2px 2px 3px 3px; transform: skewY(-8deg); }
.mark::after { content: ''; position: absolute; inset: 3px 7px 3px auto; border-left: 1px solid currentColor; }
.controls, .direction { display: flex; align-items: center; }
.controls { gap: clamp(8px, 2vw, 26px); }
.controls button { min-height: 40px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.controls button:hover { background: #eceee5; }
.motion { display: inline-flex; align-items: center; gap: .5rem; padding-inline: .65rem; font-size: .82rem; white-space: nowrap; }
.motion-icon { width: .55rem; height: .62rem; border-inline: 2px solid; }
.motion[aria-pressed='false'] .motion-icon { border: .31rem solid transparent; border-right: 0; border-left: .48rem solid currentColor; }
.step { width: 40px; padding: 0; line-height: 1; font-size: 1.45rem; }
.step + .step { border-left: none; }

.home { min-height: 100svh; }
.stage { position: absolute; inset: auto 0 var(--gutter) var(--gutter); }
.gallery { overflow-x: auto; scrollbar-width: thin; overscroll-behavior-inline: contain; }
.rail { display: flex; gap: var(--gap); }
.frame { flex: 0 0 var(--card); width: var(--card); display: block; color: inherit; -webkit-user-drag: none; }
.frame-label { display: flex; align-items: baseline; gap: clamp(7px, 1vw, 16px); min-height: var(--label); padding-block: 1px 6px; line-height: 1.25; font-size: .9rem; font-weight: 550; white-space: nowrap; }
.frame-type { color: var(--muted); font-size: .75rem; font-weight: 450; }
.frame:focus-visible .frame-label, .frame:hover .frame-label { text-decoration: underline; text-underline-offset: .24em; }
.frame:focus-visible { outline-offset: -2px; }
.art { display: block; overflow: hidden; position: relative; isolation: isolate; background: #4d544c; }
.frame .art { width: 100%; height: var(--media-height); }
.art[data-project='film'] { background: #4b352a; }
.art[data-project='books'] { background: #414335; }
.art img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 96% 50%; user-select: none; }
.art[data-project='film'] img { object-position: 96% 48%; }
.art[data-project='books'] img { object-position: 77% 55%; }
.art[data-variant='screen'] { background: #b8c2bc; }
.art[data-project='film'][data-variant='screen'] { background: #bca68d; }
.art[data-project='books'][data-variant='screen'] { background: #aeb097; }
.art[data-variant='screen'] img { padding: 5%; object-fit: contain; object-position: center; filter: drop-shadow(0 10px 13px #131a1636); }
.frame .art[data-project='books'][data-variant='screen'] img { padding: 0; object-fit: cover; filter: none; }
.art[data-variant='art'] .light { position: absolute; inset: -16%; pointer-events: none; background: radial-gradient(ellipse at 68% 36%, #f5e0ba42, transparent 57%); mix-blend-mode: screen; opacity: .25; }
.art[data-project='thought'] .light { background: radial-gradient(ellipse at 51% 35%, #dee9e655, transparent 57%); }
.frame .art[data-variant='art'] img { transform-origin: 60% 50%; animation: drift 15s ease-in-out infinite alternate both paused; }
.frame .art[data-variant='art'] .light { animation: glow 11s ease-in-out infinite alternate both paused; }
.motion-on .frame.is-visible .art[data-variant='art'] :is(img, .light) { animation-play-state: running; }
@keyframes drift { from { transform: scale(1.015); } to { transform: translateX(-1%) scale(1.08); } }
@keyframes glow { from { opacity: .13; transform: translateX(-3%); } to { opacity: .6; transform: translateX(4%); } }

.home.enhanced { overflow: clip; }
.enhanced .gallery { overflow: clip; touch-action: pan-y pinch-zoom; cursor: grab; }
.enhanced .rail { position: relative; height: calc(var(--media-height) + var(--label)); }
.enhanced .frame { position: absolute; left: 0; bottom: 0; transform: translate3d(var(--position, 0px), 0, 0); }
.gallery.is-dragging, .gallery.is-dragging a { cursor: grabbing; user-select: none; }

.intro { display: none; }
.intro-active .intro { display: grid; place-items: center; position: fixed; z-index: 6; inset: 0; color: #f4f3e9; background: #3d4940; pointer-events: none; animation: open-paper .98s var(--ease) both; }
.intro-mark { font-size: clamp(2rem, 5vw, 4.25rem); letter-spacing: .22em; transform: translateX(.11em); animation: fade-mark .45s .16s ease both; }
.intro-active .frame .art { animation: uncover .66s var(--ease) both; animation-delay: calc(.26s + var(--order, 0) * .065s); }
.intro-active .frame-label { animation: enter-label .42s ease both; animation-delay: calc(.43s + var(--order, 0) * .065s); }
@keyframes open-paper { 0%, 22% { clip-path: inset(0); } 100% { clip-path: inset(0 0 100%); visibility: hidden; } }
@keyframes fade-mark { 0% { opacity: 0; } 40% { opacity: 1; } 100% { opacity: 0; } }
@keyframes uncover { from { clip-path: inset(100% 0 0); transform: translateY(16px); } to { clip-path: inset(0); transform: none; } }
@keyframes enter-label { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.gallery-back { align-self: center; padding: .55rem 0; font-size: .875rem; }
.case { padding-bottom: var(--gutter); }
.case :is(.gallery-back, .visit, .case-nav a):hover { text-decoration: underline; text-underline-offset: .24em; }
.case-hero { display: grid; grid-template-columns: 1.06fr 1fr; gap: clamp(1rem, 4vw, 5rem); margin-inline: var(--gutter); min-height: calc(100svh - 5rem); }
.case-heading { align-self: end; padding: 1rem 0 clamp(1.5rem, 6vh, 4rem); }
.case-type { color: var(--muted); font-size: .9rem; margin-bottom: clamp(1rem, 4vh, 3rem); }
.case-heading h1 { font-size: clamp(2.65rem, 7vw, 9rem); font-weight: 500; line-height: 1.04; letter-spacing: -.07em; }
.case-english { margin-top: .8rem; color: var(--muted); font-size: clamp(1rem, 1.8vw, 1.55rem); }
.visit { display: inline-flex; min-height: 45px; align-items: center; padding: .52rem .9rem; margin-top: clamp(1.2rem, 3vw, 2.3rem); border: 1px solid var(--line); font-size: .9rem; }
.case-art { min-width: 0; min-height: 360px; height: calc(100svh - 5rem); }
.case-body { width: min(86%, 1140px); margin: clamp(3.75rem, 12vw, 11rem) auto; display: grid; gap: clamp(2rem, 6vw, 7rem); grid-template-columns: 1fr 1.2fr; }
.case-note h2 { margin-bottom: 1rem; font-size: .95rem; font-weight: 550; }
.case-note p { font-size: clamp(1.2rem, 2vw, 1.75rem); line-height: 1.7; }
.case-figure .art { aspect-ratio: 4 / 5; }
.case-figure figcaption { margin-top: .6rem; color: var(--muted); font-size: .875rem; }
.case-nav { display: flex; justify-content: space-between; gap: 1.2rem; margin-inline: var(--gutter); border-top: 1px solid var(--line); }
.case-nav a { padding: 1rem 0; }
.case-nav span { color: var(--muted); font-size: .85rem; white-space: nowrap; }

@view-transition { navigation: auto; }
::view-transition-group(case-image) { animation-duration: .64s; animation-timing-function: var(--ease); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .38s; }

@media (max-width: 720px) {
  :root { --card: max(21vw, min(79.5vw, (100svh - 6.25rem) * .8)); --media-height: min(var(--card) * 1.25, 100svh - 6rem); --label: 26px; }
  .masthead { gap: 8px; }
  .direction .step { width: 34px; }
  .motion { padding-inline: .5rem; }
  .case-hero, .case-body { grid-template-columns: 1fr; }
  .case-hero { min-height: unset; }
  .case-heading { padding: clamp(2rem, 8vh, 4rem) 0 .6rem; }
  .case-art { min-height: unset; height: auto; aspect-ratio: 4 / 5; }
  .case-type { margin-bottom: .9rem; }
  .case-figure .art { aspect-ratio: 4 / 5; }
  .case-nav { font-size: .85rem; }
}

@media (max-height: 440px) and (min-width: 721px) {
  :root { --card: max(21vw, min(26vw, (100svh - 6rem) * .8)); }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .intro-active .intro, .intro-active .frame .art, .intro-active .frame-label { animation: none; }
  .intro-active .intro { display: none; }
}
