:root {
  --ink: #0a0a0a;
  --paper: #f1efe9;
  --muted: #8f8f8a;
  --line: rgba(241, 239, 233, 0.2);
  --accent: #ff5a1f;
  --max: 1480px;
  --pad: clamp(20px, 4.7vw, 72px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--ink);
  color: var(--paper);
  font-family: Arial, "Helvetica Neue", "Noto Sans TC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body:has(dialog[open]) { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
img { display: block; width: 100%; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--accent);
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--pad);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: baseline; gap: 13px; }
.brand strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.brand span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
}
.site-nav { display: flex; gap: clamp(20px, 3vw, 48px); }
.site-nav a {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: color 160ms ease;
}
.site-nav a:hover { color: var(--paper); }

main, .site-footer {
  width: min(100%, var(--max));
  margin-inline: auto;
}
.intro {
  position: relative;
  min-height: clamp(520px, 58vw, 790px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(36px, 7vw, 106px) var(--pad) clamp(36px, 5vw, 74px);
  overflow: hidden;
  isolation: isolate;
}
.intro::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, var(--ink) 0%, rgba(10,10,10,.9) 28%, rgba(10,10,10,.15) 70%, var(--ink) 100%),
    linear-gradient(0deg, var(--ink) 0%, transparent 28%);
  pointer-events: none;
}
.intro-portrait {
  position: absolute;
  z-index: -2;
  top: 0;
  right: 3%;
  width: min(69%, 940px);
  height: 100%;
  margin: 0;
  overflow: hidden;
}
.intro-portrait img {
  width: 100%;
  height: 112%;
  object-fit: cover;
  object-position: 50% 26%;
  filter: saturate(.7) contrast(1.06) brightness(.82);
}
.intro-portrait figcaption {
  position: absolute;
  right: 18px;
  bottom: 18px;
  color: rgba(255,255,255,.65);
  font-size: 8px;
  letter-spacing: .16em;
}
.intro-meta {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.18em;
}
.intro-heading {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.intro h1 {
  margin: 0 0 -0.08em;
  font-size: clamp(72px, 13.5vw, 198px);
  font-weight: 500;
  line-height: 0.76;
  letter-spacing: -0.075em;
  white-space: nowrap;
  text-shadow: 0 2px 36px rgba(0,0,0,.22);
}
.intro-heading p {
  margin: 0;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.15em;
  text-align: right;
}

.work-navigation {
  border-top: 1px solid var(--line);
}
.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding-inline: var(--pad);
}
.mode-switch button {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: baseline;
  gap: 14px;
  padding: 22px 18px;
  border: 0;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.mode-switch button:last-child { border-right: 1px solid var(--line); }
.mode-switch span, .mode-switch em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.mode-switch strong {
  font-size: clamp(19px, 2.1vw, 31px);
  font-weight: 500;
}
.mode-switch button:hover,
.mode-switch button.is-active {
  color: var(--ink);
  background: var(--paper);
}
.mode-switch button.is-active span { color: var(--accent); }
.mode-switch button:hover span,
.mode-switch button:hover em,
.mode-switch button.is-active em { color: #5b5b57; }

.category-index {
  display: grid;
  grid-template-columns: repeat(var(--category-count, 5), 1fr);
  padding-inline: var(--pad);
  border-bottom: 1px solid var(--line);
}
.category-link {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 27px 8px;
  padding: 18px 18px 20px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}
.category-link:first-child { border-left: 1px solid var(--line); }
.category-link span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.12em;
}
.category-link strong {
  grid-column: 1;
  font-size: clamp(14px, 1.5vw, 21px);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.category-link em {
  grid-column: 2;
  align-self: end;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.category-link:hover, .category-link.is-active {
  color: var(--ink);
  background: var(--paper);
}
.category-link.is-active span, .category-link.is-active em,
.category-link:hover span, .category-link:hover em { color: #5b5b57; }
.category-link.is-active span { color: var(--accent); }

.work, .about, .contact { padding: clamp(92px, 11vw, 170px) var(--pad); }
.work-header {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  align-items: end;
  gap: 48px;
}
.section-kicker {
  margin: 0 0 24px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.17em;
}
.work-header h2 {
  margin: 0;
  font-size: clamp(50px, 8.3vw, 122px);
  font-weight: 500;
  line-height: 0.88;
  letter-spacing: -0.055em;
}
.work-intro {
  max-width: 420px;
  margin: 0 0 4px;
}
.work-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.work-intro span {
  display: inline-block;
  margin-top: 22px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--accent);
  font-size: 9px;
  letter-spacing: .14em;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(18px, 2.2vw, 34px);
  margin-top: 58px;
}
.project-card {
  grid-column: span 12;
  margin: 0;
}
.project-card:nth-child(odd):not(:only-child) { grid-column: span 7; }
.project-card:nth-child(even) { grid-column: span 5; padding-top: clamp(56px, 9vw, 130px); }
.project-button {
  width: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.project-media {
  position: relative;
  overflow: hidden;
  background: #171717;
}
.project-card.is-motion .project-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 48%, rgba(0,0,0,.5));
  pointer-events: none;
}
.project-media::before { content: ""; display: block; padding-top: 67%; }
.project-card:nth-child(even) .project-media::before { padding-top: 128%; }
.project-media img {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(.2,.75,.3,1);
}
.empty-poster {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 28px;
  color: var(--muted);
  background: linear-gradient(135deg, #181818, #0f0f0f);
  font-size: clamp(25px, 4vw, 58px);
  letter-spacing: -.04em;
}
.project-button:hover img { transform: scale(1.025); }
.play-mark {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 50%;
  background: rgba(10,10,10,.24);
  backdrop-filter: blur(8px);
  font-size: 16px;
  transform: translate(-50%, -50%);
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}
.project-button:hover .play-mark {
  color: var(--ink);
  background: var(--paper);
  transform: translate(-50%, -50%) scale(1.06);
}
.project-count {
  z-index: 2;
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 8px;
  color: var(--ink);
  background: var(--paper);
  font-size: 9px;
  letter-spacing: 0.1em;
}
.project-info {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
}
.project-info h3 { margin: 0; font-size: 17px; font-weight: 500; }
.project-info p, .project-info span {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.loading-message {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
}

.about { padding-top: 70px; }
.section-rule {
  display: flex;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.17em;
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(50px, 8vw, 130px);
  padding-top: clamp(42px, 6vw, 86px);
}
.about h2 {
  margin: 0;
  font-size: clamp(36px, 5.5vw, 80px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.045em;
}
.about-copy { display: grid; gap: 45px; }
.about-copy > div {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 24px;
}
.language-label {
  margin: 4px 0 0;
  color: var(--accent);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.about-copy div > p:last-child {
  max-width: 600px;
  margin: 0;
  color: #c5c3be;
  font-size: clamp(14px, 1.4vw, 18px);
  line-height: 1.85;
}

.contact { padding-top: 100px; }
.contact h2 {
  max-width: 920px;
  margin: 0 0 clamp(70px, 9vw, 130px);
  font-size: clamp(58px, 10vw, 145px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.065em;
}
.contact-links { border-top: 1px solid var(--line); }
.contact-links a {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  transition: color 160ms ease;
}
.contact-links a:hover { color: var(--accent); }
.contact-links span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.contact-links strong {
  overflow-wrap: anywhere;
  font-size: clamp(15px, 2vw, 28px);
  font-weight: 400;
}
.contact-links i { font-size: 22px; font-style: normal; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 26px var(--pad) 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.project-dialog {
  width: 100%;
  max-width: none;
  min-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--paper);
  background: var(--ink);
}
.project-dialog::backdrop { background: var(--ink); }
.dialog-bar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  justify-content: space-between;
  padding: 18px var(--pad);
  border-bottom: 1px solid var(--line);
  background: rgba(10,10,10,.92);
  backdrop-filter: blur(14px);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.14em;
}
.dialog-bar button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  letter-spacing: inherit;
}
.dialog-layout {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: clamp(42px, 6vw, 88px) var(--pad) clamp(70px, 9vw, 130px);
}
.dialog-copy {
  padding-bottom: clamp(34px, 5vw, 68px);
  border-bottom: 1px solid var(--line);
}
.dialog-copy > p:first-child {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.dialog-copy h2 {
  margin: 0;
  font-size: clamp(34px, 4.4vw, 64px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -.05em;
  word-break: keep-all;
  overflow-wrap: normal;
  text-wrap: balance;
}
.dialog-copy > p:last-child {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}
.dialog-gallery {
  column-count: 4;
  column-gap: clamp(6px, .8vw, 12px);
  padding-top: clamp(24px, 3vw, 42px);
}
.gallery-thumb {
  width: 100%;
  display: block;
  break-inside: avoid;
  overflow: hidden;
  margin: 0 0 clamp(6px, .8vw, 12px);
  padding: 0;
  border: 0;
  background: #141414;
  cursor: zoom-in;
}
.gallery-thumb img {
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 500ms cubic-bezier(.2,.75,.3,1), filter 220ms ease;
}
.gallery-thumb:hover img,
.gallery-thumb:focus-visible img { transform: scale(1.035); filter: brightness(.82); }
.gallery-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.project-dialog.is-motion .dialog-gallery {
  display: grid;
  grid-template-columns: 1fr;
  column-count: auto;
}
.image-viewer {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: none;
  color: var(--paper);
}
.image-viewer.is-open { display: block; }
.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: rgba(5,5,5,.96);
  cursor: zoom-out;
}
.image-viewer-stage { position: absolute; inset: 0; pointer-events: none; }
.image-viewer-bar {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  padding: 18px var(--pad);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .14em;
  pointer-events: auto;
}
.image-viewer-bar button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  letter-spacing: inherit;
}
.image-viewer-stage figure {
  position: absolute;
  inset: 58px clamp(55px, 7vw, 110px) 40px;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  margin: 0;
}
.image-viewer-stage img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 98px);
  max-height: calc(100dvh - 98px);
  object-fit: contain;
}
.image-viewer-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 44px;
  height: 60px;
  padding: 0;
  border: 0;
  color: var(--paper);
  background: transparent;
  cursor: pointer;
  font-size: 24px;
  transform: translateY(-50%);
  pointer-events: auto;
}
.image-viewer-prev { left: 8px; }
.image-viewer-next { right: 8px; }
.video-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
}
.video-frame::before { content: ""; display: block; padding-top: 56.25%; }
.video-frame iframe,
.video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.film-link {
  display: flex;
  min-height: 260px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: .16em;
}

@media (max-width: 850px) {
  .intro { min-height: 560px; }
  .intro-portrait {
    right: 0;
    width: 86%;
  }
  .category-index {
    grid-template-columns: 1fr;
    border-bottom: 0;
  }
  .category-link {
    grid-template-columns: 38px 1fr auto;
    gap: 12px;
    padding: 15px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .category-link:first-child { border-left: 0; }
  .category-link span, .category-link strong, .category-link em {
    grid-column: auto;
    align-self: center;
  }
  .work-header, .about-grid { grid-template-columns: 1fr; }
  .work-intro { margin-top: 24px; }
  .about-copy { max-width: 660px; }
  .dialog-gallery { column-count: 3; }
}
@media (max-width: 600px) {
  :root { --pad: 20px; }
  .site-header { padding-block: 15px; }
  .site-nav { gap: 14px; }
  .site-nav a:first-child { display: none; }
  .intro {
    min-height: 510px;
    padding-top: 34px;
    padding-bottom: 30px;
  }
  .intro::after {
    background:
      linear-gradient(90deg, rgba(10,10,10,.68), rgba(10,10,10,.05) 70%),
      linear-gradient(0deg, var(--ink) 0%, transparent 44%, rgba(10,10,10,.2) 100%);
  }
  .intro-portrait {
    width: 100%;
    right: 0;
  }
  .intro-portrait img {
    height: 108%;
    object-position: 52% 22%;
    filter: saturate(.64) contrast(1.06) brightness(.72);
  }
  .intro-portrait figcaption { bottom: 96px; }
  .intro-heading { align-items: flex-end; }
  .intro h1 { font-size: clamp(60px, 20vw, 82px); white-space: nowrap; }
  .intro-heading p {
    display: block;
    font-size: 7px;
  }
  .mode-switch { padding-inline: var(--pad); }
  .mode-switch button {
    grid-template-columns: 1fr auto;
    gap: 14px 8px;
    padding: 17px 12px;
  }
  .mode-switch button span { grid-column: 1; }
  .mode-switch button strong { grid-column: 1; font-size: 17px; }
  .mode-switch button em { grid-column: 2; grid-row: 2; }
  .work, .about, .contact { padding-block: 90px; }
  .work-header h2 { font-size: 54px; }
  .project-grid { margin-top: 40px; }
  .project-card:nth-child(n) { grid-column: 1 / -1; padding-top: 0; }
  .project-card:nth-child(n) .project-media::before { padding-top: 118%; }
  .project-card + .project-card { margin-top: 36px; }
  .about-copy > div { grid-template-columns: 1fr; gap: 12px; }
  .contact h2 { font-size: 58px; }
  .contact-links a { grid-template-columns: 72px 1fr auto; gap: 10px; }
  .site-footer { flex-wrap: wrap; }
  .site-footer span:nth-child(2) { display: none; }
  .dialog-layout { padding-top: 34px; }
  .dialog-copy > p:first-child { margin-bottom: 12px; }
  .dialog-copy > p:last-child { margin-top: 14px; }
  .dialog-copy h2 { font-size: clamp(34px, 11vw, 52px); }
  .dialog-gallery { column-count: 2; column-gap: 5px; }
  .gallery-thumb { margin-bottom: 5px; }
  .image-viewer-stage figure { inset: 58px 14px 34px; }
  .image-viewer-nav {
    top: auto;
    bottom: 8px;
    width: 54px;
    height: 44px;
    background: rgba(10,10,10,.68);
    transform: none;
  }
  .play-mark { width: 58px; height: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

